From 5c2aea11c37e28a799ba662bf6a564a9aaeb7df0 Mon Sep 17 00:00:00 2001 From: xs Date: Tue, 25 Jun 2024 16:15:29 +0800 Subject: [PATCH] =?UTF-8?q?2.5.0=20=E8=BD=A6=E9=97=B4=E7=94=9F=E4=BA=A7:?= =?UTF-8?q?=201=E3=80=814=E6=A5=BC=E6=BF=80=E5=85=89=E5=88=87=E5=89=B2?= =?UTF-8?q?=E5=B7=A5=E4=BD=8D=E6=9D=BF=E6=9D=90=E5=85=A5=E5=BA=93=E3=80=81?= =?UTF-8?q?=E6=9D=BF=E6=9D=90=E5=87=BA=E5=BA=93=E6=9D=A1=E7=A0=81=E6=9E=AA?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MesProductPlanDetailServiceImpl.java | 46 +++--- .../impl/WmsRawInstockServiceImpl.java | 4 +- .../impl/WmsRawOutstockServiceImpl.java | 11 +- .../views/board/fourthFloor/laserLight.vue | 147 +++++++++++++++--- 4 files changed, 165 insertions(+), 43 deletions(-) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java index 2d8c7b4..f285d8d 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductPlanDetailServiceImpl.java @@ -186,28 +186,12 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer throw new ServiceException("此生产计划已结束"); } - MesProductOrder productOrder = mesProductOrderMapper.selectMesProductOrderByProductOrderId(dbProductPlan.getProductOrderId()); - if(productOrder==null){ - throw new ServiceException("无此生产工单"); - } - - String orderStatus = productOrder.getOrderStatus(); - if(!orderStatus.equals(MesConstants.BEGIN) && !orderStatus.equals(MesConstants.PUBLISHED)){ - String orderStatusPrompt = MesConstants.ORDER_STATUS_PROMPT_MAP.get(orderStatus); - throw new ServiceException(String.format("此生产工单已经%s,不能开始!", orderStatusPrompt)); - } Date currentDate = new Date(); String userName = SecurityUtils.getUsername(); Long userId = SecurityUtils.getUserId(); - if(orderStatus.equals(MesConstants.PUBLISHED)){ - productOrder.setOrderStatus(MesConstants.BEGIN); - productOrder.setRealBeginTime(currentDate); - productOrder.setUpdateBy(userName); - productOrder.setUpdateTime(currentDate); - mesProductOrderMapper.updateMesProductOrder(productOrder); - } + startProductOrder(dbProductPlan,currentDate,userName); if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_DISPATCHED)) { dbProductPlan.setRealBeginTime(currentDate); @@ -338,7 +322,7 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer public MesProductPlanDetail startNextMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail, String startType) { //根据planId获取最新一条的生产计划明细 MesProductPlanDetail newestPlanDetail = mesProductPlanDetailMapper.selectNewestMesProductPlanDetail(mesProductPlanDetail); - //todo:在开始生产计划时,更新生产工单状态、开始时间; + //如果此计划有最新的计划明细 if (newestPlanDetail != null) { String planDetailStatus = newestPlanDetail.getPlanDetailStatus(); @@ -384,6 +368,8 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer String userName = SecurityUtils.getUsername(); Long userId = SecurityUtils.getUserId(); + startProductOrder(mesProductPlan,currentDate,userName); + if (planStatus.equals(MesConstants.MES_PRODUCT_PLAN_STATUS_DISPATCHED)) {//如果状态是已开始,需要修改计划的状态和开始时间 mesProductPlan.setPlanStatus(MesConstants.MES_PRODUCT_PLAN_STATUS_STARTED); mesProductPlan.setRealBeginTime(currentDate); @@ -409,4 +395,28 @@ public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailSer } + + public void startProductOrder(MesProductPlan productPlan,Date currentDate,String userName){ + MesProductOrder productOrder = mesProductOrderMapper.selectMesProductOrderByProductOrderId(productPlan.getProductOrderId()); + if(productOrder==null){ + throw new ServiceException("无此生产工单"); + } + + String orderStatus = productOrder.getOrderStatus(); + if(!orderStatus.equals(MesConstants.BEGIN) && !orderStatus.equals(MesConstants.PUBLISHED)){ + String orderStatusPrompt = MesConstants.ORDER_STATUS_PROMPT_MAP.get(orderStatus); + throw new ServiceException(String.format("此生产工单已经%s,不能开始!", orderStatusPrompt)); + } + + + if(orderStatus.equals(MesConstants.PUBLISHED)){ + productOrder.setOrderStatus(MesConstants.BEGIN); + productOrder.setRealBeginTime(currentDate); + productOrder.setUpdateBy(userName); + productOrder.setUpdateTime(currentDate); + mesProductOrderMapper.updateMesProductOrder(productOrder); + } + + } + } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java index a4e0702..f56e2fc 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawInstockServiceImpl.java @@ -136,11 +136,11 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { String materialBarcode = wmsRawInstockVo.getMaterialBarcode(); R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); if (baseBarcodeInfoR == null) { - throw new ServiceException("物料编码有误"); + throw new ServiceException("物料条码有误"); } MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); if (baseBarcodeInfo == null) { - throw new ServiceException("物料编码有误"); + throw new ServiceException("物料条码有误"); } String locationCode = wmsRawInstockVo.getLocationCode(); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java index 739fad7..62c32eb 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsRawOutstockServiceImpl.java @@ -1000,11 +1000,11 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { String materialBarcode = wmsRawOutstock.getMaterialBarcode(); R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); if (baseBarcodeInfoR == null) { - throw new ServiceException("物料编码有误"); + throw new ServiceException("物料条码有误"); } MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); if (baseBarcodeInfo == null) { - throw new ServiceException("物料编码有误"); + throw new ServiceException("物料条码有误"); } //验证销售订单绑定关系,或者是否安全库存 @@ -1093,7 +1093,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { * @param wmsRawOutstock * @return */ - @Transactional + @Transactional(rollbackFor = Exception.class) @Override public int directRawOutstock(WmsRawOutstock wmsRawOutstock) { //出库要求 (0申请出库,1申请审核出库,2直接出库) @@ -1105,7 +1105,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { } R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); if (baseBarcodeInfoR == null) { - throw new ServiceException("物料编码有误"); + throw new ServiceException("物料条码有误"); } MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); @@ -1142,6 +1142,9 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { if (wmsRawStock == null) { throw new ServiceException("没找到库存信息"); } else { + if (!locationCode.equals(wmsRawStock.getLocationCode())) { + throw new ServiceException("请核对库位编码"); + } BigDecimal totalAmount = wmsRawStock.getTotalAmount() == null ? BigDecimal.ZERO : wmsRawStock.getTotalAmount(); BigDecimal updatedTotalAmount = totalAmount.subtract(outstockAmount); if (updatedTotalAmount.compareTo(BigDecimal.ZERO) < 0) { diff --git a/hw-ui/src/views/board/fourthFloor/laserLight.vue b/hw-ui/src/views/board/fourthFloor/laserLight.vue index d12d55c..cae2f9d 100644 --- a/hw-ui/src/views/board/fourthFloor/laserLight.vue +++ b/hw-ui/src/views/board/fourthFloor/laserLight.vue @@ -33,7 +33,8 @@
- 板材领料 + 板材领料 + 下发图纸 完成
@@ -195,10 +196,12 @@ - + - +