Browse Source

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

master
han\hanst 7 days ago
parent
commit
62d8b856d7
  1. 17
      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

17
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<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,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<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));
}

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

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

Loading…
Cancel
Save