From ccf6e9303b62d5ca3fe8e00dcbb341ef968a2b91 Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Wed, 23 Oct 2024 10:31:11 +0800 Subject: [PATCH] =?UTF-8?q?wms=E9=83=A8=E5=88=86=E4=BF=AE=E6=94=B93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/api/domain/wms/wmsReportWork.java | 10 ++++++ .../WmsSellOutEmbryoController.java | 7 ++++ .../com/op/wms/domain/WmsFpStorageNewsSn.java | 10 ++++++ .../wms/mapper/WmsFpStorageNewsSnMapper.java | 2 ++ .../wms/service/IWmsSellOutEmbryoService.java | 2 ++ .../impl/WmsProductPutServiceImpl.java | 9 ++--- .../impl/WmsSellOutEmbryoServiceImpl.java | 35 +++++++++++++++++++ .../mapper/wms/WmsFpStorageNewsSnMapper.xml | 23 ++++++++++-- 8 files changed, 90 insertions(+), 8 deletions(-) diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/wms/wmsReportWork.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/wms/wmsReportWork.java index 622a2c88..331e66e6 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/wms/wmsReportWork.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/wms/wmsReportWork.java @@ -37,6 +37,7 @@ public class wmsReportWork extends BaseEntity { @Excel(name = "产品编码") private String productCode; + /** 产品名称 */ @Excel(name = "产品名称") private String productName; @@ -53,6 +54,15 @@ public class wmsReportWork extends BaseEntity { /** 生产工单编码 */ //已经过账的值 private String SAPquantity; + private String selectedType; + + public String getSelectedType() { + return selectedType; + } + + public void setSelectedType(String selectedType) { + this.selectedType = selectedType; + } public String getSAPquantity() { return SAPquantity; diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutEmbryoController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutEmbryoController.java index c9a37c69..1af6582c 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutEmbryoController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsSellOutEmbryoController.java @@ -135,4 +135,11 @@ public class WmsSellOutEmbryoController extends BaseController { return R.ok(); } + + + @PostMapping("addRE") + public AjaxResult addRE(@RequestBody List wmsSellOutEmbryoList) { + return success(wmsSellOutEmbryoService.addRE(wmsSellOutEmbryoList)); + } + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsFpStorageNewsSn.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsFpStorageNewsSn.java index 76f5da3f..ddffdbce 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsFpStorageNewsSn.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/WmsFpStorageNewsSn.java @@ -162,6 +162,16 @@ public class WmsFpStorageNewsSn extends BaseEntity { */ @Excel(name = "备用10") private String userDefined10; + @Excel(name = "备用1") + private String userDefined1; + + public String getUserDefined1() { + return userDefined1; + } + + public void setUserDefined1(String userDefined1) { + this.userDefined1 = userDefined1; + } /** * 创建时间 diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsFpStorageNewsSnMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsFpStorageNewsSnMapper.java index e222a378..c683a6ec 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsFpStorageNewsSnMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsFpStorageNewsSnMapper.java @@ -93,4 +93,6 @@ public interface WmsFpStorageNewsSnMapper { List selectWmsFpStorageNewsSnSTList(WmsFpStorageNewsSn wmsFpStorageNewsSn); public void insertWmsFpStorageNewsSnRecords(WmsFpStorageNewsSn wmsFpStorageNewsSn3); + + List selectwmsFpStorageNewsGroupWaCode(@Param("productCode")String productCode); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsSellOutEmbryoService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsSellOutEmbryoService.java index 4ba24d1e..c3121a63 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsSellOutEmbryoService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IWmsSellOutEmbryoService.java @@ -80,4 +80,6 @@ public interface IWmsSellOutEmbryoService { void SynchronizationOfShippingDocuments(); List selectWmsSellOutEmbryoREList(WmsSellOutEmbryo wmsSellOutEmbryo); + + String addRE(List wmsSellOutEmbryoList); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java index 286cf0de..30a45016 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsProductPutServiceImpl.java @@ -356,6 +356,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { @Override @DS("#header.poolName") public String addReportListSap(List mesReportWorks) throws ParseException { + String selectedType= mesReportWorks.get(0).getSelectedType(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); Date date = new Date(); String formattedDate = dateFormat.format(date);//批次 @@ -517,6 +518,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { map.put("QUANTITY", mesReportWork.getQuantityQualified()); map.put("ERFME", mesReportWork.getUnit()); map.put("BATCH", mesReportWork.getBatchSK()); + map.put("STCK_TYPE", selectedType); if (mesReportWork.getBatch().length()>12&&mesReportWork.getBatch().length()<30){ //String batch = mesReportWork.getBatch().substring(12); String HSDAT = InterceptionSJRules(mesReportWork.getBatch()); @@ -559,12 +561,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService { map.put("QUANTITY", mesReportWork.getQuantityQualified()); map.put("ERFME", mesReportWork.getUnit()); map.put("BATCH", mesReportWork.getBatchSK()); -// if (mesReportWork.getBatch().length()>12){ -// String batch = InterceptionRules(mesReportWork.getBatch()); -// map.put("BATCH", batch); -// }else { -// map.put("BATCH", mesReportWork.getBatch()); -// } + map.put("STCK_TYPE", selectedType); if (mesReportWork.getBatch().length()>12&&mesReportWork.getBatch().length()<30){ //String batch = mesReportWork.getBatch().substring(12); String HSDAT = InterceptionSJRules(mesReportWork.getBatch()); diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutEmbryoServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutEmbryoServiceImpl.java index 9888fb8a..20e42ca7 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutEmbryoServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/WmsSellOutEmbryoServiceImpl.java @@ -15,6 +15,8 @@ import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.uuid.IdUtils; import com.op.wms.domain.OdsProcureOrder; import com.op.wms.domain.ShipmentTDO; +import com.op.wms.domain.WmsFpStorageNewsSn; +import com.op.wms.mapper.WmsFpStorageNewsSnMapper; import okhttp3.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -35,6 +37,8 @@ import com.op.wms.service.IWmsSellOutEmbryoService; public class WmsSellOutEmbryoServiceImpl implements IWmsSellOutEmbryoService { @Autowired private WmsSellOutEmbryoMapper wmsSellOutEmbryoMapper; + @Autowired + private WmsFpStorageNewsSnMapper wmsFpStorageNewsSnMapper; @Autowired private RedisTemplate redisTemplate; @@ -161,6 +165,37 @@ public class WmsSellOutEmbryoServiceImpl implements IWmsSellOutEmbryoService { return wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoREList(wmsSellOutEmbryo); } + @Override + @DS("#header.poolName") + public String addRE(List wmsSellOutEmbryoList) { + String result="完成"; + String stockOrder="BH"; + + for (WmsSellOutEmbryo wmsSellOutEmbryo: + wmsSellOutEmbryoList) { + WmsSellOutEmbryo wmsSellOutEmbryo1= wmsSellOutEmbryoMapper.selectWmsSellOutEmbryoById(wmsSellOutEmbryo.getId()); + String productCode =wmsSellOutEmbryo1.getProductCode(); + BigDecimal planQuantity = wmsSellOutEmbryo1.getPlanQuantity(); + List wmsFpStorageNewsSns= wmsFpStorageNewsSnMapper.selectwmsFpStorageNewsGroupWaCode(productCode); + if (wmsFpStorageNewsSns.size()<1){ + return "无库存"; + } + //区分大小planQuantity + for ( WmsFpStorageNewsSn wmsFpStorageNewsSn: wmsFpStorageNewsSns){ + BigDecimal tem= wmsFpStorageNewsSn.getAmount(); + if(planQuantity.compareTo(tem)<=0){ + //生成一个 + + return result; + }else { + + + } + } + } + return null; + } + public List dayin( ) { // 定义请求的URL地址 diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsFpStorageNewsSnMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsFpStorageNewsSnMapper.xml index d5c54a27..d11b4c92 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsFpStorageNewsSnMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsFpStorageNewsSnMapper.xml @@ -499,7 +499,7 @@ - SELECT storage_id, wh_code, @@ -510,7 +510,7 @@ product_code, sn, bar_code, - COALESCE(amount, 0) , + COALESCE(amount, 0) amount, batch_number, COALESCE(user_defined1, 0) AS user_defined1, -- 如果为空则返回0 COALESCE(user_defined2, 0) AS user_defined2, -- 如果为空则返回0 @@ -562,4 +562,23 @@ and sap_factory_code = #{sapFactoryCode} +