diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java b/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java index ae535217..1e4a53c3 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java @@ -30,4 +30,23 @@ public class DeviceInterfaceController { return deviceInterfaceService.getRepairWorkOrder(); } + /** + * 获取设备信息 + * @return + */ + @GetMapping("/getEquipmentInfo") + public AjaxResult getEquipmentInfo() { + return deviceInterfaceService.getEquipmentInfo(); + } + + /** + * 获取设备维修质量TOP10 + * 设备维修质量:故障时间/故障次数 + * @return + */ + @GetMapping("/getRepairQuantity") + public AjaxResult getRepairQuantity() { + return deviceInterfaceService.getRepairQuantity(); + } + } diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/vo/IEquipmentVO.java b/op-modules/op-device/src/main/java/com/op/device/domain/vo/IEquipmentVO.java new file mode 100644 index 00000000..fa8fa23d --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/domain/vo/IEquipmentVO.java @@ -0,0 +1,75 @@ +package com.op.device.domain.vo; + +// 设备信息VO、设备维修质量VO +public class IEquipmentVO { + // 设备名称 + private String equipmentName; + // 设备编码 + private String equipmentCode; + // 所在部门 + private String department; + // 状态 + private String status; + // 设备故障率 + private Double failureRate; + // 设备有效利用率 + private Double utilizationRatio; + // 设备维修质量 + private Double rapairQuantity; + + public Double getRapairQuantity() { + return rapairQuantity; + } + + public void setRapairQuantity(Double rapairQuantity) { + this.rapairQuantity = rapairQuantity; + } + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentCode() { + return equipmentCode; + } + + public void setEquipmentCode(String equipmentCode) { + this.equipmentCode = equipmentCode; + } + + public String getDepartment() { + return department; + } + + public void setDepartment(String department) { + this.department = department; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Double getFailureRate() { + return failureRate; + } + + public void setFailureRate(Double failureRate) { + this.failureRate = failureRate; + } + + public Double getUtilizationRatio() { + return utilizationRatio; + } + + public void setUtilizationRatio(Double utilizationRatio) { + this.utilizationRatio = utilizationRatio; + } +} diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/vo/IRepairWorkOrderVO.java b/op-modules/op-device/src/main/java/com/op/device/domain/vo/IRepairWorkOrderVO.java index 1151ebc6..b8416871 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/vo/IRepairWorkOrderVO.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/vo/IRepairWorkOrderVO.java @@ -1,6 +1,77 @@ package com.op.device.domain.vo; +import java.util.Date; + // 看板维修工单返回VO public class IRepairWorkOrderVO { + // 设备名称 + private String equipmentName; + // 设备编码 + private String equipmentCode; + // 故障描述 + private String workFaultDesc; + // 维修班组 + private String teamName; + // 是否立即维修 + private String workHandle; + // 计划维修时间 + private Date workPlanTime; + // 设备位置 + private String equipmentLocation; + + public String getEquipmentName() { + return equipmentName; + } + + public void setEquipmentName(String equipmentName) { + this.equipmentName = equipmentName; + } + + public String getEquipmentCode() { + return equipmentCode; + } + + public void setEquipmentCode(String equipmentCode) { + this.equipmentCode = equipmentCode; + } + + public String getWorkFaultDesc() { + return workFaultDesc; + } + + public void setWorkFaultDesc(String workFaultDesc) { + this.workFaultDesc = workFaultDesc; + } + + public String getTeamName() { + return teamName; + } + + public void setTeamName(String teamName) { + this.teamName = teamName; + } + + public String getWorkHandle() { + return workHandle; + } + + public void setWorkHandle(String workHandle) { + this.workHandle = workHandle; + } + + public Date getWorkPlanTime() { + return workPlanTime; + } + + public void setWorkPlanTime(Date workPlanTime) { + this.workPlanTime = workPlanTime; + } + + public String getEquipmentLocation() { + return equipmentLocation; + } + public void setEquipmentLocation(String equipmentLocation) { + this.equipmentLocation = equipmentLocation; + } } diff --git a/op-modules/op-device/src/main/java/com/op/device/mapper/DeviceInterfaceMapper.java b/op-modules/op-device/src/main/java/com/op/device/mapper/DeviceInterfaceMapper.java new file mode 100644 index 00000000..d5e16ac3 --- /dev/null +++ b/op-modules/op-device/src/main/java/com/op/device/mapper/DeviceInterfaceMapper.java @@ -0,0 +1,28 @@ +package com.op.device.mapper; + +import com.op.device.domain.EquRepairWorkOrder; +import com.op.device.domain.vo.IEquipmentVO; +import com.op.device.domain.vo.IRepairWorkOrderVO; + +import java.util.List; + +public interface DeviceInterfaceMapper { + + /** + * 查询待维修工单信息-看板 + * @return + */ + List selectEquRepairWorkOrderList(); + + /** + * 获取所有设备信息 + * @return + */ + List selectEquipmentList(); + + /** + * 获取维修工单中设备信息 + * @return + */ + List selectRepairEquipmentList(); +} diff --git a/op-modules/op-device/src/main/java/com/op/device/service/IDeviceInterfaceService.java b/op-modules/op-device/src/main/java/com/op/device/service/IDeviceInterfaceService.java index e8d22918..da05dd4f 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/IDeviceInterfaceService.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/IDeviceInterfaceService.java @@ -12,4 +12,16 @@ public interface IDeviceInterfaceService { * @return */ AjaxResult getRepairWorkOrder(); + + /** + * 获取设备信息 + * @return + */ + AjaxResult getEquipmentInfo(); + + /** + * 设备维修质量TOP10 + * @return + */ + AjaxResult getRepairQuantity(); } diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java index 1fe6f3c8..acc32181 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java @@ -3,6 +3,9 @@ package com.op.device.service.impl; import com.baomidou.dynamic.datasource.annotation.DS; import com.op.common.core.web.domain.AjaxResult; import com.op.device.domain.EquRepairWorkOrder; +import com.op.device.domain.vo.IEquipmentVO; +import com.op.device.domain.vo.IRepairWorkOrderVO; +import com.op.device.mapper.DeviceInterfaceMapper; import com.op.device.mapper.EquRepairWorkOrderMapper; import com.op.device.service.IDeviceInterfaceService; import org.springframework.beans.factory.annotation.Autowired; @@ -20,19 +23,69 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService { @Autowired private EquRepairWorkOrderMapper equRepairWorkOrderMapper; + @Autowired + private DeviceInterfaceMapper deviceInterfaceMapper; /** - * 获取维修工单 + * 获取待维修的维修工单 + * * @return */ @Override @DS("#header.poolName") public AjaxResult getRepairWorkOrder() { - // 获取待维修的工单 - EquRepairWorkOrder workTemp = new EquRepairWorkOrder(); - workTemp.setWorkStatus("0"); - List workOrderList = equRepairWorkOrderMapper.selectEquRepairWorkOrderList(workTemp); -// EquRepairWorkOrder workOrder = equRepairWorkOrderMapper.selectWaitingWorkOrder(); - return success(workOrderList); + List workOrderVOList = deviceInterfaceMapper.selectEquRepairWorkOrderList(); + for (IRepairWorkOrderVO orderVO : workOrderVOList) { + if (orderVO.getWorkHandle().equals("0")) { + orderVO.setWorkHandle("立即"); + } else { + orderVO.setWorkHandle("计划"); + } + } + return success(workOrderVOList); + } + + /** + * 获取设备信息 + * 故障停机率:(设备停机时间总和/一定时间内运行总时间(年)) + * 设备有效利用率:(试机产量/理论产量) + * + * @return + */ + @Override + @DS("#header.poolName") + public AjaxResult getEquipmentInfo() { + // 获取所有设备信息 + List equipmentVOList = deviceInterfaceMapper.selectEquipmentList(); + for (IEquipmentVO equipmentVO : equipmentVOList) { + // TODO 设备状态待修改 + if (equipmentVO.getStatus().equals("1")) { + equipmentVO.setStatus("正常"); + } else { + equipmentVO.setStatus("停用"); + } + // TODO 设备故障停机率 + equipmentVO.setFailureRate(0.90); + // TODO 设备有效利用率 + equipmentVO.setUtilizationRatio(0.80); + } + return success(equipmentVOList); + } + + /** + * 获取设备维修质量TOP10 + * 设备维修质量:故障时间/故障次数 + * @return + */ + @Override + @DS("#header.poolName") + public AjaxResult getRepairQuantity() { + List equipmentVOList = deviceInterfaceMapper.selectRepairEquipmentList(); + for (IEquipmentVO equipmentVO : equipmentVOList) { + // TODO 设备维修质量 + // TODO 排序TOP10 + equipmentVO.setRapairQuantity(0.70); + } + return success(equipmentVOList); } } diff --git a/op-modules/op-device/src/main/resources/mapper/device/DeviceInterfaceMapper.xml b/op-modules/op-device/src/main/resources/mapper/device/DeviceInterfaceMapper.xml new file mode 100644 index 00000000..72c636d1 --- /dev/null +++ b/op-modules/op-device/src/main/resources/mapper/device/DeviceInterfaceMapper.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + \ No newline at end of file