|
|
@ -135,10 +135,11 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
summary.put("destination", dataList.get(0).getDestination()); |
|
|
summary.put("destination", dataList.get(0).getDestination()); |
|
|
summary.put("shippingMode", dataList.get(0).getShippingMode()); |
|
|
summary.put("shippingMode", dataList.get(0).getShippingMode()); |
|
|
|
|
|
|
|
|
// 检查是否已存在 |
|
|
|
|
|
|
|
|
// 检查是否已存在,如果已存在则跳过 |
|
|
List<EcssCoDelNotifyHeaderData> existingHeaders = coDelMapper.checkIfHasHeader(invoice); |
|
|
List<EcssCoDelNotifyHeaderData> existingHeaders = coDelMapper.checkIfHasHeader(invoice); |
|
|
boolean exists = !existingHeaders.isEmpty(); |
|
|
|
|
|
summary.put("exists", exists); |
|
|
|
|
|
|
|
|
if (!existingHeaders.isEmpty()) { |
|
|
|
|
|
return; // 跳过已存在的发票号 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 检查物料存在性 |
|
|
// 检查物料存在性 |
|
|
List<String> invalidMaterials = invalidMaterialsByInvoice.get(invoice); |
|
|
List<String> invalidMaterials = invalidMaterialsByInvoice.get(invoice); |
|
|
@ -151,10 +152,7 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 设置状态信息 |
|
|
// 设置状态信息 |
|
|
if (exists) { |
|
|
|
|
|
summary.put("status", "已存在"); |
|
|
|
|
|
summary.put("statusType", "warning"); |
|
|
|
|
|
} else if (hasInvalidMaterials) { |
|
|
|
|
|
|
|
|
if (hasInvalidMaterials) { |
|
|
summary.put("status", "物料不存在"); |
|
|
summary.put("status", "物料不存在"); |
|
|
summary.put("statusType", "error"); |
|
|
summary.put("statusType", "error"); |
|
|
} else { |
|
|
} else { |
|
|
@ -1996,11 +1994,11 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
PageSetup pageSetup = worksheet.getPageSetup(); |
|
|
PageSetup pageSetup = worksheet.getPageSetup(); |
|
|
|
|
|
|
|
|
// 设置页面方向(纵向) |
|
|
// 设置页面方向(纵向) |
|
|
pageSetup.setOrientation(PageOrientationType.PORTRAIT); |
|
|
|
|
|
|
|
|
pageSetup.setOrientation(i==2?PageOrientationType.LANDSCAPE:PageOrientationType.PORTRAIT); |
|
|
// 设置纸张大小(A4) |
|
|
// 设置纸张大小(A4) |
|
|
pageSetup.setPaperSize(PaperSizeType.PAPER_A_4); |
|
|
pageSetup.setPaperSize(PaperSizeType.PAPER_A_4); |
|
|
// 设置缩放比例 |
|
|
// 设置缩放比例 |
|
|
pageSetup.setZoom(65); |
|
|
|
|
|
|
|
|
pageSetup.setZoom(90); |
|
|
// 设置边距 |
|
|
// 设置边距 |
|
|
pageSetup.setLeftMargin(0.5); |
|
|
pageSetup.setLeftMargin(0.5); |
|
|
pageSetup.setRightMargin(0.5); |
|
|
pageSetup.setRightMargin(0.5); |
|
|
@ -2496,7 +2494,10 @@ public class CoDelServiceImpl implements CoDelService { |
|
|
int totalQty=palletDetailList.stream().mapToInt(o -> Integer.parseInt(o.get("total_qty").toString())).sum(); |
|
|
int totalQty=palletDetailList.stream().mapToInt(o -> Integer.parseInt(o.get("total_qty").toString())).sum(); |
|
|
Map<Object, Map> palletMap = palletDetailList.stream().collect(Collectors.toMap( o -> o.get("part_no"), o -> o)); |
|
|
Map<Object, Map> palletMap = palletDetailList.stream().collect(Collectors.toMap( o -> o.get("part_no"), o -> o)); |
|
|
template.addVar("hs_code_desc", stringInput(nodifyDetailList.get(0).get("hsCodeDescEn")!=null?sbEn.toString():"")); |
|
|
template.addVar("hs_code_desc", stringInput(nodifyDetailList.get(0).get("hsCodeDescEn")!=null?sbEn.toString():"")); |
|
|
template.addVar("hs_code", stringInput(nodifyDetailList.get(0).get("hsCode").toString())); |
|
|
|
|
|
|
|
|
String hsCodes = nodifyDetailList.stream() |
|
|
|
|
|
.map(m -> Objects.toString(m.get("hsCode"), "")) |
|
|
|
|
|
.collect(Collectors.joining("\n")); |
|
|
|
|
|
template.addVar("hs_code", stringInput(hsCodes)); |
|
|
Map<Object, Object> poNoMap = new HashMap<>(); |
|
|
Map<Object, Object> poNoMap = new HashMap<>(); |
|
|
BigDecimal ttlAmount = BigDecimal.ZERO; |
|
|
BigDecimal ttlAmount = BigDecimal.ZERO; |
|
|
BigDecimal grossWeight = BigDecimal.valueOf(0.0); |
|
|
BigDecimal grossWeight = BigDecimal.valueOf(0.0); |
|
|
|