From 4072bc2ecbe3494359f4a64bd8598205d0638764 Mon Sep 17 00:00:00 2001 From: liriming <1343021927@qq.com> Date: 星期四, 05 十二月 2024 15:47:37 +0800 Subject: [PATCH] 新增接口 --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/MessageCode.java | 4 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java | 4 + iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StScheduleSchemeDTO.java | 81 +++++++++++++++++++++++++++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSchemeServiceImpl.java | 16 ++++ iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleSchemeService.java | 5 + iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java | 12 ++- iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java | 10 +++ 7 files changed, 122 insertions(+), 10 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/MessageCode.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/MessageCode.java index 2a544a1..546062b 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/MessageCode.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/video/hikvision/utils/MessageCode.java @@ -9,8 +9,8 @@ public static final String JsonSavePath = "D:/hk-project/json";//海康威视抓取图片上传路径 // public static final String JsonSavePath = "D:/DLUT/json";//海康威视抓取图片上传路径 - public static final String HIK_WIN_PATH = "hikvision/win64/HCNetSDK.dll"; -// public static final String HIK_WIN_PATH = "D:\\DLUT\\lib\\HCNetSDK.dll"; +// public static final String HIK_WIN_PATH = "hikvision/win64/HCNetSDK.dll"; + public static final String HIK_WIN_PATH = "D:\\DLUT\\lib\\HCNetSDK.dll"; public static final String ModelCode = "Image_feature";//模型代码 diff --git a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java index 039e10b..9e5bd0a 100644 --- a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java +++ b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/McsApi.java @@ -42,7 +42,7 @@ @PostMapping(PREFIX + "/predict-data/cur") @Operation(summary = "获取当前预测数据") - Map<String, List<Object[]>> getPreDataCur(PreDataJsonReqVO reqVO); + Map<String, List<Object[]>> getPreDataCur(@RequestBody PreDataJsonReqVO reqVO); @PostMapping(PREFIX + "/plan-data/single-chart") @Operation(summary = "计划数据图表") @@ -54,11 +54,11 @@ @GetMapping(PREFIX + "/alarm-message/list") @Operation(summary = "获取预警信息列表") - List<AlarmMessageRespDTO> listAlarmMessage(@RequestParam("params") Map<String, Object> params); + List<AlarmMessageRespDTO> listAlarmMessage(@RequestParam Map<String, Object> params); @GetMapping(PREFIX + "/alarm-config/list") @Operation(summary = "获取预警配置列表") - List<AlarmConfigRespDTO> listAlarmConfig(@RequestParam("params") Map<String, Object> params); + List<AlarmConfigRespDTO> listAlarmConfig(@RequestParam Map<String, Object> params); @GetMapping(PREFIX + "/alarm-message/last-one") @Operation(summary = "获取最新预警信息") @@ -70,7 +70,7 @@ @GetMapping(PREFIX + "/schedule-suggest/list") @Operation(summary = "获取调度建议列表") - List<ScheduleSuggestRespDTO> listScheduleSuggest(@RequestParam("params") ScheduleSuggestReqDTO params); + List<ScheduleSuggestRespDTO> listScheduleSuggest(@RequestParam Map<String, Object> params); @PostMapping(PREFIX + "/predict-model-setting/modify") @Operation(summary = "修改预测模型设置参数") @@ -84,4 +84,8 @@ @PostMapping(PREFIX + "/schedule-model-setting/modify") @Operation(summary = "修改调度模型设置参数") Boolean modifyScheduleModelSetting(@RequestBody List<ScheduleModelSettingReqDTO> dtos); + + @GetMapping(PREFIX + "/schedule-scheme/list") + @Operation(summary = "获取调度方案列表") + List<StScheduleSchemeDTO> listScheduleScheme(@RequestParam Map<String, Object> params); } \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StScheduleSchemeDTO.java b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StScheduleSchemeDTO.java new file mode 100644 index 0000000..c3fbaad --- /dev/null +++ b/iailab-module-model/iailab-module-model-api/src/main/java/com/iailab/module/model/api/mcs/dto/StScheduleSchemeDTO.java @@ -0,0 +1,81 @@ +package com.iailab.module.model.api.mcs.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lirm + * @date 2024年12月04日 + */ +@Data +public class StScheduleSchemeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 编号 + */ + private String code; + + /** + * 名称 + */ + private String name; + + /** + * 触发方式 + */ + private String triggerMethod; + + /** + * 触发条件 + */ + private String triggerCondition; + + /** + * 调整对象 + */ + private String scheduleObj; + + /** + * 调整类型 + */ + private String scheduleType; + + /** + * 调整策略 + */ + private String scheduleStrategy; + + /** + * 调度模型 + */ + private String modelId; + + /** + * 调度时间 + */ + private Date scheduleTime; + + /** + * 状态(0正常 1停用) + */ + private Integer status; + + /** + * 备注 + */ + private String remark; + + /** + * 项目ID + */ + private String mpkprojectid; +} diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java index 3242912..e1d951c 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/McsApiImpl.java @@ -19,6 +19,7 @@ import com.iailab.module.model.mcs.pre.service.*; import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessageSaveReqVO; import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; +import com.iailab.module.model.mcs.sche.service.StScheduleSchemeService; import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService; import com.iailab.module.model.mdk.vo.ItemVO; import com.iailab.module.model.mpk.service.ChartService; @@ -79,6 +80,8 @@ @Autowired private MmPredictAlarmConfigService mmPredictAlarmConfigService; + @Autowired + private StScheduleSchemeService stScheduleSchemeService; private int HOUR_MINS = 60; @@ -516,7 +519,7 @@ } @Override - public List<ScheduleSuggestRespDTO> listScheduleSuggest(ScheduleSuggestReqDTO params) { + public List<ScheduleSuggestRespDTO> listScheduleSuggest(Map<String, Object> params) { return Collections.emptyList(); } @@ -536,6 +539,11 @@ return true; } + @Override + public List<StScheduleSchemeDTO> listScheduleScheme(Map<String, Object> params) { + return stScheduleSchemeService.list(params); + } + private Date[] calResultTime(ItemVO predictItem, Date startTimeReq, Date endTimeReq, int lengthLeft, int lengthRight) { Date[] result = new Date[3]; diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java index 42b9252..5c5043c 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/pre/service/impl/MmPredictAlarmConfigServiceImpl.java @@ -5,6 +5,7 @@ import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.framework.common.util.object.ConvertUtils; import com.iailab.framework.security.core.util.SecurityFrameworkUtils; import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO; import com.iailab.module.model.mcs.pre.dao.MmPredictAlarmConfigDao; @@ -66,6 +67,7 @@ public List<AlarmConfigRespDTO> list(Map<String, Object> params) { QueryWrapper<MmPredictAlarmConfigEntity> wrapper = new QueryWrapper<>(); wrapper.eq("is_enable", 1); - return BeanUtils.toBean(baseDao.selectList(wrapper), AlarmConfigRespDTO.class); + List<MmPredictAlarmConfigEntity> list = baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list, AlarmConfigRespDTO.class); } } \ No newline at end of file diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleSchemeService.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleSchemeService.java index db4f916..39df287 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleSchemeService.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/StScheduleSchemeService.java @@ -2,11 +2,14 @@ import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.BaseService; +import com.iailab.module.model.api.mcs.dto.StScheduleSchemeDTO; import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity; import com.iailab.module.model.mcs.sche.vo.StScheduleSchemePageReqVO; import com.iailab.module.model.mcs.sche.vo.StScheduleSchemeSaveReqVO; import java.util.Date; +import java.util.List; +import java.util.Map; /** * @author PanZhibao @@ -27,4 +30,6 @@ void updateTime(String id, Date scheduleTime); StScheduleSchemeEntity getByCode(String code); + + List<StScheduleSchemeDTO> list(Map<String, Object> params); } diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSchemeServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSchemeServiceImpl.java index 4ed005f..2de77b6 100644 --- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSchemeServiceImpl.java +++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleSchemeServiceImpl.java @@ -4,6 +4,10 @@ import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.framework.common.util.object.ConvertUtils; +import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO; +import com.iailab.module.model.api.mcs.dto.StScheduleSchemeDTO; +import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; import com.iailab.module.model.mcs.sche.dao.StScheduleSchemeDao; import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity; import com.iailab.module.model.mcs.sche.service.StScheduleSchemeService; @@ -11,8 +15,7 @@ import com.iailab.module.model.mcs.sche.vo.StScheduleSchemeSaveReqVO; import org.springframework.stereotype.Service; -import java.util.Date; -import java.util.UUID; +import java.util.*; /** * @author PanZhibao @@ -58,6 +61,15 @@ } @Override + public List<StScheduleSchemeDTO> list(Map<String, Object> params) { + QueryWrapper<StScheduleSchemeEntity> queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("trigger_method", "1"); + queryWrapper.eq("trigger_condition", params.get("trigger_condition")); + List<StScheduleSchemeEntity> list = baseDao.selectList(queryWrapper); + return ConvertUtils.sourceToTarget(list, StScheduleSchemeDTO.class); + } + + @Override public void updateTime(String id, Date scheduleTime) { StScheduleSchemeEntity entity = new StScheduleSchemeEntity(); entity.setId(id); -- Gitblit v1.9.3