diff --git a/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java b/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java index d834320b..8cf8fa72 100644 --- a/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java +++ b/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java @@ -1319,12 +1319,12 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { return String.join("\n", voyageParts); } - private String buildMexicoShippingMarkText(List notifyDetailList) { + private String buildMexicoShippingMarkText(List notifyDetailList, boolean keepDuplicateRows) { if (notifyDetailList == null || notifyDetailList.isEmpty()) { return ""; } List shippingMarkRows = new ArrayList<>(); - LinkedHashSet uniqueRowKeys = new LinkedHashSet<>(); + LinkedHashSet uniqueRowKeys = keepDuplicateRows ? null : new LinkedHashSet<>(); int maxGoodsLength = "Name of the Goods:".length(); for (Map detail : notifyDetailList) { String partDescription = detail.get("part_description") == null ? "" : String.valueOf(detail.get("part_description")).trim(); @@ -1332,9 +1332,11 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { if (StringUtils.isBlank(partDescription) && StringUtils.isBlank(pn)) { continue; } - String uniqueKey = partDescription + "@@@" + pn; - if (!uniqueRowKeys.add(uniqueKey)) { - continue; + if (!keepDuplicateRows) { + String uniqueKey = partDescription + "@@@" + pn; + if (!uniqueRowKeys.add(uniqueKey)) { + continue; + } } shippingMarkRows.add(new String[]{partDescription, pn}); if (partDescription.length() > maxGoodsLength) { @@ -1378,9 +1380,10 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { private String resolveExportGoodsVoyage(EcssDeclarationHeaderData data, EcssCoDelNotifyHeaderData notifyHeader, List notifyDetailList) { String buNo = notifyHeader == null ? "" : notifyHeader.getBuNo(); boolean mexicoShippingMarkFlag = data != null && Boolean.TRUE.equals(data.getMexicoShippingMarkFlag()); + boolean hardtagBu = "02-Hardtag".equalsIgnoreCase(buNo); if (mexicoShippingMarkFlag && isMexicoShippingMarkBu(buNo)) { - String mexicoVoyage = buildMexicoShippingMarkText(notifyDetailList); + String mexicoVoyage = buildMexicoShippingMarkText(notifyDetailList, hardtagBu); if (StringUtils.isNotBlank(mexicoVoyage)) { return normalizeExcelMultilineText(mexicoVoyage); } @@ -3620,7 +3623,7 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { template.addVar("phone2", ecssContacts.size()>1?getContactPhone(ecssContacts.get(1)):""); template.addVar("contacts", ecssContacts.get(0).get("name")+(ecssContacts.size()>1?"/"+ecssContacts.get(1).get("name"):"")); } - template.addVar("voyage", resolveExportGoodsVoyage(data, notifyHeader, nodifyDetailList));//唛头 + template.addVar("voyage", resolveExportGoodsVoyage(data, notifyHeader, coDelMapper.getEcssCoDelNotifyDetailByDelNo(data)));//唛头 template.addVar("poNos", formatPoNoForHwDesc(poNoSet)); } diff --git a/src/main/resources/templates/ALPHA/declaration-all-template.xlsx b/src/main/resources/templates/ALPHA/declaration-all-template.xlsx index 20cd532b..7a809740 100644 Binary files a/src/main/resources/templates/ALPHA/declaration-all-template.xlsx and b/src/main/resources/templates/ALPHA/declaration-all-template.xlsx differ diff --git a/src/main/resources/templates/ALPHA/export-goods-template.xlsx b/src/main/resources/templates/ALPHA/export-goods-template.xlsx index c78a290e..d6b4be1d 100644 Binary files a/src/main/resources/templates/ALPHA/export-goods-template.xlsx and b/src/main/resources/templates/ALPHA/export-goods-template.xlsx differ