From ec50954c8c9d244a2ff259b653aaaa7bfeabe79b Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期五, 21 三月 2025 14:45:52 +0800 Subject: [PATCH] 数据分析页面显示预警信息 调度建议 --- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java | 9 +++++---- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java | 3 +++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmMessageServiceImpl.java | 8 ++++---- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSuggestPageReqVO.java | 2 ++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleItemServiceImpl.java | 5 ++++- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java | 5 ++++- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSuggestRespVO.java | 4 ++++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleSuggestController.java | 3 ++- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictAlarmMessagePageReqVO.java | 2 ++ 9 files changed, 30 insertions(+), 11 deletions(-) diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleItemServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleItemServiceImpl.java index 66a8bbf..47a28ac 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleItemServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleItemServiceImpl.java @@ -35,7 +35,10 @@ @Override public List<String> getModuleIdByItemId(List<String> itemIds) { - List<String> result = new ArrayList<String>(); + List<String> result = new ArrayList<>(); + if (CollectionUtils.isEmpty(itemIds)) { + return result; + } QueryWrapper<DmModuleItemEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.in("itemid", itemIds); List<DmModuleItemEntity> list = dmModuleItemDao.selectList(queryWrapper); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java index ba748e2..f5f79c3 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/DmModuleServiceImpl.java @@ -101,6 +101,9 @@ @Override public List<String> geModuleByIds(List<String> ids) { List<String> result = new ArrayList<>(); + if (CollectionUtils.isEmpty(ids)) { + return result; + } QueryWrapper<DmModuleEntity> wrapper = new QueryWrapper<>(); wrapper.in("id", ids); List<DmModuleEntity> list = dmModuleDao.selectList(wrapper); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java index 4011d56..de4d7a0 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmItemOutputServiceImpl.java @@ -108,6 +108,9 @@ @Override public List<String> getItemIdByOut(List<String> outIds) { List<String> result = new ArrayList<>(); + if (CollectionUtils.isEmpty(outIds)) { + return result; + } QueryWrapper<MmItemOutputEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.in("id", outIds); List<MmItemOutputEntity> list = baseMapper.selectList(queryWrapper); @@ -115,7 +118,7 @@ return result; } list.forEach(item -> { - result.add(item.getId()); + result.add(item.getItemid()); }); return result; } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmMessageServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmMessageServiceImpl.java index 486379d..a58b9ed 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmMessageServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmMessageServiceImpl.java @@ -13,10 +13,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; /** * @author PanZhibao @@ -49,6 +46,9 @@ @Override public List<MmPredictAlarmMessageEntity> getList(List<String> alarmObjList, Date predictTime) { + if (CollectionUtils.isEmpty(alarmObjList)) { + return new ArrayList<>(); + } QueryWrapper<MmPredictAlarmMessageEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.in("alarm_obj", alarmObjList); queryWrapper.eq("alarm_time", predictTime); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictAlarmMessagePageReqVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictAlarmMessagePageReqVO.java index 042fde7..0f90a0d 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictAlarmMessagePageReqVO.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/vo/MmPredictAlarmMessagePageReqVO.java @@ -1,5 +1,6 @@ package com.iailab.module.model.mcs.pre.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import com.iailab.framework.common.pojo.PageParam; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -39,6 +40,7 @@ private Date endTime; @Schema(description = "预测时间", example = "") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date predictTime; @Schema(description = "输出ID", example = "") diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleSuggestController.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleSuggestController.java index 4026a77..b28432f 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleSuggestController.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/controller/admin/StScheduleSuggestController.java @@ -13,6 +13,7 @@ import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -44,7 +45,7 @@ @PostMapping("/list-out") @Operation(summary = "获得预警消息列表") - public CommonResult<List<StScheduleSuggestRespVO>> getListByOut(StScheduleSuggestPageReqVO pageVO) { + public CommonResult<List<StScheduleSuggestRespVO>> getListByOut(@RequestBody StScheduleSuggestPageReqVO pageVO) { List<String> itemIds = mmItemOutputService.getItemIdByOut(pageVO.getOutIds()); List<String> moduleIds = dmModuleItemService.getModuleIdByItemId(itemIds); List<String> moduleList = dmModuleService.geModuleByIds(moduleIds); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java index 32a5dbb..1d4db1b 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSuggestServiceImpl.java @@ -15,11 +15,9 @@ import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestSaveReqVO; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; /** * @author PanZhibao @@ -85,6 +83,9 @@ @Override public List<StScheduleSuggestEntity> getList(List<String> scheduleObjList, Date predictTime) { + if (CollectionUtils.isEmpty(scheduleObjList)) { + return new ArrayList<>(); + } QueryWrapper<StScheduleSuggestEntity> queryWrapper = new QueryWrapper<>(); queryWrapper.in("schedule_obj", scheduleObjList); queryWrapper.eq("schedule_time", predictTime); diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSuggestPageReqVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSuggestPageReqVO.java index 787c8ff..a1b2ede 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSuggestPageReqVO.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSuggestPageReqVO.java @@ -1,5 +1,6 @@ package com.iailab.module.model.mcs.sche.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import com.iailab.framework.common.pojo.PageParam; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -27,6 +28,7 @@ private String scheduleObj; @Schema(description = "预测时间", example = "") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date predictTime; @Schema(description = "输出ID", example = "") diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSuggestRespVO.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSuggestRespVO.java index 7c3e0e7..148a521 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSuggestRespVO.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/vo/StScheduleSuggestRespVO.java @@ -1,5 +1,6 @@ package com.iailab.module.model.mcs.sche.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -61,12 +62,15 @@ private BigDecimal adjustTimes; @Schema(description = "调整开始时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date adjustStart; @Schema(description = "调整结束时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date adjustEnd; @Schema(description = "调度时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date scheduleTime; @Schema(description = "状态(0未处理 1已采纳 2已忽略)") -- Gitblit v1.9.3