diff --git a/src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java b/src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java index 5a6bb78c..29aae760 100644 --- a/src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java +++ b/src/main/java/com/xujie/sys/modules/ecss/mapper/CoDelMapper.java @@ -149,6 +149,10 @@ public interface CoDelMapper { List getDefaultEcssDeclarationDetailData( @Param("site") String site,@Param("delNo") String delNo,@Param("destination") String destination,@Param("buNo") String buNo); List getDefaultEcssDeclarationDetailData2( @Param("site") String site,@Param("delNo") String delNo,@Param("destination") String destination,@Param("buNo") String buNo); + + List getDefaultEcssDeclarationDetailDataTX( @Param("site") String site,@Param("delNo") String delNo,@Param("destination") String destination,@Param("buNo") String buNo); + List getDefaultEcssDeclarationDetailData2TX( @Param("site") String site,@Param("delNo") String delNo,@Param("destination") String destination,@Param("buNo") String buNo); + void saveEcssDeclarationHeader(EcssDeclarationHeaderData inData); void saveEcssDeclarationDetail(EcssDeclarationDetailData inData); diff --git a/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java b/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java index e2af5487..fdb82b04 100644 --- a/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java +++ b/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelExcelTXServiceImpl.java @@ -561,7 +561,7 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { palletHeader.setSeqNo(palletSeqNo); palletHeader.setPalletNo(palletNo); palletHeader.setPalletQty(palletCount); - palletHeader.setVolume(volume); + palletHeader.setVolume(volume!= null ? volume : BigDecimal.ZERO); if (outerSizeStr != null && !outerSizeStr.isEmpty()) { String[] sizes = outerSizeStr.split("\\*"); @@ -2243,7 +2243,7 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { Integer palletQty = palletQtyMap.get(palletSeqNo); eorder.put("total_pallets", showPalletQty ? (palletQty != null ? palletQty : 1) : ""); eorder.put("volume", isFirstRow ? volume : ""); - eorder.put("gross_weight", isFirstRow ? ((BigDecimal) list.get(m).get("gross_weight")).setScale(2, RoundingMode.HALF_UP) : ""); + //eorder.put("gross_weight", isFirstRow ? ((BigDecimal) list.get(m).get("gross_weight")).setScale(2, RoundingMode.HALF_UP) : ""); eorder.put("net_weight",isFirstRow ? ((BigDecimal) list.get(m).get("net_weight")).setScale(2, RoundingMode.HALF_UP) : ""); // 构建artNo内容 diff --git a/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java b/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java index ab4deed0..e9f91658 100644 --- a/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java +++ b/src/main/java/com/xujie/sys/modules/ecss/service/impl/CoDelServiceImpl.java @@ -976,6 +976,33 @@ public class CoDelServiceImpl implements CoDelService { List hsCodeList = coDelMapper.searchHsCodeList(paramData); data.setUnit(!hsCodeList.isEmpty() ? (String) hsCodeList.get(0).get("unit") : ""); } + } else if (notifyHeaderData.getBuNo().equals("04-MHM")) { + List rows1 = coDelMapper.getDefaultEcssDeclarationDetailDataTX(inData.getSite(), inData.getDelNo(), + notifyHeaderData.getCnative(),inData.getBuNo()); + Map dataMap = rows1.stream() + .collect(Collectors.toMap(o -> StringUtils.defaultString(o.getHsCodeDesc()) + + "$" + StringUtils.defaultString(o.getHsCode()) + "$" + + StringUtils.defaultString(o.getBrand())+ + "$"+ StringUtils.defaultString(o.getUnit()), o -> o, (oldValue, newValue) -> oldValue)); + EcssDeclarationHeaderData declarationHeaderData = new EcssDeclarationHeaderData(); + declarationHeaderData.setSite(notifyHeaderData.getSite()); + declarationHeaderData.setDelNo(notifyHeaderData.getDelNo()); + List detailList = coDelMapper.exportEcssCoDelNotifyDetail(declarationHeaderData); + rows2 = coDelMapper.getDefaultEcssDeclarationDetailData2TX(inData.getSite(), inData.getDelNo(), + notifyHeaderData.getCnative(),inData.getBuNo()); + for (EcssDeclarationDetailData data : rows2){ + String dataKey = StringUtils.defaultString(data.getHsCodeDesc()) + + "$" + StringUtils.defaultString(data.getHsCode()) + "$" + + StringUtils.defaultString(data.getBrand())+ + "$"+ StringUtils.defaultString(data.getUnit()); + EcssDeclarationDetailData matchedData = dataMap.get(dataKey); + if (matchedData != null) { + data.setNetWeight(matchedData.getNetWeight()); + } else { + data.setNetWeight(BigDecimal.ZERO); + log.warn("未匹配到净重数据: hsCodeDesc={}, hsCode={}, brand={}", data.getHsCodeDesc(), data.getHsCode(), data.getBrand()); + } + } } else { Map dataMap = rows.stream() .collect(Collectors.toMap(o -> StringUtils.defaultString(o.getHsCodeDesc()) + "$" + StringUtils.defaultString(o.getHsCode()) + "$" diff --git a/src/main/resources/mapper/ecss/CoDelMapper.xml b/src/main/resources/mapper/ecss/CoDelMapper.xml index 250a4d56..757dc3af 100644 --- a/src/main/resources/mapper/ecss/CoDelMapper.xml +++ b/src/main/resources/mapper/ecss/CoDelMapper.xml @@ -701,6 +701,61 @@ create_by,create_date,update_by,update_date GROUP BY b.hsCodeDesc,b.hsCode,b.brand,LEFT(a.currency,3) + + + + insert into ecss_declaration_header (site,declaration_no,customs_office_code,input_code,local_shipper,local_ship_address,ship_type,ship_date,submit_date, diff --git a/src/main/resources/templates/ALPHA/declaration-all-template.xlsx b/src/main/resources/templates/ALPHA/declaration-all-template.xlsx index b5484cd6..3fb0baf6 100644 Binary files a/src/main/resources/templates/ALPHA/declaration-all-template.xlsx and b/src/main/resources/templates/ALPHA/declaration-all-template.xlsx differ diff --git a/src/main/resources/templates/ALPHA/export-goods-template.xlsx b/src/main/resources/templates/ALPHA/export-goods-template.xlsx index b71f28a8..f8b9d1f9 100644 Binary files a/src/main/resources/templates/ALPHA/export-goods-template.xlsx and b/src/main/resources/templates/ALPHA/export-goods-template.xlsx differ diff --git a/src/main/resources/templates/YB/declaration-all-template.xlsx b/src/main/resources/templates/YB/declaration-all-template.xlsx index df5c7efa..bbf827a3 100644 Binary files a/src/main/resources/templates/YB/declaration-all-template.xlsx and b/src/main/resources/templates/YB/declaration-all-template.xlsx differ diff --git a/src/main/resources/templates/YB/export-goods-template.xlsx b/src/main/resources/templates/YB/export-goods-template.xlsx index b71f28a8..f714e151 100644 Binary files a/src/main/resources/templates/YB/export-goods-template.xlsx and b/src/main/resources/templates/YB/export-goods-template.xlsx differ