diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java index c855aae..e1587eb 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/alarm/AlarmDataServiceImpl.java @@ -3,11 +3,13 @@ package com.inspur.module.system.service.alarm; import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.inspur.framework.common.util.spring.SpringUtils; import com.inspur.framework.tenant.core.aop.TenantIgnore; import com.inspur.module.system.dal.dataobject.alarm.AlarmDataDTO; import com.inspur.module.system.dal.dataobject.alarm.EquipAlarmDataDO; import com.inspur.module.system.dal.dataobject.equip.EquipInfoDO; import com.inspur.module.system.service.equip.EquipInfoService; +import com.inspur.module.system.service.inspection.InspectionInfoServiceImpl; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -118,6 +120,9 @@ public class AlarmDataServiceImpl implements AlarmDataService { equipAlarmDataSaveReqVO.setEquipAlarmId(equipAlarmId); equipAlarmDataSaveReqVO.setStatus(1);//关闭 equipAlarmDataService.updateEquipAlarmData(equipAlarmDataSaveReqVO); + //关闭点检工单 + InspectionInfoServiceImpl inspectionInfoService = SpringUtils.getBean(InspectionInfoServiceImpl.class); + inspectionInfoService.closeInspectionInfoByAlarmId(equipAlarmId); if (CollUtil.isEmpty(alarmDataList)){ return 0; } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoService.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoService.java index e05d7a5..e5a309e 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoService.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/inspection/InspectionInfoService.java @@ -80,4 +80,13 @@ public interface InspectionInfoService { * @return com.inspur.module.system.controller.inspection.vo.IsSubmitInspectionVO */ IsSubmitInspectionVO isSubmitInspection(String alarmId); + + /** + * 根据报警id关闭所有点检工单 + * + * @Author xusd + * @Date 10:37 2024/10/28 + * @param alarmId 报警id + */ + void closeInspectionInfoByAlarmId(String alarmId); } \ 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/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 ac2415a..1e6db16 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 @@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.inspur.framework.common.exception.ServiceException; import com.inspur.framework.common.pojo.PageResult; import com.inspur.framework.tenant.core.aop.TenantIgnore; @@ -166,4 +167,14 @@ public class InspectionInfoServiceImpl implements InspectionInfoService { return vo; } } + + @Override + @TenantIgnore + public void closeInspectionInfoByAlarmId(String alarmId) { + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.eq(InspectionInfoDO::getAlarmId, alarmId); + updateWrapper.set(InspectionInfoDO::getStatus, 3); + updateWrapper.set(InspectionInfoDO::getRemark, "手动关闭报警"); + inspectionInfoMapper.update(updateWrapper); + } } \ No newline at end of file diff --git a/imt-ui/src/views/system/inspection/inspectionInfo/index.vue b/imt-ui/src/views/system/inspection/inspectionInfo/index.vue index 26f88a4..d025653 100644 --- a/imt-ui/src/views/system/inspection/inspectionInfo/index.vue +++ b/imt-ui/src/views/system/inspection/inspectionInfo/index.vue @@ -72,7 +72,7 @@ - +