Browse Source

硬标西班牙委托书的唛头部分,根据发票对应的内容显示,同样的品名料号不需要合并,有几个显示几个

master
han\hanst 1 week ago
parent
commit
62d8b856d7
  1. 11
      src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java
  2. BIN
      src/main/resources/templates/ALPHA/declaration-all-template.xlsx
  3. BIN
      src/main/resources/templates/ALPHA/export-goods-template.xlsx

11
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); return String.join("\n", voyageParts);
} }
private String buildMexicoShippingMarkText(List<Map> notifyDetailList) {
private String buildMexicoShippingMarkText(List<Map> notifyDetailList, boolean keepDuplicateRows) {
if (notifyDetailList == null || notifyDetailList.isEmpty()) { if (notifyDetailList == null || notifyDetailList.isEmpty()) {
return ""; return "";
} }
List<String[]> shippingMarkRows = new ArrayList<>(); List<String[]> shippingMarkRows = new ArrayList<>();
LinkedHashSet<String> uniqueRowKeys = new LinkedHashSet<>();
LinkedHashSet<String> uniqueRowKeys = keepDuplicateRows ? null : new LinkedHashSet<>();
int maxGoodsLength = "Name of the Goods:".length(); int maxGoodsLength = "Name of the Goods:".length();
for (Map detail : notifyDetailList) { for (Map detail : notifyDetailList) {
String partDescription = detail.get("part_description") == null ? "" : String.valueOf(detail.get("part_description")).trim(); 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)) { if (StringUtils.isBlank(partDescription) && StringUtils.isBlank(pn)) {
continue; continue;
} }
if (!keepDuplicateRows) {
String uniqueKey = partDescription + "@@@" + pn; String uniqueKey = partDescription + "@@@" + pn;
if (!uniqueRowKeys.add(uniqueKey)) { if (!uniqueRowKeys.add(uniqueKey)) {
continue; continue;
} }
}
shippingMarkRows.add(new String[]{partDescription, pn}); shippingMarkRows.add(new String[]{partDescription, pn});
if (partDescription.length() > maxGoodsLength) { if (partDescription.length() > maxGoodsLength) {
maxGoodsLength = partDescription.length(); maxGoodsLength = partDescription.length();
@ -1378,9 +1380,10 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService {
private String resolveExportGoodsVoyage(EcssDeclarationHeaderData data, EcssCoDelNotifyHeaderData notifyHeader, List<Map> notifyDetailList) { private String resolveExportGoodsVoyage(EcssDeclarationHeaderData data, EcssCoDelNotifyHeaderData notifyHeader, List<Map> notifyDetailList) {
String buNo = notifyHeader == null ? "" : notifyHeader.getBuNo(); String buNo = notifyHeader == null ? "" : notifyHeader.getBuNo();
boolean mexicoShippingMarkFlag = data != null && Boolean.TRUE.equals(data.getMexicoShippingMarkFlag()); boolean mexicoShippingMarkFlag = data != null && Boolean.TRUE.equals(data.getMexicoShippingMarkFlag());
boolean hardtagBu = "02-Hardtag".equalsIgnoreCase(buNo);
if (mexicoShippingMarkFlag && isMexicoShippingMarkBu(buNo)) { if (mexicoShippingMarkFlag && isMexicoShippingMarkBu(buNo)) {
String mexicoVoyage = buildMexicoShippingMarkText(notifyDetailList);
String mexicoVoyage = buildMexicoShippingMarkText(notifyDetailList, hardtagBu);
if (StringUtils.isNotBlank(mexicoVoyage)) { if (StringUtils.isNotBlank(mexicoVoyage)) {
return normalizeExcelMultilineText(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("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("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)); template.addVar("poNos", formatPoNoForHwDesc(poNoSet));
} }

BIN
src/main/resources/templates/ALPHA/declaration-all-template.xlsx

BIN
src/main/resources/templates/ALPHA/export-goods-template.xlsx

Loading…
Cancel
Save