From daa01891f712f6eb4ff5a783b5a65364d4594301 Mon Sep 17 00:00:00 2001 From: xusd Date: Fri, 8 Nov 2024 17:47:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E4=B8=8E=E7=82=B9=E6=A3=80?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E7=8A=B6=E6=80=81=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vo/InspectionInfoSaveReqVO.java | 2 + .../dal/mysql/alarm/EquipAlarmDataMapper.java | 2 +- .../inspection/InspectionInfoServiceImpl.java | 41 ++++++++++++++++++- .../MaintenanceOrderServiceImpl.java | 8 ++-- ...anceSpringExpressionExecutionListener.java | 5 +++ .../views/system/alarm/alarmdata/index.vue | 15 ++++++- .../system/alarm/equipalarmdata/index.vue | 3 +- .../inspection/inspectionInfo/index.vue | 2 +- 8 files changed, 70 insertions(+), 8 deletions(-) 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" /> +
+ 状态: + +