From e4fa9236bd81a2f48b98ca26b9b029cf6f3191ce Mon Sep 17 00:00:00 2001 From: "YEJIAXING-PC\\lenovo" <591141169@qq.com> Date: Mon, 31 Mar 2025 11:48:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=A2=9E=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E5=9C=B0=E7=82=B9=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...upplierdeliverRequestDetailController.java | 37 +++++++++++++++++++ .../SupplierdeliverRequestMainController.java | 9 ++++- ...SupplierdeliverRequestDetailPageReqVO.java | 4 ++ .../SupplierdeliverRequestDetailRespVO.java | 3 ++ .../vo/SupplierdeliverRequestMainExcelVO.java | 4 ++ ...pplierinvoiceRequestDetailServiceImpl.java | 16 ++------ 6 files changed, 60 insertions(+), 13 deletions(-) diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/SupplierdeliverRequestDetailController.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/SupplierdeliverRequestDetailController.java index 007472483c..8923a6d6c0 100644 --- a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/SupplierdeliverRequestDetailController.java +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/SupplierdeliverRequestDetailController.java @@ -26,6 +26,7 @@ import com.win.module.wms.enums.common.ConstantDataInfo; import com.win.module.wms.service.itembasic.ItembasicService; import com.win.module.wms.service.supplier.SupplierService; import com.win.module.wms.service.supplierdeliverRequest.SupplierdeliverRequestDetailService; +import com.win.module.wms.service.supplieritem.SupplieritemService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -65,6 +66,8 @@ public class SupplierdeliverRequestDetailController { private SupplieritemMapper supplieritemMapper; @Resource private ItembasicService itembasicService; + @Resource + private SupplieritemService supplieritemService; @PostMapping("/create") @Operation(summary = "创建供应商发货申请子") @@ -108,6 +111,31 @@ public class SupplierdeliverRequestDetailController { pageVO.setItemCodeList(List.of("没有数据"));//给一个永远也查询不到的品番 } } + if(org.apache.commons.lang.StringUtils.isNotEmpty(pageVO.getSupplierAddress())){//供应商地点 且模糊搜索 + List supplierAddress = supplieritemService.getSupplierAddress(pageVO.getSupplierAddress()); + List supplierAddressList = new ArrayList<>();//根据供应商地点查询到的供应商 + List itemList = new ArrayList<>();//根据供应商地点查询到的物料号 + for(SupplieritemDO en:supplierAddress){ + supplierAddressList.add(en.getSupplierCode()); + itemList.add(en.getItemCode()); + } + if(!supplierAddress.isEmpty()){ + if(pageVO.getSupplierCodeList()!=null && !pageVO.getSupplierCodeList().isEmpty()){//取交集 + supplierAddressList.retainAll(pageVO.getSupplierCodeList()); + pageVO.setSupplierCodeList(supplierAddressList); + }else{ + pageVO.setSupplierCodeList(supplierAddressList); + } + if(pageVO.getItemCodeList()!=null && !pageVO.getItemCodeList().isEmpty()){//取交集 + itemList.retainAll(pageVO.getItemCodeList()); + pageVO.setItemCodeList(itemList); + }else{ + pageVO.setItemCodeList(itemList); + } + }else{//根据供应商地点没有查询到供应商 + pageVO.setSupplierCodeList(List.of("没有数据"));//给一个永远也查询不到的品番 + } + } PageResult pageResult = supplierdeliverRequestDetailService.getSupplierdeliverRequestDetailPage(pageVO); PageResult result = SupplierdeliverRequestDetailConvert.INSTANCE.convertPage(pageResult); if (pageResult.getList().size() > 0) { @@ -146,6 +174,15 @@ public class SupplierdeliverRequestDetailController { vo.setBackNumber(itembasicDO.getBackNumber());//背番 } vo.setRemark(supplierdeliverRequestMainDO.getRemark()); + try { + SupplieritemDO supplieritemDO = supplieritemMapper.selectBySuppercode(vo.getSupplierCode(),vo.getItemCode()); + if(supplieritemDO!=null){ + vo.setSupplierAddress(supplieritemDO.getSupplierAddress()); + vo.setAllowOverShipment(supplieritemDO.getAllowOverShipment()); + } + } catch (Exception e) { + e.getMessage(); + } } } } diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/SupplierdeliverRequestMainController.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/SupplierdeliverRequestMainController.java index 93a90609b9..6d6a478e34 100644 --- a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/SupplierdeliverRequestMainController.java +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/SupplierdeliverRequestMainController.java @@ -17,7 +17,9 @@ import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO; import com.win.module.wms.dal.dataobject.supplier.SupplierDO; import com.win.module.wms.dal.dataobject.supplierdeliverRequest.SupplierdeliverRequestDetailDO; import com.win.module.wms.dal.dataobject.supplierdeliverRequest.SupplierdeliverRequestMainDO; +import com.win.module.wms.dal.dataobject.supplieritem.SupplieritemDO; import com.win.module.wms.dal.dataobject.supplieruser.SupplierUserDO; +import com.win.module.wms.dal.mysql.supplieritem.SupplieritemMapper; import com.win.module.wms.dal.mysql.supplieruser.SupplierUserMapper; import com.win.module.wms.enums.DictTypeConstants; import com.win.module.wms.enums.ErrorCodeConstants; @@ -70,7 +72,8 @@ public class SupplierdeliverRequestMainController { private SupplierUserMapper supplierUserMapper; @Resource private ItembasicService itembasicService; - + @Resource + private SupplieritemMapper supplieritemMapper; @Resource private SupplierService supplierService; @@ -240,6 +243,10 @@ public class SupplierdeliverRequestMainController { if(supplierDO!=null){ vo.setSupplierName(supplierDO.getName()); } + SupplieritemDO supplieritemDO = supplieritemMapper.selectBySuppercode(vo.getSupplierCode(),vo.getItemCode()); + if(supplieritemDO!=null){ + vo.setSupplierAddress(supplieritemDO.getSupplierAddress()); + } resultList.add(vo); } } diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestDetailPageReqVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestDetailPageReqVO.java index fb8a4e4674..9942ecd611 100644 --- a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestDetailPageReqVO.java +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestDetailPageReqVO.java @@ -146,5 +146,9 @@ public class SupplierdeliverRequestDetailPageReqVO extends PageParam { */ private String poLineType; + @Schema(description = "供应商地点") + private String supplierAddress; + + } diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestDetailRespVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestDetailRespVO.java index 27d4ab46f9..ab1e6eec05 100644 --- a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestDetailRespVO.java +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestDetailRespVO.java @@ -200,4 +200,7 @@ public class SupplierdeliverRequestDetailRespVO extends SupplierdeliverRequestDe */ private String allowOverShipment; + @Schema(description = "供应商地点") + private String supplierAddress; + } diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestMainExcelVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestMainExcelVO.java index 0dcfe8aa9a..d1665c21d8 100644 --- a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestMainExcelVO.java +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/supplierdeliverRequest/vo/SupplierdeliverRequestMainExcelVO.java @@ -50,6 +50,10 @@ public class SupplierdeliverRequestMainExcelVO { @Colour(IndexedColors.LIGHT_YELLOW) private String supplierName; + @ExcelProperty("供应商地点") + @Colour(IndexedColors.LIGHT_YELLOW) + private String supplierAddress; + @ExcelProperty(value = "便次") @Colour(IndexedColors.LIGHT_YELLOW) @ColumnWidth(value = 16) diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplierinvoiceRequest/SupplierinvoiceRequestDetailServiceImpl.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplierinvoiceRequest/SupplierinvoiceRequestDetailServiceImpl.java index 9a24d00596..abd46c56a1 100644 --- a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplierinvoiceRequest/SupplierinvoiceRequestDetailServiceImpl.java +++ b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/supplierinvoiceRequest/SupplierinvoiceRequestDetailServiceImpl.java @@ -975,17 +975,9 @@ public class SupplierinvoiceRequestDetailServiceImpl implements SupplierinvoiceR } recordSupplierdeliverDetailVO.setUom(uomMap.get(recordSupplierdeliverDetailVO.getUom()));//单位转换 } - //取货日期 - List timeList = new ArrayList<>(); int Serial = 1; for (RecordSupplierdeliverDetailVO recordSupplierdeliverDetailVO : list) { recordSupplierdeliverDetailVO.setSupplierSerial(String.valueOf(Serial++)); - if(recordSupplierdeliverDetailVO.getPickDate()!=null){ - timeList.add(recordSupplierdeliverDetailVO.getPickDate()); - } - } - if(!timeList.isEmpty()){ - Collections.sort(timeList); } //打印几页 BigDecimal total = new BigDecimal(0); @@ -1008,11 +1000,9 @@ public class SupplierinvoiceRequestDetailServiceImpl implements SupplierinvoiceR supplierdeliverDocumentVO.setSupplierCode(recordMainDO.getSupplierCode()); SupplierDO select = supplierMapper.selectByCode(recordMainDO.getSupplierCode()); supplierdeliverDocumentVO.setSupplierName(select.getShortName()); - if(!timeList.isEmpty()){ - supplierdeliverDocumentVO.setPickDate(LocalDateTimeUtil.format(timeList.get(0), DatePattern.NORM_DATE_FORMATTER)); + if(recordMainDO.getSchdShipDate()!=null){ + supplierdeliverDocumentVO.setPickDate(LocalDateTimeUtil.format(recordMainDO.getSchdShipDate(), DatePattern.NORM_DATE_FORMATTER)); } - supplierdeliverDocumentVO.setPrintDate(LocalDateTimeUtil.format(LocalDateTime.now(), DatePattern.NORM_DATE_FORMATTER)); - supplierdeliverDocumentVO.setPrintTime(LocalDateTimeUtil.format(LocalDateTime.now(), DatePattern.NORM_TIME_FORMATTER)); supplierdeliverDocumentVO.setReceivedNumber(itembasicDO.getReceivedNumber()); QueryWrapper dockDOQueryWrapper = new QueryWrapper(); dockDOQueryWrapper.eq("code", recordMainDO.getToDockCode()); @@ -1042,6 +1032,8 @@ public class SupplierinvoiceRequestDetailServiceImpl implements SupplierinvoiceR //根据要货计划查询采购订单中的管理编号 PurchasePlanMainDO purchasePlanMainDO = purchasePlanMainMapper.selectByNumber(recordMainDO.getPpNumber()); if (purchasePlanMainDO != null) { + supplierdeliverDocumentVO.setPrintDate(LocalDateTimeUtil.format(purchasePlanMainDO.getCreateTime(), DatePattern.NORM_DATE_FORMATTER)); + supplierdeliverDocumentVO.setPrintTime(LocalDateTimeUtil.format(purchasePlanMainDO.getCreateTime(), DatePattern.NORM_TIME_FORMATTER)); supplierdeliverDocumentVO.setContacts(purchasePlanMainDO.getContacts()); supplierdeliverDocumentVO.setPhone(purchasePlanMainDO.getPhone()); supplierdeliverDocumentVO.setStoolTime(purchasePlanMainDO.getDeliNo());