|
|
@ -1501,6 +1501,21 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
.reduce(0, Integer::sum); |
|
|
.reduce(0, Integer::sum); |
|
|
defaultData.setPackageQty(totalPlt); |
|
|
defaultData.setPackageQty(totalPlt); |
|
|
List<Map> boxList = coDelMapper.exportCoDelBoxList(notifyHeaderData); |
|
|
List<Map> boxList = coDelMapper.exportCoDelBoxList(notifyHeaderData); |
|
|
|
|
|
// 检查box_qty是否存在null或0 |
|
|
|
|
|
for (Map box : boxList) { |
|
|
|
|
|
Object boxQtyObj = box.get("box_qty"); |
|
|
|
|
|
if (boxQtyObj == null) { |
|
|
|
|
|
throw new RuntimeException("存在箱数(box_qty)为null的数据,请检查装箱信息!"); |
|
|
|
|
|
} |
|
|
|
|
|
try { |
|
|
|
|
|
int boxQty = Integer.parseInt(boxQtyObj.toString()); |
|
|
|
|
|
if (boxQty == 0) { |
|
|
|
|
|
throw new RuntimeException("存在箱数(box_qty)为0的数据,请检查装箱信息!"); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (NumberFormatException e) { |
|
|
|
|
|
throw new RuntimeException("箱数(box_qty)格式错误,请检查装箱信息!"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
defaultData.setBoxQty(boxList.stream().mapToInt(o->Integer.parseInt(o.get("box_qty").toString())).sum()); |
|
|
defaultData.setBoxQty(boxList.stream().mapToInt(o->Integer.parseInt(o.get("box_qty").toString())).sum()); |
|
|
map.put("row", defaultData); |
|
|
map.put("row", defaultData); |
|
|
Map<String, EcssDeclarationDetailData> dataMap = rows.stream() |
|
|
Map<String, EcssDeclarationDetailData> dataMap = rows.stream() |
|
|
@ -2467,7 +2482,11 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
if (data.getPackaging()!=null && data.getPackaging()) { |
|
|
if (data.getPackaging()!=null && data.getPackaging()) { |
|
|
template.addVar("packaging", "Non-reusable plastic packaging:"); |
|
|
template.addVar("packaging", "Non-reusable plastic packaging:"); |
|
|
// 根据维护参数计算出KGS=总托数*plastic packaging维护参数 |
|
|
// 根据维护参数计算出KGS=总托数*plastic packaging维护参数 |
|
|
template.addVar("KGS_qty", data.getKgs()!=null?(data.getKgs().multiply(BigDecimal.valueOf(totalPlt))).setScale(2, RoundingMode.HALF_UP):""); |
|
|
|
|
|
|
|
|
BigDecimal totalKgs = data.getKgs()!=null?data.getKgs():BigDecimal.ZERO; |
|
|
|
|
|
if (palletHeaderDataList.isEmpty()) { |
|
|
|
|
|
totalKgs = BigDecimal.valueOf(0.1); |
|
|
|
|
|
} |
|
|
|
|
|
template.addVar("KGS_qty", data.getKgs()!=null?(totalKgs.multiply(BigDecimal.valueOf(totalPlt))).setScale(2, RoundingMode.HALF_UP):""); |
|
|
template.addVar("KGS", "KGS"); |
|
|
template.addVar("KGS", "KGS"); |
|
|
} |
|
|
} |
|
|
// 新加的 货物明细单选框 勾选显示 |
|
|
// 新加的 货物明细单选框 勾选显示 |
|
|
|