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 9b94b722..a1844d6a 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 @@ -1484,35 +1484,10 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { List ndList = sqlSession.selectList("ecssMapper.searchEcssCoDelNotifyDetailList", notifyHeader); for (int i = 0; i < ndList.size(); i++) { Map eorder = ndList.get(i); - String partNo = (String) eorder.get("part_no"); - Integer itemNo = eorder.get("item_no") != null ? (Integer) eorder.get("item_no") : null; eorder.put("row_num", i + 1); - EcssCoDelNotifyDetailData nodifyData = notifyDetailMap.get(partNo); - // 根据item_no获取该明细行对应的装箱重量 - String lossratio = ""; - if (nodifyData!=null && nodifyData.getLossratio()!=null && !StringUtils.isBlank(nodifyData.getLossratio())) { - // 关务物料属性 - List propertiesValues = coDelMapper.getPropertiesListByTypeAndCodeNo( - notifyHeader.getSite(), "ECSSPART","BG001", notifyHeader.getBuNo(), partNo); - // 每一个物料加属性对应一个属性,用来下面遍历发货通知单明细时获取具体属性值 - Map> partNoAndItemNoMap = propertiesValues.stream() - .collect(Collectors.groupingBy(PartSubPropertiesValue::getPropertiesItemNo)); - BigDecimal qty = ((BigDecimal)eorder.get("qty")).setScale(6, RoundingMode.HALF_UP); - BigDecimal fscW = fscWeight(partNoAndItemNoMap,partNo, qty, nodifyData.getLossratio()); - lossratio = (fscW.compareTo(BigDecimal.ZERO)>0?"\n"+"FSC Mix Credit SGSHK-COC-321321":"")+ - "\n" + (nodifyData.getEhundred()!=null && StringUtils.isNotEmpty(nodifyData.getEhundred()) - ?"E100-"+nodifyData.getEhundred()+ " ":"") - + (fscW.compareTo(BigDecimal.ZERO)>0?"重量:"+ fscW :""); - } - String hsCodeDesc = data.getHsCodeDesc()!=null&& data.getHsCodeDesc()? - ("\n"+(data.getHsCodeDescTypeInvoice()!=null&& data.getHsCodeDescTypeInvoice().equals("N") - ?eorder.get("hsCodeDescEn") :eorder.get("hsCodeDesc"))):""; - // 构建designation内容 - String designationContent = eorder.get("part_description") + "\n" + "PO:" + eorder.get("customerPO") - + (data.getSo()!=null && data.getSo()?" SO:"+eorder.get("so"):"") - + (data.getHsCodeFlag()!=null && data.getHsCodeFlag()?"\nHS Code:" + eorder.get("hsCode"):"")+hsCodeDesc+ lossratio; - + String designationContent = eorder.get("pn")+" " + eorder.get("part_description") + "\n" + + " PO#" + eorder.get("customerPO")+" HS CODE#" + eorder.get("hsCode"); eorder.put("designation", designationContent); // 计算designation内容的行数,动态设置行高 @@ -1576,11 +1551,7 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { for (EcssCoDelNotifyDetailData nData:notifyDetailList){ coDelMapper.updateEcssCoDelNotifyDetail(nData); } - } else { - notifyDetailList = coDelMapper.getNotifyPartDetail2(data); } - Map notifyDetailMap = notifyDetailList.stream().collect( - Collectors.toMap(EcssCoDelNotifyDetailData::getPartNo,e->e)); template.setCellStyle(true); template.setRangeStyle(true); template.setMoveSeal(true); @@ -1621,7 +1592,6 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { BigDecimal totalCartons = BigDecimal.valueOf(0.0); BigDecimal grossWeight = BigDecimal.valueOf(0.0); BigDecimal netWeight = BigDecimal.valueOf(0.0); - BigDecimal rolls = BigDecimal.valueOf(0.0); BigDecimal totalQty = BigDecimal.valueOf(0.0); // 托盘序号 -> 托盘数(用于托盘数列展示) Map palletQtyMap = palletHeaderDataList.stream() @@ -1656,18 +1626,13 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { if (!Objects.equals(palletSeqNo, previousPalletSeqNo)) { palletStartIndex = boxStartIndex; } - // 获取box的rolls - BigDecimal boxRolls = list.get(m).get("rolls") != null ? - ((BigDecimal) list.get(m).get("rolls")).setScale(0, RoundingMode.HALF_UP) : BigDecimal.ZERO; // 获取box的volume BigDecimal volume = list.get(m).get("volume") != null ? ((BigDecimal) list.get(m).get("volume")).setScale(6, RoundingMode.HALF_UP) : BigDecimal.ZERO; for (int i = 0; i < checkList.size(); i++) { Map eorder = checkList.get(i); - String partNo = (String) eorder.get("part_no"); BigDecimal qty = ((BigDecimal)eorder.get("qty")).setScale(6, RoundingMode.HALF_UP); totalQty = totalQty.add(qty); - BigDecimal noCartons = list.get(m).get("box_qty")!=null?(BigDecimal) list.get(m).get("box_qty"):BigDecimal.ZERO; eorder.put("total_qty", ((BigDecimal)eorder.get("qty")).setScale(6, RoundingMode.HALF_UP)); // 合箱时:第一行显示数值,用于合并单元格居中显示 boolean isFirstRow = (i == 0); @@ -1686,12 +1651,6 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { eorder.put("gross_weight", isFirstRow ? ((BigDecimal) list.get(m).get("gross_weight")).setScale(2, RoundingMode.HALF_UP) : ""); eorder.put("net_weight", ((BigDecimal) list.get(m).get("net_weight")).setScale(2, RoundingMode.HALF_UP)); - // rolls处理:如果明细的rolls全部为空或0,则取box的rolls;合箱时合并居中显示 - // 使用box的rolls,合箱时只在第一行显示(用于合并单元格居中) - - if (isFirstRow) { - rolls = rolls.add(boxRolls); - } // 构建artNo内容 String artNoContent = eorder.get("pn")+" " + eorder.get("part_description") + "\n" + " PO#" + eorder.get("po_no")+" HS CODE#" + eorder.get("hsCode"); @@ -1751,7 +1710,6 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { template.addVar("total_netweight", netWeight.setScale(2, RoundingMode.HALF_UP)); template.addVar("total_box", totalCartons.setScale(0, RoundingMode.HALF_UP)); template.addVar("goods_total_qty", totalQty); - template.addVar("total_rolls", rolls.setScale(0, RoundingMode.HALF_UP)); // 下面是可选的或者手动维护的 // RFID需要的 if (notifyHeader.getBuNo().equals("01-Label") || notifyHeader.getBuNo().equals("03-RFID")) { @@ -1774,10 +1732,6 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { if (data.getMaterial()!=null && data.getMaterial()) { template.addVar("RFIDBase", "RFID Base Material"); template.addVar("HSCode", "& H.S.Code:"+stringInput(data.getHsCode())); - /* template.addVar("volume", !palletHeaderData.isPresent()?"":palletHeaderData.map(ecssCoDelPalletHeaderData -> - ecssCoDelPalletHeaderData.getLength().setScale(2, RoundingMode.HALF_UP) - + "*" + ecssCoDelPalletHeaderData.getWidth().setScale(2, RoundingMode.HALF_UP) + "*" - + ecssCoDelPalletHeaderData.getHeight().setScale(2, RoundingMode.HALF_UP) + "m").orElse(""));*/ } // 欧洲地区需要 if (data.getPackaging()!=null && data.getPackaging()) { @@ -1863,7 +1817,6 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { BigDecimal totalCartons = BigDecimal.valueOf(0.0); BigDecimal grossWeight = BigDecimal.valueOf(0.0); BigDecimal netWeight = BigDecimal.valueOf(0.0); - BigDecimal rolls = BigDecimal.valueOf(0.0); BigDecimal totalQty = BigDecimal.valueOf(0.0); // 托盘序号 -> 托盘数(用于托盘数列展示) Map palletQtyMap = palletHeaderDataList.stream() @@ -1936,12 +1889,6 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { 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) : ""); - // rolls处理:如果明细的rolls全部为空或0,则取box的rolls;合箱时合并居中显示 - // 使用box的rolls,合箱时只在第一行显示(用于合并单元格居中) - - if (isFirstRow) { - rolls = rolls.add(boxRolls); - } // 构建artNo内容 String artNoContent = eorder.get("pn")+" " + eorder.get("part_description") + "\n" + " PO#" + eorder.get("po_no")+" HS CODE#" + eorder.get("hsCode"); @@ -2004,7 +1951,6 @@ public class CoDelExcelTXServiceImpl implements CoDelExcelTXService { template.addVar("total_netweight", netWeight.setScale(2, RoundingMode.HALF_UP)); template.addVar("total_box", totalCartons.setScale(0, RoundingMode.HALF_UP)); template.addVar("goods_total_qty", totalQty); - template.addVar("total_rolls", rolls.setScale(0, RoundingMode.HALF_UP)); // 下面是可选的或者手动维护的 // RFID需要的 if (notifyHeader.getBuNo().equals("01-Label") || notifyHeader.getBuNo().equals("03-RFID")) { diff --git a/src/main/resources/mapper/ecss/EcssCommonMapper.xml b/src/main/resources/mapper/ecss/EcssCommonMapper.xml index 24c91a72..df8204bb 100644 --- a/src/main/resources/mapper/ecss/EcssCommonMapper.xml +++ b/src/main/resources/mapper/ecss/EcssCommonMapper.xml @@ -137,7 +137,7 @@ CASE WHEN a.modifyFlag = 1 THEN '是' ELSE '否' END AS modifyFlag from ecss_CoDelNotifydetail a left join part b on a.site=b.site and a.part_no=b.part_no - left join ecss_hsCode h on b.hsCode=h.HsCode and a.site=h.site and b.hsCodeDesc=h.hsCodeDesc + left join ecss_hsCode h on b.hsCode=h.HsCode and a.site=h.site and b.hsCodeDesc=h.hsCodeDesc and h.brand=b.brand And a.site = #{site} AND a.delNo = #{delNo} diff --git a/src/main/resources/templates/YB/declaration-invoice2-template.xlsx b/src/main/resources/templates/YB/declaration-invoice2-template.xlsx index c15dfb12..e6dd76b9 100644 Binary files a/src/main/resources/templates/YB/declaration-invoice2-template.xlsx and b/src/main/resources/templates/YB/declaration-invoice2-template.xlsx differ