Merge remote-tracking branch 'origin/master'
| | |
| | | |
| | | @GetMapping(PREFIX + "/alarm-message/list") |
| | | @Operation(summary = "获取预警信息列表") |
| | | List<AlarmMessageRespDTO> listAlarmMessage(@RequestParam Map<String, Object> params); |
| | | List<AlarmMessageRespDTO> listAlarmMessage(@RequestParam("params") Map<String, Object> params); |
| | | |
| | | @GetMapping(PREFIX + "/alarm-config/list") |
| | | @Operation(summary = "获取预警配置列表") |
| | | List<AlarmConfigRespDTO> listAlarmConfig(@RequestParam("params") Map<String, Object> params); |
| | | |
| | | @GetMapping(PREFIX + "/alarm-message/last-one") |
| | | @Operation(summary = "获取最新预警信息") |
| | |
| | | @Operation(summary = "添加调度建议") |
| | | Boolean createScheduleSuggest(@RequestBody ScheduleSuggestRespDTO dto); |
| | | |
| | | @GetMapping(PREFIX + "/schedule-suggest/last-limit") |
| | | @GetMapping(PREFIX + "/schedule-suggest/list") |
| | | @Operation(summary = "获取调度建议列表") |
| | | List<ScheduleSuggestRespDTO> getLastLimitScheduleSuggest(@RequestParam("scheduleObj") String scheduleObj, @RequestParam("limit") Integer limit); |
| | | List<ScheduleSuggestRespDTO> listScheduleSuggest(@RequestParam("params") ScheduleSuggestReqDTO params); |
| | | |
| | | @PostMapping(PREFIX + "/predict-model-setting/modify") |
| | | @Operation(summary = "修改预测模型设置参数") |
| | | Boolean modifyPredictModelSetting(@RequestBody List<PredictModelSettingReqDTO> dtos); |
| | | |
| | | @GetMapping(PREFIX + "/schedule-suggest/last-limit") |
| | | @Operation(summary = "获取调度建议列表") |
| | | List<ScheduleSuggestRespDTO> getLastLimitScheduleSuggest(@RequestParam("scheduleObj") String scheduleObj, @RequestParam("limit") Integer limit); |
| | | |
| | | |
| | | @PostMapping(PREFIX + "/schedule-model-setting/modify") |
| | | @Operation(summary = "修改调度模型设置参数") |
| | | Boolean modifyScheduleModelSetting(@RequestBody List<ScheduleModelSettingReqDTO> dtos); |
对比新文件 |
| | |
| | | package com.iailab.module.model.api.mcs.dto; |
| | | |
| | | import com.iailab.framework.common.pojo.PageParam; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月20日 |
| | | */ |
| | | @Schema(description = "模型平台 - Request VO") |
| | | @Data |
| | | public class AlarmConfigReqDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "消息标题") |
| | | private String title; |
| | | |
| | | @Schema(description = "监控对象") |
| | | private String alarmObj; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.api.mcs.dto; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | | * @Description |
| | | * @createTime 2024年11月20日 |
| | | */ |
| | | @Schema(description = "模型服务 - 预警配置 Response VO") |
| | | @Data |
| | | public class AlarmConfigRespDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "消息标题") |
| | | private String title; |
| | | |
| | | @Schema(description = "监控对象") |
| | | private String alarmObj; |
| | | |
| | | @Schema(description = "预测项ID") |
| | | private String itemId; |
| | | |
| | | private String itemName; |
| | | |
| | | @Schema(description = "输出ID") |
| | | private String outId; |
| | | |
| | | private String outName; |
| | | |
| | | @Schema(description = "比较长度") |
| | | private Integer compLength; |
| | | |
| | | @Schema(description = "上限") |
| | | private BigDecimal upperLimit; |
| | | |
| | | @Schema(description = "下限") |
| | | private BigDecimal lowerLimit; |
| | | |
| | | @Schema(description = "单位") |
| | | private String unit; |
| | | |
| | | @Schema(description = "转换系数") |
| | | private BigDecimal coefficient; |
| | | |
| | | @Schema(description = "调度方案") |
| | | private String scheduleId; |
| | | |
| | | @Schema(description = "是否启用(0禁用 1启用)") |
| | | private Integer isEnable; |
| | | |
| | | @Schema(description = "创建者") |
| | | private String creator; |
| | | |
| | | @Schema(description = "创建时间") |
| | | private Date createTime; |
| | | |
| | | @Schema(description = "更新者") |
| | | private String updater; |
| | | |
| | | @Schema(description = "更新时间") |
| | | private Date updateTime; |
| | | } |
| | |
| | | @Autowired |
| | | private PlanItemApi planItemApi; |
| | | |
| | | @Autowired |
| | | private MmPredictAlarmConfigService mmPredictAlarmConfigService; |
| | | |
| | | |
| | | private int HOUR_MINS = 60; |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<AlarmConfigRespDTO> listAlarmConfig(Map<String, Object> params) { |
| | | return mmPredictAlarmConfigService.list(params); |
| | | } |
| | | |
| | | @Override |
| | | public AlarmMessageRespDTO getLastAlarmMessage(String alarmObj) { |
| | | MmPredictAlarmMessageEntity entity = mmPredictAlarmMessageService.getLast(alarmObj); |
| | | return ConvertUtils.sourceToTarget(entity, AlarmMessageRespDTO.class); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<ScheduleSuggestRespDTO> listScheduleSuggest(ScheduleSuggestReqDTO params) { |
| | | return Collections.emptyList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ScheduleSuggestRespDTO> getLastLimitScheduleSuggest(String scheduleObj, Integer limit) { |
| | | List<StScheduleSuggestEntity> list = stScheduleSuggestService.getList(scheduleObj, limit); |
| | | return ConvertUtils.sourceToTarget(list, ScheduleSuggestRespDTO.class); |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.BaseService; |
| | | import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigPageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigSaveReqVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | |
| | | void update(MmPredictAlarmConfigSaveReqVO reqVO); |
| | | |
| | | void delete(String id); |
| | | |
| | | List<AlarmConfigRespDTO> list(Map<String, Object> params); |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.pre.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | 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.security.core.util.SecurityFrameworkUtils; |
| | | import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO; |
| | | import com.iailab.module.model.mcs.pre.dao.MmPredictAlarmConfigDao; |
| | | import com.iailab.module.model.mcs.pre.entity.DmModuleEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmConfigEntity; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmMessageEntity; |
| | | import com.iailab.module.model.mcs.pre.service.MmPredictAlarmConfigService; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigPageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigSaveReqVO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author PanZhibao |
| | |
| | | public void delete(String id) { |
| | | baseDao.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | 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); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.iailab.module.model.mcs.pre.dao.MmPredictAlarmConfigDao"> |
| | | <select id="getPageList" resultType="com.iailab.module.model.mcs.pre.vo.MmPredictAlarmConfigRespVO"> |
| | | select t1.*,t2.itemname itemName,t3.tagname outName |
| | | from t_mm_predict_alarm_config t1 |
| | | left join t_mm_predict_item t2 on t2.id = t1.item_id |
| | | left join t_mm_item_output t3 on t3.id = t1.out_id |
| | | <where> |
| | | <if test="params.title != null and params.title != ''"> |
| | | AND t.title LIKE CONCAT('%', #{params.title},'%') |
| | | </if> |
| | | <if test="params.alarmObj != null and params.alarmObj != ''"> |
| | | AND t.alarmObj LIKE CONCAT('%', #{params.alarmObj},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | #{end} |
| | | if (#{foreach} ($column in [1..$entity.dataLength])#{if}($column==1)data${column} == null || data${column}.length == 0 || data${column}[0].length == 0#{else} || data${column} == null || data${column}.length == 0 || data${column}[0].length == 0#{end}#{end}) { |
| | | result = new HashMap<String, Object>(); |
| | | result.put("status_code", "400"); |
| | | result.put("status_code", "998"); |
| | | return result; |
| | | } |
| | | result = ${pyName}${entity.methodName}(#foreach ($column in [1..$entity.dataLength])data${column}, #{end}#{if}($entity.model==1)model, #{end}settings); |
| | | |
| | | return utils.reverseResult(this.result); |
| | | } |
| | | #{end} |
| | |
| | | #{if}($method.methodName=="train") |
| | | <tab-train class="${model.pkgName}.impl.${model.pyName}Impl" method="train" |
| | | params="#{foreach} ($column in [1..$method.dataLength])double[][],#{end}#{if}($method.model==1)java.util.HashMap,#{end}java.util.HashMap"> |
| | | <property key="data1" name="数据路径" type="file" valueType="file" min="" max=""/> |
| | | #{foreach} ($column in [1..$method.dataLength]) |
| | | <property key="data${column}" name="数据${column}路径" type="file" valueType="file" min="" max=""/> |
| | | #{end} |
| | | #{foreach} ($setting in $method.methodSettings) |
| | | #{if}($setting.type=="select") |
| | | <property key="${setting.settingKey}" name="${setting.name}" type="select" valueType="${setting.valueType}" min="$!{setting.min}" max="$!{setting.max}"> |
| | |
| | | <tab-load class="${model.pkgName}.impl.${model.pyName}Impl" method="predict" |
| | | params="#{foreach} ($column in [1..$method.dataLength])double[][],#{end}#{if}($method.model==1)java.util.HashMap,#{end}java.util.HashMap" resultKey="$!{method.resultKey}" |
| | | modelRules="${model.pkgName}.impl.${model.pyName}Impl.predict"> |
| | | <property key="data1" name="数据路径" type="file" valueType="file" min="" max=""/> |
| | | #{foreach} ($column in [1..$method.dataLength]) |
| | | <property key="data${column}" name="数据${column}路径" type="file" valueType="file" min="" max=""/> |
| | | #{end} |
| | | #{foreach} ($setting in $method.methodSettings) |
| | | #{if}($setting.type=="select") |
| | | <property key="${setting.settingKey}" name="${setting.name}" type="select" valueType="${setting.valueType}" min="$!{setting.min}" max="$!{setting.max}"> |