From 1fb81c6bed7fb51dc39823737f738a8407389531 Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Thu, 7 Nov 2024 15:53:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=80=E6=9F=84?= =?UTF-8?q?=E4=B9=9F=E8=BF=9B=E8=A1=8C=E8=AE=A1=E7=AE=97=E5=AF=BF=E5=91=BD?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/md/controller/BaseKnifeController.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java index 87d20d7..baf2ae9 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java @@ -166,7 +166,6 @@ public class BaseKnifeController extends BaseController return AjaxResult.error("物料台账查询错误", techBom.getKnifeCode()); } - // 查询台账数据 baseKnifeWrapper.setMbbBdMrlId(mdItemTemp.getItemId()); baseKnifeWrapper.setIsLocked(0); List tempList = this.baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); @@ -184,7 +183,7 @@ public class BaseKnifeController extends BaseController operLogService.insertOperlog(operLog); return AjaxResult.error("Bom头查询错误", techBom.getKnifeCode()); } - + BomRoute bomRoute = bomRouteService.selectBomRouteByBomRouteId(bomRouteList.get(0).getBomRouteId()); if (!bomRoute.getMbbProduBomList().isEmpty()) { @@ -194,7 +193,6 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); List sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); @@ -233,6 +231,7 @@ public class BaseKnifeController extends BaseController // 将物料填入集合 tempList.forEach(item -> { if (knifeCount.get() > 0 && tempList.size() > countMap.get(item.getKnifeCode())) { + // 更新数量 knifeCount.getAndDecrement(); countMap.put(item.getKnifeCode(), countMap.get(item.getKnifeCode()) + 1); } @@ -241,6 +240,7 @@ public class BaseKnifeController extends BaseController if ("PRODUCT".equals(mdItemTemp.getItemOrProduct())){ // 查询整刀bom项, 如果不存在说明 为基础物料,或者没有记录此整刀的组装 bomRouteTemp.setMdItemId(mdItemTemp.getItemId()); + List bomRouteList = bomRouteService.selectBomRouteList(bomRouteTemp); if (bomRouteList.isEmpty()){ operLog.setJsonResult("Bom头查询错误:" + techBom.getKnifeCode()); @@ -257,7 +257,6 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); List sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ operLog.setJsonResult("基础物料不足进行组装工具:" + bom.getMdItemCode()); @@ -378,7 +377,6 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); List sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); @@ -456,7 +454,6 @@ public class BaseKnifeController extends BaseController baseKnifeWrapper.setMbbBdMrlId(bom.getMdItemId()); baseKnifeWrapper.setIsLocked(0); List sitmTempList = baseKnifeService.selectBaseKnifeList(baseKnifeWrapper); - sitmTempList.removeIf(baseKnife -> baseKnife.getKnifeLife() + baseKnife.getResetCount() * 100 < techBom.getExpendLife()); if (sitmTempList.isEmpty()){ baseKnifeOriginList.forEach(baseKnife -> baseKnifeService.updateBaseKnife(baseKnife)); From 8429137f088c0eb166a4caee9b525b457e83f2ad Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Thu, 7 Nov 2024 16:37:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=84=E8=A3=85?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=85=A5=E5=BA=93=E8=AE=A1=E5=88=92=E5=8D=95?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E9=87=8D=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ktg/mes/md/controller/BaseKnifeController.java | 4 +++- ktg-mes/src/main/resources/mapper/wm/WmsZdTaskMapper.xml | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java index baf2ae9..548ad87 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/md/controller/BaseKnifeController.java @@ -29,6 +29,8 @@ import com.ktg.common.enums.BusinessType; import com.ktg.common.utils.poi.ExcelUtil; import com.ktg.common.core.page.TableDataInfo; +import static com.ktg.generator.util.MultiModuleCodeGenerator.generateTaskCode; + /** * 工具台账Controller * @@ -752,7 +754,7 @@ public class BaseKnifeController extends BaseController MdItem mdItem = mdItemService.selectMdItemById(zdTask.getmProductId()); WmsInTask wmsInTask = new WmsInTask(); wmsInTask.setPlanInId(wmsInPlan.getPlanId()); - wmsInTask.setPlanInCode(wmsInPlan.getPlanCode()); + wmsInTask.setPlanInCode(generateTaskCode(wmsInPlan.getPlanCode())); wmsInTask.setMaterialCode(mdItem.getItemCode()); wmsInTask.setTaskInQuantity(zdTask.getProductIdQty()); wmsInTask.setActualInQuantity(zdTask.getProductIdQty()); diff --git a/ktg-mes/src/main/resources/mapper/wm/WmsZdTaskMapper.xml b/ktg-mes/src/main/resources/mapper/wm/WmsZdTaskMapper.xml index eee8781..ab10022 100644 --- a/ktg-mes/src/main/resources/mapper/wm/WmsZdTaskMapper.xml +++ b/ktg-mes/src/main/resources/mapper/wm/WmsZdTaskMapper.xml @@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -29,8 +30,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select wzt.WMS_ZD_TASK_ID, wzt.CODE, wzt."name", wzt.M_PRODUCT_ID, wzt."product_id_qty", wzt.QTY, wzt.PLAN_OUT_ID, - wzt.PLAN_OUT_TYPE, wzt.QTY_OK, wzt.REMARK, wzt.ATTR1, wzt.ATTR3, wzt.CREATE_BY, wzt.CREATE_TIME, - wzt.UPDATE_BY, wzt.UPDATE_TIME, wzt.STATUS, mi.item_name attr2, btb.figure_code attr4 + wzt.PLAN_OUT_TYPE, wzt.QTY_OK, wzt.REMARK, wzt.ATTR1, wzt.ATTR3, wzt.ATTR4, wzt.CREATE_BY, wzt.CREATE_TIME, + wzt.UPDATE_BY, wzt.UPDATE_TIME, wzt.STATUS, mi.item_name attr2, btb.figure_code plan_sheet from WMS_ZD_TASK wzt left join md_item mi on wzt.m_product_id = mi.item_id left join base_technology_bom btb on btb.technology_bom_id = wzt.attr4 @@ -50,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and ATTR1 = #{attr1} and ATTR2 = #{attr2} and ATTR3 = #{attr3} - and ATTR4 = #{attr4} + and ATTR4 = #{attr4} and CREATE_BY = #{createBy} and CREATE_TIME = #{createTime} and UPDATE_BY = #{updateBy} @@ -123,7 +124,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ATTR1 = #{attr1}, ATTR2 = #{attr2}, ATTR3 = #{attr3}, - ATTR4 = #{attr4}, CREATE_BY = #{createBy}, CREATE_TIME = #{createTime}, UPDATE_BY = #{updateBy},