|
|
|
@ -1319,12 +1319,12 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
return String.join("\n", voyageParts); |
|
|
|
} |
|
|
|
|
|
|
|
private String buildMexicoShippingMarkText(List<Map> notifyDetailList) { |
|
|
|
private String buildMexicoShippingMarkText(List<Map> notifyDetailList, boolean keepDuplicateRows) { |
|
|
|
if (notifyDetailList == null || notifyDetailList.isEmpty()) { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
List<String[]> shippingMarkRows = new ArrayList<>(); |
|
|
|
LinkedHashSet<String> uniqueRowKeys = new LinkedHashSet<>(); |
|
|
|
LinkedHashSet<String> 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,10 +1332,12 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
if (StringUtils.isBlank(partDescription) && StringUtils.isBlank(pn)) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (!keepDuplicateRows) { |
|
|
|
String uniqueKey = partDescription + "@@@" + pn; |
|
|
|
if (!uniqueRowKeys.add(uniqueKey)) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
shippingMarkRows.add(new String[]{partDescription, pn}); |
|
|
|
if (partDescription.length() > maxGoodsLength) { |
|
|
|
maxGoodsLength = partDescription.length(); |
|
|
|
@ -1378,9 +1380,10 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
|
private String resolveExportGoodsVoyage(EcssDeclarationHeaderData data, EcssCoDelNotifyHeaderData notifyHeader, List<Map> 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)); |
|
|
|
} |
|
|
|
|
|
|
|
|