Browse Source

最新模版

java8
han\hanst 6 months ago
parent
commit
84ebf3c252
  1. 21
      src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java
  2. 2
      src/main/resources/mapper/ecss/EcssCommonMapper.xml
  3. BIN
      src/main/resources/templates/declaration-all-template-pdf.xlsx
  4. BIN
      src/main/resources/templates/declaration-all-template.xlsx
  5. BIN
      src/main/resources/templates/export-goods-template.xlsx
  6. BIN
      src/main/resources/templates/packing-template.xlsx

21
src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java

@ -135,10 +135,11 @@ public class CoDelServiceImpl implements CoDelService {
summary.put("destination", dataList.get(0).getDestination()); summary.put("destination", dataList.get(0).getDestination());
summary.put("shippingMode", dataList.get(0).getShippingMode()); summary.put("shippingMode", dataList.get(0).getShippingMode());
// 检查是否已存在
// 检查是否已存在如果已存在则跳过
List<EcssCoDelNotifyHeaderData> existingHeaders = coDelMapper.checkIfHasHeader(invoice); List<EcssCoDelNotifyHeaderData> existingHeaders = coDelMapper.checkIfHasHeader(invoice);
boolean exists = !existingHeaders.isEmpty();
summary.put("exists", exists);
if (!existingHeaders.isEmpty()) {
return; // 跳过已存在的发票号
}
// 检查物料存在性 // 检查物料存在性
List<String> invalidMaterials = invalidMaterialsByInvoice.get(invoice); List<String> invalidMaterials = invalidMaterialsByInvoice.get(invoice);
@ -151,10 +152,7 @@ public class CoDelServiceImpl implements CoDelService {
} }
// 设置状态信息 // 设置状态信息
if (exists) {
summary.put("status", "已存在");
summary.put("statusType", "warning");
} else if (hasInvalidMaterials) {
if (hasInvalidMaterials) {
summary.put("status", "物料不存在"); summary.put("status", "物料不存在");
summary.put("statusType", "error"); summary.put("statusType", "error");
} else { } else {
@ -1996,11 +1994,11 @@ public class CoDelServiceImpl implements CoDelService {
PageSetup pageSetup = worksheet.getPageSetup(); PageSetup pageSetup = worksheet.getPageSetup();
// 设置页面方向纵向 // 设置页面方向纵向
pageSetup.setOrientation(PageOrientationType.PORTRAIT);
pageSetup.setOrientation(i==2?PageOrientationType.LANDSCAPE:PageOrientationType.PORTRAIT);
// 设置纸张大小A4 // 设置纸张大小A4
pageSetup.setPaperSize(PaperSizeType.PAPER_A_4); pageSetup.setPaperSize(PaperSizeType.PAPER_A_4);
// 设置缩放比例 // 设置缩放比例
pageSetup.setZoom(65);
pageSetup.setZoom(90);
// 设置边距 // 设置边距
pageSetup.setLeftMargin(0.5); pageSetup.setLeftMargin(0.5);
pageSetup.setRightMargin(0.5); pageSetup.setRightMargin(0.5);
@ -2496,7 +2494,10 @@ public class CoDelServiceImpl implements CoDelService {
int totalQty=palletDetailList.stream().mapToInt(o -> Integer.parseInt(o.get("total_qty").toString())).sum(); int totalQty=palletDetailList.stream().mapToInt(o -> Integer.parseInt(o.get("total_qty").toString())).sum();
Map<Object, Map> palletMap = palletDetailList.stream().collect(Collectors.toMap( o -> o.get("part_no"), o -> o)); Map<Object, Map> palletMap = palletDetailList.stream().collect(Collectors.toMap( o -> o.get("part_no"), o -> o));
template.addVar("hs_code_desc", stringInput(nodifyDetailList.get(0).get("hsCodeDescEn")!=null?sbEn.toString():"")); template.addVar("hs_code_desc", stringInput(nodifyDetailList.get(0).get("hsCodeDescEn")!=null?sbEn.toString():""));
template.addVar("hs_code", stringInput(nodifyDetailList.get(0).get("hsCode").toString()));
String hsCodes = nodifyDetailList.stream()
.map(m -> Objects.toString(m.get("hsCode"), ""))
.collect(Collectors.joining("\n"));
template.addVar("hs_code", stringInput(hsCodes));
Map<Object, Object> poNoMap = new HashMap<>(); Map<Object, Object> poNoMap = new HashMap<>();
BigDecimal ttlAmount = BigDecimal.ZERO; BigDecimal ttlAmount = BigDecimal.ZERO;
BigDecimal grossWeight = BigDecimal.valueOf(0.0); BigDecimal grossWeight = BigDecimal.valueOf(0.0);

2
src/main/resources/mapper/ecss/EcssCommonMapper.xml

@ -46,7 +46,7 @@
select b.po_no as customerPO,b.part_no,b.qty, select b.po_no as customerPO,b.part_no,b.qty,
a.box_qty as boxQty,b.rolls,b.pn,a.gross_weight as grossWeight,a.net_weight as netWeight, a.box_qty as boxQty,b.rolls,b.pn,a.gross_weight as grossWeight,a.net_weight as netWeight,
#{cmcInvoice} as cmcInvoice,#{shippingMode} as shippingMode,#{destination} as destination, #{cmcInvoice} as cmcInvoice,#{shippingMode} as shippingMode,#{destination} as destination,
c.remark,CONVERT(varchar(10), #{readyDate}, 120) AS readyDate
c.cmc_comment,CONVERT(varchar(10), #{readyDate}, 120) AS readyDate
from ecss_CoDelBoxList a from ecss_CoDelBoxList a
left join ecss_CoDelPalletDetail b on a.site=b.site and a.bu_no=b.bu_no and a.delNo=b.delNo and a.item_no=b.seq_no left join ecss_CoDelPalletDetail b on a.site=b.site and a.bu_no=b.bu_no and a.delNo=b.delNo and a.item_no=b.seq_no
left join ecss_CoDelNotifydetail c on b.site=c.site and b.bu_no=c.bu_no and b.delNo=c.delNo and b.notify_detail_item_no=c.item_no left join ecss_CoDelNotifydetail c on b.site=c.site and b.bu_no=c.bu_no and b.delNo=c.delNo and b.notify_detail_item_no=c.item_no

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

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

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

BIN
src/main/resources/templates/packing-template.xlsx

Loading…
Cancel
Save