diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java index 145b8157..9a7b387f 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrder.java @@ -132,6 +132,17 @@ public class ProOrder extends TreeEntity { @Excel(name = "更新日期", width = 20, dateFormat = "yyyy-MM-dd") private Date updateTime; + // 车数 + private Integer carNum; + + public Integer getCarNum() { + return carNum; + } + + public void setCarNum(Integer carNum) { + this.carNum = carNum; + } + @Override public Date getCreateTime() { return createTime; @@ -324,6 +335,7 @@ public class ProOrder extends TreeEntity { .append("prodSpc", getProdSpc()) .append("planDateStart",getPlanDateStart()) .append("planDateEnd",getPlanDateEnd()) + .append("carNum",getCarNum()) .toString(); } } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java index 39756518..f3f03736 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProOrderWorkorder.java @@ -148,6 +148,17 @@ public class ProOrderWorkorder extends TreeEntity { /** 班次名称(数据库无该字段,需自行查询) */ private String shiftDesc; + // 车数 + private Integer carNum; + + public Integer getCarNum() { + return carNum; + } + + public void setCarNum(Integer carNum) { + this.carNum = carNum; + } + // 料罐id(湿料计划模块使用) private Integer bucketId; @@ -512,6 +523,7 @@ public class ProOrderWorkorder extends TreeEntity { .append("bucketName",getBucketName()) .append("routeName",getRouteName()) .append("prodLineName",getProdLineName()) + .append("carNum",getCarNum()) .toString(); } } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/dto/ProOrderDTO.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/dto/ProOrderDTO.java index c85166b5..a2632e3e 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/dto/ProOrderDTO.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/dto/ProOrderDTO.java @@ -63,6 +63,16 @@ public class ProOrderDTO { private String planFactoryCode; + private Integer carNum; + + public Integer getCarNum() { + return carNum; + } + + public void setCarNum(Integer carNum) { + this.carNum = carNum; + } + public String getPlanFactoryCode() { return planFactoryCode; } 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 bc9b61fa..e6460f26 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 @@ -154,6 +154,12 @@ public class ProOrderServiceImpl implements IProOrderService { workOrder.setWorkorderCode(proOrder.getOrderCode() + "-" + endCode); // 3.设置父工单 workOrder.setParentOrder(parentOrder.toString()); + // 工单对应车数-白坯订单操作 + if (proOrder.getProdType().equals("white")) { + int everyNum = (int) Math.ceil(proOrder.getQuantity() / proOrder.getCarNum()); + int carNum = (int) Math.ceil(splitOrderDTO.getSplitNum() / everyNum); + workOrder.setCarNum(carNum); + } // 将工单信息更新至数据库 proOrderWorkorderMapper.insertProOrderWorkorder(workOrder); // 生成批次表信息并更新至数据库 diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java index 293ce3f1..7ed4ab9c 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderWorkorderServiceImpl.java @@ -525,6 +525,13 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { if (splitOrderDTO.getRouteCode() != null){ proOrderWorkorder.setRouteCode(splitOrderDTO.getRouteCode()); } + // 白坯工单返修-车数 + if (proOrderWorkorder.getProdType().equals("white")) { + int everyNum = (int) Math.ceil(proOrder.getQuantity() / proOrder.getCarNum()); + int carNum = (int) Math.ceil(splitOrderDTO.getSplitNum() / everyNum); + proOrderWorkorder.setCarNum(carNum); + } + proOrderWorkorderMapper.updateProOrderWorkorder(proOrderWorkorder); // System.out.println("这里是workorderCode------------》"+proOrderWorkorder.getWorkorderCode()); 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 181039a5..b9ced4b7 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 @@ -29,13 +29,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + select id, plan_factory_code, order_type, order_code, prod_code, prod_desc, quantity, quantity_split, unit, worker_order, plan_pro_date, plan_complete, atrr1, atrr2, atrr3, status, parent_order, create_by, create_time, update_by, update_time, prod_type, - factory_code, prod_spc + factory_code, prod_spc ,car_num from pro_order @@ -197,6 +198,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time, prod_type, prod_spc, + car_num, #{id}, @@ -223,6 +225,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateTime}, #{prodType}, #{prodSpc}, + #{carNum}, diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml index 2f52d1a4..645f97de 100644 --- a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderMapper.xml @@ -36,13 +36,14 @@ + select workorder_id, workorder_code, workorder_name, order_id, order_code, product_id, product_code, product_name, product_spc, unit, quantity_produced, quantity_split, route_code, prod_line_code, product_date, shift_id, parent_order, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, - update_by, update_time, prod_type, factory_code , end_flag + update_by, update_time, prod_type, factory_code , end_flag , car_num from pro_order_workorder @@ -184,6 +185,7 @@ prod_type, factory_code, end_flag, + car_num, #{workorderId}, @@ -217,6 +219,7 @@ #{prodType}, #{factoryCode}, #{endFlag}, + #{carNum}, @@ -368,6 +371,7 @@ prod_type = #{prodType}, factory_code = #{factoryCode}, end_flag = #{endFlag}, + car_num = #{carNum}, where workorder_id = #{workorderId}