|
|
|
@ -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())); |
|
|
|
// 箱重量:物料维护里取 |
|
|
|
|