diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/EquipAlarmDataController.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/EquipAlarmDataController.java index fdd43e6..07ed92b 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/EquipAlarmDataController.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/EquipAlarmDataController.java @@ -97,4 +97,17 @@ public class EquipAlarmDataController { BeanUtils.toBean(list, EquipAlarmDataRespVO.class)); } + @Operation(summary = "获取报警提交维修工单详情") + @GetMapping("/getSubmitOrderDetails/{alarmId}") + @PreAuthorize("@ss.hasPermission('imt:equip-alarm-data:query')") + public CommonResult getSubmitOrderDetails(@PathVariable("alarmId") String alarmId) { + return success(equipAlarmDataService.getSubmitOrderDetails(alarmId)); + } + + @GetMapping("/isSubmitOrder/{alarmId}") + @Operation(summary = "判断报警是否已经提交工单") + public CommonResult isSubmitOrder(@PathVariable("alarmId") String alarmId){ + return success(equipAlarmDataService.isSubmitOrder(alarmId)); + } + } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/vo/AlarmSubmitOrderDetailsVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/vo/AlarmSubmitOrderDetailsVO.java new file mode 100644 index 0000000..68e8247 --- /dev/null +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/admin/alarm/vo/AlarmSubmitOrderDetailsVO.java @@ -0,0 +1,81 @@ +package com.inspur.module.system.controller.admin.alarm.vo; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * 报警提交维修工单详情 + * + * @Author xusd + * @Date 2024/9/14 14:39 + **/ +@Data +public class AlarmSubmitOrderDetailsVO { + + /** + * 设备预警信息主键 + */ + private String equipAlarmId; + + /** + * 机床设备id + */ + private String equipId; + + /** + * 机床设备编号 + */ + private String equipNo; + + /** + * 设备型号 + */ + private String modelName; + + /** + * 机床分析状态(0:正常,1:磨损中,2:磨损严重) + */ + private Integer equipAnalyseStatus; + + /** + * 机床组件id + */ + private String componentId; + + /** + * 机床组件名称 + */ + private String componentName; + + /** + * 机床客户信息id + */ + private String customerId; + + /** + * 机床客户名称 + */ + private String customerName; + + /** + * 报警等级 + */ + private Integer alarmLevel; + + /** + * 报警类型 + */ + private Integer alarmType; + + /** + * 首次报警时间 + */ + private LocalDateTime firstAlarmTime; + + /** + * 最新报警时间 + */ + private LocalDateTime latestAlarmTime; + +} diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/EquipAlarmDataMapper.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/EquipAlarmDataMapper.java index 43718a1..7449936 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/EquipAlarmDataMapper.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/dal/mysql/alarm/EquipAlarmDataMapper.java @@ -48,4 +48,14 @@ public interface EquipAlarmDataMapper extends BaseMapperX { */ List getEquipAlarmDataByEquipIdAndAlarmType(@Param("equipId") String equipId, @Param("alarmType") Integer alarmType); + + /** + * 获取报警提交维修工单详情 + * + * @Author xusd + * @Date 14:42 2024/9/14 + * @param alarmId 报警id + * @return com.inspur.module.system.controller.admin.alarm.vo.AlarmSubmitOrderDetailsVO + */ + AlarmSubmitOrderDetailsVO getSubmitOrderDetails(@Param("alarmId") String alarmId); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataService.java index 25e1faf..bc15485 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataService.java @@ -57,4 +57,24 @@ public interface EquipAlarmDataService { * 通过设备id查询设备报警数据 */ List getEquipAlarmDataByEquipId(String equipId,Integer alarmType); + + /** + * 获取报警提交维修工单详情 + * + * @Author xusd + * @Date 14:42 2024/9/14 + * @param alarmId 报警id + * @return com.inspur.module.system.controller.admin.alarm.vo.AlarmSubmitOrderDetailsVO + */ + AlarmSubmitOrderDetailsVO getSubmitOrderDetails(String alarmId); + + /** + * 判断报警是否已经提交工单 + * + * @Author xusd + * @Date 16:44 2024/9/14 + * @param alarmId 报警id + * @return java.lang.Boolean + */ + Boolean isSubmitOrder(String alarmId); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataServiceImpl.java index fa4b7ca..fc3abec 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/EquipAlarmDataServiceImpl.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.inspur.framework.tenant.core.aop.TenantIgnore; import com.inspur.module.system.dal.dataobject.alarm.AlarmRulesDO; +import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO; +import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -36,6 +38,9 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService { @Resource private EquipAlarmDataMapper equipAlarmDataMapper; + @Resource + private MaintenanceOrderMapper maintenanceOrderMapper; + @Override @TenantIgnore public String createEquipAlarmData(EquipAlarmDataSaveReqVO createReqVO) { @@ -91,4 +96,16 @@ public class EquipAlarmDataServiceImpl implements EquipAlarmDataService { public List getEquipAlarmDataByEquipId(String equipId,Integer alarmType) { return equipAlarmDataMapper.getEquipAlarmDataByEquipIdAndAlarmType(equipId,alarmType); } + + @Override + public AlarmSubmitOrderDetailsVO getSubmitOrderDetails(String alarmId) { + return equipAlarmDataMapper.getSubmitOrderDetails(alarmId); + } + + @Override + public Boolean isSubmitOrder(String alarmId) { + MaintenanceOrderDO maintenanceOrderDO = maintenanceOrderMapper.selectOne(MaintenanceOrderDO::getAlarmId, alarmId); + return Objects.nonNull(maintenanceOrderDO); + } + } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/alarm/EquipAlarmDataMapper.xml b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/alarm/EquipAlarmDataMapper.xml index 05c4508..984a902 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/alarm/EquipAlarmDataMapper.xml +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/alarm/EquipAlarmDataMapper.xml @@ -17,8 +17,24 @@ + + + + + + + + + + + + + + + + - select iead.equip_alarm_id, iead.equip_id, iead.component_id, iead.alarm_level, iead.alarm_type, iead.first_alarm_time, iead.latest_alarm_time, iead.status, iead.equip_analyse_status, cui.customer_name, ei.equip_no, imi.model_name, ci.component_name from imt_equip_alarm_data iead + select iead.equip_alarm_id, iead.equip_id, iead.component_id, iead.alarm_level, iead.alarm_type, iead.first_alarm_time, iead.latest_alarm_time, iead.status, iead.equip_analyse_status, cui.customer_name, ei.equip_no, imi.model_name, ci.component_name, cui.customer_id from imt_equip_alarm_data iead left join imt_equip_info ei on iead.equip_id = ei.equip_id left join imt_model_info imi on ei.model_id = imi.model_id left join imt_component_info ci on iead.component_id = ci.component_id @@ -49,4 +65,9 @@ and iead.deleted = '0' and iead.alarm_type = #{alarmType} + \ No newline at end of file diff --git a/imt-ui/src/api/system/alarm/equipalarmdata.js b/imt-ui/src/api/system/alarm/equipalarmdata.js index d7ef85a..f825005 100644 --- a/imt-ui/src/api/system/alarm/equipalarmdata.js +++ b/imt-ui/src/api/system/alarm/equipalarmdata.js @@ -51,3 +51,19 @@ export function exportEquipAlarmDataExcel(params) { responseType: "blob", }); } + +// 获取报警提交维修工单详情 +export function getSubmitOrderDetails(alarmId) { + return request({ + url: "/imt/equip-alarm-data/getSubmitOrderDetails/" + alarmId, + method: "get", + }); +} + +// 判断报警是否已经提交工单 +export function isSubmitOrder(alarmId) { + return request({ + url: "/imt/equip-alarm-data/isSubmitOrder/" + alarmId, + method: "get", + }); +} diff --git a/imt-ui/src/views/system/alarm/alarmdata/index.vue b/imt-ui/src/views/system/alarm/alarmdata/index.vue index a207464..e9f16ba 100644 --- a/imt-ui/src/views/system/alarm/alarmdata/index.vue +++ b/imt-ui/src/views/system/alarm/alarmdata/index.vue @@ -364,6 +364,7 @@ >
@@ -504,9 +505,10 @@ style="height:500px" >
+ - +