diff --git a/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/WCSDTO.java b/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/WCSDTO.java index 7e84e659..7829d084 100644 --- a/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/WCSDTO.java +++ b/op-api/op-api-system/src/main/java/com/op/system/api/domain/dto/WCSDTO.java @@ -29,6 +29,12 @@ public class WCSDTO { private String spec; private String productionState; private List stationNos; + private String workorderId; + private String bucketCode; + private String materialCode; + private String materialName; + private String shiftId; + private String workorderCode; public List getStationNos() { return stationNos; @@ -161,4 +167,52 @@ public class WCSDTO { public void setData(List data) { this.data = data; } + + public String getWorkorderId() { + return workorderId; + } + + public void setWorkorderId(String workorderId) { + this.workorderId = workorderId; + } + + public String getBucketCode() { + return bucketCode; + } + + public void setBucketCode(String bucketCode) { + this.bucketCode = bucketCode; + } + + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public String getShiftId() { + return shiftId; + } + + public void setShiftId(String shiftId) { + this.shiftId = shiftId; + } + + public String getWorkorderCode() { + return workorderCode; + } + + public void setWorkorderCode(String workorderCode) { + this.workorderCode = workorderCode; + } } diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquPlan.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquPlan.java index f2c9f5ed..12eb7404 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquPlan.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquPlan.java @@ -143,14 +143,14 @@ public class EquPlan extends BaseEntity { // 是否停机保养 private String shutDown; - private String planEquCode; + private String planEquId; - public String getPlanEquCode() { - return planEquCode; + public String getPlanEquId() { + return planEquId; } - public void setPlanEquCode(String planEquCode) { - this.planEquCode = planEquCode; + public void setPlanEquId(String planEquId) { + this.planEquId = planEquId; } public String getUpkeep() { diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/DeviceTaskMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/DeviceTaskMapper.java index b78756b2..fbdda61a 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/DeviceTaskMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/DeviceTaskMapper.java @@ -20,5 +20,5 @@ public interface DeviceTaskMapper { List getPlans(EquPlan equPlan); - EquOrder getNewTaskOrder(EquOrder equOrder); + EquOrder getNewTaskOrder(EquPlan quPlan); } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquCheckItemDetailMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquCheckItemDetailMapper.java index 39b52b3b..b04c2d89 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquCheckItemDetailMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquCheckItemDetailMapper.java @@ -3,6 +3,8 @@ package com.op.device.mapper; import java.util.List; import com.op.device.domain.EquCheckItemDetail; +import com.op.device.domain.EquOrder; +import org.apache.ibatis.annotations.Mapper; /** * 检查项详情Mapper接口 @@ -10,6 +12,7 @@ import com.op.device.domain.EquCheckItemDetail; * @author wws * @date 2023-10-10 */ +@Mapper public interface EquCheckItemDetailMapper { /** * 查询检查项详情 @@ -91,4 +94,5 @@ public interface EquCheckItemDetailMapper { * @return */ List selectCheckItemDetailByItemCode(String itemCode); + } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderDetailMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderDetailMapper.java index 7dc3458c..37e62743 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderDetailMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderDetailMapper.java @@ -3,6 +3,9 @@ package com.op.device.mapper; import java.util.List; import com.op.device.domain.EquOrderDetail; +import com.op.device.domain.EquPlanDetail; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 计划工单详情-检查项信息Mapper接口 @@ -10,6 +13,7 @@ import com.op.device.domain.EquOrderDetail; * @author Open Platform * @date 2023-10-23 */ +@Mapper public interface EquOrderDetailMapper { /** * 查询计划工单详情-检查项信息 @@ -72,4 +76,6 @@ public interface EquOrderDetailMapper { * @return */ List selectEquOrderDetailByOrderCode(String orderCode); + + int insertEquOrderDetails(@Param("list") List details); } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderEquMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderEquMapper.java index 19802e6f..1cd90aa4 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderEquMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderEquMapper.java @@ -3,6 +3,8 @@ package com.op.device.mapper; import java.util.List; import com.op.device.domain.EquOrderEqu; +import com.op.device.domain.EquPlanEqu; +import org.apache.ibatis.annotations.Param; /** * 计划工单-设备Mapper接口 @@ -65,4 +67,7 @@ public interface EquOrderEquMapper { * @return */ EquOrderEqu selectEquOrderEquListByParentCode(String orderCode); + + int insertEquOrderEqus(@Param("list") List equs); + } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderMapper.java index 0cb79b49..6e251af6 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderMapper.java @@ -4,6 +4,7 @@ import java.util.List; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.device.domain.EquOrder; +import com.op.device.domain.EquPlan; import com.op.device.domain.dto.PDADTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -118,4 +119,5 @@ public interface EquOrderMapper { * @return */ List selectTodayTask(PDADTO pdadto); + } 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 214e9001..daad4389 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 @@ -3,6 +3,8 @@ package com.op.device.mapper; import java.util.List; import com.op.device.domain.EquOrderPerson; +import com.op.device.domain.EquPlanPerson; +import org.apache.ibatis.annotations.Param; /** * 计划工单-人员Mapper接口 @@ -65,4 +67,6 @@ public interface EquOrderPersonMapper { * @return */ List selectEquOrderPersonByOrderCode(String orderCode); + + int insertEquOrderPlans(@Param("list") List persons); } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderStandardMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderStandardMapper.java index 6cdc4f1f..98ee5be5 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderStandardMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquOrderStandardMapper.java @@ -5,6 +5,8 @@ import java.util.List; import com.op.common.core.domain.BaseFileData; import com.op.device.domain.EquOrder; import com.op.device.domain.EquOrderStandard; +import com.op.device.domain.EquPlanStandard; +import org.apache.ibatis.annotations.Param; /** * 计划工单-标准Mapper接口 @@ -74,4 +76,6 @@ public interface EquOrderStandardMapper { * @return */ public List selectPdaEquOrderList(EquOrder equOrder); + + int insertEquOrderStandards(@Param("list") List standards); } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanDetailMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanDetailMapper.java index 57f8330f..620d2b32 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanDetailMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquPlanDetailMapper.java @@ -2,6 +2,7 @@ package com.op.device.mapper; import java.util.List; +import com.op.device.domain.EquPlan; import com.op.device.domain.EquPlanDetail; /** @@ -84,4 +85,6 @@ public interface EquPlanDetailMapper { * @return */ List selectEquPlanDetailListByParentCode(String code); + + List selectPlanDetailList(EquPlan plan); } 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 a4962019..c9af8a20 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 @@ -1,6 +1,8 @@ package com.op.device.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; +import com.op.common.core.utils.DateUtils; +import com.op.common.core.utils.uuid.IdUtils; import com.op.common.core.web.domain.AjaxResult; import com.op.common.security.utils.SecurityUtils; import com.op.device.domain.*; @@ -10,8 +12,10 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; +import java.util.Date; import java.util.List; import static com.op.common.core.web.domain.AjaxResult.error; @@ -32,6 +36,26 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService { @Autowired private EquOrderMapper equOrderMapper; + @Autowired + private EquOrderDetailMapper equOrderDetailMapper; + + @Autowired + private EquPlanDetailMapper equPlanDetailMapper; + + @Autowired + private EquPlanEquMapper equPlanEquMapper; + @Autowired + private EquOrderEquMapper equOrderEquMapper; + + @Autowired + private EquPlanStandardMapper equPlanStandardMapper; + @Autowired + private EquOrderStandardMapper equOrderStandardMapper; + + @Autowired + private EquPlanPersonMapper equPlanPersonMapper; + @Autowired + private EquOrderPersonMapper equOrderPersonMapper; /** * 根据点检计划生成点检任务 * **/ @@ -42,13 +66,12 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService { equPlan.setPlanType("spotInspection"); List plans = deviceTaskMapper.getPlans(equPlan); for(EquPlan plan:plans){ - if("day".equals(plan.getPlanLoopType())){ - EquOrder order = new EquOrder(); - order.setPlanType("spotInspection"); - EquOrder hasTask = deviceTaskMapper.getNewTaskOrder(order); - if(hasTask==null || Integer.parseInt(plan.getPlanLoop())<= hasTask.getDays()){ - //生成点检计划 - this.createSpotCheckPlan(plan); + EquOrder hasTask = deviceTaskMapper.getNewTaskOrder(plan); + if(hasTask==null || Integer.parseInt(plan.getPlanLoop())<= hasTask.getDays()){ + //生成点检计划 + int m = this.createSpotCheckPlan(plan); + if(m==0){ + error("equ_order相关添加失败"); } } } @@ -57,13 +80,95 @@ public class DeviceTaskServiceImpl implements IDeviceTaskService { } private int createSpotCheckPlan(EquPlan plan){ - /**equ_order**/ + Date nowtime = DateUtils.getNowDate(); + String createBy = SecurityUtils.getUsername(); + int sce = 0; + /**equ_plan->equ_order********************************************************************/ EquOrder order = new EquOrder(); + //源->目标 BeanUtils.copyProperties(plan,order); - equOrderMapper.insertEquOrder(order); - /**equ_order_detail**/ - List details = new ArrayList<>(); + order.setOrderId(IdUtils.fastSimpleUUID()); + order.setCreateBy(createBy); + order.setCreateTime(nowtime); + // 流水号 + String serialNum = String.format("%03d",equOrderMapper.selectSerialNumber()); + String orderCode = "O"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD)+serialNum; + order.setOrderCode(orderCode); + /**equ_order**/ + sce = equOrderMapper.insertEquOrder(order); + + /**equ_plan_equ->equ_order_equ*************************************************************/ + EquPlanEqu equPlanEqu = new EquPlanEqu(); + equPlanEqu.setId(plan.getPlanEquId()); + List equs = equPlanEquMapper.selectEquPlanEquList(equPlanEqu); + if(CollectionUtils.isEmpty(equs)){ + return 0; + } + String orderEquId = IdUtils.fastSimpleUUID(); + //equs一定就一个实值 + for(EquPlanEqu equ:equs){ + equ.setId(orderEquId); + equ.setCreateTime(nowtime); + equ.setCreateBy(createBy); + equ.setDelFlag("0"); + equ.setCode(orderCode); + } + sce = equOrderEquMapper.insertEquOrderEqus(equs); + /**equ_plan_detail->equ_order_detail*******************************************************/ + EquPlanDetail itqo = new EquPlanDetail(); + itqo.setParentCode(plan.getPlanEquId()); + itqo.setDelFlag("0"); + List details = equPlanDetailMapper.selectEquPlanDetailList(itqo); + if(CollectionUtils.isEmpty(details)){ + return 0; + } - return 0; + List standards = new ArrayList<>(); + List standards0 = null; + for(EquPlanDetail itme:details){ + String detailId = IdUtils.fastSimpleUUID(); + EquPlanStandard standardqo = new EquPlanStandard(); + //equ_plan_detail的id + standardqo.setParentCode(itme.getId()); + standards0 = equPlanStandardMapper.selectEquPlanStandardList(standardqo); + for(EquPlanStandard standard:standards0) { + standard.setId(IdUtils.fastSimpleUUID()); + standard.setCreateTime(nowtime); + standard.setCreateBy(createBy); + standard.setDelFlag("0"); + standard.setPlanCode(orderCode); + standard.setParentCode(detailId); + } + standards.addAll(standards0); + + itme.setId(detailId); + itme.setCreateTime(nowtime); + itme.setCreateBy(createBy); + itme.setDelFlag("0"); + itme.setParentCode(orderEquId); + } + sce = equOrderDetailMapper.insertEquOrderDetails(details); + /**equ_plan_standard->equ_order_standard*******************************************************/ + if(CollectionUtils.isEmpty(standards)){ + return 0; + } + sce = equOrderStandardMapper.insertEquOrderStandards(standards); + /**equ_plan_person->equ_order_person*********************************************************/ + EquPlanPerson equPlanPerson = new EquPlanPerson(); + equPlanPerson.setPlanCode(plan.getPlanCode()); + List persons = equPlanPersonMapper.selectEquPlanPersonList(equPlanPerson); + if(CollectionUtils.isEmpty(persons)){ + return 0; + } + + for(EquPlanPerson person:persons){ + person.setId(IdUtils.fastSimpleUUID()); + person.setCreateTime(nowtime); + person.setCreateBy(createBy); + person.setDelFlag("0"); + person.setPlanCode(orderCode); + } + sce = equOrderPersonMapper.insertEquOrderPlans(persons); + 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 be468d21..29c262a3 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 @@ -5,7 +5,8 @@ select top 1 order_code orderCode, create_time createTime, - DATEDIFF (day, create_time, GETDATE()) days + DATEDIFF (day, create_time, GETDATE()) days + DATEDIFF (week, create_time, GETDATE()) days + DATEDIFF (month, create_time, GETDATE()) days + DATEDIFF (month, create_time, GETDATE())/3 days + DATEDIFF (year, create_time, GETDATE()) days from equ_order - where plan_type = #{planType} + where plan_type = #{planType} and plan_code = #{planCode} order by create_time desc diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemDetailMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemDetailMapper.xml index 7d6a5679..03432131 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemDetailMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquCheckItemDetailMapper.xml @@ -25,7 +25,9 @@ - select detail_id, parent_code, standard_type, standard_name, factory_code, detail_up_limit, detail_down_limit, detail_unit, attr1, attr2, attr3, del_flag, create_time, create_by, update_time, update_by, detail_code from equ_check_item_detail + select detail_id, parent_code, standard_type, standard_name, factory_code, detail_up_limit, detail_down_limit, + detail_unit, attr1, attr2, attr3, del_flag, create_time, create_by, update_time, update_by, detail_code + from equ_check_item_detail @@ -106,6 +109,25 @@ #{updateTime}, + + insert into equ_order_detail + ( + id, parent_code, + item_code, item_name, item_method, + item_type, item_type_name, factroy_code, del_flag, + create_by, create_time + ) + VALUES + + ( + #{item.id},#{item.parentCode}, + #{item.itemCode},#{item.itemName},#{item.itemMethod}, + #{item.itemType},#{item.itemTypeName},#{item.factroyCode},#{item.delFlag}, + #{item.createBy},#{item.createTime} + ) + + + update equ_order_detail @@ -141,4 +163,4 @@ #{id} - \ No newline at end of file + diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquMapper.xml index 1461f653..4802141e 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderEquMapper.xml @@ -89,6 +89,18 @@ #{updateTime}, + + insert into equ_order_equ( + id,order_code,equipment_code, equipment_name, + factory_code,del_flag, create_by, create_time + )values + + ( + #{item.id},#{item.code},#{item.equipmentCode},#{item.equipmentName}, + #{item.factoryCode},#{item.delFlag},#{item.createBy},#{item.createTime} + ) + + update equ_order_equ @@ -121,4 +133,4 @@ #{id} - \ No newline at end of file + diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml index 0d6c7009..f0b80d74 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderMapper.xml @@ -39,11 +39,15 @@ - - select order_id, plan_id, plan_code, plan_type, order_code, plan_workshop, plan_prod_line, plan_loop, plan_loop_type, plan_loop_start, plan_loop_end, order_start, order_end, equipment_code, order_status, order_cost, plan_person, order_cost_time, order_sign_person, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,upkeep,calculation_rule,shut_down,order_inspect,repair_code,work_code,plan_restrict from equ_order + select order_id, plan_id, plan_code, plan_type, order_code, plan_workshop, plan_prod_line, plan_loop, plan_loop_type, + plan_loop_start, plan_loop_end, order_start, order_end, equipment_code, order_status, + order_cost, plan_person, order_cost_time, order_sign_person, + factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, + update_by, update_time,upkeep,calculation_rule,shut_down,order_inspect,repair_code,work_code + from equ_order @@ -80,6 +82,21 @@ #{updateTime}, + + insert into equ_order_person + ( + id, order_code, user_id, user_name, factory_code, + del_flag, create_by, create_time + ) + VALUES + + ( + #{item.id},#{item.planCode}, + #{item.userId},#{item.userName},#{item.factroyCode}, + #{item.delFlag},#{item.createBy},#{item.createTime} + ) + + update equ_order_person @@ -110,4 +127,4 @@ #{id} - \ No newline at end of file + diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOrderStandardMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOrderStandardMapper.xml index 2f308e42..f42fe5c7 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOrderStandardMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOrderStandardMapper.xml @@ -37,7 +37,11 @@ - select id, code, parent_code, order_code, standard_type, standard_name, detail_up_limit, detail_down_limit, detail_unit, detail_reach, actual_value, detail_error, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time,error_flag,fault_type,repair_reach,repair_value,repair_picture from equ_order_standard + select id, code, parent_code, order_code, standard_type, standard_name, detail_up_limit, detail_down_limit, + detail_unit, detail_reach, actual_value, detail_error, factory_code, attr1, attr2, attr3, + del_flag, create_by, create_time, update_by, update_time,picture_path,error_flag,fault_type,repair_reach, + repair_value,repair_picture + from equ_order_standard @@ -160,4 +163,4 @@ update equ_plan_detail set del_flag = '1' where plan_code = #{planCode} - \ No newline at end of file + diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquPlanEquMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquPlanEquMapper.xml index 4db0ccfb..eb0f5923 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquPlanEquMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquPlanEquMapper.xml @@ -23,12 +23,15 @@ - select id, code, parent_code,plan_code, equipment_code, equipment_name, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_plan_equ + select id, code, parent_code,plan_code, equipment_code, equipment_name, factory_code, + attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time + from equ_plan_equ @@ -119,4 +121,4 @@ update equ_plan_person set del_flag = '1' where plan_code = #{planCode} - \ No newline at end of file + diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquPlanStandardMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquPlanStandardMapper.xml index 759f2caf..b8911d79 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquPlanStandardMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquPlanStandardMapper.xml @@ -27,7 +27,10 @@ - select id, code, parent_code,plan_code, detail_code, standard_type, standard_name, detail_up_limit, detail_down_limit, detail_unit, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time from equ_plan_standard + select id, code, parent_code,plan_code, detail_code, standard_type, standard_name, detail_up_limit, + detail_down_limit, detail_unit, factory_code, attr1, attr2, attr3, del_flag, create_by, create_time, + update_by, update_time + from equ_plan_standard + 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 ffb51e77..3e6128ca 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 @@ -137,8 +137,8 @@ public class ProOrder extends TreeEntity { private String planDateEnd; /** 创建日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "创建日期", width = 20, dateFormat = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "创建日期", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** 更新日期 */ 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 708b08f1..0818455e 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 @@ -150,5 +150,7 @@ public interface ProOrderWorkorderMapper { List selectProOrderWorkorderByOrderId(String orderId); int getProSortNo(ProOrder proOrder); + + void deleteProOrderWorkorderByOrderIds(String[] orderIds); } 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 01c5cf64..d7191c56 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 @@ -472,6 +472,7 @@ public class ProOrderServiceImpl implements IProOrderService { ProOrder orderExit = proOrderMapper.selectProOrderByOrderCode(proOrder.getOrderCode()); if (orderExit==null) {//不存在就插入 proOrder.setId(IdUtils.fastSimpleUUID()); + proOrder.setCreateTime(nowDate); proOrderMapper.insertProOrder(proOrder); logger.info("=======订单"+proOrder.getOrderCode()+"同步成功"); } else {//存在,如果没活动更新,否则不允许更新,关闭订单 @@ -493,7 +494,7 @@ public class ProOrderServiceImpl implements IProOrderService { //删除批次pro_order_workorder_batch proOrderWorkorderBatchMapper.deleteProOrderWorkorderBatchByWorkorderIds(ids); //删除工单pro_order_workorder - proOrderWorkorderMapper.deleteProOrderWorkorderByWorkorderIds(ids); + proOrderWorkorderMapper.deleteProOrderWorkorderByOrderIds(ids); } logger.info("=======订单"+proOrder.getOrderCode()+"同步成功"); }else{ @@ -547,7 +548,6 @@ public class ProOrderServiceImpl implements IProOrderService { order.setPlanFactoryCode(factoryCode); order.setFactoryCode(factoryCode); order.setCreateBy(SecurityUtils.getUsername()); - order.setCreateTime(DateUtils.getNowDate()); order.setOrderType("LJ01"); order.setProdType("prod"); order.setStatus("o0"); 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 694a8a40..6da59778 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 @@ -440,4 +440,12 @@ set del_flag = '1' where order_id = #{id} + + update pro_order_workorder + set del_flag = '1' + where order_id in + + #{orderId} + +