From 5eb96ee45b80f376d3e80de4920b470894400451 Mon Sep 17 00:00:00 2001 From: Stang <32996823@qq.com> Date: Thu, 7 Nov 2024 15:32:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E9=87=8F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1bug=EF=BC=8C=E6=89=8B=E5=8A=A8=E7=BB=84=E8=A3=85?= =?UTF-8?q?=E6=95=B4=E5=88=80=E4=B8=8D=E9=94=81=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../md/controller/BaseKnifeController.java | 20 +++++++++++++------ .../resources/mapper/md/BaseKnifeMapper.xml | 2 +- 2 files changed, 15 insertions(+), 7 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 ccf6231..87d20d7 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 @@ -588,12 +588,12 @@ public class BaseKnifeController extends BaseController // 查询工艺bom BaseTechnologyBom technologyBom = new BaseTechnologyBom(); + Boolean lockedFlag = false; if (zdTask.getAttr4() != null){ + lockedFlag = true; technologyBom = baseTechnologyBomService.selectBaseTechnologyBomByTechnologyBomId(zdTask.getAttr4()); } else { technologyBom.setFigureCode(zdTask.getCode()); - technologyBom.setLockedStartTime(DateUtils.getNowDate()); - technologyBom.setLockedEndTime(DateUtils.getNowDate()); } // 出库基础物料 @@ -622,9 +622,13 @@ public class BaseKnifeController extends BaseController baseKnife.setStandardQuantity("1"); baseKnife.setKnifeLife(100); baseKnife.setKnifeFineState(0); - baseKnife.setIsLocked(1); - baseKnife.setLockedStartTime(technologyBom.getLockedStartTime()); - baseKnife.setLockedEndTime(technologyBom.getLockedEndTime()); + if (lockedFlag) { + baseKnife.setIsLocked(1); + baseKnife.setLockedStartTime(technologyBom.getLockedStartTime()); + baseKnife.setLockedEndTime(technologyBom.getLockedEndTime()); + } else { + baseKnife.setIsLocked(0); + } baseKnife.setPlanSheet(zdTask.getAttr4()); baseKnife.setItemOrProduct("PRODUCT"); baseKnife.setCreateBy(getUsername()); @@ -716,10 +720,14 @@ public class BaseKnifeController extends BaseController wmsOutTask.setCreateBy(getUsername()); wmsOutTask.setCreateTime(DateUtils.getNowDate()); wmsOutTaskMapper.insertWmsOutTask(wmsOutTask); + + // 更新基础物料数量 + MdItem mdItem = mdItemService.selectMdItemById(outPlanDetail.getMdItemId()); + mdItem.setStandardNumber(mdItem.getStandardNumber() - outPlanDetail.getRealQuantity()); + mdItemService.updateMdItem(mdItem); } // 整刀入库计划 - Random random = new Random(); WmsInPlan wmsInPlan = new WmsInPlan(); wmsInPlan.setState("1"); wmsInPlan.setSourceType("SGLR"); diff --git a/ktg-mes/src/main/resources/mapper/md/BaseKnifeMapper.xml b/ktg-mes/src/main/resources/mapper/md/BaseKnifeMapper.xml index d27d504..e9e4f82 100644 --- a/ktg-mes/src/main/resources/mapper/md/BaseKnifeMapper.xml +++ b/ktg-mes/src/main/resources/mapper/md/BaseKnifeMapper.xml @@ -560,6 +560,6 @@ \ No newline at end of file