From bf6f2b2359a69a0610ec2598f3ba4dd4f9ac9b10 Mon Sep 17 00:00:00 2001 From: xs Date: Fri, 18 Oct 2024 18:37:13 +0800 Subject: [PATCH] =?UTF-8?q?3.2.6=20=E8=BD=A6=E9=97=B4=E7=94=9F=E4=BA=A7:?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E4=B8=80=E6=A5=BC=E5=8C=85=E8=A3=85?= =?UTF-8?q?=E5=88=B6=E4=BD=9C=E5=B7=A5=E5=BA=8F=E5=92=8C=E5=8C=85=E8=A3=85?= =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E7=9A=84=E7=99=BB=E5=BD=95=E5=92=8C=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=80=BB=E8=BE=91=20MES=EF=BC=9A=20=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=8C=85=E8=A3=85?= =?UTF-8?q?=E5=B7=A5=E5=BA=8F=E7=9A=84=E7=94=9F=E4=BA=A7=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=92=8C=E6=B4=BE=E5=B7=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hw/common/core/constant/MesConstants.java | 1 + .../impl/MesProductOrderServiceImpl.java | 42 +++++++++++-------- hw-ui/src/views/board/firstFloor/index.vue | 21 ++++------ hw-ui/src/views/login.vue | 10 +++++ hw-ui/src/views/mes/productOrder/index.vue | 14 ++++--- 5 files changed, 53 insertions(+), 35 deletions(-) diff --git a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java index 0e5a961..410e162 100644 --- a/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java +++ b/hw-common/hw-common-core/src/main/java/com/hw/common/core/constant/MesConstants.java @@ -172,6 +172,7 @@ public class MesConstants { public static final String MES_PRODUCT_ORDER_SALE = "1";//外部销售 public static final String MES_PRODUCT_ORDER_INTERNAL = "2";//对内生产 + public static final String MES_PRODUCT_ORDER_PACKING= "3";//包装 /** * 物料信息常备物料标识,是否需要采购订单明细绑定销售订单 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 4f9ac68..5fa4276 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,27 +94,35 @@ public class MesProductOrderServiceImpl implements IMesProductOrderService { // if(mesProductOrder.getPreOrderId()!=null){ // checkPreTime(mesProductOrder); // } - - - //校验同一工艺路线时间重叠 - checkSameProcessTimeClash(mesProductOrder); - //销售订单添加工单:校验是否超出销售数量 - if (mesProductOrder.getSaleOrderFlag().equals("1") && StringUtils.isNotNull(mesProductOrder.getSaleOrderId())) { - checkSalesQuantity(mesProductOrder); - } else { - mesProductOrder.setSaleAmount(mesProductOrder.getPlanAmount()); - } - if (mesProductOrder.getSaleOrderId() == null) { + if(mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_PACKING)){ + mesProductOrder.setDispatchId(5L);//包装工艺路线ID mesProductOrder.setSaleOrderId(0L); - } - if (mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_SALE)) { - mesProductOrder.setProduceMaterialId(null); - } else { - if (mesProductOrder.getProduceMaterialId() == null) { - throw new ServiceException("请选择生产物料"); + mesProductOrder.setSaleOrderFlag(MesConstants.MES_ORDER_BIND_SAFE_FLAG_NO); + mesProductOrder.setMaterialId(0L); + mesProductOrder.setMaterialBomId(0L); + mesProductOrder.setSaleAmount(mesProductOrder.getPlanAmount()); + }else{ + //校验同一工艺路线时间重叠 + checkSameProcessTimeClash(mesProductOrder); + //销售订单添加工单:校验是否超出销售数量 + if (mesProductOrder.getSaleOrderFlag().equals("1") && StringUtils.isNotNull(mesProductOrder.getSaleOrderId())) { + checkSalesQuantity(mesProductOrder); + } else { + mesProductOrder.setSaleAmount(mesProductOrder.getPlanAmount()); + } + if (mesProductOrder.getSaleOrderId() == null) { + mesProductOrder.setSaleOrderId(0L); + } + if (mesProductOrder.getSaleType().equals(MesConstants.MES_PRODUCT_ORDER_SALE)) { + mesProductOrder.setProduceMaterialId(null); + } else { + if (mesProductOrder.getProduceMaterialId() == null) { + throw new ServiceException("请选择生产物料"); + } } } + return mesProductOrderMapper.insertMesProductOrder(mesProductOrder); } diff --git a/hw-ui/src/views/board/firstFloor/index.vue b/hw-ui/src/views/board/firstFloor/index.vue index 2cd4f18..871b5df 100644 --- a/hw-ui/src/views/board/firstFloor/index.vue +++ b/hw-ui/src/views/board/firstFloor/index.vue @@ -212,7 +212,6 @@