Browse Source

发货通知单导入时,新增客户维护项等

支持导入改单等
java8
han\hanst 7 months ago
parent
commit
45ed339931
  1. 2
      src/main/java/com/xujie/sys/modules/ecss/controller/CoDelController.java
  2. 27
      src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java
  3. 6
      src/main/resources/mapper/ecss/CoDelMapper.xml

2
src/main/java/com/xujie/sys/modules/ecss/controller/CoDelController.java

@ -256,7 +256,7 @@ public class CoDelController {
@PostMapping("/getDeclarationDefaultData")
public R getDeclarationDefaultData(@RequestBody EcssCoDelNotifyHeaderData inData){
Map<String, Object> map = coDelService.getDeclarationDefaultData(inData);
return R.ok().put("row",map.get("row")).put("rows",map.get("rows")).put("customers",map.get("customers")).put("customerAdd",map.get("customerAdd"));
return R.ok().put("row",map.get("row")).put("rows",map.get("rows"));
}
@PostMapping("/partInformationHsCode")

27
src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java

@ -535,6 +535,11 @@ public class CoDelServiceImpl implements CoDelService {
} catch (Exception e) {
throw new RuntimeException("导入失败:" + e.getMessage());
}
for (EcssCoDelNotifyData data:excelList) {
if (!inData.getCmcInvoice().equals(data.getCmcInvoice())) {
throw new RuntimeException("导入失败:Excel中存在与发货通知单["+inData.getCmcInvoice()+"]不一致的发票号");
}
}
List<EcssCoDelNotifyHeaderData> notifyHeader = coDelMapper.checkIfHasHeader(excelList.get(0).getCmcInvoice());
EcssCoDelNotifyHeaderData headerData;
if (notifyHeader.isEmpty()) {
@ -551,7 +556,7 @@ public class CoDelServiceImpl implements CoDelService {
excelList.get(i).setItemNo(i + 1);
}
coDelMapper.batchSaveEcssCoDelNotifyDetail(excelList);
inData.setModifyFlag(true);
headerData.setModifyFlag(true);
coDelMapper.updateEcssDelHeaderForModify(headerData);
List<EcssCoDelNotifyDetailData> newData =coDelMapper.searchEcssCoDelNotifyDetail(headerData);
Map<String, List<EcssCoDelNotifyDetailData>> dbMap = dbData.stream().collect(Collectors.groupingBy(EcssCoDelNotifyDetail::getPn));
@ -602,12 +607,12 @@ public class CoDelServiceImpl implements CoDelService {
@Override
public void updateEcssDel(EcssCoDelNotifyHeaderData data) {
List<EcssCoDelNotifyHeaderData> checkHeader = coDelMapper.checkEcssCoDelNotifyHeaderByDelNo(data.getSite(), data.getDelNo());
if (checkHeader.size() == 0) {
if (checkHeader.isEmpty()) {
throw new RuntimeException("不存在该发货通知单请刷新界面");
}
if (!"仓库已确认".equals(checkHeader.get(0).getNotifyStatus())) {
/* if (!"仓库已确认".equals(checkHeader.get(0).getNotifyStatus())) {
throw new RuntimeException("发货通知单状态不为仓库已确认,请刷新页面。");
}
}*/
coDelMapper.updateEcssDel(data);
}
@ -1768,7 +1773,7 @@ public class CoDelServiceImpl implements CoDelService {
if (data.getPackaging()!=null && data.getPackaging()) {
template.addVar("packaging", "Non-reusable plastic packaging:");
// 根据维护参数计算出KGS=总托数*plastic packaging维护参数
template.addVar("KGS_qty", (data.getKgs().multiply(BigDecimal.valueOf(totalPlt))).setScale(2, RoundingMode.HALF_UP));
template.addVar("KGS_qty", data.getKgs()!=null?(data.getKgs().multiply(BigDecimal.valueOf(totalPlt))).setScale(2, RoundingMode.HALF_UP):"");
template.addVar("KGS", "KGS");
}
// 新加的 货物明细单选框 勾选显示
@ -1940,7 +1945,7 @@ public class CoDelServiceImpl implements CoDelService {
if (data.getPackaging()!=null && data.getPackaging()) {
template.addVar("packaging", "Non-reusable plastic packaging:");
// 根据维护参数计算出KGS=总托数*plastic packaging维护参数
template.addVar("KGS_qty", data.getKgs().multiply(BigDecimal.valueOf(totalPlt)));
template.addVar("KGS_qty", data.getKgs()!=null?(data.getKgs().multiply(BigDecimal.valueOf(totalPlt))).setScale(2, RoundingMode.HALF_UP):"");
template.addVar("KGS", "KGS");
}
// 新加的 货物明细单选框 勾选显示
@ -2149,7 +2154,7 @@ public class CoDelServiceImpl implements CoDelService {
.collect(Collectors.toMap(o -> o.getPartNo() + "$" + o.getPropertiesItemNo(), o -> o));
Map<String, EcssCoDelNotifyDetailData> palletItemMap = new HashMap<>();
Map<String, List<EcssCoDelNotifyDetailData>> palletListMap = new HashMap<>();
int totalQty = 0;
//int totalQty = 0;
for (EcssCoDelNotifyDetailData detailData : ecssCoDelNotifyDetail) {
if (detailData.getQty().compareTo(BigDecimal.ZERO)==0) {
continue;
@ -2164,7 +2169,7 @@ public class CoDelServiceImpl implements CoDelService {
list.add(detailData);
palletListMap.put(detailData.getPartNo(), list);
}
totalQty = totalQty + detailData.getQty().intValue();
//totalQty = totalQty + detailData.getQty().intValue();
}
int seq = 0;
int seqNo = coDelMapper.getCoDelPalletHeaderSeqNo(inData);
@ -2198,9 +2203,13 @@ public class CoDelServiceImpl implements CoDelService {
headerData.setLength(palletData.getLength());
headerData.setWidth(palletData.getWidth());
headerData.setHeight(palletData.getHeight());
int totalQty = 0;
for (EcssCoDelNotifyDetailData detailData : palletListMap.get(partNo)) {
totalQty = totalQty + detailData.getQty().intValue();
}
// 每托层数*箱高+底座高
headerData.setVolume(headerData.getLength().multiply(headerData.getWidth()).multiply(headerData.getHeight()));
BigDecimal boxWeight = BigDecimal.valueOf(propertiesBoxWeight.getNumValue());// 包装箱的重量
BigDecimal boxWeight = BigDecimal.valueOf(propertiesBoxWeight.getNumValue());// 箱的重量
// Total Qty / 每箱EA
BigDecimal noCartons = BigDecimal.valueOf(totalQty/((double) propertiesRollQty.getNumValue().intValue() * propertiesBoxRolls.getNumValue().intValue()));
// 箱重量物料维护里取

6
src/main/resources/mapper/ecss/CoDelMapper.xml

@ -535,15 +535,15 @@ create_by,create_date,update_by,update_date
</delete>
<select id="getAllWeight" resultType="com.xujie.sys.modules.ecss.entity.EcssCoDelPalletHeader">
select sum( pallet_qty*gross_weight) as gross_weight ,sum( pallet_qty*net_weight) as net_weight from ecss_CoDelPalletHeader
select sum(gross_weight) as gross_weight ,sum(net_weight) as net_weight from ecss_CoDelPalletHeader
where site =#{site} and delNo=#{delNo}
</select>
<select id="getDefaultEcssDeclarationDetailData" resultType="EcssDeclarationDetailData">
select #{site} as site, b.hsCode,b.hsCodeDesc as hsCodeDesc,sum( a.qty) as qty , sum(c.Net_Weight*isnull(a.box_qty,1)) as NetWeight
select #{site} as site, b.hsCode,b.hsCodeDesc as hsCodeDesc,sum(a.qty) as qty,sum(distinct c.Net_Weight) as NetWeight
,'CNY' as currency,'中国' as madeArea,#{destination} as destination,'南通其他' as sourceArea ,'照章征免' as levy from
ecss_CoDelPalletDetail a left join part b on a.site=b.site and a.part_no=b.part_no
left join ecss_CoDelPalletHeader c on a.site=c.site and a.delNo=c.delNo
left join ecss_CoDelPalletHeader c on a.site=c.site and a.delNo=c.delNo and a.seq_no=c.seq_no
where a.site =#{site} and a.delNo=#{delNo}
GROUP BY b.hsCodeDesc,b.hsCode
</select>

Loading…
Cancel
Save