From 6c41a9d11f33b0616b3a8a3aab204a9f4b6cd014 Mon Sep 17 00:00:00 2001 From: xs Date: Thu, 24 Oct 2024 19:12:10 +0800 Subject: [PATCH] =?UTF-8?q?3.3.4=20MES=20=E5=8E=9F=E6=9D=90=E6=96=99?= =?UTF-8?q?=E6=9D=A1=E7=A0=81=EF=BC=9A=E5=90=88=E5=B9=B6=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=96=B0=E5=A2=9E=E5=92=8C=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MesBaseBarcodeInfoServiceImpl.java | 31 ++++++++++++++++--- .../impl/MesProductOrderServiceImpl.java | 2 +- .../mapper/mes/MesSaleOrderRelateMapper.xml | 2 +- hw-ui/src/views/mes/barcode/index.vue | 3 +- .../views/mes/saleOrder/bindingPurchase.vue | 4 +-- hw-ui/src/views/system/menu/index.vue | 1 + 6 files changed, 33 insertions(+), 10 deletions(-) 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 f8c5a12..56e65ab 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 @@ -7,6 +7,7 @@ import com.hw.common.core.domain.R; import com.hw.common.core.exception.ServiceException; import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.StringUtils; +import com.hw.common.core.utils.ip.IpUtils; import com.hw.common.core.utils.uuid.Seq; import com.hw.common.security.utils.SecurityUtils; import com.hw.mes.api.domain.*; @@ -663,7 +664,9 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService try { - redisTemplate.opsForList().rightPush("print_10.10.3.119", printContentJson.toString()); + String hostIp = IpUtils.getIpAddr(); + String printKey = "print_" + hostIp; + redisTemplate.opsForList().rightPush(printKey, printContentJson.toString()); // redisTemplate.convertAndSend("print_10.10.3.119", printContentJson.toString()); } catch (Exception e) { throw new ServiceException("打印失败:" + e.getMessage()); @@ -1383,7 +1386,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService Long materialId = this.insertNewVirtualMaterial(barcodeInfo, userName, currentDate); //创建虚拟销售订单,保存对应的销售订单列表 - MesSaleOrder virtualSaleOrder = this.insertNewVirtualSaleOrder(materialId, barcodeInfo, mesSaleOrderRelateList, userName, currentDate); + MesSaleOrder virtualSaleOrder = this.insertNewVirtualSaleOrder(materialId, barcodeInfo, mesBaseBarcodeInfo.getSaleorderCode(), mesSaleOrderRelateList, userName, currentDate); //创建虚拟bom,并合并销售订单的bom信息 this.insertVirtualMaterialBom(materialId, barcodeInfo, toUpdatedMaterialBoms, userName, currentDate); @@ -1397,7 +1400,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService toInsertedBarcodeInfo.setPurchaseOrderId(-1L); toInsertedBarcodeInfo.setMaterialId(materialId); toInsertedBarcodeInfo.setSaleOrderId(virtualSaleOrder.getSaleOrderId()); - toInsertedBarcodeInfo.setSaleorderCode(virtualSaleOrder.getSaleorderCode()); + toInsertedBarcodeInfo.setSaleorderCode(mesBaseBarcodeInfo.getSaleorderCode()); toInsertedBarcodeInfo.setSafeFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO); toInsertedBarcodeInfo.setSingleFlag(MesConstants.MES_BARCODE_SINGLE_FLAG_MERGE); // toInsertedBarcodeInfo.setBarcodeSpec(materialCodes.toString()); @@ -1439,7 +1442,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService } - public MesSaleOrder insertNewVirtualSaleOrder(Long materialId, String barcodeInfo, + public MesSaleOrder insertNewVirtualSaleOrder(Long materialId, String barcodeInfo, String saleOrderCode, List mesSaleOrderRelates, String userName, Date currentDate) { @@ -1453,7 +1456,7 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService mesSaleOrder.setMaterialCode(barcodeInfo); mesSaleOrder.setMaterialName(barcodeInfo); mesSaleOrder.setOrderAmount(BigDecimal.ONE); - mesSaleOrder.setSaleorderCode(Seq.getId(Seq.mesVirtualSaleOrderSeqType, Seq.mesVirtualSaleOrderCode)); + mesSaleOrder.setSaleorderCode(saleOrderCode); mesSaleOrder.setIsRelease(MesConstants.MES_SALE_ORDER_IS_RELEASE_TO_PUBLISH); // mesSaleOrder.setPlanDeliveryDate(); mesSaleOrder.setSaleOrderClassfication(MesConstants.MES_SALE_ORDER_CLASSFICATION_VIRTUAL); @@ -1623,6 +1626,24 @@ public class MesBaseBarcodeInfoServiceImpl implements IMesBaseBarcodeInfoService throw new ServiceException(errorMsgBuilder.toString()); } + // 判断是否要更新虚拟订单的销售订单号 + if (dbMesSaleOrderRelateList != null && !dbMesSaleOrderRelateList.isEmpty() + && mesSaleOrderRelateList != null && !mesSaleOrderRelateList.isEmpty()) { + MesSaleOrderRelate toDeletedMesSaleOrderRelate = dbMesSaleOrderRelateList.get(0); + String oldSaleOrderCode = toDeletedMesSaleOrderRelate.getRelateSaleOrderCode(); + + MesSaleOrderRelate toInsertedMesSaleOrder = mesSaleOrderRelateList.get(0); + String newSaleOrderCode = toInsertedMesSaleOrder.getRelateSaleOrderCode(); + + if (!oldSaleOrderCode.equals(newSaleOrderCode)) { + MesSaleOrder virtualSaleOrder = mesSaleOrderMapper.selectMesSaleOrderBySaleOrderId(toDeletedMesSaleOrderRelate.getSaleOrderId()); + virtualSaleOrder.setSaleorderCode(newSaleOrderCode); + virtualSaleOrder.setUpdateTime(currentDate); + virtualSaleOrder.setUpdateBy(userName); + mesSaleOrderMapper.updateMesSaleOrder(virtualSaleOrder); + } + } + //生成条码 mesBaseBarcodeInfo.setUpdateBy(userName); 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 81f79fb..493c64e 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 @@ -372,7 +372,7 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { productOrder.setProductOrderId(mesProductOrder.getProductOrderId()); productOrder.setOrderStatus(MesConstants.PUBLISHED); productOrder.setReleaseTime(DateUtils.getNowDate()); - return this.updateMesProductOrder(productOrder); + return mesProductOrderMapper.updateMesProductOrder(productOrder); } /** diff --git a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderRelateMapper.xml b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderRelateMapper.xml index d66abe0..6fafcde 100644 --- a/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderRelateMapper.xml +++ b/hw-modules/hw-mes/src/main/resources/mapper/mes/MesSaleOrderRelateMapper.xml @@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select sale_order_relate_id, sale_order_id,barcode_info, order_bind_id,relate_sale_order_id,material_id, relate_sale_order_amount from mes_sale_order_relate + select sale_order_relate_id, sale_order_id,barcode_info, order_bind_id,relate_sale_order_id,relate_sale_order_code,material_id, relate_sale_order_amount from mes_sale_order_relate