diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoSaveReqVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoSaveReqVO.java index 3d4904b..a480f76 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoSaveReqVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/inspection/vo/InspectionInfoSaveReqVO.java @@ -40,4 +40,6 @@ public class InspectionInfoSaveReqVO { @Schema(description = "定制化点检反馈") private String exclusiveInspectionFeedback; + private Boolean closeAlarm; + } \ No newline at end of file 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 497fdeb..aa42559 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 @@ -55,7 +55,7 @@ public interface EquipAlarmDataMapper extends BaseMapperX { .leftJoin(ModelInfoDO.class, ModelInfoDO::getModelId, EquipInfoDO::getModelId) .leftJoin(CustomerInfoDO.class, CustomerInfoDO::getCustomerId, EquipInfoDO::getCustomerId) .leftJoin(ComponentInfoDO.class, ComponentInfoDO::getComponentId, EquipAlarmDataDO::getComponentId) - .eq(EquipAlarmDataDO::getStatus, 0) + .ne(EquipAlarmDataDO::getStatus, 1) .eqIfExists(EquipAlarmDataDO::getEquipId, reqVO.getEquipId()) .eqIfExists(EquipAlarmDataDO::getComponentId, reqVO.getComponentId()) .eqIfExists(EquipAlarmDataDO::getAlarmLevel, reqVO.getAlarmLevel()) diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoServiceImpl.java index 6290d87..da6715f 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoServiceImpl.java @@ -16,12 +16,14 @@ import com.inspur.module.system.controller.admin.inspection.vo.InspectionPlanLis import com.inspur.module.system.controller.baseData.vo.CustomerInfoSelectionVO; import com.inspur.module.system.controller.equip.vo.EquipSelectionVO; import com.inspur.module.system.controller.inspection.vo.*; +import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDO; import com.inspur.module.system.dal.dataobject.baseData.CustomerInfoDO; import com.inspur.module.system.dal.dataobject.inspection.InspectionFeedbackDO; import com.inspur.module.system.dal.dataobject.inspection.InspectionInfoDO; import com.inspur.module.system.dal.dataobject.inspection.InspectionPlanDO; import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO; import com.inspur.module.system.dal.dataobject.notify.NotifyMessageDO; +import com.inspur.module.system.dal.mysql.alarm.EquipAlarmDataMapper; import com.inspur.module.system.dal.mysql.inspection.InspectionInfoMapper; import com.inspur.module.system.service.alarm.AlarmDataService; import com.inspur.module.system.service.baseData.CustomerInfoService; @@ -76,6 +78,9 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { @Resource private InspectionPlanService inspectionPlanService; + @Resource + private EquipAlarmDataMapper equipAlarmDataMapper; + @Override @TenantIgnore @Transactional @@ -93,6 +98,11 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { inspectionInfo.setStatus(0); inspectionInfoMapper.insert(inspectionInfo); + //修改报警状态 + if (StrUtil.isNotBlank(createReqVO.getAlarmId())){ + equipAlarmDataMapper.updateById(new EquipAlarmDataDO().setEquipAlarmId(createReqVO.getAlarmId()).setStatus(2)); + } + //消息推送 NotifyMessageDO noticeMessageDO = new NotifyMessageDO() .setOrderId(inspectionInfo.getInspectionId()) @@ -104,7 +114,6 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { .setTemplateNickname(SecurityFrameworkUtils.getLoginUserNickname()) .setTenantId(inspectionInfo.getTenantId()); notifyMessageService.createNotifyMessage(noticeMessageDO); - // 返回 return inspectionInfo.getInspectionId(); } @@ -117,7 +126,15 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { InspectionInfoDO validateInfo = validateInspectionInfoExists(updateReqVO.getInspectionId()); // 更新 InspectionInfoDO updateObj = BeanUtils.toBean(updateReqVO, InspectionInfoDO.class); + if (updateReqVO.getCloseAlarm()) { + alarmDataService.closeAllAlarmDataByEquipAlarmId(updateReqVO.getAlarmId(),false); + } inspectionInfoMapper.updateById(updateObj); + + //修改报警状态 + if (StrUtil.isNotBlank(updateReqVO.getExclusiveInspection())){ + equipAlarmDataMapper.updateById(new EquipAlarmDataDO().setEquipAlarmId(updateReqVO.getAlarmId()).setStatus(4)); + } //消息推送 NotifyMessageDO noticeMessageDO = new NotifyMessageDO() .setOrderId(updateObj.getInspectionId()) @@ -206,6 +223,17 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { alarmDataService.closeAllAlarmDataByEquipAlarmId(vo.getAlarmId(),false); } int i = inspectionInfoMapper.updateById(inspectionInfoDO); + + //修改报警状态 + int alarmStatus; + //未解决 + if(vo.getStatus().equals(1)){ + alarmStatus = 3; + }else { + alarmStatus = 1; + } + equipAlarmDataMapper.updateById(new EquipAlarmDataDO().setEquipAlarmId(vo.getAlarmId()).setStatus(alarmStatus)); + //点检树新增 if (CollUtil.isNotEmpty(vo.getFeedbackList())){ List feedbackList = vo.getFeedbackList(); @@ -221,6 +249,17 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { if (vo.getCloseAlarm()) { alarmDataService.closeAllAlarmDataByEquipAlarmId(vo.getAlarmId(),false); } + + //修改报警状态 + int alarmStatus; + //未解决 + if(vo.getStatus().equals(4)){ + alarmStatus = 5; + }else { + alarmStatus = 1; + } + equipAlarmDataMapper.updateById(new EquipAlarmDataDO().setEquipAlarmId(vo.getAlarmId()).setStatus(alarmStatus)); + return inspectionInfoMapper.updateById(inspectionInfoDO) > 0; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java index 1fc5587..b69d7d1 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/MaintenanceOrderServiceImpl.java @@ -20,6 +20,7 @@ import com.inspur.module.system.controller.equip.vo.ComponentSelectionVO; import com.inspur.module.system.controller.equip.vo.EquipSelectionVO; import com.inspur.module.system.controller.inspection.vo.InspectionInfoSaveReqVO; import com.inspur.module.system.controller.maintenance.vo.*; +import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDO; import com.inspur.module.system.dal.dataobject.baseData.CustomerInfoDO; import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO; import com.inspur.module.system.dal.dataobject.equip.EquipInfoDetailsDTO; @@ -28,6 +29,7 @@ import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO; import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceReportDO; import com.inspur.module.system.dal.dataobject.notify.NotifyMessageDO; import com.inspur.module.system.dal.dataobject.user.AdminUserDO; +import com.inspur.module.system.dal.mysql.alarm.EquipAlarmDataMapper; import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper; import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderRecordMapper; import com.inspur.module.system.dal.mysql.maintenance.MaintenanceReportMapper; @@ -94,10 +96,10 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService { private TaskService taskService; @Resource - private AlarmDataService alarmDataService; + private NotifyMessageService notifyMessageService; @Resource - private NotifyMessageService notifyMessageService; + private EquipAlarmDataMapper equipAlarmDataMapper; /** * OA 请假对应的流程定义 KEY @@ -128,7 +130,7 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService { } maintenanceOrderMapper.insert(remoteMaintenanceOrder); if ("0".equals(createReqVO.getSubmitFlag()) && StrUtil.isNotBlank(createReqVO.getAlarmId())) { - alarmDataService.closeAllAlarmDataByEquipAlarmId(createReqVO.getAlarmId(),false); + equipAlarmDataMapper.updateById(new EquipAlarmDataDO().setEquipAlarmId(createReqVO.getAlarmId()).setStatus(6)); } //设置点检工单状态 if (StrUtil.isNotBlank(createReqVO.getInspectionId())){ diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/listener/MaintenanceSpringExpressionExecutionListener.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/listener/MaintenanceSpringExpressionExecutionListener.java index 5763400..c996848 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/listener/MaintenanceSpringExpressionExecutionListener.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/maintenance/listener/MaintenanceSpringExpressionExecutionListener.java @@ -5,6 +5,7 @@ import com.inspur.framework.security.core.util.SecurityFrameworkUtils; import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO; import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO; import com.inspur.module.system.dal.mysql.equip.EquipInfoMapper; +import com.inspur.module.system.service.alarm.AlarmDataService; import com.inspur.module.system.service.maintenance.MaintenanceOrderService; import lombok.extern.slf4j.Slf4j; import org.flowable.engine.delegate.DelegateExecution; @@ -29,6 +30,9 @@ public class MaintenanceSpringExpressionExecutionListener { @Resource private EquipInfoMapper equipInfoMapper; + @Resource + private AlarmDataService alarmDataService; + /** * 派单 */ @@ -97,6 +101,7 @@ public class MaintenanceSpringExpressionExecutionListener { equipInfoDO.setRunStatus(0); equipInfoMapper.updateById(equipInfoDO); } + alarmDataService.closeAllAlarmDataByEquipAlarmId(maintenanceOrder.getAlarmId(),false); } log.info("listenerEvaluate评价方法调用,参数:{}", execution); } diff --git a/imt-ui/src/views/system/alarm/alarmdata/index.vue b/imt-ui/src/views/system/alarm/alarmdata/index.vue index f7ced1b..391f5ac 100644 --- a/imt-ui/src/views/system/alarm/alarmdata/index.vue +++ b/imt-ui/src/views/system/alarm/alarmdata/index.vue @@ -53,6 +53,16 @@ :value="alarmLevel" /> +
+ 状态: + +