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 @@ - + - +