From 57cb7848e0eb80e248695e08b82241b9b552e116 Mon Sep 17 00:00:00 2001 From: xs Date: Sun, 20 Oct 2024 14:48:10 +0800 Subject: [PATCH] =?UTF-8?q?3.2.7=20=E8=BD=A6=E9=97=B4=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=EF=BC=9A=20=E5=9B=9B=E6=A5=BC=E6=BF=80=E5=85=89=E5=88=87?= =?UTF-8?q?=E5=89=B2=EF=BC=9A=E6=9D=BF=E6=9D=90=E5=85=A5=E5=BA=93=E5=92=8C?= =?UTF-8?q?=E6=9D=BF=E6=9D=90=E9=A2=86=E6=96=99=E5=90=8E=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=BA=93=E5=AD=98=20=E4=BA=94=E6=A5=BC?= =?UTF-8?q?=E8=87=AA=E6=A3=80=E5=B7=A5=E5=BA=8F=EF=BC=9A=E5=9C=A8=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=88=90=E5=93=81=E6=9D=A1=E7=A0=81=E5=89=8D=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=9C=89=E6=B2=A1=E6=9C=89=E5=8D=8A=E6=88=90=E5=93=81?= =?UTF-8?q?=E5=87=BA=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hw/mes/api/domain/MesBaseBarcodeInfo.java | 10 +++ .../impl/MesBaseBarcodeInfoServiceImpl.java | 12 ++- .../impl/MesProductOrderServiceImpl.java | 27 +++++-- .../mapper/mes/MesProductOrderMapper.xml | 1 + .../mapper/mes/MesProductPlanMapper.xml | 2 +- .../hw/wms/controller/WmsApiController.java | 23 ++++-- .../wms/controller/WmsMobileController.java | 3 +- .../hw/wms/service/IWmsRawInstockService.java | 3 +- .../wms/service/IWmsRawOutstockService.java | 3 +- .../hw/wms/service/IWmsTransferService.java | 8 ++ .../impl/WmsRawInstockServiceImpl.java | 25 ++++--- .../impl/WmsRawOutstockServiceImpl.java | 8 +- .../impl/WmsStockTotalServiceImpl.java | 1 + .../service/impl/WmsTransferServiceImpl.java | 14 ++++ hw-ui/src/api/board/barcode.js | 9 +++ hw-ui/src/api/mes/materialBom.js | 15 ++++ .../views/board/barcode/workshopBarcode.vue | 73 +++++++++++-------- .../views/board/fourthFloor/laserLight.vue | 10 +-- hw-ui/src/views/mes/materialBom/index.vue | 39 +++++++--- .../views/mes/materialinfo/selectMaterial.vue | 3 +- hw-ui/src/views/mes/productOrder/index.vue | 31 +++++++- 21 files changed, 232 insertions(+), 88 deletions(-) diff --git a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java index 4f92901..11c45af 100644 --- a/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java +++ b/hw-api/hw-api-mes/src/main/java/com/hw/mes/api/domain/MesBaseBarcodeInfo.java @@ -194,6 +194,8 @@ public class MesBaseBarcodeInfo extends BaseEntity private Long orderBindId; + private Long materialBomId; + public String getLocationCode() { return locationCode; @@ -619,6 +621,14 @@ public class MesBaseBarcodeInfo extends BaseEntity this.orderBindId = orderBindId; } + public Long getMaterialBomId() { + return materialBomId; + } + + public void setMaterialBomId(Long materialBomId) { + this.materialBomId = materialBomId; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java index 20db462..f0e5794 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesBaseBarcodeInfoServiceImpl.java @@ -349,7 +349,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService Long saleOrderId = productPlan.getSaleOrderId(); String saleOrderCode = productPlan.getSaleorderCode(); - Long materialId = productPlan.getMaterialId();;//在生产计划的materialid是根据saletype保存,如果是外部销售则保存productorder中的materialid,如果是内部生产则保存prpductorder中的producematerialid + Long materialId = productPlan.getMaterialId(); + ;//在生产计划的materialid是根据saletype保存,如果是外部销售则保存productorder中的materialid,如果是内部生产则保存prpductorder中的producematerialid //五楼自检工序根据原材料条码生成成品条码 if (StringUtils.isNotEmpty(mesBaseBarcodeInfo.getSingleFlag()) && @@ -369,6 +370,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService barcode = Seq.getId(Seq.mesPurchaseVirtualProductBarcodeSeqType, Seq.mesPurchaseVirtualProductBarcodeCode); } else if (rawMaterialBarcode.contains(Seq.mesInternalVirtualBarcodeCode)) {//内部生产合并虚拟条码 barcode = Seq.getId(Seq.mesInternalVirtualProductBarcodeSeqType, Seq.mesInternalVirtualProductBarcodeCode); + materialId = rawBarcode.getMaterialId(); } MesBaseBarcodeInfo productBarcodeInfo = mesBaseBarcodeInfoMapper.selectMesBaseBarcodeInfoByProductBarcode(rawMaterialBarcode); @@ -719,7 +721,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService PrintContentVo printMaterialSpec = new PrintContentVo(); printMaterialSpec.setKey(PrintContentVo.RAW_MATERIAL_LABEL_KEY_MATERIAL_SPEC); - printMaterialSpec.setValue(mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", "")); + if(StringUtils.isNotEmpty(mesBaseBarcodeInfo.getBarcodeSpec())) { + printMaterialSpec.setValue(mesBaseBarcodeInfo.getBarcodeSpec().replaceAll("[\\x00-\\x1F\\x7F-\\x9F]", "")); + } printMaterialSpec.setType(PrintContentVo.TYPE_TEXT); PrintContentVo printQty = new PrintContentVo(); @@ -1066,6 +1070,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService MesMaterialBom childMaterialBom = childMaterialBomList.get(0); MesMaterialBom parentBom = mesMaterialBomMapper.selectMesMaterialBomByMaterialBomId(childMaterialBom.getParentId()); + //四楼到五楼,主要是多个成品合并到一个托盘后生成原材料条码需要保存以下信息,一个成品的保不保存无所谓 MesSaleOrderRelate saleOrderRelate = new MesSaleOrderRelate(); saleOrderRelate.setBarcodeInfo(barcodeInfo); saleOrderRelate.setSaleOrderId(mesBaseBarcodeInfo.getSaleOrderId()); @@ -1082,9 +1087,8 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService saleOrderRelate.setRelateSaleOrderAmount(BigDecimal.ONE); toInsertedSaleOrderRelateList.add(saleOrderRelate); - } - + } } if (allErrorMsgBuilder.length() > 0) { diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java index 5fa4276..608fd21 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesProductOrderServiceImpl.java @@ -94,14 +94,14 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { // if(mesProductOrder.getPreOrderId()!=null){ // checkPreTime(mesProductOrder); // } - if(mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_PACKING)){ + if (mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_PACKING)) { mesProductOrder.setDispatchId(5L);//包装工艺路线ID mesProductOrder.setSaleOrderId(0L); mesProductOrder.setSaleOrderFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO); mesProductOrder.setMaterialId(0L); mesProductOrder.setMaterialBomId(0L); mesProductOrder.setSaleAmount(mesProductOrder.getPlanAmount()); - }else{ + } else { //校验同一工艺路线时间重叠 checkSameProcessTimeClash(mesProductOrder); //销售订单添加工单:校验是否超出销售数量 @@ -119,6 +119,17 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { if (mesProductOrder.getProduceMaterialId() == null) { throw new ServiceException("请选择生产物料"); } + + //校验此生产物料是否在销售订单成品物料的生产bom中 + MesMaterialBom queryMaterialBom = new MesMaterialBom(); + queryMaterialBom.setMaterialId(mesProductOrder.getProduceMaterialId()); + queryMaterialBom.setParentId(mesProductOrder.getMaterialBomId()); + queryMaterialBom.setActiveFlag(MesConstants.MES_MATERIAL_BOM_ACTIVE_FLAG_NORMAL); + List mesMaterialBoms = mesMaterialBomMapper.selectMesMaterialBomList(queryMaterialBom); + if (mesMaterialBoms == null || mesMaterialBoms.isEmpty()) { + throw new ServiceException("所选择生产物料不在选择的成品bom中"); + } + } } @@ -180,6 +191,7 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { /** * 校验当前任务的开始时间是否小于前置任务的结束时间 + * * @param mesProductOrder */ private void checkPreTime(MesProductOrder mesProductOrder) { @@ -188,8 +200,8 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { long prePlanEndTimeL = prePlanEndTime.getTime(); Date planBeginTime = mesProductOrder.getPlanBeginTime(); long planBeginTimeL = planBeginTime.getTime(); - if(planBeginTimeL < prePlanEndTimeL){ - throw new ServiceException("计划开始时间不能小于前置任务的计划结束时间:"+prePlanEndTime); + if (planBeginTimeL < prePlanEndTimeL) { + throw new ServiceException("计划开始时间不能小于前置任务的计划结束时间:" + prePlanEndTime); } } @@ -331,8 +343,8 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { String productOrderStatus = dbProductOrder.getOrderStatus(); // 工单状态:0-待发布;1-已发布;2-已完成;3-已开始;4-暂停;8-已撤回;9-已删除 //已发布和已开始的可以改为暂停 - if(!productOrderStatus.equals(MesConstants.PUBLISHED) && - !productOrderStatus.equals(MesConstants.BEGIN)){ + if (!productOrderStatus.equals(MesConstants.PUBLISHED) && + !productOrderStatus.equals(MesConstants.BEGIN)) { String orderStatusPrompt = MesConstants.ORDER_STATUS_PROMPT_MAP.get(productOrderStatus); throw new ServiceException(String.format("此生产任务已经%s,不能暂停!", orderStatusPrompt)); } @@ -357,7 +369,7 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { String productOrderStatus = dbProductOrder.getOrderStatus(); // 工单状态:0-待发布;1-已发布;2-已完成;3-已开始;4-暂停;8-已撤回;9-已删除 //已暂停的可以改为已开始 - if(!productOrderStatus.equals(MesConstants.PAUSE)){ + if (!productOrderStatus.equals(MesConstants.PAUSE)) { String orderStatusPrompt = MesConstants.ORDER_STATUS_PROMPT_MAP.get(productOrderStatus); throw new ServiceException(String.format("此生产任务已经%s,不能继续开始!", orderStatusPrompt)); } @@ -371,7 +383,6 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { } - /** * 校验BOM是否被生产工单选择 * diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml index 753d709..57ba80f 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductOrderMapper.xml @@ -347,6 +347,7 @@ mpo.order_status not in ('9') and mpo.order_code like concat('%', #{orderCode},'%') + and mpo.sale_type = #{saleType} and mpo.pre_order_code like concat('%', #{preOrderCode},'%') and mpo.saleorder_code like concat('%', #{saleorderCode},'%') and bmi.material_code like concat('%', #{materialCode},'%') diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml index fa81973..0b3a59a 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesProductPlanMapper.xml @@ -359,7 +359,7 @@ and mpp.plan_status = #{planStatus} and mpp.plan_status in ('1','2') - order by mpp.plan_begin_time + order by mpp.plan_id desc diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java index 253a471..1cbe8dc 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsApiController.java @@ -49,6 +49,9 @@ public class WmsApiController extends BaseController { @Autowired private IWmsProductOutstockService wmsProductOutstockService; + @Autowired + private IWmsTransferService wmsTransferService; + @Autowired private IWmsErpScheduledTaskService wmsErpScheduledTaskService; @@ -103,7 +106,6 @@ public class WmsApiController extends BaseController { } - /** * 新增原材料入库记录(适合于四楼激光切割工位的板材入库) */ @@ -111,7 +113,7 @@ public class WmsApiController extends BaseController { @Log(title = "原材料入库记录", businessType = BusinessType.INSERT) @PostMapping(("/addRawInstock")) public AjaxResult addRawInstock(@Validated @RequestBody WmsRawInstockVo wmsRawInstockVo) { - return toAjax(wmsRawInstockService.insertWmsRawInstock(wmsRawInstockVo)); + return success(wmsRawInstockService.insertWmsRawInstock(wmsRawInstockVo)); } /** @@ -130,7 +132,7 @@ public class WmsApiController extends BaseController { @Log(title = "原材料出库记录", businessType = BusinessType.CONFIRM) @PostMapping(("/directRawOutstock")) public AjaxResult directRawOutstock(@RequestBody WmsRawOutstock wmsRawOutstock) { - return toAjax(wmsRawOutstockService.directRawOutstock(wmsRawOutstock)); + return success(wmsRawOutstockService.directRawOutstock(wmsRawOutstock)); } @@ -218,10 +220,9 @@ public class WmsApiController extends BaseController { } - - /** * 定时同步原材料入库信息给ERP + * * @return */ @PostMapping(("/synchronizeInventoryInformationToERP")) @@ -231,6 +232,7 @@ public class WmsApiController extends BaseController { /** * 定时同步原材料出库信息给ERP + * * @return */ @PostMapping(("/synchronizeRawMaterialDeliveryInformationToERP")) @@ -240,6 +242,7 @@ public class WmsApiController extends BaseController { /** * 定时同步成品入库信息给ERP + * * @param days 同步days天前数据 * @return */ @@ -250,6 +253,7 @@ public class WmsApiController extends BaseController { /** * 定时同步成品出库信息给ERP + * * @param days 同步days天前数据 * @return */ @@ -268,4 +272,13 @@ public class WmsApiController extends BaseController { return toAjax(wmsRawInstockService.continueRawInstock(wmsRawInstockContinueVo)); } + + /** + * 根据原材料条码判断是否有半成品出库 + */ + @GetMapping(("/checkSemiOutstock")) + public AjaxResult checkSemiOutstock(WmsTransfer wmsTransfer) { + return success(wmsTransferService.checkSemiOutstock(wmsTransfer)); + } + } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java index b9d1d70..480ca29 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsMobileController.java @@ -101,7 +101,8 @@ public class WmsMobileController extends BaseController { @Log(title = "原材料入库记录", businessType = BusinessType.INSERT) @PostMapping(("/addRawInstock")) public AjaxResult addRawInstock(@Validated @RequestBody WmsRawInstockVo wmsRawInstockVo) { - return toAjax(wmsRawInstockService.insertWmsRawInstock(wmsRawInstockVo)); + wmsRawInstockService.insertWmsRawInstock(wmsRawInstockVo); + return toAjax(1); } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawInstockService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawInstockService.java index 156caaa..779b3d8 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawInstockService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawInstockService.java @@ -1,5 +1,6 @@ package com.hw.wms.service; +import java.math.BigDecimal; import java.util.List; import com.hw.wms.domain.WmsRawInstock; import com.hw.wms.domain.vo.WmsRawBackVo; @@ -72,7 +73,7 @@ public interface IWmsRawInstockService * @param wmsRawInstockVo 原材料入库记录 * @return 结果 */ - public int insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo); + public BigDecimal insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo); /** diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawOutstockService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawOutstockService.java index 5eb3f62..17137c9 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawOutstockService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsRawOutstockService.java @@ -1,5 +1,6 @@ package com.hw.wms.service; +import java.math.BigDecimal; import java.util.List; import com.alibaba.fastjson2.JSONObject; @@ -139,7 +140,7 @@ public interface IWmsRawOutstockService * @param wmsRawOutstock * @return */ - public int directRawOutstock(WmsRawOutstock wmsRawOutstock); + public BigDecimal directRawOutstock(WmsRawOutstock wmsRawOutstock); /** * 五楼装配工位申请领料时,在拿完物料,调用wcs接口已领完,wcs可以调度背负agv进行下一个任务 diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsTransferService.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsTransferService.java index 1be8e24..62aabe5 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsTransferService.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/IWmsTransferService.java @@ -94,4 +94,12 @@ public interface IWmsTransferService * @return */ public int transferInstock(WmsTransferDetail wmsTransferDetail); + + /** + * 校验半成品是否已经出库 + * + * @param wmsTransfer 转库记录 + * @return 转库记录 + */ + public int checkSemiOutstock(WmsTransfer wmsTransfer); } 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 11e7986..bebdff6 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 @@ -146,7 +146,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { */ @Transactional(rollbackFor = Exception.class) @Override - public int insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo) { + public BigDecimal insertWmsRawInstock(WmsRawInstockVo wmsRawInstockVo) { String materialBarcode = wmsRawInstockVo.getMaterialBarcode(); R baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER); if (baseBarcodeInfoR == null) { @@ -206,9 +206,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { int rows = wmsRawInstockMapper.insertWmsRawInstock(wmsRawInstock); //更新库位库存 - updateRawStock(wmsRawInstock, wmsRawInstockVo, baseLocation, baseBarcodeInfo, userName, currentDate); - - return rows; + return updateRawStock(wmsRawInstock, wmsRawInstockVo, baseLocation, baseBarcodeInfo, userName, currentDate); } @@ -221,7 +219,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { * @param userName * @param currentDate */ - public void updateRawStock(WmsRawInstock wmsRawInstock, WmsRawInstockVo wmsRawInstockVo, WmsBaseLocation baseLocation + public BigDecimal updateRawStock(WmsRawInstock wmsRawInstock, WmsRawInstockVo wmsRawInstockVo, WmsBaseLocation baseLocation , MesBaseBarcodeInfo baseBarcodeInfo, String userName, Date currentDate) { String barcode = baseBarcodeInfo.getBarcodeInfo(); String locationCode = wmsRawInstock.getLocationCode(); @@ -239,12 +237,14 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { String batchFlag = baseBarcodeInfo.getBatchFlag(); //如果是同一库位入同一批次,则更新数量 WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(barcode); + BigDecimal newTotalAmount = BigDecimal.ZERO; if (wmsRawStock != null) { // wmsRawStock.setQualityStatus(wmsRawInstockVo.getQualityStatus()); if (!batchFlag.equals(MesConstants.IS_BATCH)) { throw new ServiceException("此物料条码已经入库"); } - wmsRawStock.setTotalAmount(wmsRawStock.getTotalAmount().add(wmsRawInstockVo.getInstockAmount())); + newTotalAmount = wmsRawStock.getTotalAmount().add(wmsRawInstockVo.getInstockAmount()); + wmsRawStock.setTotalAmount(newTotalAmount); wmsRawStock.setUpdateBy(userName); wmsRawStock.setUpdateDate(currentDate); wmsRawStockMapper.updateWmsRawStock(wmsRawStock); @@ -258,7 +258,8 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { wmsRawStock.setWarehouseFloor(baseLocation.getWarehouseFloor()); // wmsRawStock.setLastOutstockTime(baseBarcodeInfo.getLastOutstockDate()); // wmsRawStock.setQualityStatus(wmsRawInstockVo.getQualityStatus()); - wmsRawStock.setTotalAmount(wmsRawInstockVo.getInstockAmount()); + newTotalAmount = wmsRawInstockVo.getInstockAmount(); + wmsRawStock.setTotalAmount(newTotalAmount); wmsRawStock.setSaleOrderId(baseBarcodeInfo.getSaleOrderId()); wmsRawStock.setSafeFlag(baseBarcodeInfo.getSafeFlag()); wmsRawStock.setInstockDate(baseBarcodeInfo.getAcceptedDate()); @@ -267,6 +268,8 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { wmsRawStock.setCreateDate(currentDate); wmsRawStockMapper.insertWmsRawStock(wmsRawStock); } + + return newTotalAmount; } @@ -386,12 +389,12 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService { } MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); if (baseBarcodeInfo == null) { - throw new ServiceException("物料条码有误"); + throw new ServiceException("物料条码有误!"); } - if (StringUtils.isEmpty(baseBarcodeInfo.getProductBarcode())) { - throw new ServiceException("此物料条码信息有误"); - } +// if (StringUtils.isEmpty(baseBarcodeInfo.getProductBarcode())) { +// throw new ServiceException("此物料条码信息有误"); +// } String wcsAgvContinueUrl = wmsConfig.getWcsAgvContinueUrl(); RestTemplate restTemplate = new RestTemplate(); 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 c2ad1ec..c93d27d 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 @@ -1199,7 +1199,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { */ @Transactional(rollbackFor = Exception.class) @Override - public int directRawOutstock(WmsRawOutstock wmsRawOutstock) { + public BigDecimal directRawOutstock(WmsRawOutstock wmsRawOutstock) { //出库要求 (0申请出库,1申请审核出库,2直接出库) String materialBarcode = wmsRawOutstock.getMaterialBarcode(); String locationCode = wmsRawOutstock.getLocationCode(); @@ -1237,13 +1237,12 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { this.insertRawOutstockDetail(wmsRawOutstock, locationCode, materialBarcode, batchCode, userName, currentDate); - directOutstockUpdateRawStock(locationCode, materialBarcode, outstockAmount, userName, currentDate); + return directOutstockUpdateRawStock(locationCode, materialBarcode, outstockAmount, userName, currentDate); - return 1; } - public void directOutstockUpdateRawStock(String locationCode, String materialBarcode, BigDecimal outstockAmount, + public BigDecimal directOutstockUpdateRawStock(String locationCode, String materialBarcode, BigDecimal outstockAmount, String userName, Date currentDate) { WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(materialBarcode); if (wmsRawStock == null) { @@ -1266,6 +1265,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService { wmsRawStockMapper.updateWmsRawStock(wmsRawStock); } + return updatedTotalAmount; } } diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java index c808d8d..9dde376 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsStockTotalServiceImpl.java @@ -154,6 +154,7 @@ public class WmsStockTotalServiceImpl implements IWmsStockTotalService { String materialClassfication = wmsStockTotal.getMaterialClassfication(); Long warehouseId = wmsStockTotal.getWarehouseId(); + //五楼原料周转区仓库ID if (warehouseId.equals(wmsConfig.getFifthCabinetWarehouseId()) && materialClassfication.equals(MesConstants.MES_MATERIAL_CLASSFICATION_VIRTUAL)) { wmsStockTotal.setMaterialId(wmsStockTotal.getProductId()); wmsStockTotal.setAccessoriesFlag(null); diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsTransferServiceImpl.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsTransferServiceImpl.java index 8285598..cb9501e 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsTransferServiceImpl.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/service/impl/WmsTransferServiceImpl.java @@ -425,5 +425,19 @@ public class WmsTransferServiceImpl implements IWmsTransferService { } + /** + * 校验半成品是否已经出库 + * + * @param wmsTransfer 转库记录 + * @return 转库记录 + */ + @Override + public int checkSemiOutstock(WmsTransfer wmsTransfer) { + List wmsTransfers = wmsTransferMapper.selectWmsTransferList(wmsTransfer); + if(wmsTransfers==null || wmsTransfers.isEmpty()){ + throw new ServiceException("此物料还未从半成品库出库,不能生成成品条码"); + } + return 1; + } } diff --git a/hw-ui/src/api/board/barcode.js b/hw-ui/src/api/board/barcode.js index 41ed3d7..dcdee00 100644 --- a/hw-ui/src/api/board/barcode.js +++ b/hw-ui/src/api/board/barcode.js @@ -64,3 +64,12 @@ export function addInternalBarcode(data) { data: data }) } + +//根据原材料条码判断是否有半成品出库 +export function checkSemiOutstock(query) { + return request({ + url: '/wms/api/checkSemiOutstock', + method: 'get', + params: query + }) +} diff --git a/hw-ui/src/api/mes/materialBom.js b/hw-ui/src/api/mes/materialBom.js index 4ce5261..51c7f61 100644 --- a/hw-ui/src/api/mes/materialBom.js +++ b/hw-ui/src/api/mes/materialBom.js @@ -50,3 +50,18 @@ export function delMaterialBom(materialBomId) { method: 'delete' }) } + + + +// bom状态修改 +export function changeBomStatus(materialBomId, activeFlag) { + const data = { + materialBomId, + activeFlag + } + return request({ + url: '/mes/materialBom', + method: 'put', + data: data + }) +} diff --git a/hw-ui/src/views/board/barcode/workshopBarcode.vue b/hw-ui/src/views/board/barcode/workshopBarcode.vue index dc32dc5..c549547 100644 --- a/hw-ui/src/views/board/barcode/workshopBarcode.vue +++ b/hw-ui/src/views/board/barcode/workshopBarcode.vue @@ -95,7 +95,7 @@ >配对码 - 重新生成 - +      - + - - - - - - - - - + + + + + + + + + - - - + + + { if (valid) { this.submitLoading = true; - if(this.defineData.barcodeType && this.defineData.barcodeType == this.BARCODE_TYPE_PARAM.SPLIT_BIND_BARCODE){ - this.form.barcodeAmount = 1; + if (this.defineData.barcodeType && this.defineData.barcodeType === this.BARCODE_TYPE_PARAM.PRODUCT) { + + checkSemiOutstock({productBatch: this.form.productBarcode}).then(e => { + this.addProductBarcode(); + }).finally(e => { + this.submitLoading = false; + }); + } else { + if (this.defineData.barcodeType && this.defineData.barcodeType === this.BARCODE_TYPE_PARAM.SPLIT_BIND_BARCODE) { + this.form.barcodeAmount = 1; + } + this.addProductBarcode(); } - addProductBarcode(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.addProductBarcodeOpen = false; - this.getList(); - }).finally(e => { - this.submitLoading = false; - }); } }); }, + addProductBarcode() { + addProductBarcode(this.form).then(response => { + this.$modal.msgSuccess("新增成功"); + this.addProductBarcodeOpen = false; + this.getList(); + }).finally(e => { + this.submitLoading = false; + }); + }, + // 表单重置 resetInternal() { this.internalForm = { @@ -871,8 +888,6 @@ export default { }, - - } }; diff --git a/hw-ui/src/views/board/fourthFloor/laserLight.vue b/hw-ui/src/views/board/fourthFloor/laserLight.vue index 80e8d6f..ef3fd56 100644 --- a/hw-ui/src/views/board/fourthFloor/laserLight.vue +++ b/hw-ui/src/views/board/fourthFloor/laserLight.vue @@ -1078,7 +1078,7 @@ export default { this.submitLoading = true; if (this.stockType === this.STOCK_TYPE.INSTOCK) {//入库 addRawInstock(this.wmsForm).then(response => { - this.$modal.msgSuccess("板材入库成功"); + this.$modal.msgSuccess("板材入库成功,当前库存为:"+response.data); this.cancel(); }).finally(e => { this.submitLoading = false; @@ -1158,16 +1158,12 @@ export default { } }); - - - - - + }, directRawOutstock() { directRawOutstock(this.wmsForm).then(response => { - this.$modal.msgSuccess("板材领取成功"); + this.$modal.msgSuccess("板材领取成功,当前库存:"+response.data); this.cancel(); }).finally(e => { this.submitLoading = false; diff --git a/hw-ui/src/views/mes/materialBom/index.vue b/hw-ui/src/views/mes/materialBom/index.vue index 476a8ea..ba6854c 100644 --- a/hw-ui/src/views/mes/materialBom/index.vue +++ b/hw-ui/src/views/mes/materialBom/index.vue @@ -84,16 +84,6 @@ >展开/折叠 - - BOM导入 - - @@ -135,6 +125,17 @@ + + + +