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