From 20abf4cde4fd5e90da90c569380fa5a35fb32d5d Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Thu, 16 Nov 2023 17:24:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=B7=A5+=E6=88=90=E5=93=81=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/domain/mes/MesReportWorkDTO.java | 9 +++++++++ .../controller/MesReportWorkController.java | 4 ++++ .../java/com/op/mes/domain/MesReportWork.java | 18 +++++++++++++++++ .../com/op/mes/domain/ProOrderWorkorder.java | 18 +++++++++++++++++ .../op/mes/mapper/MesReportWorkMapper.java | 2 ++ .../op/mes/service/IMesReportWorkService.java | 2 ++ .../service/impl/IWCInterfaceServiceImpl.java | 5 ++++- .../impl/MesReportWorkServiceImpl.java | 6 ++++++ .../mapper/mes/MesReportWorkMapper.xml | 20 +++++++++++++++++-- .../op/open/service/impl/OpenServiceImpl.java | 5 ++++- .../main/resources/mapper/open/OpenMapper.xml | 3 ++- .../com/op/plan/domain/ProOrderWorkorder.java | 9 +++++++++ .../plan/mapper/ProOrderWorkorderMapper.java | 2 ++ .../impl/ProOrderWorkorderServiceImpl.java | 8 +++++++- .../mapper/plan/ProOrderWorkorderMapper.xml | 5 +++++ 15 files changed, 110 insertions(+), 6 deletions(-) diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/MesReportWorkDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/MesReportWorkDTO.java index 6f1ea864..58bbdbb7 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/MesReportWorkDTO.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/mes/MesReportWorkDTO.java @@ -161,6 +161,15 @@ public class MesReportWorkDTO extends BaseEntity { private String createTimeEnd; private String feedbackTimeStart; private String feedbackTimeEnd; + private String endReport; + + public String getEndReport() { + return endReport; + } + + public void setEndReport(String endReport) { + this.endReport = endReport; + } public BigDecimal getQuantitySplit() { return quantitySplit; diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java index f2c6b4da..5571d018 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java @@ -364,6 +364,10 @@ public class MesReportWorkController extends BaseController { return getDataTable(list); } + @PutMapping("/getBatchList") + public List getBatchList(@RequestBody ProOrderWorkorder ProOrderWorkorder) { + return mesReportWorkService.getBatchList(ProOrderWorkorder); + } public static void main(String args[]){ DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:00:00"); diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java index 4420c907..430c2bbc 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesReportWork.java @@ -163,6 +163,24 @@ public class MesReportWork extends BaseEntity { private String createTimeEnd; private String feedbackTimeStart; private String feedbackTimeEnd; + private String batch; + private String endReport; + + public String getEndReport() { + return endReport; + } + + public void setEndReport(String endReport) { + this.endReport = endReport; + } + + public String getBatch() { + return batch; + } + + public void setBatch(String batch) { + this.batch = batch; + } public Long getUseMan() { return useMan; diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrderWorkorder.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrderWorkorder.java index 2b6da617..88c8ede8 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrderWorkorder.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/ProOrderWorkorder.java @@ -154,6 +154,24 @@ public class ProOrderWorkorder extends TreeEntity { // 料罐名称(湿料计划模块使用) private String bucketName; + private String batchCode; + private String batchId; + + public String getBatchCode() { + return batchCode; + } + + public void setBatchCode(String batchCode) { + this.batchCode = batchCode; + } + + public String getBatchId() { + return batchId; + } + + public void setBatchId(String batchId) { + this.batchId = batchId; + } public String getBucketName() { return bucketName; diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java index 5d133a95..74694cd0 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java @@ -106,4 +106,6 @@ public interface MesReportWorkMapper { Map getEquipInfoByCodes(String substring); List getMesListEquip(EquEquipmentDTO qo); + + List getBatchList(ProOrderWorkorder proOrderWorkorder); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java index 1fd73c96..34112f93 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java @@ -88,4 +88,6 @@ public interface IMesReportWorkService { List getMesListEquip(EquEquipmentDTO equEquipmentDTO); R reportSap(MesReportWork mesReportWork); + + List getBatchList(ProOrderWorkorder proOrderWorkorder); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index ffe3d389..116f6026 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -330,7 +330,10 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { //工单完成数量>工单数量:关闭订单 MesReportWork proResult = mesReportWorkMapper.getProdResult(work); //ProOrderWorkorder topOrder = this.getTopOrder(work.getWorkorderCode()); - if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0){ + if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0 + || + "1".equals(work.getEndReport())//最终报工标识 + ){ //工单完成,关闭工单 remoteSapService.sapCloseOrder(work.getWorkorderCodeSap()); work.setStatus("w3"); diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java index 586c82c8..4f8b0ef4 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java @@ -122,6 +122,12 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { return s; } + @Override + @DS("#header.poolName") + public List getBatchList(ProOrderWorkorder proOrderWorkorder) { + return mesReportWorkMapper.getBatchList(proOrderWorkorder); + } + /** * 修改报工报表 * diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index 40ddc366..a4fcf4a9 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -96,7 +97,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mrw.feedback_time, mrw.record_user, mrw.status, mrw.remark, mrw.work_time, mrw.machine_code, mrw.machine_name, mrw.team_code, mrw.shift_code, mrw.create_by, mrw.create_time,mrw.upload_time,mrw.upload_status,mrw.upload_msg, - mrw.use_man, + mrw.use_man,mrw.batch, pow.order_code,pow.quantity_split from mes_report_work mrw left join pro_order_workorder pow on mrw.workorder_code = pow.workorder_code @@ -228,7 +229,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mrw.id, mrw.quantity_feedback quantityFeedback, mrw.product_code productCode, - mrw.product_name productName + mrw.product_name productName, + mrw.end_report endReport from mes_report_work mrw left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code left join pro_route rte on rte.route_code = ow.route_code @@ -433,6 +435,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from base_equipment where equipment_type_code = 'equ_type_bzx' and del_flag = '0' + insert into mes_report_work @@ -471,6 +481,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time, update_by, prod_type, + batch, + end_report, #{id}, @@ -507,6 +519,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateTime}, #{updateBy}, #{prodType}, + #{batch}, + #{endReport}, @@ -545,6 +559,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" create_time = #{createTime}, update_time = #{updateTime}, update_by = #{updateBy}, + batch = #{batch}, + end_report = #{endReport}, where id = #{id} diff --git a/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java b/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java index bb3562c5..c5bc8c0c 100644 --- a/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java +++ b/op-modules/op-open/src/main/java/com/op/open/service/impl/OpenServiceImpl.java @@ -199,7 +199,10 @@ public class OpenServiceImpl implements OpenService { //工单完成数量>工单数量:关闭订单 MesReportWorkDTO proResult = openMapper.getProdResult(work); //ProOrderWorkorderDTO topOrder = this.getTopOrder(work.getWorkorderCode()); - if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0){ + if(proResult.getQuantityFeedback().compareTo(work.getQuantitySplit())>=0 + || + "1".equals(work.getEndReport())//最终报工标识 + ){ //工单完成,关闭工单 remoteSapService.sapCloseOrder(work.getWorkorderCodeSap()); work.setStatus("w3"); diff --git a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml index 4fd58e39..df978636 100644 --- a/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml +++ b/op-modules/op-open/src/main/resources/mapper/open/OpenMapper.xml @@ -84,7 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mrw.id, mrw.quantity_feedback quantityFeedback, mrw.product_code productCode, - mrw.product_name productName + mrw.product_name productName, + mrw.end_report endReport from mes_report_work mrw left join pro_order_workorder ow on mrw.workorder_code = ow.workorder_code left join pro_route rte on rte.route_code = ow.route_code 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 5e8beb78..2f7acc72 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 @@ -208,10 +208,19 @@ public class ProOrderWorkorder extends TreeEntity { /** 批次号 */ private List batchCodeList; private List batchNumList; + private List batchInfo; /** $column.columnComment */ private String factoryCode; + public List getBatchInfo() { + return batchInfo; + } + + public void setBatchInfo(List batchInfo) { + this.batchInfo = batchInfo; + } + public List getBatchNumList() { return batchNumList; } 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 0818455e..2fe38f03 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 @@ -152,5 +152,7 @@ public interface ProOrderWorkorderMapper { int getProSortNo(ProOrder proOrder); void deleteProOrderWorkorderByOrderIds(String[] orderIds); + + List getBatchInfo(String workorderCode); } 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 997f9bf9..3509a1c8 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 @@ -110,6 +110,10 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { // workorder.setProdLineCode(proOrderMapper.selectProdLineName(workorder.getProdLineCode())); // 通过工艺编码code查询出机型名称 workorder.setRouteName(proOrderWorkorderMapper.selectRouteNameByRouteCode(workorder.getRouteCode())); +// +// //批次信息(母) +// List batchs = proOrderWorkorderMapper.getBatchInfo(workorder.getWorkorderId()); +// workorder.setBatchInfo(batchs); } return workorderList; } @@ -973,14 +977,16 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService { // 通过工单id查询批次号 List batchCodeList = proOrderMapper.selectBatchCodesById(proOrderWorkorder.getWorkorderId()); List batchCodes = new ArrayList<>(); + List batchNums = new ArrayList<>(); // 格式化数据 for (ProOrderWorkorderBatch batchCode : batchCodeList) { batchCodes.add(new StringBuilder(batchCode.getBatchCode()).append(";").append("\n")); + batchNums.add(new StringBuilder(batchCode.getBatchQuantity()+"").append(";").append("\n")); } // 将查询结果设置到当前工单对象 proOrderWorkorder.setShiftDesc(shiftDesc); proOrderWorkorder.setBatchCodeList(batchCodes); - + proOrderWorkorder.setBatchNumList(batchNums); // 通过母工单workorder_id查询子工单 List childWorkorders = proOrderWorkorderMapper.selectChildWorkOrder(proOrderWorkorder.getWorkorderCode()); if (!childWorkorders.isEmpty()) { 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 6da59778..57a1c89b 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 @@ -348,6 +348,11 @@ select count(0)+1 from pro_order_workorder where product_date = #{productDate} and end_flag='1' + insert into mes_prepare_detail