From 1c8293df91d43c4de241a39f204e3e60a1123456 Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Fri, 9 Aug 2024 13:44:48 +0800 Subject: [PATCH 1/8] =?UTF-8?q?wms103=E6=9A=82=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/system/api/RemoteSapService.java | 7 +- .../api/factory/RemoteSapFallbackFactory.java | 5 + .../controller/WmsToWCSmissionController.java | 12 +- .../com/op/wms/domain/OdsProcureOrder.java | 47 +++++++ .../op/wms/mapper/WmsRawOrderInSnMapper.java | 2 + .../com/op/wms/service/IBaseAreaService.java | 2 + .../wms/service/impl/BaseAreaServiceImpl.java | 7 + .../impl/OdsProcureOrderServiceImpl.java | 120 +++++++++++++++--- .../mapper/wms/OdsProcureOrderMapper.xml | 4 + .../wms/WmsOdsMateStorageNewsMapper.xml | 2 +- .../wms/WmsOdsMateStorageNewsSnMapper.xml | 3 +- .../mapper/wms/WmsRawOrderInSnMapper.xml | 34 +++-- 12 files changed, 210 insertions(+), 35 deletions(-) diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java index dfd7d205..9a2dec95 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/RemoteSapService.java @@ -125,4 +125,9 @@ public interface RemoteSapService { @PostMapping("/sap/removeDatasource") public R removeDatasource(@RequestBody DataSourcePropertyDTO dataSourceProperty); -} + /** + *来料暂收接口 + */ + @PostMapping("/sap/temporarilyCollected") + public R temporarilyCollected(@RequestBody(required = false) List mapList) ; + } diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java index eebdb006..c7bc2477 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/factory/RemoteSapFallbackFactory.java @@ -138,6 +138,11 @@ public class RemoteSapFallbackFactory implements FallbackFactory mapList) { + return R.fail("来料暂收过账失败" + throwable.getMessage()); + } + }; } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java index 83a049aa..a2c14243 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/controller/WmsToWCSmissionController.java @@ -6,6 +6,7 @@ import com.op.common.core.utils.StringUtils; import com.op.common.core.web.domain.AjaxResult; import com.op.common.core.web.page.TableDataInfo; +import com.op.common.security.annotation.RequiresPermissions; import com.op.system.api.RemoteOpenService; import com.op.wms.domain.*; import com.op.wms.service.*; @@ -33,6 +34,8 @@ public class WmsToWCSmissionController { private IOdsWhiteEmbryoService iOdsWhiteEmbryoService; @Autowired private IOdsProductEmbryoInventoryService odsProductEmbryoInventoryService; + @Autowired + private IBaseAreaService baseAreaService; /** @@ -723,6 +726,13 @@ public class WmsToWCSmissionController { return iWmsToWCSmissionService.liftTakeOrPutCompleted(wcsdto); } - + /** + * 查询库区列表 + */ + @PostMapping("/listTableDataInfo") + public AjaxResult list(@RequestBody BaseArea baseArea) { + List list = baseAreaService.selectBaseAreaListSC(baseArea); + return success(list); + } } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProcureOrder.java b/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProcureOrder.java index 0eb96bde..77433d6a 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProcureOrder.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/domain/OdsProcureOrder.java @@ -77,6 +77,17 @@ public class OdsProcureOrder extends BaseEntity { @Excel(name = "仓库编码") private String whCode; + @Excel(name = "仓库编码") + private String waCode; + + public String getWaCode() { + return waCode; + } + + public void setWaCode(String waCode) { + this.waCode = waCode; + } + public String getWhCode() { return whCode; } @@ -337,6 +348,42 @@ public class OdsProcureOrder extends BaseEntity { */ @Excel(name = "企业编码") private String enterpriseCode; + private String SapTempInfor; + private String SapTempStatus; + private String SAPstatus; + private String SAPmessage; + + public String getSapTempInfor() { + return SapTempInfor; + } + + public void setSapTempInfor(String sapTempInfor) { + SapTempInfor = sapTempInfor; + } + + public String getSapTempStatus() { + return SapTempStatus; + } + + public void setSapTempStatus(String sapTempStatus) { + SapTempStatus = sapTempStatus; + } + + public String getSAPstatus() { + return SAPstatus; + } + + public void setSAPstatus(String SAPstatus) { + this.SAPstatus = SAPstatus; + } + + public String getSAPmessage() { + return SAPmessage; + } + + public void setSAPmessage(String SAPmessage) { + this.SAPmessage = SAPmessage; + } public void setSiteCode(String siteCode) { this.siteCode = siteCode; diff --git a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRawOrderInSnMapper.java b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRawOrderInSnMapper.java index 51766dd5..3e15e639 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRawOrderInSnMapper.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/mapper/WmsRawOrderInSnMapper.java @@ -67,4 +67,6 @@ public interface WmsRawOrderInSnMapper { List selecPurchaseOrderdeliPdaList(OdsProcureOrder odsProcureOrder); void insertWmsLogotypeTable(WmsLogotypeTable wmsLogotypeTable); + + WmsRawOrderInSn selecPurchaseOrderdeliPdaById(OdsProcureOrder odsProcureOrder); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseAreaService.java b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseAreaService.java index 764ad9cb..2bfa3e82 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseAreaService.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/IBaseAreaService.java @@ -62,4 +62,6 @@ public interface IBaseAreaService { boolean checkAreaCodeUnique(BaseArea baseArea); boolean checkAreaDescUnique(BaseArea baseArea); + + List selectBaseAreaListSC(BaseArea baseArea); } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseAreaServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseAreaServiceImpl.java index 4da7d6b0..8ac8d34d 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseAreaServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/BaseAreaServiceImpl.java @@ -3,6 +3,7 @@ package com.op.wms.service.impl; import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.utils.DateUtils; import com.op.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -133,4 +134,10 @@ public class BaseAreaServiceImpl implements IBaseAreaService { } } + @Override + public List selectBaseAreaListSC(BaseArea baseArea) { + DynamicDataSourceContextHolder.push("ds_" + baseArea.getFactoryCode()); + return baseAreaMapper.selectBaseAreaList(baseArea); + } + } diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java index 6f135831..3f96c3f1 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java @@ -164,9 +164,11 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { //wms_raw_order_in_sn WmsRawOrderInSn wmsRawOrderInSn = new WmsRawOrderInSn(); wmsRawOrderInSn.setRawOrderInSnId(IdUtils.fastSimpleUUID()); - wmsRawOrderInSn.setUserDefined1("1");// + wmsRawOrderInSn.setUserDefined1("1");//1是收货,2是入库 wmsRawOrderInSn.setUserDefined2(odsProcureOrder.getIncomeBatchNo());//批次 wmsRawOrderInSn.setWhCode(odsProcureOrder.getWhCode());//厂库编号 + wmsRawOrderInSn.setWaCode(odsProcureOrder.getWaCode()); + wmsRawOrderInSn.setWlCode("00001-1-01");//先都设置为同一个库位 wmsRawOrderInSn.setPoNo(order.getProcureCode());//采购单号 wmsRawOrderInSn.setPoLine(odsProcureOrder.getPoLine());//行项目 wmsRawOrderInSn.setMaterialCode(odsProcureOrder.getMaterialCode()); @@ -203,24 +205,6 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { } Integer tem = odsProcureOrderMapper.updateRealityNuById(odsProcureOrder); //插入检验集计划 -// QcCheckTaskIncomeDTO qcCheckTaskIncomeDTO = new QcCheckTaskIncomeDTO(); -// qcCheckTaskIncomeDTO.setCheckLoc("mjtest"); -// qcCheckTaskIncomeDTO.setCheckType("checkTypeLL"); -//// qcCheckTaskIncomeDTO.setCheckManCode("mobile"); -//// qcCheckTaskIncomeDTO.setCheckManName("手持测试用户"); -// qcCheckTaskIncomeDTO.setSupplierCode(order.getSupplierCode()); -// String name = odsProcureOrderMapper.selectBaseSupplier(odsProcureOrder); -// qcCheckTaskIncomeDTO.setSupplierName(name); -// qcCheckTaskIncomeDTO.setOrderType("bc"); -// qcCheckTaskIncomeDTO.setUnit(order.getUnit()); -// qcCheckTaskIncomeDTO.setFactoryCode(odsProcureOrder.getFactoryCode()); -// qcCheckTaskIncomeDTO.setQuality(odsProcureOrder.getPlanNumber()); -// qcCheckTaskIncomeDTO.setMaterialCode(odsProcureOrder.getMaterialCode()); -// qcCheckTaskIncomeDTO.setMaterialName(odsProcureOrder.getSupplierName()); -// qcCheckTaskIncomeDTO.setIncomeBatchNo(odsProcureOrder.getIncomeBatchNo()); -// qcCheckTaskIncomeDTO.setOrderNo(order.getProcureCode()); -// qcCheckTaskIncomeDTO.setIncomeTime(new Date()); -// remoteQualityService.createIncomeTask(qcCheckTaskIncomeDTO); return tem; } @@ -739,9 +723,103 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { public String PurchaseOrderdeliPdaConfirm(OdsProcureOrder odsProcureOrder) { DynamicDataSourceContextHolder.push("ds_" + odsProcureOrder.getFactoryCode()); String result="操作成功"; - List wmsRawOrderInSn = wmsRawOrderInSnMapper.selecPurchaseOrderdeliPdaList(odsProcureOrder); - + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); + Date date = new Date(); + String formattedDate = dateFormat.format(date); + WmsRawOrderInSn wmsRawOrderInSn1=new WmsRawOrderInSn(); + OdsProcureOrder order = odsProcureOrderMapper.selectOdsProcureOrderByID(odsProcureOrder.getID()); + List wmsRawOrderInSns = wmsRawOrderInSnMapper.selecPurchaseOrderdeliPdaList(odsProcureOrder); + WmsRawOrderInSn wmsRawOrderInSnTEM = wmsRawOrderInSnMapper.selecPurchaseOrderdeliPdaById(odsProcureOrder); + if(wmsRawOrderInSns.size()>0){ + }else { + result="托盘都已经入库"; + return result; + } + //先sap暂收成功后,我们这边也进行收货 + BigDecimal amount= wmsRawOrderInSnTEM.getAmount();//要入库的数量 + Map paramMap=new HashMap<>(); + List mapList = new ArrayList<>(); + /** + * ZMES_103_MIGO函数取值说明:智慧工厂MIGO-103移动类型收货 + * 字段 类型 长度 小数位 描述 + * EBELN CHAR 10 0 采购凭证号 + * EBELP NUMC 5 0 采购凭证的项目编号 + * MATNR CHAR 18 0 物料号 + * WERKS CHAR 4 0 工厂 + * QUANTITY QUAN 13 3 数量 + * @param mapList + * @return + */ + paramMap.put("EBELN",order.getProcureCode()); + paramMap.put("EBELP",order.getUserDefined3()); + paramMap.put("MATNR",order.getMaterialCode()); + paramMap.put("WERKS",order.getSiteCode()); + paramMap.put("QUANTITY",amount.toString()); + R result2 = remoteSapService.temporarilyCollected(mapList); + int code = result2.getCode(); + if (code == 200){//成功 + order.setSapTempStatus("1");//0是失败。1是成功 + order.setSapTempInfor(result2.getMsg()); + odsProcureOrderMapper.updateOdsProcureOrder(order); + for (WmsRawOrderInSn wmsRawOrderInSn:wmsRawOrderInSns){ + //收货 + WmsOdsMateStorageNewsSn wmsOdsMateStorageNewsSn = new WmsOdsMateStorageNewsSn(); + wmsOdsMateStorageNewsSn.setMateOrderInSnId(IdUtils.fastSimpleUUID()); + wmsOdsMateStorageNewsSn.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码 + wmsOdsMateStorageNewsSn.setWaCode(wmsRawOrderInSn.getWaCode()); + wmsOdsMateStorageNewsSn.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码--现在都设置为00001-1-01 + wmsOdsMateStorageNewsSn.setMaterialCode(wmsRawOrderInSn.getMaterialCode()); + wmsOdsMateStorageNewsSn.setMaterialDesc(wmsRawOrderInSn.getMaterialDesc()); + wmsOdsMateStorageNewsSn.setSn(wmsRawOrderInSn.getSn()); + wmsOdsMateStorageNewsSn.setAmount(wmsRawOrderInSn.getAmount()); + wmsOdsMateStorageNewsSn.setCreateBy(odsProcureOrder.getCreateBy()); + wmsOdsMateStorageNewsSn.setGmtCreate(new Date()); + wmsOdsMateStorageNewsSn.setUserDefined2(formattedDate);//批次 + wmsOdsMateStorageNewsSn.setFactoryCode(wmsRawOrderInSn.getFactoryCode()); + wmsOdsMateStorageNewsSn.setSapFactoryCode(wmsRawOrderInSn.getFactoryCode()); + wmsOdsMateStorageNewsSn.setActiveFlag("1"); + wmsOdsMateStorageNewsSnMapper.insertWmsOdsMateStorageNewsSn(wmsOdsMateStorageNewsSn); + //修改库存 + //2,修改库存---/加库存数量-/-冻结数量 + WmsOdsEmStorageNews wmsOdsEmStorageNews = new WmsOdsEmStorageNews(); + wmsOdsEmStorageNews.setWhCode(wmsRawOrderInSn.getWhCode());//仓库编码 + wmsOdsEmStorageNews.setWlCode(wmsRawOrderInSn.getWlCode());//库位编码 + wmsOdsEmStorageNews.setWaCode(wmsRawOrderInSn.getWaCode());//库位编码 + wmsOdsEmStorageNews.setMaterialCode(wmsRawOrderInSn.getMaterialCode()); + wmsOdsEmStorageNews.setAmount(wmsRawOrderInSn.getAmount()); + //添加库存--这个要有个判断有没有这个库存如果没有的话,就插入 + WmsOdsMateStorageNews wmsOdsMateStorageNews = wmsOdsMateStorageNewsMapper.selectByWhCodeAndMate(wmsOdsEmStorageNews); + if (wmsOdsMateStorageNews == null) { + WmsOdsMateStorageNews wmsOdsMateStorageNews1 = new WmsOdsMateStorageNews(); + wmsOdsMateStorageNews1.setStorageId(IdUtils.fastSimpleUUID()); + wmsOdsMateStorageNews1.setWhCode(wmsRawOrderInSn.getWhCode()); + wmsOdsMateStorageNews1.setWlCode(wmsRawOrderInSn.getWlCode()); + wmsOdsMateStorageNews1.setWaCode(wmsRawOrderInSn.getWaCode()); + wmsOdsMateStorageNews1.setAmount(wmsRawOrderInSn.getAmount()); + wmsOdsMateStorageNews1.setStorageAmount(wmsRawOrderInSn.getAmount()); + wmsOdsMateStorageNews1.setMaterialCode(wmsRawOrderInSn.getMaterialCode()); + wmsOdsMateStorageNews1.setMaterialDesc(wmsRawOrderInSn.getMaterialDesc()); + wmsOdsMateStorageNews1.setStorageType("BC"); + wmsOdsMateStorageNews1.setCreateBy(wmsRawOrderInSn.getCreateBy()); + wmsOdsMateStorageNews1.setGmtCreate(new Date()); + wmsOdsMateStorageNews1.setActiveFlag("1"); + wmsOdsMateStorageNews1.setFactoryCode(wmsRawOrderInSn.getFactoryCode()); + wmsOdsMateStorageNews1.setSapFactoryCode(wmsRawOrderInSn.getSapFactoryCode()); + wmsOdsMateStorageNews1.setUserDefined1(wmsRawOrderInSn.getUserDefined4());//单位 + wmsOdsMateStorageNewsMapper.insertWmsOdsMateStorageNews(wmsOdsMateStorageNews1); + } else { + wmsOdsMateStorageNewsSnMapper.updateAdd(wmsOdsEmStorageNews); + } + wmsRawOrderInSnMapper.updateU1Byid(wmsRawOrderInSn);//入库 + } + }else {////失败| + result="暂收失败"; + order.setSapTempInfor(result2.getMsg()); + order.setSapTempStatus("0");//0是失败。1是成功 + odsProcureOrderMapper.updateOdsProcureOrder(order); + return result; + } return result; } diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOrderMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOrderMapper.xml index 6a6f837b..94a5bb43 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOrderMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/OdsProcureOrderMapper.xml @@ -188,6 +188,10 @@ Last_Update_By = #{lastUpdateBy}, Last_Update_Date = #{lastUpdateDate}, Active = #{Active}, + Sap_Temp_Infor = #{SapTempInfor}, + Sap_Temp_Status = #{SapTempStatus}, + SAP_status = #{SAPstatus}, + SAP_message = #{SAPmessage}, Enterprise_Id = #{enterpriseId}, Enterprise_Code = #{enterpriseCode}, diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsMateStorageNewsMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsMateStorageNewsMapper.xml index 2f8a79dd..1476172d 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsMateStorageNewsMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsOdsMateStorageNewsMapper.xml @@ -213,7 +213,7 @@ SELECT wh_code, + wl_code, + wa_code, po_no, material_code, material_desc, - sum ( amount ) AS amount, - user_defined2, - user_defined3 + sn, + amount AS amount FROM wms_raw_order_in_sn WHERE - user_defined5 = #{receiptNoCode} - AND active_flag='1' - GROUP BY + user_defined3 = #{ID} + AND user_defined1 = '1' + AND active_flag = '1' + + insert into wms_logotype_table( From e214ca957e5319db21dc052316ca92058e5a20b4 Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Fri, 9 Aug 2024 14:24:16 +0800 Subject: [PATCH 2/8] =?UTF-8?q?wms103=E6=9A=82=E6=94=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/wms/WmsRawOrderInSnMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/WmsRawOrderInSnMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/WmsRawOrderInSnMapper.xml index 1c37e039..b63ddacc 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/WmsRawOrderInSnMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/WmsRawOrderInSnMapper.xml @@ -244,7 +244,7 @@ id, logotype, sn, - activeFlag + active_flag ) values ( From 682699cb20240780360ca40a8156bd17032504bc Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Fri, 9 Aug 2024 16:44:26 +0800 Subject: [PATCH 3/8] =?UTF-8?q?wms103=E6=9A=82=E6=94=B6=E4=BF=AE=E6=94=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java index 3f96c3f1..479b7ad0 100644 --- a/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java +++ b/op-modules/op-wms/src/main/java/com/op/wms/service/impl/OdsProcureOrderServiceImpl.java @@ -756,6 +756,7 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService { paramMap.put("MATNR",order.getMaterialCode()); paramMap.put("WERKS",order.getSiteCode()); paramMap.put("QUANTITY",amount.toString()); + mapList.add(paramMap); R result2 = remoteSapService.temporarilyCollected(mapList); int code = result2.getCode(); if (code == 200){//成功 From d338843bfc0b03988ae53691a1c8af3f182a2f07 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Fri, 9 Aug 2024 17:17:15 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E8=B4=A8=E9=87=8Foa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../quality/service/impl/QcCheckUnqualifiedServiceImpl.java | 6 ++++-- .../resources/mapper/quality/QcCheckTypeProjectMapper.xml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java index 12c314bb..f014a93c 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java @@ -358,8 +358,10 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService mainObject.append(",\"PZYCMS\":"+"\""+detailInfo.getRemark()+"\"");//品质异常描述 mainObject.append(",\"Notes\":"+"\"\"");//测试备注 mainObject.append(",\"SFXYZG\":"+"\""+task.getSfxyzg()+"\"");//*是否需要主管审核 1否 0是 - mainObject.append(",\"PGZG\":"+"\""+task.getPgzg()+"\"");//QC主管:SFXYZG字段为"是",则此项选择QC主管信息 - mainObject.append(",\"PGZR\":"+"\""+task.getPgzr()+"\"");//质量主管 660:朱继新 + if("0".equals(task.getSfxyzg())){ + mainObject.append(",\"PGZG\":"+"\""+task.getPgzg()+"\"");//QC主管:SFXYZG字段为"是",则此项选择QC主管信息 + mainObject.append(",\"PGZR\":"+"\""+task.getPgzr()+"\"");//质量主管 660:朱继新 + } mainObject.append(",\"SFGYSWT\":"+"\""+task.getSfgyswt()+"\"");//*是否供应商问题 1非供应商问题 0是供应商问题 mainObject.append("}"); diff --git a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml index 57a272af..e95c6832 100644 --- a/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml +++ b/op-modules/op-quality/src/main/resources/mapper/quality/QcCheckTypeProjectMapper.xml @@ -319,7 +319,7 @@ from base_product bp left join qc_material_group qmg on qmg.group_code = bp.mvgr5 where bp.product_code like concat('%',#{materialCode},'%') - and bp.del_flag = '0' + and bp.del_flag = '0' and qmg.del_flag = '0' order by qmg.create_time desc + SELECT + mes_report_work.report_code work_order, + pro_order_workorder.workorder_code_sap product_order, + mes_report_work.product_code, + mes_report_work.product_name, + mes_report_work.unit unit_of_measure, + mes_report_work.batch batch_number, + mes_report_work.quantity plan_quantity, + ( mes_report_work.quantity- put.put_quantity ) attr3 + FROM + pro_order_workorder + LEFT JOIN mes_report_work ON pro_order_workorder.workorder_code = mes_report_work.workorder_code + LEFT JOIN ( + SELECT SUM + ( wms_product_put.put_quantity ) AS put_quantity, + wms_product_put.work_order AS work_order, + wms_product_put.product_code AS product_code + FROM + wms_product_put + GROUP BY + wms_product_put.work_order, + wms_product_put.product_code + ) put ON put.work_order= mes_report_work.report_code + AND put.product_code= pro_order_workorder.workorder_code_sap + WHERE + pro_order_workorder.workorder_code_sap=#{attribute1} + AND mes_report_work.batch=#{attribute2} + AND mes_report_work.parent_order = '0' + From dffd9907703078ef6648268900fe270f8998acfd Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Mon, 12 Aug 2024 16:16:29 +0800 Subject: [PATCH 7/8] del_flag bug --- .../src/main/resources/mapper/mes/MesPrepareDetailMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesPrepareDetailMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesPrepareDetailMapper.xml index ae78454a..9fe5b0b8 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesPrepareDetailMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesPrepareDetailMapper.xml @@ -82,7 +82,7 @@ from pro_order_workorder ow left join mes_prepare mp on ow.workorder_code = mp.workorder_code left join mes_prepare_detail mpd on mp.prepare_id = mpd.prepare_id - where ow.belong_work_order = #{workorderCode} + where ow.belong_work_order = #{workorderCode} and ow.del_flag = '0' and mpd.recoil = #{recoil} and mp.del_flag = '0' and mpd.del_flag = '0' order by mpd.recoil From 2d0d6f878143fbd3bb057f3fdc78d3b286c5f6a4 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Mon, 12 Aug 2024 22:01:24 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/op/mes/domain/MesReportWorkConsume.java | 9 +++++++++ .../com/op/mes/mapper/MesReportWorkConsumeMapper.java | 3 +++ .../service/impl/MesReportWorkConsumeServiceImpl.java | 6 ++++++ .../resources/mapper/mes/MesReportWorkConsumeMapper.xml | 3 +++ .../main/resources/mapper/mes/MesReportWorkMapper.xml | 1 + .../service/impl/QcCheckTaskIncomeServiceImpl.java | 2 +- .../service/impl/QcCheckUnqualifiedServiceImpl.java | 9 +++++---- 7 files changed, 28 insertions(+), 5 deletions(-) diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWorkConsume.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWorkConsume.java index a75a09c4..3861064c 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWorkConsume.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWorkConsume.java @@ -93,6 +93,7 @@ public class MesReportWorkConsume extends BaseEntity { @Excel(name = "报工编码") private String reportCode; + private BigDecimal quantityFeedback; //虚拟字段 private String id; private String parentOrder; @@ -117,6 +118,14 @@ public class MesReportWorkConsume extends BaseEntity { private String erfmg; private String erfme; + public BigDecimal getQuantityFeedback() { + return quantityFeedback; + } + + public void setQuantityFeedback(BigDecimal quantityFeedback) { + this.quantityFeedback = quantityFeedback; + } + public String getErfmg() { return erfmg; } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkConsumeMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkConsumeMapper.java index a45a914b..d6f69ff5 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkConsumeMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkConsumeMapper.java @@ -1,5 +1,6 @@ package com.op.mes.mapper; +import java.math.BigDecimal; import java.util.List; import com.op.mes.domain.MesReportWorkConsume; @@ -85,4 +86,6 @@ public interface MesReportWorkConsumeMapper { List getSumConsumeList(MesReportWorkConsume consumeqo); int getSumConsumeListNum(MesReportWorkConsume consumeqo); + + BigDecimal getActAllProduct(MesReportWorkConsume mesReportWorkConsume); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkConsumeServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkConsumeServiceImpl.java index 8d49d1a7..44a56bb0 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkConsumeServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkConsumeServiceImpl.java @@ -358,6 +358,12 @@ public class MesReportWorkConsumeServiceImpl implements IMesReportWorkConsumeSer pTabs.setTitle("第"+i+"层工单物料损耗"); mesReportWorkConsume.setParentOrder("0"); List liblist0 = mesReportWorkConsumeMapper.getConsumeList(mesReportWorkConsume); + + if(!CollectionUtils.isEmpty(liblist0)){ + BigDecimal actPro = mesReportWorkConsumeMapper.getActAllProduct(mesReportWorkConsume); + liblist0.get(0).setQuantityFeedback(actPro); + } + pTabs.setLibList(liblist0); tabs.add(pTabs); diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml index 2c9f01f2..f5b9d049 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkConsumeMapper.xml @@ -202,6 +202,9 @@ and mrw.machine_code = #{machineCode} )t + insert into mes_report_work_consume diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index 68509b2b..d132b6be 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -702,6 +702,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and CONVERT(varchar(10), #{productDateEnd}, 23) >= CONVERT(varchar(10),pow.product_date, 23) + and pow.product_code like concat('%', #{productCode}, '%') order by be.equipment_code diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java index bc79d244..8bb7e041 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckTaskIncomeServiceImpl.java @@ -927,7 +927,7 @@ public class QcCheckTaskIncomeServiceImpl implements private void setOaFunc(QcCheckUnqualified unqualified,QcCheckTaskIncome qcCheckTaskIncome){ //不合格描述 unqualified.setRemark(qcCheckTaskIncome.getRemark()); - if("produce".equals(qcCheckTaskIncome.getTypeCode())){ + if("produce".equals(qcCheckTaskIncome.getTypeCode())||"product".equals(qcCheckTaskIncome.getTypeCode())){ unqualified.setTypeCode(qcCheckTaskIncome.getTypeCode()); unqualified.setSfgyswt(qcCheckTaskIncome.getSfgyswt()); unqualified.setUser(qcCheckTaskIncome.getPgzg());//qcCheckTaskIncome.getUpdateBy(); diff --git a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java index f014a93c..7c4b3148 100644 --- a/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java +++ b/op-modules/op-quality/src/main/java/com/op/quality/service/impl/QcCheckUnqualifiedServiceImpl.java @@ -100,13 +100,14 @@ public class QcCheckUnqualifiedServiceImpl implements IQcCheckUnqualifiedService if("material".equals(taskIfo.getTypeCode())) { //ZL0010-来料检验不合格控制流程 oaR = this.createLLOA(taskIfo); - }else if("produce".equals(taskIfo.getTypeCode())){ + }else if("produce".equals(taskIfo.getTypeCode())||"product".equals(taskIfo.getTypeCode())){ //ZL0030-品质异常流程 oaR = this.createProduceOA(taskIfo); - }else if("product".equals(taskIfo.getTypeCode())) { - //ZL0020-成品检验控制流程 - oaR = this.createProductOA(taskIfo); } +// else if("product".equals(taskIfo.getTypeCode())) { +// //ZL0020-成品检验控制流程 +// oaR = this.createProductOA(taskIfo); +// } if(oaR!=null ){ if((oaR.get("code").toString()).equals("200")){ /**qc_check_unqualified**/