diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceOrderSaveReqVO.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceOrderSaveReqVO.java index fc479d5..09260c7 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceOrderSaveReqVO.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/controller/maintenance/vo/MaintenanceOrderSaveReqVO.java @@ -70,4 +70,7 @@ public class MaintenanceOrderSaveReqVO { @Schema(description = "点检方案") private String patrolPlan; + @Schema(description = "维修工单提交标识,报警提交时为0") + private String submitFlag; + } \ 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/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 5c76941..9a4079b 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 @@ -1,5 +1,6 @@ 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.tenant.core.aop.TenantIgnore; @@ -103,11 +104,14 @@ public class AlarmDataServiceImpl implements AlarmDataService { @Transactional public int closeAllAlarmDataByEquipAlarmId(String equipAlarmId){ List alarmDataList = alarmDataMapper.selectAlarmDatas(new AlarmDataPageReqVO().setEquipAlarmId(equipAlarmId)); - List alarmDataIdList = alarmDataList.stream().map(AlarmDataDO::getAlarmDataId).collect(Collectors.toList()); EquipAlarmDataSaveReqVO equipAlarmDataSaveReqVO = new EquipAlarmDataSaveReqVO(); equipAlarmDataSaveReqVO.setEquipAlarmId(equipAlarmId); equipAlarmDataSaveReqVO.setStatus(1);//关闭 equipAlarmDataService.updateEquipAlarmData(equipAlarmDataSaveReqVO); + if (CollUtil.isEmpty(alarmDataList)){ + return 0; + } + List alarmDataIdList = alarmDataList.stream().map(AlarmDataDO::getAlarmDataId).collect(Collectors.toList()); return alarmDataMapper.batchUpdateAlarmDataStatus(alarmDataIdList); } 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 538ad8f..a87c422 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.dal.dataobject.user.AdminUserDO; 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; +import com.inspur.module.system.service.alarm.AlarmDataService; import com.inspur.module.system.service.baseData.CustomerInfoService; import com.inspur.module.system.service.equip.ComponentInfoService; import com.inspur.module.system.service.equip.EquipInfoService; @@ -77,6 +78,9 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService { @Resource private TaskService taskService; + @Resource + private AlarmDataService alarmDataService; + /** * OA 请假对应的流程定义 KEY */ @@ -116,11 +120,15 @@ public class MaintenanceOrderServiceImpl implements MaintenanceOrderService { } @Override + @Transactional(rollbackFor = Exception.class) public void updateRemoteMaintenanceOrder(MaintenanceOrderSaveReqVO updateReqVO) { // 校验存在 validateRemoteMaintenanceOrderExists(updateReqVO.getMaintenanceOrderId()); // 更新 MaintenanceOrderDO updateObj = BeanUtils.toBean(updateReqVO, MaintenanceOrderDO.class); + if ("0".equals(updateReqVO.getSubmitFlag()) && StrUtil.isNotBlank(updateReqVO.getAlarmId())) { + alarmDataService.closeAllAlarmDataByEquipAlarmId(updateReqVO.getAlarmId()); + } maintenanceOrderMapper.updateById(updateObj); } diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/largeScreen/LargeScreenMapper.xml b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/largeScreen/LargeScreenMapper.xml index d381d60..838ab00 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/largeScreen/LargeScreenMapper.xml +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/resources/mapper/largeScreen/LargeScreenMapper.xml @@ -5,15 +5,17 @@