diff --git a/src/main/java/com/xujie/sys/modules/ecss/controller/CoDelController.java b/src/main/java/com/xujie/sys/modules/ecss/controller/CoDelController.java index 12a7213b..87d26e6c 100644 --- a/src/main/java/com/xujie/sys/modules/ecss/controller/CoDelController.java +++ b/src/main/java/com/xujie/sys/modules/ecss/controller/CoDelController.java @@ -9,6 +9,8 @@ import com.xujie.sys.modules.ecss.entity.*; import com.xujie.sys.modules.ecss.service.CoDelService; import com.xujie.sys.modules.factory.entity.vo.BusinessRoleVo; import com.xujie.sys.modules.orderIssure.entity.SOIssueNotifyHeaderData; +import com.xujie.sys.modules.part.entity.ComponentPartData; +import com.xujie.sys.modules.part.entity.PartInformationEntity; import com.xujie.sys.modules.part.entity.PartSubPropertiesValue; import com.xujie.sys.modules.part.entity.PartSubPropertiesValueData; import com.xujie.sys.modules.part.service.PartInformationService; @@ -228,7 +230,7 @@ public class CoDelController { @PostMapping("/savePalletDetail") - public R savePalletDetail(@RequestBody EcssCoDelPalletDetailData inData){ + public R savePalletDetail(@RequestBody EcssCoDelPalletData inData){ coDelService.savePalletDetail(inData); return R.ok(); } @@ -441,4 +443,11 @@ public class CoDelController { List rows = coDelService.getPropertiesListByDeclaration(inData); return R.ok().put("rows", rows); } + + @PostMapping(value="/queryPartListAll") + @ResponseBody + public R queryPartListAll(@RequestBody PartInformationEntity data) { + PageUtils page = coDelService.queryPartListAll(data); + return R.ok().put("page", page); + } } 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 86110236..8e5fae84 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 @@ -7,8 +7,7 @@ import com.xujie.sys.modules.attrbute.entity.PropertyModelHeader; import com.xujie.sys.modules.ecss.data.*; import com.xujie.sys.modules.ecss.entity.*; import com.xujie.sys.modules.orderIssure.entity.PartData; -import com.xujie.sys.modules.part.entity.PartSubPropertiesValue; -import com.xujie.sys.modules.part.entity.PartSubPropertiesValueData; +import com.xujie.sys.modules.part.entity.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -37,7 +36,7 @@ public interface CoDelMapper { void batchSaveEcssCoDelNotifyDetail(List list ); List checkPart(@Param("site") String site, @Param("partNo") String partNo); - List getPartNo(@Param("site") String site, @Param("partNo") String partNo, @Param("userName") String userName); + List getPartNo(@Param("site") String site, @Param("partNo") String partNo, @Param("userName") String userName, @Param("buNo") String buNo); List getPartInfo(@Param("site") String site, @Param("partNo") String partNo); @@ -101,6 +100,7 @@ public interface CoDelMapper { int getCoDelPalletHeaderSeqNo(EcssCoDelPalletHeaderData inData); int getCoDelPalletDetailItem(EcssCoDelPalletDetail inData); void updateCodelPalletHeader(EcssCoDelPalletHeaderData inData); + void updateCodelPalletHeader2(EcssCoDelPalletData inData); void updateCodelPalletDetail(EcssCoDelPalletDetail inData); void deletePalletHeader(EcssCoDelPalletHeaderData inData); void deletePalletDetail(EcssCoDelPalletDetail inData); @@ -170,6 +170,8 @@ public interface CoDelMapper { List getNotifyPartDetail(EcssDeclarationHeaderData inData); + List getNotifyDetailGroup(EcssDeclarationHeaderData data); + List getPropertiesListByTypeAndCodeNo(@Param("site") String site,@Param("recordType") String recordType, @Param("codeNo") String codeNo,@Param("buNo") String buNo); @@ -204,4 +206,6 @@ public interface CoDelMapper { void deleteWalMartOrder(EcssWalMartOrder inData); void batchSaveWalMartOrder(List list ); + + IPage queryPartListAll(Page componentPartDataPage, @Param("query") PartInformationEntity data); } diff --git a/src/main/java/com/xujie/sys/modules/ecss/service/CoDelService.java b/src/main/java/com/xujie/sys/modules/ecss/service/CoDelService.java index ee8f67c3..0a8c7c36 100644 --- a/src/main/java/com/xujie/sys/modules/ecss/service/CoDelService.java +++ b/src/main/java/com/xujie/sys/modules/ecss/service/CoDelService.java @@ -4,6 +4,8 @@ import com.xujie.sys.common.utils.PageUtils; import com.xujie.sys.modules.ecss.data.*; import com.xujie.sys.modules.ecss.entity.*; +import com.xujie.sys.modules.part.entity.ComponentPartData; +import com.xujie.sys.modules.part.entity.PartInformationEntity; import com.xujie.sys.modules.part.entity.PartSubPropertiesValue; import com.xujie.sys.modules.part.entity.PartSubPropertiesValueData; import org.apache.ibatis.annotations.Param; @@ -63,7 +65,7 @@ public interface CoDelService { void deletePalletHeader(EcssCoDelPalletHeaderData inData); - void savePalletDetail(EcssCoDelPalletDetailData inData); + void savePalletDetail(EcssCoDelPalletData inData); void deletePalletDetail(EcssCoDelPalletDetailData inData); @@ -128,4 +130,6 @@ public interface CoDelService { void deleteWalMartOrder(EcssWalMartOrder data); List getPropertiesListByDeclaration(EcssDeclarationHeaderData inData); + + PageUtils queryPartListAll(PartInformationEntity data); } 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 122bd97c..2037a86b 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 @@ -12,10 +12,7 @@ import com.xujie.sys.modules.ecss.entity.*; import com.xujie.sys.modules.ecss.mapper.CoDelMapper; import com.xujie.sys.modules.ecss.service.CoDelService; import com.xujie.sys.modules.orderIssure.entity.PartData; -import com.xujie.sys.modules.part.entity.PartSubPropertiesValue; -import com.xujie.sys.modules.part.entity.PartSubPropertiesValueData; -import com.xujie.sys.modules.part.entity.PartSubPropertiesValueHeaderData; -import com.xujie.sys.modules.part.entity.PlmPropertiesItemAvailableData; +import com.xujie.sys.modules.part.entity.*; import com.xujie.sys.modules.part.mapper.PartInformationMapper; import com.xujie.sys.modules.pms.mapper.EamMapper; import com.xujie.sys.modules.sys.entity.SysUserEntity; @@ -171,7 +168,7 @@ public class CoDelServiceImpl implements CoDelService { task.setStatus(getStringCellValue(row, 6)); task.setFamily(getStringCellValue(row, 7)); task.setPn(getStringCellValue(row, 8)); - List parts = coDelMapper.getPartNo(site, task.getPn(),currentUser.getUsername()); + List parts = coDelMapper.getPartNo(site, task.getPn(),currentUser.getUsername(),inData.getBuNo()); if (parts.isEmpty()) { throw new RuntimeException("导入失败:物料:" + task.getPn() + "不存在!"); } @@ -316,6 +313,12 @@ public class CoDelServiceImpl implements CoDelService { @Override public void changeEcssDelStatus(EcssCoDelNotifyHeaderData data) { + if (data.getNotifyStatus().equals("已下达")) { + List checkEcssCoDelNotifyDetail = coDelMapper.searchEcssCoDelNotifyDetail(data); + if (checkEcssCoDelNotifyDetail.isEmpty()) { + throw new RuntimeException("该发货通知单下没有明细无法下达!"); + } + } coDelMapper.changeEcssDelStatus(data); } @@ -328,6 +331,11 @@ public class CoDelServiceImpl implements CoDelService { if (!"已计划".equals(checkHeader.get(0).getNotifyStatus())) { throw new RuntimeException("发货通知单状态不为已计划,无法修改。"); } + SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); + List parts = coDelMapper.getPartNo(data.getSite(), data.getPn(),currentUser.getUsername(),data.getBuNo()); + if (parts.isEmpty()) { + throw new RuntimeException("修改失败:物料:" + data.getPn() + "不存在!"); + } coDelMapper.updateEcssDelDetail(data); } @@ -534,6 +542,7 @@ public class CoDelServiceImpl implements CoDelService { } @Override + @Transactional public void saveCoDelPalletDataByExcel(MultipartFile file, EcssCoDelNotifyHeaderData inData) { SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); List excelList = new ArrayList<>(); @@ -582,7 +591,7 @@ public class CoDelServiceImpl implements CoDelService { excelData.setPalletRemark(getStringCellValue(row, 2)); excelData.setPoNo(getStringCellValue(row, 3)); excelData.setPn(getStringCellValue(row, 4)); - List parts = coDelMapper.getPartNo(excelData.getSite(), excelData.getPn(),currentUser.getUsername()); + List parts = coDelMapper.getPartNo(excelData.getSite(), excelData.getPn(),currentUser.getUsername(),inData.getBuNo()); if (parts.isEmpty()) { throw new RuntimeException("导入失败:物料:" + excelData.getPn() + "不存在!"); } @@ -680,12 +689,12 @@ public class CoDelServiceImpl implements CoDelService { // 每一个物料加属性对应一个属性,用来下面遍历发货通知单明细时获取具体属性值 Map partNoAndItemNoMap = propertiesValues.stream() .collect(Collectors.toMap(o -> o.getPartNo() + "$" + o.getPropertiesItemNo(), o -> o)); - PartSubPropertiesValueData propertiesWeight = partNoAndItemNoMap.get(partNo + "$ROLLWEIGHT");//每卷重量 + //PartSubPropertiesValueData propertiesWeight = partNoAndItemNoMap.get(partNo + "$ROLLWEIGHT");//每卷重量 PartSubPropertiesValueData propertiesRollQty = partNoAndItemNoMap.get(partNo + "$ROLLQTY");//每卷数量 PartSubPropertiesValueData propertiesBoxRolls = partNoAndItemNoMap.get(partNo + "$BOXROLLS");//每箱卷数 - PartSubPropertiesValueData propertiesBoxWeight = partNoAndItemNoMap.get(partNo + "$BOXWEIGHT");//箱重量 - if (propertiesWeight==null||propertiesRollQty==null||propertiesBoxRolls==null||propertiesBoxWeight==null) { - throw new RuntimeException("请先维护物料["+partNo+"]基本信息!"); + //PartSubPropertiesValueData propertiesBoxWeight = partNoAndItemNoMap.get(partNo + "$BOXWEIGHT");//箱重量 + if (propertiesRollQty==null||propertiesBoxRolls==null) { + throw new RuntimeException("请先维护物料["+detailData.getPn()+"]的每卷数量和每箱卷数!"); } detailData.setBoxQty(detailData.getQty().divide( BigDecimal.valueOf(((double) propertiesRollQty.getNumValue().intValue() * propertiesBoxRolls.getNumValue().intValue())),2, BigDecimal.ROUND_HALF_UP)); @@ -740,8 +749,28 @@ public class CoDelServiceImpl implements CoDelService { for (int i = 0; i < headerList.size(); i++) { coDelMapper.saveCodelPalletHeader(headerList.get(i)); } + Map palletDetailMap = new HashMap<>(); for (int i = 0; i < detailList.size(); i++) { coDelMapper.saveCodelPalletDetail(detailList.get(i)); + if (!palletDetailMap.containsKey(detailList.get(i).getPn())) { + palletDetailMap.put(detailList.get(i).getPn(), detailList.get(i).getQty()); + } else { + palletDetailMap.put(detailList.get(i).getPn(), palletDetailMap.get(detailList.get(i).getPn()).add(detailList.get(i).getQty())); + } + } + List ecssCoDelNotifyDetail = coDelMapper.searchEcssCoDelNotifyDetail(inData); + Map notifyDetailMap = new HashMap<>(); + for (EcssCoDelNotifyDetailData detailData : ecssCoDelNotifyDetail) { + if (!notifyDetailMap.containsKey(detailData.getPn())) { + notifyDetailMap.put(detailData.getPn(), detailData.getQty()); + } else { + notifyDetailMap.put(detailData.getPn(), notifyDetailMap.get(detailData.getPn()).add(detailData.getQty())); + } + } + for (Map.Entry entry : palletDetailMap.entrySet()) { + if (notifyDetailMap.get(entry.getKey()).compareTo(entry.getValue())!=0) { + throw new RuntimeException("物料["+entry.getKey()+"]的数量和发货通知单数量不一致!"); + } } } catch (Exception e) { throw new RuntimeException("导入失败:" + e.getMessage()); @@ -886,7 +915,8 @@ public class CoDelServiceImpl implements CoDelService { @Override - public void savePalletDetail(EcssCoDelPalletDetailData inData) { + @Transactional + public void savePalletDetail(EcssCoDelPalletData inData) { List checkPart = coDelMapper.checkPart(inData.getSite(), inData.getPartNo()); if (checkPart.size() == 0) { throw new RuntimeException("导入失败:物料:" + inData.getPartNo() + "在当前工厂不存在!"); @@ -900,6 +930,7 @@ public class CoDelServiceImpl implements CoDelService { } else { inData.setUpdateBy(currentUser.getUsername()); coDelMapper.updateCodelPalletDetail(inData); + coDelMapper.updateCodelPalletHeader2(inData); } } @@ -1263,7 +1294,7 @@ public class CoDelServiceImpl implements CoDelService { template.addVar("dateStr", DateUtils.format(notifyHeader.getReadyDate(), "yyyy-MM-dd")); template.addVar("Currency", "CNY"); template.addVar("Incoterm", "EXW "); - template.addVar("shippingMode", notifyHeader.getShippingMode()); + template.addVar("shippingMode", stringInput(notifyHeader.getShippingMode())); Map notifyDetailMap = notifyDetailList.stream().collect( Collectors.toMap(EcssCoDelNotifyDetailData::getPartNo,e->e)); // 装箱明细 @@ -1323,12 +1354,12 @@ public class CoDelServiceImpl implements CoDelService { } // RFID需要的 if (notifyHeader.getBuNo().equals("01-Label") || notifyHeader.getBuNo().equals("03-RFID")) { - template.addVar("madein", data.getOrigin()); + template.addVar("madein", stringInput(data.getOrigin())); } // 孟加拉需要的 if (data.getMaterial()!=null && data.getMaterial()) { template.addVar("RFIDBase", "RFID Base Material"); - template.addVar("HSCode", "& H.S.Code:"+data.getHsCode()); + template.addVar("HSCode", "& H.S.Code:"+stringInput(data.getHsCode())); } // 欧洲地区需要 if (ecHeader.getPackaging()!=null && ecHeader.getPackaging()) { @@ -1496,7 +1527,7 @@ public class CoDelServiceImpl implements CoDelService { // 孟加拉需要的 if (data.getMaterial()!=null && data.getMaterial()) { template.addVar("RFIDBase", "RFID Base Material"); - template.addVar("HSCode", "& H.S.Code:"+data.getHsCode()); + template.addVar("HSCode", "& H.S.Code:"+stringInput(data.getHsCode())); template.addVar("volume", palletHeaderData.map(ecssCoDelPalletHeaderData -> ecssCoDelPalletHeaderData.getLength().setScale(2, RoundingMode.HALF_UP) + "*" + ecssCoDelPalletHeaderData.getWidth().setScale(2, RoundingMode.HALF_UP) + "*" @@ -1515,7 +1546,7 @@ public class CoDelServiceImpl implements CoDelService { template.addVar("originLabel", "Origin of goods Made in China"); template.addVar("sellerLabel", "Name of seller Checkpoint Commercial (Shanghai) Co.. Ltd."); } - template.addVar("Shipping_Mark", data.getShippingMark()); + template.addVar("Shipping_Mark", stringInput(data.getShippingMark())); template.addVar("Measurement", palletHeaderData.get().getLength(). multiply(palletHeaderData.get().getWidth()).multiply(palletHeaderData.get().getHeight()). multiply(BigDecimal.valueOf(totalPlt)).setScale(2, RoundingMode.HALF_UP)); @@ -1636,14 +1667,14 @@ public class CoDelServiceImpl implements CoDelService { template.addVar("shipping_port", stringInput(notifyHeader.getDestination())); template.addVar("cmc_invoice", stringInput(notifyHeader.getCmcInvoice())); // 导出时默认,可编辑的栏目 - template.addVar("sales_method", data.getSalesMethod());//贸易方式 - template.addVar("currency", data.getCurrency());//币制 - template.addVar("made_area", data.getMadeArea());//货物产地 - template.addVar("send_port", data.getSendPort());//发货港 - template.addVar("shipper", data.getShipper());//发货人 - template.addVar("voyage", data.getVoyage());//航次 - template.addVar("delivery_goods_date", data.getDeliveryGoodsDate());//提货日期 - template.addVar("shipping_date", data.getShippingDate());//船期 + template.addVar("sales_method", stringInput(data.getSalesMethod()));//贸易方式 + template.addVar("currency", stringInput(data.getCurrency()));//币制 + template.addVar("made_area", stringInput(data.getMadeArea()));//货物产地 + template.addVar("send_port", stringInput(data.getSendPort()));//发货港 + template.addVar("shipper", stringInput(data.getShipper()));//发货人 + template.addVar("voyage", stringInput(data.getVoyage()));//航次 + template.addVar("delivery_goods_date", stringInput(data.getDeliveryGoodsDate()));//提货日期 + template.addVar("shipping_date", stringInput(data.getShippingDate()));//船期 // 需要计算的 // 总托数 Integer totalPlt = palletHeaderDataList.get(0).getPalletQty(); @@ -1686,49 +1717,22 @@ public class CoDelServiceImpl implements CoDelService { @Override public void downloadContract(HttpServletResponse response, EcssDeclarationHeaderData data) { try { - ExcelTemplate template = ExcelTemplate.load(new ClassPathResource("templates/declaration-elements-template.xlsx").getInputStream()); - template.addVar("brandType", data.getBrandType()); - // 获取partNo列表 - List partNos = coDelMapper.getDeclarationElements(data); - List partNoList = partNos.stream().map(map -> map.get("partNo").toString()).collect(Collectors.toList()); - // 根据partNo获取hsCode - List hsCodes = coDelMapper.getHsCodeByPartNo(data.getSite(), partNoList); - Map hsCodeMap = new HashMap<>(); - for (int i = 0; i < hsCodes.size(); i++) { - Map eorder = hsCodes.get(i); - String key = eorder.get("hsCode")+"&"+eorder.get("hsCodeDesc"); - if (hsCodeMap.containsKey(key)) { - hsCodeMap.get(key).put("sku", hsCodeMap.get(key).get("sku")+"\n "+eorder.get("sku")); - } else { - // hscode所有属性 - PartSubPropertiesValueData inData = new PartSubPropertiesValueData(); - inData.setSite(data.getSite()); - inData.setBuNo(eorder.get("BuNo").toString()); - inData.setCodeNo(eorder.get("codeNo").toString()); - inData.setPartNo(eorder.get("hsCodeDesc").toString()); - inData.setRecordType("ECSS"); - List propertiesList = coDelMapper.getPropertiesListByPartAndCodeNo(inData); - StringBuilder properties = new StringBuilder(); - for (int j = 0; j < propertiesList.size(); j++) { - if (j == propertiesList.size() - 1) { - properties.append(propertiesList.get(j).getItemDesc()).append(": ").append(propertiesList.get(j).getTextValue()); - } else { - properties.append(propertiesList.get(j).getItemDesc()).append(": ").append(propertiesList.get(j).getTextValue()).append("\n"); - } - } - eorder.put("properties",properties); - hsCodeMap.put(key, eorder); - } - } - List list = new ArrayList<>(hsCodeMap.values()); - for (int i = 0; i < list.size(); i++) { - Map fMap = list.get(i); - fMap.put("content", "HS Code: "+fMap.get("hsCode")+ - "\n品名: "+(data.getHsCodeDescType()!=null&&data.getHsCodeDescType().equals("N")?fMap.get("hsCodeDescEn"):fMap.get("hsCodeDesc"))+ - "\n"+fMap.get("properties")+ - "\n型号: "+fMap.get("sku")); + ExcelTemplate template = ExcelTemplate.load(new ClassPathResource("templates/declaration-contract-template.xlsx").getInputStream()); + EcssDeclarationHeaderData ecHeader = coDelMapper.getDeclarationHeader(data); + // 发货通知单 + EcssCoDelNotifyHeaderData notifyHeader = coDelMapper.getEcssCoDelNotifyHeader(data.getSite(), data.getDelNo()); + template.addVar("cmcInvoice", notifyHeader.getCmcInvoice()); + List notifyDetailGroup = coDelMapper.getNotifyDetailGroup(data); + BigDecimal totalQty = BigDecimal.ZERO; + BigDecimal totalAmount = BigDecimal.ZERO; + for (int i = 0; i < notifyDetailGroup.size(); i++) { + Map notifyDetail = notifyDetailGroup.get(i); + totalQty = totalQty.add((BigDecimal) notifyDetail.get("total_qty")); + totalAmount = totalAmount.add((BigDecimal) notifyDetail.get("ttl_amount")); } - template.addListVarAll(list); + template.addVar("totalQty", totalQty); + template.addVar("totalAmount", totalAmount); + template.addListVarAll(notifyDetailGroup); template.render(response.getOutputStream()); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setHeader("Content-Disposition", "attachment; filename=\"合同.xlsx\""); @@ -1786,10 +1790,10 @@ public class CoDelServiceImpl implements CoDelService { int seqNo = coDelMapper.getCoDelPalletHeaderSeqNo(inData); for (String partNo : palletItemMap.keySet()) { List partList = coDelMapper.getPartInfo(inData.getSite(),partNo); - List packageDataList = coDelMapper.getPackage(inData.getSite(),inData.getBuNo(),partList.get(0).getPackageNo()); + /* List packageDataList = coDelMapper.getPackage(inData.getSite(),inData.getBuNo(),partList.get(0).getPackageNo()); if (packageDataList.isEmpty()) { throw new RuntimeException("物料["+partList.get(0).getSku()+"]未维护包装箱信息!"); - } + }*/ PartSubPropertiesValueData propertiesWeight = partNoAndItemNoMap.get(partNo + "$ROLLWEIGHT");//每卷重量 PartSubPropertiesValueData propertiesRollQty = partNoAndItemNoMap.get(partNo + "$ROLLQTY");//每卷数量 PartSubPropertiesValueData propertiesBoxRolls = partNoAndItemNoMap.get(partNo + "$BOXROLLS");//每箱卷数 @@ -2022,4 +2026,10 @@ public class CoDelServiceImpl implements CoDelService { }); return list; } + + @Override + public PageUtils queryPartListAll(PartInformationEntity data) { + IPage list = this.coDelMapper.queryPartListAll(new Page(data.getPage(), data.getLimit()), data); + return new PageUtils(list); + } } diff --git a/src/main/resources/mapper/ecss/CoDelMapper.xml b/src/main/resources/mapper/ecss/CoDelMapper.xml index ec60eb84..2efb9701 100644 --- a/src/main/resources/mapper/ecss/CoDelMapper.xml +++ b/src/main/resources/mapper/ecss/CoDelMapper.xml @@ -126,7 +126,7 @@ select a.site,a.bu_no,a.delNo,a.item_no,a.salesOrder,a.salesOrder_item_no,a.customerPO,a.line,a.version,a.status,a.family, a.part_no,a.part_description,a.qty,a.lt,a.cmc_comment,a.saleType,a.awb_bl,a.shipping_number,a.forwarder_info, a.currency,a.tp,a.ttl_amount,a.sum_price,a.so,a.upc,a.remark,a.erp_delItemNo,a.pn,CONVERT(DECIMAL(20, 0),a.nocartons) as nocartons, - c.num_value as boxrolls,d.num_value as rollqty + c.num_value as boxrolls,d.num_value as rollqty,#{cmcInvoice} as cmcInvoice from ecss_CoDelNotifydetail a left join part_sub_properties_value c on a.part_no=c.part_no and c.site=a.site and c.bu_no=a.bu_no and c.record_type='ECSSPART' and c.code_no='BG001' and c.properties_item_no='BOXROLLS' @@ -188,7 +188,7 @@ @@ -218,7 +218,7 @@ update ecss_CoDelNotifyDetail set salesOrder=#{salesOrder},customerPO=#{customerPO},line=#{line},version=#{version}, status=#{status},family=#{family},part_no=#{partNo},part_description=#{partDescription},qty=#{qty,jdbcType=DECIMAL}, - lt=#{lt,jdbcType=DECIMAL},cmc_comment=#{cmcComment},saleType=#{saleType}, + lt=#{lt,jdbcType=DECIMAL},cmc_comment=#{cmcComment},saleType=#{saleType},pn=#{pn}, awb_bl=#{awbBl},shipping_number=#{shippingNumber},forwarder_info=#{forwarderInfo},currency=#{currency}, tp=#{tp,jdbcType=DECIMAL},ttl_amount=#{ttlAmount,jdbcType=DECIMAL},sum_price=#{sumPrice,jdbcType=DECIMAL}, so=#{so},upc=#{upc},remark=#{remark} @@ -448,6 +448,11 @@ create_by,create_date,update_by,update_date update_by=#{updateBy},update_date=GetDate() where site =#{site} and bu_no=#{buNo} and delNo=#{delNo} and seq_no=#{seqNo} + + update ecss_CoDelPalletHeader set gross_weight=#{grossWeight,jdbcType=DECIMAL},net_weight=#{netWeight,jdbcType=DECIMAL}, + update_by=#{updateBy},update_date=GetDate() + where site =#{site} and bu_no=#{buNo} and delNo=#{delNo} and seq_no=#{seqNo} + update ecss_CoDelPalletDetail set part_no=#{partNo},qty=#{qty,jdbcType=DECIMAL},po_no=#{poNo}, box_qty=#{boxQty,jdbcType=DECIMAL},update_by=#{updateBy},update_date=GetDate(),rolls=#{rolls},pn=#{pn} @@ -715,7 +720,7 @@ left join ecss_CoDelNotifyHeader noHeader on a.site=noHeader.site and a.delNo=no + + delete from ecss_walMartOrder where buNo=#{buNo} and sku=#{sku} and so=#{so} and qty=#{qty} + + + diff --git a/src/main/resources/templates/declaration-contract-template.xlsx b/src/main/resources/templates/declaration-contract-template.xlsx new file mode 100644 index 00000000..80e64288 Binary files /dev/null and b/src/main/resources/templates/declaration-contract-template.xlsx differ diff --git a/src/main/resources/templates/declaration-template.xlsx b/src/main/resources/templates/declaration-template.xlsx index 678c490f..6ebc3b05 100644 Binary files a/src/main/resources/templates/declaration-template.xlsx and b/src/main/resources/templates/declaration-template.xlsx differ