|
|
@ -2923,24 +2923,23 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
// 发货通知单明细 |
|
|
// 发货通知单明细 |
|
|
List<Map> nodifyDetailList = coDelMapper.exportEcssCoDelNotifyDetail(data); |
|
|
List<Map> nodifyDetailList = coDelMapper.exportEcssCoDelNotifyDetail(data); |
|
|
List<Map> rows = sqlSession.selectList("ecssMapper.getEcssCoDelNotifyDetailData", notifyHeader); |
|
|
List<Map> rows = sqlSession.selectList("ecssMapper.getEcssCoDelNotifyDetailData", notifyHeader); |
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
|
|
StringBuilder sbEn = new StringBuilder(); |
|
|
|
|
|
for (int i = 0; i < rows.size(); i++) { |
|
|
|
|
|
if (i < rows.size() - 1) { |
|
|
|
|
|
sb.append(rows.get( i).get("hsCodeDesc")).append("、"); |
|
|
|
|
|
sbEn.append(rows.get( i).get("hsCodeDescEn")).append("、"); |
|
|
|
|
|
} else { |
|
|
|
|
|
sb.append(rows.get( i).get("hsCodeDesc")); |
|
|
|
|
|
sbEn.append(rows.get( i).get("hsCodeDescEn")); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
String sb = rows.stream() |
|
|
|
|
|
.map(row -> Objects.toString(row.get("hsCodeDesc"), "").trim()) |
|
|
|
|
|
.filter(StringUtils::isNotBlank) |
|
|
|
|
|
.distinct() |
|
|
|
|
|
.collect(Collectors.joining("、")); |
|
|
|
|
|
String sbEn = rows.stream() |
|
|
|
|
|
.map(row -> Objects.toString(row.get("hsCodeDescEn"), "").trim()) |
|
|
|
|
|
.filter(StringUtils::isNotBlank) |
|
|
|
|
|
.distinct() |
|
|
|
|
|
.collect(Collectors.joining("、")); |
|
|
// 装箱明细 |
|
|
// 装箱明细 |
|
|
List<Map> palletDetailList = coDelMapper.exportCoDelPalletDetail(notifyHeader); |
|
|
List<Map> palletDetailList = coDelMapper.exportCoDelPalletDetail(notifyHeader); |
|
|
BigDecimal totalQty = palletDetailList.stream() |
|
|
BigDecimal totalQty = palletDetailList.stream() |
|
|
.map(o -> new BigDecimal(o.get("total_qty").toString())) |
|
|
.map(o -> new BigDecimal(o.get("total_qty").toString())) |
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
.reduce(BigDecimal.ZERO, BigDecimal::add); |
|
|
template.addVar("hs_code_desc", data.getHsCodeDescType()!=null&& data.getHsCodeDescType().equals("N")? |
|
|
template.addVar("hs_code_desc", data.getHsCodeDescType()!=null&& data.getHsCodeDescType().equals("N")? |
|
|
sbEn.toString():sb.toString()); |
|
|
|
|
|
|
|
|
sbEn:sb); |
|
|
String hsCodes = nodifyDetailList.stream() |
|
|
String hsCodes = nodifyDetailList.stream() |
|
|
.map(m -> Objects.toString(m.get("hsCode"), "")) |
|
|
.map(m -> Objects.toString(m.get("hsCode"), "")) |
|
|
.filter(s -> !s.isEmpty()) // 去掉空值 |
|
|
.filter(s -> !s.isEmpty()) // 去掉空值 |
|
|
@ -2958,12 +2957,23 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { |
|
|
ttlAmount = ttlAmount.add((BigDecimal) map.get("ttl_amount")); |
|
|
ttlAmount = ttlAmount.add((BigDecimal) map.get("ttl_amount")); |
|
|
} |
|
|
} |
|
|
boolean showOrderNoFlag = data != null && Boolean.TRUE.equals(data.getShowOrderNoFlag()); |
|
|
boolean showOrderNoFlag = data != null && Boolean.TRUE.equals(data.getShowOrderNoFlag()); |
|
|
|
|
|
boolean showInvoiceFlag = data != null && Boolean.TRUE.equals(data.getShowInvoiceFlag()); |
|
|
String buNo = notifyHeader == null ? "" : notifyHeader.getBuNo(); |
|
|
String buNo = notifyHeader == null ? "" : notifyHeader.getBuNo(); |
|
|
String poNoDisplayText = formatPoNoForDisplay(poNoSet); |
|
|
String poNoDisplayText = formatPoNoForDisplay(poNoSet); |
|
|
if (isShowOrderNoBu(buNo)) { |
|
|
if (isShowOrderNoBu(buNo)) { |
|
|
poNoDisplayText = showOrderNoFlag ? formatPoNoForHwDesc(poNoSet) : ""; |
|
|
poNoDisplayText = showOrderNoFlag ? formatPoNoForHwDesc(poNoSet) : ""; |
|
|
} |
|
|
} |
|
|
template.addVar("hw_desc", (data.getHsCodeDescType()!=null&& data.getHsCodeDescType().equals("N")?sbEn:sb) + "\n" +poNoDisplayText); |
|
|
|
|
|
|
|
|
String hsCodeDescText = data.getHsCodeDescType()!=null&& data.getHsCodeDescType().equals("N") ? sbEn : sb; |
|
|
|
|
|
String hwDescText = hsCodeDescText + "\n" + poNoDisplayText; |
|
|
|
|
|
if (isShowOrderNoBu(buNo) && showInvoiceFlag) { |
|
|
|
|
|
String cmcInvoiceText = stringInput(notifyHeader.getCmcInvoice()); |
|
|
|
|
|
if (StringUtils.isBlank(poNoDisplayText)) { |
|
|
|
|
|
hwDescText = hsCodeDescText + "\n" + cmcInvoiceText; |
|
|
|
|
|
} else { |
|
|
|
|
|
hwDescText = hwDescText + "\n" + cmcInvoiceText; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
template.addVar("hw_desc", hwDescText); |
|
|
template.addVar("shipping_port", stringInput(notifyHeader.getCnative())); |
|
|
template.addVar("shipping_port", stringInput(notifyHeader.getCnative())); |
|
|
template.addVar("cmc_invoice", stringInput(notifyHeader.getCmcInvoice())); |
|
|
template.addVar("cmc_invoice", stringInput(notifyHeader.getCmcInvoice())); |
|
|
// 导出时默认,可编辑的栏目 |
|
|
// 导出时默认,可编辑的栏目 |
|
|
|