diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/DevicePDAController.java b/op-modules/op-device/src/main/java/com/op/device/controller/DevicePDAController.java index 2caac166..cfdba65d 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/DevicePDAController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/DevicePDAController.java @@ -137,6 +137,12 @@ public class DevicePDAController { return devicePDAService.updateMaintenanceRecords(equRepairWorkOrder); } + //传故障类型 +// @GetMapping(value = "/queryEquFaultTypeTree") +// public AjaxResult queryEquFaultTypeTree(EquRepairWorkOrder equRepairWorkOrder) { +// return devicePDAService.queryEquFaultTypeTree(equRepairWorkOrder); +// } + /** * 开始保养任务 * @param pdadto diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquFaultType.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquFaultType.java index 1aff0c83..0afa5673 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquFaultType.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquFaultType.java @@ -74,6 +74,14 @@ public class EquFaultType extends BaseEntity { // 创建日期结束 private String createTimeEnd; + //故障大类 + // 字典名 + private String dictLabel; + + // 字典值 + private String dictValue; + + public List getCreateTimeArray() { return createTimeArray; } @@ -193,6 +201,22 @@ public class EquFaultType extends BaseEntity { return delFlag; } + public void setDictValue(String dictValue) { + this.dictValue = dictValue; + } + + public String getDictValue() { + return dictValue; + } + + public void setDictLabel(String dictLabel) { + this.dictLabel = dictLabel; + } + + public String getDictLabel() { + return dictLabel; + } + @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/EquOrder.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquOrder.java index 820e0a08..a12354a0 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 @@ -165,6 +165,15 @@ public class EquOrder extends BaseEntity { /** 维护类型名称 */ private String itemTypeName; + /** 主键 */ + private String id; + public void setId(String id) { + this.id = id; + } + public String getId() { + return id; + } + //标准列表 public List getStandardList() { return standardList; diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquOutsourceWork.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquOutsourceWork.java index a4903fcb..6db1d97a 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquOutsourceWork.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquOutsourceWork.java @@ -61,6 +61,10 @@ public class EquOutsourceWork extends BaseEntity { @Excel(name = "委外用时") private String workCostTime; + /** 委外状态 */ + @Excel(name = "委外状态") + private String workStatus; + /** 备用字段1 */ @Excel(name = "备用字段1") private String attr1; @@ -185,6 +189,13 @@ public class EquOutsourceWork extends BaseEntity { return workCostTime; } + public void setWorkStatus(String workStatus) { + this.workStatus = workStatus; + } + public String getWorkStatus() { + return workStatus; + } + public void setAttr1(String attr1) { this.attr1 = attr1; } diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairWorkOrder.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairWorkOrder.java index d7f062b6..0ad69d53 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairWorkOrder.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquRepairWorkOrder.java @@ -122,18 +122,18 @@ public class EquRepairWorkOrder extends BaseEntity { /** 维修开始时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "维修开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private String workStartTime; + private Date workStartTime; /** 维修结束时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @Excel(name = "维修结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") - private String workEndTime; + private Date workEndTime; //维修停机真正开始时间 - private String actualDownStartTime; + private Date actualDownStartTime; //维修停机真正结束时间 - private String actualDownEndTime; + private Date actualDownEndTime; // 设备 /** 设备名称 */ @@ -545,17 +545,17 @@ public class EquRepairWorkOrder extends BaseEntity { } //维修工单 新增字段 维修开始结束时间 - public void setWorkStartTime(String workStartTime) { + public void setWorkStartTime(Date workStartTime) { this.workStartTime = workStartTime; } - public String getWorkStartTime() { + public Date getWorkStartTime() { return workStartTime; } - public void setWorkEndTime(String workEndTime) { + public void setWorkEndTime(Date workEndTime) { this.workEndTime = workEndTime; } - public String getWorkEndTime() { + public Date getWorkEndTime() { return workEndTime; } @@ -604,16 +604,16 @@ public class EquRepairWorkOrder extends BaseEntity { } //计划停机开始时间、结束时间 - public String getActualDownStartTime() { + public Date getActualDownStartTime() { return actualDownStartTime; } - public void setActualDownStartTime(String actualDownStartTime) { + public void setActualDownStartTime(Date actualDownStartTime) { this.actualDownStartTime = actualDownStartTime; } - public String getActualDownEndTime() { + public Date getActualDownEndTime() { return actualDownEndTime; } - public void setActualDownEndTime(String actualDownEndTime) { + public void setActualDownEndTime(Date actualDownEndTime) { this.actualDownEndTime = actualDownEndTime; } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/EquFaultTypeMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/EquFaultTypeMapper.java index 8f33ec25..914b2e93 100644 --- a/op-modules/op-device/src/main/java/com/op/device/mapper/EquFaultTypeMapper.java +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/EquFaultTypeMapper.java @@ -3,6 +3,7 @@ package com.op.device.mapper; import java.util.List; import com.op.device.domain.EquFaultType; +import com.op.device.domain.EquRepairWorkOrder; /** * 故障类型维护Mapper接口 @@ -64,4 +65,7 @@ public interface EquFaultTypeMapper { * @return */ int selectSerialNumber(); + + //故障报修第一级 + List selectFirstLevelList(EquRepairWorkOrder equRepairWorkOrder); } 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 9ab79a03..7e42afbf 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 @@ -121,13 +121,6 @@ public interface EquOrderMapper { */ List selectTodayTask(PDADTO pdadto); - /** - * PC获取点检、巡检检查项 - * @param - * @return - */ - List selectEquOrderDetailsList(EquOrder equOrder); - /** * 通过设备编码查询设备名称 * @param equipmentCode @@ -148,4 +141,18 @@ public interface EquOrderMapper { * @return */ void updateEquOrderRepairCode(EquOrder equOrder); + + /** + * 手持、PC获取维修点检、巡检检查项 + * @param + * @return + */ + List selectCheckListByWorkCode(EquOrder equOrder); + + /** + * 手持、PC获取报修点检、巡检检查项 + * @param + * @return + */ + List selectCheckListByRepairCode(EquOrder equOrder); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IDevicePDAService.java b/op-modules/op-device/src/main/java/com/op/device/service/IDevicePDAService.java index e4548a25..f559fe14 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/IDevicePDAService.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/IDevicePDAService.java @@ -91,6 +91,9 @@ public interface IDevicePDAService { */ public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder); + //获取设备故障类型 +// public AjaxResult queryEquFaultTypeTree(EquRepairWorkOrder equRepairWorkOrder); + //待处理 AjaxResult getMaintenancePendRecords(EquRepairWorkOrder equRepairWorkOrder); diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java index 3889ea54..c6655dcd 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DevicePDAServiceImpl.java @@ -23,10 +23,7 @@ import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Date; -import java.util.List; +import java.util.*; import static com.op.common.core.web.domain.AjaxResult.error; import static com.op.common.core.web.domain.AjaxResult.success; @@ -63,6 +60,9 @@ public class DevicePDAServiceImpl implements IDevicePDAService { @Autowired private EquFileMapper equFileMapper; + @Autowired + private EquFaultTypeMapper equFaultTypeMapper; + /** * 获取今日巡检任务工单list-状态不为已完成 @@ -266,7 +266,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService { equTeamUser.setUserName(SecurityUtils.getUsername()); EquTeamUser equTeamUserList = equRepairOrderMapper.getRepairPhoneNumber(equTeamUser); equRepairOrder.setOrderConnection(equTeamUserList.getPhonenumber()); - + equRepairOrder.setOrderRepairmanName(equTeamUserList.getNickName()); // 报修来源 if (equOrder.getPlanType().equals("inspection")){ equRepairOrder.setOrderSource("巡检"); @@ -414,7 +414,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService { } /** - * 获取待维修记录(除了待维修) + * 获取维修记录(除了待维修) * * @param equRepairWorkOrder * @return @@ -474,7 +474,11 @@ public class DevicePDAServiceImpl implements IDevicePDAService { public AjaxResult updateDowntime(EquRepairWorkOrder equRepairWorkOrder) { try { //不停机 那么实际停机开始时间和实际停机结束时间都没有 - //如果停机 那么实际停机时间就是传入的时间 停机时间必须选择校验 + //如果停机 那么实际停机时间就是传入的时间 + equRepairWorkOrder.setWorkStartTime(DateUtils.getNowDate()); + if(equRepairWorkOrder.getWorkDownMachine().equals("1")){ + equRepairWorkOrder.setActualDownStartTime(DateUtils.getNowDate()); + } equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername()); equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate()); //维修中 @@ -518,11 +522,12 @@ public class DevicePDAServiceImpl implements IDevicePDAService { EquOrder equOrder = new EquOrder(); equOrder.setWorkCode(list.getWorkCode()); //检查项 - List checkLists = equOrderMapper.selectEquOrderDetailsList(equOrder); + List checkLists = equOrderMapper.selectCheckListByWorkCode(equOrder); //每个检查项对应的检测标准 for(EquOrder equOrder1 :checkLists){ EquOrderStandard equOrderStandard = new EquOrderStandard(); equOrderStandard.setOrderCode(equOrder1.getOrderCode()); + equOrderStandard.setParentCode(equOrder1.getId()); List standardLists = equOrderStandardMapper.selectPdaEquOrderList(equOrderStandard); for(EquOrderStandard standardList :standardLists){ //每个检查标准里面的照片 @@ -562,6 +567,16 @@ public class DevicePDAServiceImpl implements IDevicePDAService { @DS("#header.poolName") public AjaxResult updateMaintenanceRecords(EquRepairWorkOrder equRepairWorkOrder) { try { + //判断是否停机 + EquRepairWorkOrder list = equRepairWorkOrderMapper.selectEquRepairWorkOrderByWorkId(equRepairWorkOrder.getWorkId()); + if(list.getWorkDownMachine().equals("1")){ + //维修结束时间、维修真正停机时间 + equRepairWorkOrder.setActualDownEndTime(DateUtils.getNowDate()); + equRepairWorkOrder.setWorkEndTime(DateUtils.getNowDate()); + //维修完成 + equRepairWorkOrder.setWorkStatus("1"); + } + //更新每一项点检/巡检检查项信息 List checkLists = equRepairWorkOrder.getDetailList(); for(EquOrder checkList:checkLists){ @@ -594,6 +609,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService { } equOrderMapper.updateEquOrder(checkList); } + //新建申领单 缺少code List equSpareApplies = equRepairWorkOrder.getApplyList(); for(EquSpareApply equSpareApply:equSpareApplies){ @@ -603,7 +619,7 @@ public class DevicePDAServiceImpl implements IDevicePDAService { equSpareApply.setApplyTime(DateUtils.getNowDate()); equSpareApplyMapper.insertEquSpareApply(equSpareApply); } - //维修人员名字????前端能够提供吗??? + //图片 //先删除每个维修工单对应图片 equRepairWorkOrderMapper.deleteBaseFileBySourceId(equRepairWorkOrder.getWorkId()); @@ -628,10 +644,33 @@ public class DevicePDAServiceImpl implements IDevicePDAService { equRepairWorkOrder.setUpdateBy(SecurityUtils.getUsername()); equRepairWorkOrder.setUpdateTime(DateUtils.getNowDate()); equRepairWorkOrderMapper.updateEquRepairWorkOrder(equRepairWorkOrder); - //需要更新设备状态 + //需要更新设备状态????这里没做 return success("提交成功,维修完成!"); } catch (Exception e) { return error(); } } + + /** + * 查询故障树 + * + * @param equRepairWorkOrder + * @return + */ +// @Override +// @DS("#header.poolName") +// public AjaxResult queryEquFaultTypeTree(EquRepairWorkOrder equRepairWorkOrder) { +// // 查询一级数据 +// List firstLevel = equFaultTypeMapper.selectFirstLevelList(equRepairWorkOrder); +// // 一级list +// List firstTree = new ArrayList<>(); +// // 判空 +// if (!CollectionUtils.isEmpty(firstLevel)) { +// for(EquFaultType equFaultType : firstLevel){ +// +// } +// } +// +// return treeAll; +// } } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java index efd46e05..4291e868 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquOrderServiceImpl.java @@ -288,6 +288,7 @@ public class EquOrderServiceImpl implements IEquOrderService { equTeamUser.setUserName(SecurityUtils.getUsername()); EquTeamUser equTeamUserList = equRepairOrderMapper.getRepairPhoneNumber(equTeamUser); equRepairOrder.setOrderConnection(equTeamUserList.getPhonenumber()); + equRepairOrder.setOrderRepairmanName(equTeamUserList.getNickName()); // 报修来源 if (equOrder.getPlanType().equals("inspection")) { 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 4cb8f174..de1ffbac 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 @@ -72,11 +72,12 @@ public class EquRepairOrderServiceImpl implements IEquRepairOrderService { //报修单号 equOrder.setRepairCode(list.getOrderCode()); //检查项 - List checkLists = equOrderMapper.selectEquOrderDetailsList(equOrder); + List checkLists = equOrderMapper.selectCheckListByRepairCode(equOrder); //每个检查项对应的检测标准 for(EquOrder equOrder1 :checkLists){ EquOrderStandard equOrderStandard = new EquOrderStandard(); equOrderStandard.setOrderCode(equOrder1.getOrderCode()); + equOrderStandard.setParentCode(equOrder1.getId()); List standardLists = equOrderStandardMapper.selectPdaEquOrderList(equOrderStandard); for(EquOrderStandard standardList :standardLists){ //每个检查标准里面的照片 diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java index 272525d5..4e9302b7 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/EquRepairWorkOrderServiceImpl.java @@ -68,11 +68,12 @@ public class EquRepairWorkOrderServiceImpl implements IEquRepairWorkOrderService EquOrder equOrder = new EquOrder(); equOrder.setWorkCode(list.getWorkCode()); //检查项 - List checkLists = equOrderMapper.selectEquOrderDetailsList(equOrder); + List checkLists = equOrderMapper.selectCheckListByWorkCode(equOrder); //每个检查项对应的检测标准 for(EquOrder equOrder1 :checkLists){ EquOrderStandard equOrderStandard = new EquOrderStandard(); equOrderStandard.setOrderCode(equOrder1.getOrderCode()); + equOrderStandard.setParentCode(equOrder1.getId()); List standardLists = equOrderStandardMapper.selectPdaEquOrderList(equOrderStandard); for(EquOrderStandard standardList :standardLists){ //每个检查标准里面的照片 diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquFaultTypeMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquFaultTypeMapper.xml index 4945af13..413383c4 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquFaultTypeMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquFaultTypeMapper.xml @@ -19,6 +19,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + @@ -125,4 +130,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{faultId} + + + + \ 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 6ebf8ba3..65da4369 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 @@ -40,6 +40,7 @@ + @@ -286,23 +287,39 @@ - select eo.order_id, eo.order_code, eo.repair_code, eo.work_code, + eod.id, eod.item_name, eod.item_method, eod.item_type, eod.item_type_name from equ_order eo left join equ_order_detail eod on eo.order_code = eod.order_code - - and eo.work_code = #{workCode} - and eo.repair_code = #{repairCode} - and eo.del_flag = '0' - + where eo.work_code = #{workCode} + and eo.del_flag = '0' + + + + 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 5eff47db..466095ba 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 @@ -223,23 +223,19 @@ diff --git a/op-modules/op-device/src/main/resources/mapper/device/EquOutsourceWorkMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/EquOutsourceWorkMapper.xml index e23f2181..19c22bd1 100644 --- a/op-modules/op-device/src/main/resources/mapper/device/EquOutsourceWorkMapper.xml +++ b/op-modules/op-device/src/main/resources/mapper/device/EquOutsourceWorkMapper.xml @@ -17,6 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -35,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select work_id, work_code,order_code, repair_code, work_person, work_outsourcing_unit, work_connection, work_reason, work_type, equipment_code, work_cost, work_cost_time, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_outsource_work + select work_id, work_code,order_code, repair_code, work_person, work_outsourcing_unit, work_connection, work_reason, work_type, equipment_code, work_cost, work_cost_time,work_status, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_outsource_work