From 0785b6b95ba8bf8db1d67a1d585bf1d255d6df11 Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Thu, 27 Jun 2024 22:55:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=85=E5=8A=A9=E6=8E=92=E4=BA=A71.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/controller/ProOrderController.java | 15 + .../main/java/com/op/plan/domain/ProLine.java | 18 + .../com/op/plan/domain/dto/ProOrderDTO.java | 121 ++++++ .../com/op/plan/mapper/ProOrderMapper.java | 12 + .../mapper/ProOrderWorkorderBatchMapper.java | 2 + .../plan/mapper/ProOrderWorkorderMapper.java | 11 +- .../com/op/plan/service/IProOrderService.java | 6 + .../service/impl/ProOrderServiceImpl.java | 363 +++++++++++++----- .../resources/mapper/plan/ProOrderMapper.xml | 43 ++- .../plan/ProOrderWorkorderBatchMapper.xml | 12 + .../mapper/plan/ProOrderWorkorderMapper.xml | 33 +- 11 files changed, 529 insertions(+), 107 deletions(-) diff --git a/op-modules/op-plan/src/main/java/com/op/plan/controller/ProOrderController.java b/op-modules/op-plan/src/main/java/com/op/plan/controller/ProOrderController.java index 802ab0a0..f035cb6c 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/controller/ProOrderController.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/controller/ProOrderController.java @@ -133,6 +133,10 @@ public class ProOrderController extends BaseController { return proOrderService.getWorkOrderList(id); } + @GetMapping(value = "/getWorkOrderListCG/{id}") + public AjaxResult getWorkOrderListCG(@PathVariable("id") String id) { + return proOrderService.getWorkOrderListCG(id); + } /** * 获取当前订单信息列表 @@ -341,4 +345,15 @@ public class ProOrderController extends BaseController { return proOrderService.autoSplitOrder(proOrder); } + /**辅助排产取消**/ + @PostMapping("/autoSplitOrderCancel") + public R autoSplitOrderCancel(@RequestBody ProOrder proOrder) { + return proOrderService.autoSplitOrderCancel(proOrder); + } + + /**辅助排产提交**/ + @PostMapping("/autoSplitOrderOk") + public R autoSplitOrderOk(@RequestBody ProOrder proOrder) { + return proOrderService.autoSplitOrderOk(proOrder); + } } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProLine.java b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProLine.java index 7fc9202e..320b8aef 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/domain/ProLine.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/domain/ProLine.java @@ -6,6 +6,24 @@ public class ProLine { private String label; private String lineCode; private String lineName; + private Long efficiency; + private String dh; + + public Long getEfficiency() { + return efficiency; + } + + public void setEfficiency(Long efficiency) { + this.efficiency = efficiency; + } + + public String getDh() { + return dh; + } + + public void setDh(String dh) { + this.dh = dh; + } public String getLineCode() { return lineCode; 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 0c375cd2..24b42fb5 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 @@ -1,5 +1,8 @@ package com.op.plan.domain.dto; +import com.op.plan.domain.ProOrder; + +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -105,6 +108,124 @@ public class ProOrderDTO { private Integer sortNo; + private String bomBo; + private String syncUser; + private String productDate; + private String lineCode; + private String lineName; + private List lineList; + private List recommendLineList;//推荐线体 + private Integer useMan; + private BigDecimal efficiency; + private String[] lineCodes; + private String routeCode; + private Integer endFlag; + private String belongWorkOrder; + + public String getBomBo() { + return bomBo; + } + + public void setBomBo(String bomBo) { + this.bomBo = bomBo; + } + + public String getSyncUser() { + return syncUser; + } + + public void setSyncUser(String syncUser) { + this.syncUser = syncUser; + } + + public String getProductDate() { + return productDate; + } + + public void setProductDate(String productDate) { + this.productDate = productDate; + } + + public String getLineCode() { + return lineCode; + } + + public void setLineCode(String lineCode) { + this.lineCode = lineCode; + } + + public String getLineName() { + return lineName; + } + + public void setLineName(String lineName) { + this.lineName = lineName; + } + + public List getLineList() { + return lineList; + } + + public void setLineList(List lineList) { + this.lineList = lineList; + } + + public List getRecommendLineList() { + return recommendLineList; + } + + public void setRecommendLineList(List recommendLineList) { + this.recommendLineList = recommendLineList; + } + + public Integer getUseMan() { + return useMan; + } + + public void setUseMan(Integer useMan) { + this.useMan = useMan; + } + + public BigDecimal getEfficiency() { + return efficiency; + } + + public void setEfficiency(BigDecimal efficiency) { + this.efficiency = efficiency; + } + + public String[] getLineCodes() { + return lineCodes; + } + + public void setLineCodes(String[] lineCodes) { + this.lineCodes = lineCodes; + } + + public String getRouteCode() { + return routeCode; + } + + public void setRouteCode(String routeCode) { + this.routeCode = routeCode; + } + + public Integer getEndFlag() { + return endFlag; + } + + public void setEndFlag(Integer endFlag) { + this.endFlag = endFlag; + } + + public String getBelongWorkOrder() { + return belongWorkOrder; + } + + public void setBelongWorkOrder(String belongWorkOrder) { + this.belongWorkOrder = belongWorkOrder; + } + public Integer getCarNum() { return carNum; } 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 4c18bea4..a326aef0 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 @@ -240,4 +240,16 @@ public interface ProOrderMapper { List getCanProductLine(); List getSelectLineLevel1(ProOrder proOrder); + + List selectBatchCodesByIdCG(String workorderId); + + int deleteAutoSplitWork(String orderCode); + + int deleteAutoSplitWorkBatch(String orderCode); + + int updateAutoSplitWorkBatch(String orderCode); + + int updateAutoSplitWork(String orderCode); + + int updateAutoSplitOrder(String orderCode); } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderBatchMapper.java b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderBatchMapper.java index a7d4e35e..3cc78210 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderBatchMapper.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderBatchMapper.java @@ -89,4 +89,6 @@ public interface ProOrderWorkorderBatchMapper { List checkBatchCodeByWorkOrderIds(@Param("workorderIds")String[] workorderIds,@Param("newbatchs") List newbatchs); List getProdLineList(); + + int insertWorkorderBatchs(@Param("list") List workBatchs); } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java index daf7cfa4..a12d16ed 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/mapper/ProOrderWorkorderMapper.java @@ -9,6 +9,7 @@ import com.op.system.api.domain.dto.MesPrepareDetailDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -217,10 +218,18 @@ public interface ProOrderWorkorderMapper { int updateCheckTaskBatch(CheckTaskBatchDTO checkTaskBatchDTO); - Long getLineProductInfo(ProOrder proOrder); + ProLine getLineProductInfo(ProOrder proOrder); String getProcessCode(String routeCode); int insertWorkorders(@Param("list") List workorders); + + BaseProduct getProductInfo(ProOrder proOrder); + + BigDecimal getQuaRatio(String productCode); + + List selectFirWorkOrderCG(String id); + + List selectChildWorkOrderCG(String workorderCode); } diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/IProOrderService.java b/op-modules/op-plan/src/main/java/com/op/plan/service/IProOrderService.java index ee548b89..7debc0a6 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/IProOrderService.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/IProOrderService.java @@ -149,4 +149,10 @@ public interface IProOrderService { ProOrder getCanProductLine(ProOrder proOrder); R autoSplitOrder(ProOrder proOrder); + + AjaxResult getWorkOrderListCG(String id); + + R autoSplitOrderCancel(ProOrder proOrder); + + R autoSplitOrderOk(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 2430371a..a887f7ae 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 @@ -416,6 +416,99 @@ public class ProOrderServiceImpl implements IProOrderService { } } + /**辅助排产结果查看**/ + @Override + @DS("#header.poolName") + public AjaxResult getWorkOrderListCG(String id) { + // 通过订单id查询所有母工单信息list + List proOrderWorkorderList = proOrderWorkorderMapper.selectFirWorkOrderCG(id); + + for (ProOrderWorkorder proOrderWorkorder : proOrderWorkorderList) { + formatProOrderWorkorderCG(proOrderWorkorder); + } + + return success(proOrderWorkorderList); + } + + @Override + @DS("#header.poolName") + public R autoSplitOrderCancel(ProOrder proOrder) { + ProOrder order = proOrder; + /**pro_order_workorder_batch**/ + int n = proOrderMapper.deleteAutoSplitWorkBatch(proOrder.getOrderCode()); + logger.info("n:"+n); + + /**pro_order_workorder**/ + int m = proOrderMapper.deleteAutoSplitWork(proOrder.getOrderCode()); + logger.info("m:"+m); + + return R.ok(); + } + + @Override + @DS("#header.poolName") + public R autoSplitOrderOk(ProOrder proOrder) { + ProOrder order = proOrder; + /**pro_order_workorder_batch**/ + int n = proOrderMapper.updateAutoSplitWorkBatch(proOrder.getOrderCode()); + logger.info("n:"+n); + + /**pro_order_workorder**/ + int m = proOrderMapper.updateAutoSplitWork(proOrder.getOrderCode()); + logger.info("m:"+m); + + /**pro_order**/ + int s = proOrderMapper.updateAutoSplitOrder(proOrder.getOrderCode()); + logger.info("s:"+s); + return R.ok(); + } + + /** + * 格式化工单信息(递归处理) + * + * @param proOrderWorkorder + */ + private void formatProOrderWorkorderCG(ProOrderWorkorder proOrderWorkorder) { + + StringBuilder prodLineName = new StringBuilder(""); + StringBuilder equipCods = new StringBuilder("'"); + JSONArray codeArray = JSONArray.parseArray(proOrderWorkorder.getProdLineCode()); + for(int c=0;c equipMap = proOrderMapper.getEquipInfoByCodes(equipCods.substring(1));//设备字典 + for (int c = 0; c < codeArray.size(); c++) { + String equipCode = codeArray.getJSONArray(c).getString(1); + prodLineName.append(equipMap.get(equipCode).getLabel() + ","); + } + + proOrderWorkorder.setProdLineCode(prodLineName.toString()); + + // 通过工单id查询批次号 + List batchCodeList = proOrderMapper.selectBatchCodesByIdCG(proOrderWorkorder.getWorkorderId()); + List batchCodes = new ArrayList<>(); + List batchNums = new ArrayList<>(); + // 格式化数据 + for (ProOrderWorkorderBatch batchCode : batchCodeList) { + batchCodes.add(new StringBuilder(batchCode.getBatchCode()).append(";")); + batchNums.add(new StringBuilder(batchCode.getBatchQuantity()+"").append(";")); + } + + proOrderWorkorder.setBatchCodeList(batchCodes); + proOrderWorkorder.setBatchNumList(batchNums); + + // 通过母工单workorder_id查询子工单 + List childWorkorders = proOrderWorkorderMapper.selectChildWorkOrderCG(proOrderWorkorder.getWorkorderCode()); + if (!childWorkorders.isEmpty()) { + for (ProOrderWorkorder childWorkorder : childWorkorders) { + formatProOrderWorkorderCG(childWorkorder); // 递归处理子工单 + } + proOrderWorkorder.setChildren(childWorkorders); // 设置子工单列表 + } + } + /** * 获取当前订单信息列表 * @@ -1235,98 +1328,135 @@ public class ProOrderServiceImpl implements IProOrderService { @DS("#header.poolName") public R autoSplitOrder(ProOrder proOrder) { -// Date nowTime = DateUtils.getNowDate();//公共时间 -// HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); -// String key = "#header.poolName"; -// proOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); -// proOrder.setCreateTime(nowTime); -// //订单总量 -// Long orderQua = proOrder.getQuantity(); -// //有几个设备就有几个工单 -// for(int i=0;i workorders = new ArrayList<>(); -// List workorderBatches = new ArrayList<>(); -// -// proOrder.setLineCode(proOrder.getLineCodes()[i]); -// Long efficiency = proOrderWorkorderMapper.getLineProductInfo(proOrder);//线体产能 -// if(efficiency==null){ -// break; -// logger.error("线体"+proOrder.getLineCodes()[i]+"产能"+efficiency+"无法生产"); -// } -// if(efficiency < orderQua){ -// proOrder.setQuantitySplit(efficiency); -// }else{ -// proOrder.setQuantitySplit(orderQua); -// } -// orderQua = orderQua - efficiency;//消耗订单总数量 -// List sonOrders = (List)proOrder.getChildren(); -// if(CollectionUtils.isEmpty(sonOrders)){//1层订单 -// proOrder.setEndFlag(1); -// } -// int endCode = getEndCode(proOrder.getId()); -// String belongWorkOrder = proOrder.getOrderCode()+"-"+endCode; -// proOrder.setBelongWorkOrder(belongWorkOrder); -// proOrder.setWorkerOrder(belongWorkOrder); -// proOrder.setParentOrder("0"); -// ProOrderWorkorder pworkOrder = getWorkOrderByOrder(proOrder);//TODO; -// //父级 -// workorders.add(pworkOrder); -// -// /**pro_order_workorder_batch**/ -// String parentWorkOrder = belongWorkOrder; -// while(!CollectionUtils.isEmpty(sonOrders)){ -// ProOrder sonOrder = sonOrders.get(0); -// sonOrder.setBelongWorkOrder(belongWorkOrder); -// endCode = getEndCode(proOrder.getId()); -// String sworkOrderCode = sonOrder.getOrderCode()+"-"+endCode; -// sonOrder.setBelongWorkOrder(belongWorkOrder); -// sonOrder.setWorkerOrder(sworkOrderCode); -// sonOrder.setParentOrder(parentWorkOrder); -// sonOrders = (List)sonOrder.getChildren(); -// if(CollectionUtils.isEmpty(sonOrders)){//1层订单 -// sonOrder.setEndFlag(1); -// } -// ProOrderWorkorder sworkOrder = getWorkOrderByOrder(sonOrder);//TODO; -// workorders.add(sworkOrder); -// parentWorkOrder = sworkOrderCode; -// } -// -// /**pro_order_workorder**/ -// if(!CollectionUtils.isEmpty(workorders)){ -// int pm = proOrderWorkorderMapper.insertWorkorders(workorders); -// System.out.println("pm:"+pm); -// } -// -// //拆批次 -// Long pworkOrderQua = proOrder.getQuantitySplit();//工单数量 -// ProOrderWorkorderBatch workBatch = null; -// int batchNum = 1; -// while(pworkOrderQua>0){ -// workBatch = new ProOrderWorkorderBatch(); -// workBatch.setBatchQuantity(0L); -// List batchCode = StringUtils.batchAutoCreate(proOrder.getFactoryCode(), -// proOrder.getLineCode(), -// DateUtils.dateTime("yyyy-MM-dd",proOrder.getProductDate()), -// proOrder.getAtrr2().substring(proOrder.getAtrr2().length()-1), -// "0",batchNum++); -// workBatch.setBatchCode(batchCode); -// workorderBatches.add(workBatch); -// } -// /**pro_order_workorder_batch**/ -// if(!CollectionUtils.isEmpty(workorderBatches)) { -// int pn = proOrderWorkorderBatchMapper.insertWorkorderBatchs(workBatch); -// System.out.println("pn:"+pn); -// } -// } + Date nowTime = DateUtils.getNowDate();//公共时间 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + proOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); + proOrder.setCreateTime(nowTime); + //订单总量 + proOrder.setQuantitySplit(proOrder.getQuantitySplit()==null?0L:proOrder.getQuantitySplit()); + Long orderQua = proOrder.getQuantity()-proOrder.getQuantitySplit(); + //有几个设备就有几个工单 + for(int i=0;i workorders = new ArrayList<>(); + + proOrder.setLineCode(proOrder.getLineCodes()[i]); + ProLine plineInfo = proOrderWorkorderMapper.getLineProductInfo(proOrder);//线体母单产品产能和线体代码 + if(plineInfo==null){ + logger.error("线体"+proOrder.getLineCodes()[i]+"产能"+plineInfo.getEfficiency()+"无法生产"); + break; + } + Long efficiency = plineInfo.getEfficiency(); + if(efficiency < orderQua){ + proOrder.setQuantitySplit(efficiency); + }else{ + proOrder.setQuantitySplit(orderQua); + } + orderQua = orderQua - proOrder.getQuantitySplit();//消耗订单总数量 + if(CollectionUtils.isEmpty(proOrder.getChildren())){//1层订单 + proOrder.setEndFlag(1); + } + int endCode = getEndCode(proOrder.getId()); + String belongWorkOrder = proOrder.getOrderCode()+"-"+endCode; + proOrder.setBelongWorkOrder(belongWorkOrder); + proOrder.setWorkerOrder(belongWorkOrder); + proOrder.setParentOrder("0"); + ProOrderWorkorder pworkOrder = getWorkOrderByOrder(proOrder,proOrder);//TODO; + //父级 + workorders.add(pworkOrder); + + /**pro_order_workorder_batch**/ + String parentWorkOrder = belongWorkOrder; + + ProOrder order = proOrder; + while(!CollectionUtils.isEmpty(order.getChildren())){ + // 解决方案就是将list再次转为json串,然后由json串再转为list + String s = JSON.toJSONString(order.getChildren()); + List oragainzation = JSON.parseArray(s, ProOrder.class); + ProOrder sonOrder = oragainzation.get(0); + sonOrder.setBelongWorkOrder(belongWorkOrder); + String sworkOrderCode = sonOrder.getOrderCode()+"-"+(++endCode); + sonOrder.setBelongWorkOrder(belongWorkOrder); + sonOrder.setWorkerOrder(sworkOrderCode); + sonOrder.setParentOrder(parentWorkOrder); + sonOrder.setQuantitySplit(sonOrder.getQuantity()); + if(CollectionUtils.isEmpty(sonOrder.getChildren())){ + sonOrder.setEndFlag(1); + } + ProOrderWorkorder sworkOrder = getWorkOrderByOrder(sonOrder,proOrder);//TODO; + workorders.add(sworkOrder); + order = sonOrder; + parentWorkOrder = sworkOrderCode; + } + + /**pro_order_workorder**/ + if(!CollectionUtils.isEmpty(workorders)){ + //计算子单拆分数量 + for(int wm=0;wm workorderBatches0 = getBatchList(proOrder);//TODO; + List workBatchs = new ArrayList<>(); + for(int m=0;m getBatchList(ProOrder proOrder){ + List workorderBatches = new ArrayList<>(); + Long pworkOrderQua = proOrder.getQuantitySplit();//母工单数量 + BaseProduct batchQua0 = proOrderWorkorderMapper.getProductInfo(proOrder);//母单标准批次产能和几合一 + ProOrderWorkorderBatch workBatch = null; + while(pworkOrderQua>0){ + workBatch = new ProOrderWorkorderBatch(); + workBatch.setCreateBy(SecurityUtils.getUsername()); + workBatch.setCreateTime(proOrder.getCreateTime()); + if(batchQua0.getBatchQuaStandar().longValue()<= pworkOrderQua){ + workBatch.setBatchQuantity(batchQua0.getBatchQuaStandar().longValue()); + }else{ + workBatch.setBatchQuantity(pworkOrderQua); + } + workorderBatches.add(workBatch); + pworkOrderQua = pworkOrderQua - batchQua0.getBatchQuaStandar().longValue(); + } + + //获取批次号集合 + List batchCodes = StringUtils.batchAutoCreate(proOrder.getFactoryCode(), + proOrder.getProdSpc(), + DateUtils.dateTime("yyyy-MM-dd",proOrder.getProductDate()), + proOrder.getAtrr2().substring(proOrder.getAtrr2().length()-1), + "0",workorderBatches.size()); + + for(int n=0;n lines = new ArrayList<>(); List proLines = proOrderMapper.getSelectLineLevel1(proOrder); //订单总量 - BigDecimal orderQuality = new BigDecimal(proOrder.getQuantity()); + proOrder.setQuantitySplit(proOrder.getQuantitySplit()==null?0L:proOrder.getQuantitySplit()); + BigDecimal orderQuality = new BigDecimal(proOrder.getQuantity()).subtract(new BigDecimal(proOrder.getQuantitySplit())); BigDecimal consumeQuality = BigDecimal.ZERO; for(ProOrder pline:proLines){ lines.add(pline.getLineCode()); @@ -1382,8 +1546,13 @@ public class ProOrderServiceImpl implements IProOrderService { // for(int c=0;c - + + insert into pro_order @@ -409,6 +416,25 @@ #{id} + + update pro_order_workorder_batch set del_flag = '0' + where workorder_id in(select workorder_id from pro_order_workorder + where del_flag= '2' and belong_work_order like concat(#{orderCode},'-%')) + and del_flag='2' + + + update pro_order_workorder set del_flag = '0' + where del_flag= '2' and belong_work_order like concat(#{orderCode},'-%') + + + update pro_order + set status = 'o2', + quantity_split = quantity + where del_flag= '0' and order_code in( + select order_code from pro_order_workorder + where del_flag= '0' and belong_work_order like concat(#{orderCode},'-%') + ) + update pro_order @@ -424,4 +450,13 @@ #{id} + + delete from pro_order_workorder where del_flag= '2' and belong_work_order like concat(#{orderCode},'-%') + + + delete from pro_order_workorder_batch + where workorder_id in(select workorder_id from pro_order_workorder + where del_flag= '2' and belong_work_order like concat(#{orderCode},'-%')) + and del_flag='2' + diff --git a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderBatchMapper.xml b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderBatchMapper.xml index 1348714f..1d2dd5b1 100644 --- a/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderBatchMapper.xml +++ b/op-modules/op-plan/src/main/resources/mapper/plan/ProOrderWorkorderBatchMapper.xml @@ -125,6 +125,18 @@ #{factoryCode}, + + INSERT INTO pro_order_workorder_batch ( + batch_id,workorder_id,batch_code,batch_quantity,status, + create_by,create_time,factory_code,del_flag + )VALUES + + ( + #{d.batchId},#{d.workorderId},#{d.batchCode},#{d.batchQuantity},'0', + #{d.createBy},#{d.createTime}, #{d.factoryCode},'2' + ) + + update pro_order_workorder_batch 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 a99bb4bc..1279a840 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 @@ -212,12 +212,22 @@ and del_flag = '0' + + - + - + select mlp.efficiency efficiency, + bp.dh from mes_line_product mlp + left join base_equipment bp on mlp.line_code = bp.equipment_code where mlp.del_flag = '0' and product_code = #{prodCode} - and mlp.line_code = #{lineCode} + and mlp.line_code = #{lineCode} and bp.del_flag = '0' + + insert into mes_prepare_detail @@ -760,7 +783,7 @@ ( #{d.workorderId},#{d.workorderCode},#{d.orderId},#{d.orderCode},#{d.productCode}, - #{d.productName},#{d.unit},#{d.quantitySplit},#{d.routeCode},#{d.prodLineCodeArray}, + #{d.productName},#{d.unit},#{d.quantitySplit},#{d.routeCode},#{d.prodLineCode}, #{d.productDate},#{d.parentOrder},#{d.status},#{d.createBy},#{d.createTime}, #{d.prodType}, #{d.factoryCode},#{d.endFlag},'2',#{d.sortNo}, #{d.belongWorkOrder}