From 8dfc341463f82bf188e7c819f88b86b53f83293f Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Fri, 17 Nov 2023 09:48:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8B=E6=9C=BA=E5=8F=B0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96-unlock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/mapper/EquOrderPersonMapper.java | 2 +- .../service/impl/DeviceTaskServiceImpl.java | 49 +++++++++++++------ .../mapper/device/DeviceTaskMapper.xml | 4 ++ .../mapper/device/EquOrderPersonMapper.xml | 2 +- .../mapper/mes/ProRfidProcessDetailMapper.xml | 2 +- .../main/resources/mapper/open/OpenMapper.xml | 2 +- 6 files changed, 43 insertions(+), 18 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderPersonMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderPersonMapper.java index daad4389..7bb544a8 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderPersonMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderPersonMapper.java @@ -68,5 +68,5 @@ public interface EquOrderPersonMapper { */ List selectEquOrderPersonByOrderCode(String orderCode); - int insertEquOrderPlans(@Param("list") List persons); + int insertEquOrderPersons(@Param("list") List persons); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java index 14e72515..66a3b5ee 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java @@ -70,6 +70,9 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService { private EquOrderPersonMapper equOrderPersonMapper; @Autowired private RemoteUserService remoteUserService; + + @Autowired + private EquOutsourceWorkMapper equOutsourceWorkMapper; /** * 根据点检计划生成点检任务 * **/ @@ -254,6 +257,10 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService { String serialNum = String.format("%03d",equOrderMapper.selectSerialNumber()); String orderCode = "O"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+serialNum; order.setOrderCode(orderCode); + + if("1".equals(plan.getUpkeep())) {//1委外工单 + order.setOutsourceCode("OW"+orderCode); + } /**equ_order**/ sce = equOrderMapper.insertEquOrder(order); System.out.println(plan.getPlanCode()+"========equ_order:"+sce); @@ -310,23 +317,37 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService { /**equ_plan_standard->equ_order_standard*******************************************************/ if(!CollectionUtils.isEmpty(standards)) { sce = equOrderStandardMapper.insertEquOrderStandards(standards); - System.out.println(plan.getPlanCode() + "========equ_order_detail:" + sce); + System.out.println(plan.getPlanCode() + "========equ_order_standard:" + sce); } /**equ_plan_person->equ_order_standard*********************************************************/ - EquPlanPerson equPlanPerson = new EquPlanPerson(); - equPlanPerson.setPlanCode(plan.getPlanCode()); - List persons = equPlanPersonMapper.selectEquPlanPersonList(equPlanPerson); + if("1".equals(plan.getUpkeep())){//1委外 + EquOutsourceWork equOutsourceWork = new EquOutsourceWork(); + BeanUtils.copyProperties(plan,order); + equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID()); + equOutsourceWork.setWorkCode(order.getOutsourceCode()); + equOutsourceWork.setCreateBy(createBy); + equOutsourceWork.setCreateTime(nowtime); + equOutsourceWork.setDelFlag("0"); - for(EquPlanPerson person:persons){ - person.setId(IdUtils.fastSimpleUUID()); - person.setCreateTime(nowtime); - person.setCreateBy(createBy); - person.setDelFlag("0"); - person.setPlanCode(orderCode); - } - if(!CollectionUtils.isEmpty(persons)) { - sce = equOrderPersonMapper.insertEquOrderPlans(persons); - System.out.println(plan.getPlanCode() + "========equ_order_standard:" + sce); + //TODO; + sce = equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork); + System.out.println(plan.getPlanCode() + "========equ_outsource_work:" + sce); + }else { + EquPlanPerson equPlanPerson = new EquPlanPerson(); + equPlanPerson.setPlanCode(plan.getPlanCode()); + List persons = equPlanPersonMapper.selectEquPlanPersonList(equPlanPerson); + + for (EquPlanPerson person : persons) { + person.setId(IdUtils.fastSimpleUUID()); + person.setCreateTime(nowtime); + person.setCreateBy(createBy); + person.setDelFlag("0"); + person.setPlanCode(orderCode); + } + if (!CollectionUtils.isEmpty(persons)) { + sce = equOrderPersonMapper.insertEquOrderPersons(persons); + System.out.println(plan.getPlanCode() + "========equ_order_person:" + sce); + } } return sce; } diff --git a/op-modules/op-device/src/main/resources/mapper/device/DeviceTaskMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/DeviceTaskMapper.xml index 7e4ae2e6..2531142c 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/DeviceTaskMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/DeviceTaskMapper.xml @@ -18,6 +18,10 @@ ep.calculation_rule calculationRule, ep.shut_down as 'shutDown', ep.upkeep, + ep.work_person workPerson, + ep.work_outsourcing_unit workOutsourcingUnit, + ep.work_connection workConnection, + ep.work_reason workReason, epe.equipment_code equipmentCode, epe.equipment_name equipmentName, epe.id planEquId diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderPersonMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderPersonMapper.xml index 5c90ada4..870e0dc0 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderPersonMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderPersonMapper.xml @@ -82,7 +82,7 @@ #{updateTime}, - + insert into equ_order_person ( id, order_code, user_id, user_name, factory_code, diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/ProRfidProcessDetailMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/ProRfidProcessDetailMapper.xml index cab05f69..75ec7ae3 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/ProRfidProcessDetailMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/ProRfidProcessDetailMapper.xml @@ -109,7 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bp.product_code productCode, bp.product_model productModel, w.prod_line_code prodLineCode - from pro_rfid_process_detail rfid + from pro_rfid_process_detail rfid with (NOLOCK) left join pro_process p on p.process_id = rfid.next_process_id left join pro_order_workorder w on w.workorder_code = rfid.workorder_code left join base_product bp on bp.product_code = w.product_code 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 df978636..2ca18af7 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 @@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bp.product_code productCode, bp.product_model productModel, w.prod_line_code prodLineCode - from pro_rfid_process_detail rfid + from pro_rfid_process_detail rfid with (NOLOCK) left join pro_process p on p.process_id = rfid.next_process_id left join pro_order_workorder w on w.workorder_code = rfid.workorder_code left join base_product bp on bp.product_code = w.product_code From 3e642c17a0afd006f37129f41b1acfc47afc4b1b Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Fri, 17 Nov 2023 10:25:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A7=94=E5=A4=96=E4=BF=9D=E5=85=BB?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/op/device/service/impl/DeviceTaskServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java index 66a3b5ee..796cfe9d 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceTaskServiceImpl.java @@ -259,7 +259,7 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService { order.setOrderCode(orderCode); if("1".equals(plan.getUpkeep())) {//1委外工单 - order.setOutsourceCode("OW"+orderCode); + order.setOutsourceCode("BW"+orderCode); } /**equ_order**/ sce = equOrderMapper.insertEquOrder(order); @@ -322,14 +322,14 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService { /**equ_plan_person->equ_order_standard*********************************************************/ if("1".equals(plan.getUpkeep())){//1委外 EquOutsourceWork equOutsourceWork = new EquOutsourceWork(); - BeanUtils.copyProperties(plan,order); + BeanUtils.copyProperties(plan,equOutsourceWork); equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID()); + equOutsourceWork.setOrderCode(orderCode); equOutsourceWork.setWorkCode(order.getOutsourceCode()); + equOutsourceWork.setWorkType("1");//1委外保养0委外维修 equOutsourceWork.setCreateBy(createBy); equOutsourceWork.setCreateTime(nowtime); equOutsourceWork.setDelFlag("0"); - - //TODO; sce = equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork); System.out.println(plan.getPlanCode() + "========equ_outsource_work:" + sce); }else {