From 3bff62705312d129c107b8b03b88085aa80055d8 Mon Sep 17 00:00:00 2001 From: xs Date: Mon, 21 Oct 2024 13:21:37 +0800 Subject: [PATCH] =?UTF-8?q?3.2.9=20mes:=20=E9=87=87=E8=B4=AD=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=BB=91=E5=AE=9A=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=EF=BC=8C=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/MesPurchaseOrderServiceImpl.java | 28 +++++++++++-------- .../views/mes/saleOrder/bindingPurchase.vue | 4 +-- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java index cc55c8a..cd484a8 100644 --- a/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java +++ b/hw-modules/hw-mes/src/main/java/com/hw/mes/service/impl/MesPurchaseOrderServiceImpl.java @@ -250,11 +250,12 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService { if (mesSaleOrderRelatesBySale != null && !mesSaleOrderRelatesBySale.isEmpty()) { throw new ServiceException("选择的销售订单已经合并过,不能绑定"); } - } + }else{ + if (orderBind.getSaleOrderId() != null) { + throw new ServiceException("安全库存标识为是的不需要选择销售订单"); + } - if (orderBind.getSafeFlag().equals(MesConstants.MES_ORDER_BIND_SAFE_FLAG_YES) - && orderBind.getSaleOrderId() != null) { - throw new ServiceException("安全库存标识为是的不需要选择销售订单"); + orderBind.setSaleOrderId(0L); } BigDecimal bindAmount = orderBind.getBindAmount() == null ? @@ -348,15 +349,15 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService { MesPurchaseOrder dbMesPurchaseOrder = mesPurchaseOrderMapper. unbindPurchaseOrderListByPurchaseAndSaleOrderId(purchaseOrderId, mesSaleOrder.getSaleOrderId()); if (!mesPurchaseOrder.equals(dbMesPurchaseOrder)) { - throw new ServiceException("数据有变化,请重新更新"); + throw new ServiceException("序号: " + mesPurchaseOrder.getSerialNumber() +",数据有变化,请重新更新"); } if (dbMesPurchaseOrder.getOrderStatus().equals(MesConstants.MES_PURCHASE_ORDER_STATUS_PURCHASE_COMPLETE)) { - throw new ServiceException("此采购订单已经采购完成,无需再绑定"); + throw new ServiceException("序号: " + mesPurchaseOrder.getSerialNumber() +",此采购订单已经采购完成,无需再绑定"); } if (dbMesPurchaseOrder.getOrderStatus().equals(MesConstants.MES_PURCHASE_ORDER_STATUS_AUTO_OUTSTOCK_COMPLETE)) { - throw new ServiceException("此采购订单已经自动出库完成,无需再绑定"); + throw new ServiceException("序号: " + mesPurchaseOrder.getSerialNumber() +",此采购订单已经自动出库完成,无需再绑定"); } @@ -426,10 +427,15 @@ public class MesPurchaseOrderServiceImpl implements IMesPurchaseOrderService { mesOrderBindMapper.insertMesOrderBind(orderBind); } else { MesOrderBind bind = bindList.get(0); - bind.setBindAmount(purchaseOrder.getUpdateAmount()); - bind.setUpdateBy(SecurityUtils.getUsername()); - bind.setUpdateTime(DateUtils.getNowDate()); - mesOrderBindMapper.updateMesOrderBind(bind); + if(purchaseOrder.getUpdateAmount().compareTo(BigDecimal.ZERO)>0){ + bind.setBindAmount(purchaseOrder.getUpdateAmount()); + bind.setUpdateBy(SecurityUtils.getUsername()); + bind.setUpdateTime(DateUtils.getNowDate()); + mesOrderBindMapper.updateMesOrderBind(bind); + }else{ + mesOrderBindMapper.deleteMesOrderBindByOrderBindId(bind.getOrderBindId()); + } + } } diff --git a/hw-ui/src/views/mes/saleOrder/bindingPurchase.vue b/hw-ui/src/views/mes/saleOrder/bindingPurchase.vue index bb5dc99..afb9f89 100644 --- a/hw-ui/src/views/mes/saleOrder/bindingPurchase.vue +++ b/hw-ui/src/views/mes/saleOrder/bindingPurchase.vue @@ -423,9 +423,9 @@ export default { const updateAmount = obj.updateAmount ? parseInt(obj.updateAmount) : 0;//更新绑定数 - if (!this.isPositiveInteger(updateAmount) || updateAmount <= 0) { + if (!this.isPositiveInteger(updateAmount) || updateAmount < 0) { this.submitLoading = false; - this.$modal.msgError("序号为" + (obj.serialNumber) + ",绑定数量须为大于0的正整数!"); + this.$modal.msgError("序号为" + (obj.serialNumber) + ",绑定数量须为大于等于0!"); return; }