From 3466e0602e9f653c599e286ee0fb66afbedb7dd7 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Thu, 14 Sep 2023 12:52:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BD=E5=9D=AF=E8=AE=A2=E5=8D=95=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/op/plan/domain/dto/SplitOrderDTO.java | 9 +++++++++ .../java/com/op/plan/mapper/ProOrderMapper.java | 6 ++++++ .../op/plan/service/impl/ProOrderServiceImpl.java | 6 ++++-- .../service/impl/ProWhiteOrderServiceImpl.java | 1 + .../main/resources/mapper/plan/ProOrderMapper.xml | 14 +++++++++++++- 5 files changed, 33 insertions(+), 3 deletions(-) diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/dto/SplitOrderDTO.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/dto/SplitOrderDTO.java index d77d3cd7..d9d128d8 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/dto/SplitOrderDTO.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/dto/SplitOrderDTO.java @@ -25,6 +25,15 @@ public class SplitOrderDTO { private String routeCode; private ProOrderWorkorder proOrderWorkorder; + private Integer carNum; + + public Integer getCarNum() { + return carNum; + } + + public void setCarNum(Integer carNum) { + this.carNum = carNum; + } public ProOrderWorkorder getProOrderWorkorder() { return proOrderWorkorder; diff --git a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderMapper.java b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderMapper.java index 0de48209..a3fc22fb 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderMapper.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderMapper.java @@ -199,4 +199,10 @@ public interface ProOrderMapper { * @param orderCode */ void updateOrderStatusByOrderCode(String orderCode); + + /** + * 更新白坯子订单 + * @param proOrder + */ + void updateWhiteOrder(ProOrder proOrder); } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java index 1ced87ef..a78935fa 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java @@ -160,12 +160,13 @@ public class ProOrderServiceImpl implements IProOrderService { proOrder.setUpdateTime(DateUtils.getNowDate()); proOrder.setUpdateBy(SecurityContextHolder.getUserName()); proOrder.setQuantitySplit(splitOrderDTO.getSplitNum()); - proOrder.setQuantity(splitOrderDTO.getSplitNum()); + proOrder.setQuantity(proOrder.getQuantitySplit()); proOrder.setStatus("o1"); + proOrder.setCarNum(proOrder.getCarNum()+splitOrderDTO.getCarNum()); if (flag) { proOrder.setStatus("o2"); } - proOrderMapper.updateOrder(proOrder); + proOrderMapper.updateWhiteOrder(proOrder); // 设置工单通用属性 ProOrderWorkorder proOrderWorkorder = setCommonWorkAttribute(proOrder, splitOrderDTO.getProductDate(), splitOrderDTO.getProdLineCode(), splitOrderDTO.getShiftId(), splitOrderDTO.getRouteCode()); @@ -183,6 +184,7 @@ public class ProOrderServiceImpl implements IProOrderService { proOrderWorkorder.setProdType(proOrder.getProdType()); proOrderWorkorder.setParentOrder("0"); proOrderWorkorder.setEndFlag(1); + proOrderWorkorder.setCarNum(splitOrderDTO.getCarNum()); // 插入工单 proOrderWorkorderMapper.insertProOrderWorkorder(proOrderWorkorder); diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java index 04c4757d..5b38d2a9 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProWhiteOrderServiceImpl.java @@ -148,6 +148,7 @@ public class ProWhiteOrderServiceImpl implements IProWhiteOrderService { childProOrder.setStatus("o0"); childProOrder.setOrderType(proOrder.getProdType()); childProOrder.setOrderCode(orderCode+num++); + childProOrder.setCarNum(0); childProOrder.setCreateBy(SecurityContextHolder.getUserName()); childProOrder.setCreateTime(DateUtils.getNowDate()); childProOrder.setUpdateBy(SecurityContextHolder.getUserName()); diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderMapper.xml index c26036e8..12abbe90 100644 --- a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderMapper.xml +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderMapper.xml @@ -319,7 +319,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update pro_order set status = 'o1' where parent_order = #{orderCode} - + + update pro_order + + quantity += #{quantity}, + quantity_split += #{quantitySplit}, + update_by = #{updateBy}, + update_time = #{updateTime}, + status = #{status}, + + where id = #{id} + + + delete from pro_order where id = #{id}