diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/EquRepairOrderController.java b/op-modules/op-device/src/main/java/com/op/device/controller/EquRepairOrderController.java index e77b9694..9d787425 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/EquRepairOrderController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/EquRepairOrderController.java @@ -4,6 +4,7 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; import com.op.device.domain.EquEquipment; +import com.op.device.domain.EquTeamUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -130,9 +131,9 @@ public class EquRepairOrderController extends BaseController { * 查询报修人员列表 */ @GetMapping("/getRepairPersonList") - public TableDataInfo getRepairPersonList(EquEquipment equEquipment) { + public TableDataInfo getRepairPersonList(EquTeamUser equTeamUser) { startPage(); - List list = equRepairOrderService.getRepairPersonList(equEquipment); + List list = equRepairOrderService.getRepairPersonList(equTeamUser); return getDataTable(list); } diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java index 64dc108a..4dcfca2a 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java @@ -605,6 +605,35 @@ public class EquOrder extends BaseEntity { return delFlag; } + //检查项详情 + public void setItemName(String itemName) { + this.itemName = itemName; + } + public String getItemName() { + return itemName; + } + + public void setItemMethod(String itemMethod) { + this.itemMethod = itemMethod; + } + public String getItemMethod() { + return itemMethod; + } + + public void setItemType(String itemType) { + this.itemType = itemType; + } + public String getItemType() { + return itemType; + } + + public void setItemTypeName(String itemTypeName) { + this.itemTypeName = itemTypeName; + } + public String getItemTypeName() { + return itemTypeName; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairOrder.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairOrder.java index cfed6350..60c6e759 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairOrder.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairOrder.java @@ -178,6 +178,16 @@ public class EquRepairOrder extends BaseEntity { //检查项列表 private List checkList; + //时间列表 虚拟字段 + private List orderBreakdownTimeArray; + private List orderTimeArray; + //故障开始时间、故障结束时间 + private String orderBreakdownTimeStart; + private String orderBreakdownTimeEnd; + //报修开始时间、结束时间 + private String orderTimeStart; + private String orderTimeEnd; + //图片文件 public String getFileList() { return fileList; @@ -463,6 +473,49 @@ public class EquRepairOrder extends BaseEntity { this.checkList = checkList; } + //时间列表 + public List getOrderBreakdownTimeArray() { + return orderBreakdownTimeArray; + } + public void setOrderBreakdownTimeArray(List orderBreakdownTimeArray) { + this.orderBreakdownTimeArray = orderBreakdownTimeArray; + } + + public List getOrderTimeArray() { + return orderTimeArray; + } + public void setOrderTimeArray(List orderTimeArray) { + this.orderTimeArray = orderTimeArray; + } + + //故障开始时间、结束时间 + public String getOrderBreakdownTimeStart() { + return orderBreakdownTimeStart; + } + public void setOrderBreakdownTimeStart(String orderBreakdownTimeStart) { + this.orderBreakdownTimeStart = orderBreakdownTimeStart; + } + public String getOrderBreakdownTimeEnd() { + return orderBreakdownTimeEnd; + } + public void setOrderBreakdownTimeEnd(String orderBreakdownTimeEnd) { + this.orderBreakdownTimeEnd = orderBreakdownTimeEnd; + } + + //报修开始时间、结束时间 + public String getOrderTimeStart() { + return orderTimeStart; + } + public void setOrderTimeStart(String orderTimeStart) { + this.orderTimeStart = orderTimeStart; + } + public String getOrdeTimeEnd() { + return orderTimeEnd; + } + public void setOrderTimeEnd(String orderTimeEnd) { + this.orderTimeEnd = orderTimeEnd; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) 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 5d29e9ff..9ab79a03 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 @@ -134,4 +134,18 @@ public interface EquOrderMapper { * @return */ String selectEquipmentNameByEquCode(String equipmentCode); + + /** + * 通过OrderCode查询对应所有检查项ID + * @param orderCode + * @return + */ + List getIdsByOrderCode(String orderCode); + + /** + * 只更新维修单号 + * @param equOrder + * @return + */ + void updateEquOrderRepairCode(EquOrder equOrder); } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquRepairOrderMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquRepairOrderMapper.java index 13282b06..ea564636 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquRepairOrderMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquRepairOrderMapper.java @@ -7,6 +7,7 @@ import com.op.common.core.domain.BaseFileData; import com.op.device.domain.EquEquipment; import com.op.device.domain.EquFile; import com.op.device.domain.EquRepairOrder; +import com.op.device.domain.EquTeamUser; import org.apache.ibatis.annotations.Param; /** @@ -72,7 +73,7 @@ public interface EquRepairOrderMapper { //查询报修人员列表 @DS("master") - List getRepairPersonList(EquEquipment equEquipment); + List getRepairPersonList(EquTeamUser equTeamUser); /** * 通过报修code查询报修单信息 diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IEquRepairOrderService.java b/op-modules/op-device/src/main/java/com/op/device/service/IEquRepairOrderService.java index ef98c30e..097698ab 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/IEquRepairOrderService.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/IEquRepairOrderService.java @@ -3,10 +3,8 @@ package com.op.device.service; import java.util.List; import com.op.common.core.web.domain.AjaxResult; +import com.op.device.domain.*; import com.op.device.domain.EquEquipment; -import com.op.device.domain.EquEquipment; -import com.op.device.domain.EquRepairOrder; -import com.op.device.domain.EquRepairWorkOrder; /** * 故障报修Service接口 @@ -78,5 +76,5 @@ public interface IEquRepairOrderService { public int checkEquRepairOrder(EquRepairOrder equRepairOrder); //查询报修人员列表 - List getRepairPersonList(EquEquipment equEquipment); + List getRepairPersonList(EquTeamUser equTeamUser); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairOrderServiceImpl.java index 55d73659..48a1a3ce 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairOrderServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairOrderServiceImpl.java @@ -1,5 +1,6 @@ package com.op.device.service.impl; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -66,19 +67,6 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService { list.setFiles(files); } -// //查询对应检查项信息 -// EquOrder equOrder = new EquOrder(); -// equOrder.setOrderCode(list.getOrderCode()); -// List checkLists = equOrderStandardMapper.selectPdaEquOrderList(equOrder); -// //每个检查项对应文件 -// for(EquOrderStandard equOrderStandard :checkLists){ -// List file = equOrderStandardMapper.getBaseFileBatch(equOrderStandard.getId()); -// if (!CollectionUtils.isEmpty(file)) { -// equOrderStandard.setPicturePaths(file); -// } -// } -// list.setCheckList(checkLists); - //查询对应检查项信息 EquOrder equOrder = new EquOrder(); //报修单号 @@ -112,6 +100,22 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService { @Override @DS("#header.poolName") public List selectEquRepairOrderList(EquRepairOrder equRepairOrder) { + if (equRepairOrder.getOrderBreakdownTimeArray() != null) { + // 设置故障开始时间、结束时间 + if (equRepairOrder.getOrderBreakdownTimeArray().size() == 2) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + equRepairOrder.setOrderBreakdownTimeStart(formatter.format(equRepairOrder.getOrderBreakdownTimeArray().get(0))); + equRepairOrder.setOrderBreakdownTimeEnd(formatter.format(equRepairOrder.getOrderBreakdownTimeArray().get(1))); + } + } + if (equRepairOrder.getOrderTimeArray() != null) { + // 设置更新日期开始和结束 + if (equRepairOrder.getOrderTimeArray().size() == 2) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + equRepairOrder.setOrderTimeStart(formatter.format(equRepairOrder.getOrderTimeArray().get(0))); + equRepairOrder.setOrderTimeEnd(formatter.format(equRepairOrder.getOrderTimeArray().get(1))); + } + } return equRepairOrderMapper.selectEquRepairOrderList(equRepairOrder); } @@ -166,14 +170,31 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService { @Override @DS("#header.poolName") public int checkEquRepairOrder(EquRepairOrder equRepairOrder) { + //改了,不生成流水号,从第十位开始切割 + String code = equRepairOrder.getOrderCode().substring(10); + String workCode = DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + code; + //判断是否是点检、巡检过来的 + if(equRepairOrder.getOrderSource().equals("点检") || equRepairOrder.getOrderSource().equals("巡检")){ + //更新检查项信息 + EquOrder equOrder = new EquOrder(); + List ids = equOrderMapper.getIdsByOrderCode(equRepairOrder.getOrderCode()); + for(String id :ids){ + EquOrder one = new EquOrder(); + one.setOrderId(id); + one.setWorkCode("WX" + workCode); + one.setUpdateBy(SecurityUtils.getUsername()); + one.setUpdateTime(DateUtils.getNowDate()); + //只更新其中一个信息 + equOrderMapper.updateEquOrderRepairCode(one); + } + } + if(equRepairOrder.getRepairDestination().equals("计划性维修")){ EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder(); //报修单号 equRepairWorkOrder.setOrderCode(equRepairOrder.getOrderCode()); //维修单号 - String serialNum = String.format("%03d", equRepairWorkOrderMapper.selectWorkCodeSerialNumber()); - String equipmentCode = equRepairOrder.getEquipmentCode(); - equRepairWorkOrder.setWorkCode("WX"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum); + equRepairWorkOrder.setWorkCode("WX" + workCode); equRepairWorkOrder.setOrderId(equRepairOrder.getOrderId()); equRepairWorkOrder.setEquipmentCode(equRepairOrder.getEquipmentCode()); equRepairWorkOrder.setWorkTeam(equRepairOrder.getWorkTeam()); @@ -202,17 +223,17 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService { equRepairWorkOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder); equRepairOrder.setOrderStatus("审核通过"); + }else if(equRepairOrder.getRepairDestination().equals("不维修")){ equRepairOrder.setOrderStatus("驳回"); + }else if(equRepairOrder.getRepairDestination().equals("委外维修")){ EquOutsourceWork equOutsourceWork = new EquOutsourceWork(); //委外工单编码、id、联系方式、委外单位、委外人员、委外原因 equOutsourceWork.setWorkId(IdUtils.fastSimpleUUID()); equOutsourceWork.setOrderCode(equRepairOrder.getOrderCode()); - String serialNum = String.format("%03d", equOutsourceWorkMapper.selectWorkCodeSerialNumber()); - String equipmentCode = equRepairOrder.getEquipmentCode(); - equOutsourceWork.setEquipmentCode(equipmentCode); - equOutsourceWork.setWorkCode("WW"+DateUtils.dateTimeNow(DateUtils.YYYYMMDD) + equipmentCode + serialNum); + equOutsourceWork.setEquipmentCode(equRepairOrder.getEquipmentCode()); + equOutsourceWork.setWorkCode("WW" + workCode); equOutsourceWork.setRepairCode("无"); equOutsourceWork.setWorkConnection(equRepairOrder.getWorkConnection()); equOutsourceWork.setWorkOutsourcingUnit(equRepairOrder.getWorkOutsourcingUnit()); @@ -226,10 +247,38 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService { equOutsourceWorkMapper.insertEquOutsourceWork(equOutsourceWork); equRepairOrder.setOrderStatus("审核通过"); }else if(equRepairOrder.getRepairDestination().equals("立即维修")){ - //立即维修 - //是否立即维修 1是 0 否 EquRepairWorkOrder equRepairWorkOrder = new EquRepairWorkOrder(); + //报修单号 + equRepairWorkOrder.setOrderCode(equRepairOrder.getOrderCode()); + //维修单号 + equRepairWorkOrder.setWorkCode("WX"+workCode); + equRepairWorkOrder.setOrderId(equRepairOrder.getOrderId()); + equRepairWorkOrder.setEquipmentCode(equRepairOrder.getEquipmentCode()); + equRepairWorkOrder.setWorkTeam(equRepairOrder.getWorkTeam()); + //不委外 + equRepairWorkOrder.setWorkOutsource("0"); + equRepairWorkOrder.setOutWorkCode("无"); + //是否立即维修 1是 0 否 equRepairWorkOrder.setWorkHandle("0"); + //计划维修时间 + equRepairWorkOrder.setWorkPlanTime(equRepairOrder.getWorkPlanTime()); + //是否停机维修 停机维修时间 + if(equRepairOrder.getWorkPlanDownTime() != null){ + equRepairWorkOrder.setWorkDownMachine("1"); + equRepairWorkOrder.setWorkPlanDownTime(equRepairOrder.getWorkPlanDownTime()); + }else{ + equRepairWorkOrder.setWorkDownMachine("0"); + } + equRepairWorkOrder.setWorkFaultDesc(equRepairOrder.getOrderDesc()); + equRepairWorkOrder.setWorkStatus("0"); + equRepairWorkOrder.setWorkId(IdUtils.fastSimpleUUID()); + equRepairWorkOrder.setCreateTime(DateUtils.getNowDate()); + equRepairWorkOrder.setCreateBy(SecurityUtils.getUsername()); + //工厂 + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + String key = "#header.poolName"; + equRepairWorkOrder.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_","")); + equRepairWorkOrderMapper.insertEquRepairWorkOrder(equRepairWorkOrder); equRepairOrder.setOrderStatus("审核通过"); } equRepairOrder.setUpdateTime(DateUtils.getNowDate()); @@ -326,12 +375,12 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService { /** * 查询报修人员列表 * - * @param equEquipment + * @param equTeamUser * @return */ @Override @DS("#header.poolName") - public List getRepairPersonList(EquEquipment equEquipment) { - return equRepairOrderMapper.getRepairPersonList(equEquipment); + public List getRepairPersonList(EquTeamUser equTeamUser) { + return equRepairOrderMapper.getRepairPersonList(equTeamUser); } } 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 a5d1aa8f..6ebf8ba3 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 @@ -305,4 +305,25 @@ + + + + + + + update equ_order + + update_by = #{updateBy}, + update_time = #{updateTime}, + work_code = #{workCode}, + + where order_id = #{orderId} + + 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 ec27f3ef..07d13fe8 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 @@ -226,7 +226,7 @@ eos.id, eos.order_code, eos.standard_name, - eod.item_method, + eos.detail_up_limit, eos.detail_down_limit, eos.detail_unit, diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquRepairOrderMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquRepairOrderMapper.xml index fb112684..26c3564d 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquRepairOrderMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquRepairOrderMapper.xml @@ -46,6 +46,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + @@ -81,9 +84,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and order_code like concat('%', #{orderCode}, '%') and equipment_code like concat('%', #{equipmentCode}, '%') and order_desc like concat('%', #{orderDesc}, '%') - and order_breakdown_time = #{orderBreakdownTime} + + and CONVERT(date,order_breakdown_time) >= #{orderBreakdownTimeStart} + and #{orderBreakdownTimeEnd} >= CONVERT(date,order_breakdown_time) and order_source like concat('%', #{orderSource}, '%') - and order_time = #{orderTime} + + and CONVERT(date,order_time) >= #{orderTimeStart} + and #{orderTimeEnd} >= CONVERT(date,order_time) and order_handle = #{orderHandle} and order_repairman_code like concat('%', #{orderRepairmanCode}, '%') and order_repairman_name like concat('%', #{orderRepairmanName}, '%') @@ -268,7 +275,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" nick_name AS nickName, CONCAT(nick_name,user_name) AS teamUserName from sys_user - where del_flag = '0' + + and user_name like concat('%', #{userName}, '%') + and nick_name like concat('%', #{nickName}, '%') + and del_flag = '0' +