Merge remote-tracking branch 'origin/master'
# Conflicts:
# iailab-module-model/iailab-module-model-biz/db/增量SQL/2025.sql
| | |
| | | - Path=/admin-api/model/** |
| | | filters: |
| | | - RewritePath=/admin-api/model/v3/api-docs, /v3/api-docs |
| | | ## ai-server 服务 |
| | | - id: ai-admin-api # 路由的编号 |
| | | uri: grayLb://ai-server |
| | | predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组 |
| | | - Path=/admin-api/ai/** |
| | | filters: |
| | | - RewritePath=/admin-api/ai/v3/api-docs, /v3/api-docs # 配置,保证转发到 /v3/api-docs |
| | | ## fast 服务 |
| | | - id: fast-admin-api # 路由的编号 |
| | | uri: grayLb://fast-server |
| | |
| | | |
| | | public static final String PV = "point_value:"; |
| | | |
| | | public static final long offset = 60 * 2L; |
| | | public static final long offset = 3L; |
| | | |
| | | /** |
| | | * 采集 |
| | |
| | | List<DaPointDTO> pointMeasureList = daPointService.getMeasurePoint(minfreq); |
| | | pointValues.addAll(measureHandle.handle(collectTime, pointMeasureList, dataMap, listGood, listBad)); |
| | | |
| | | log.info("读取计算点"); |
| | | List<DaPointDTO> pointCalculateList = daPointService.getMathPoint(minfreq); |
| | | pointValues.addAll(calculateHandle.handle(collectTime, pointCalculateList, dataMap, listGood, listBad)); |
| | | |
| | | log.info("读取累计点"); |
| | | List<DaPointDTO> pointCumulateList = daPointService.getCumulatePoint(minfreq); |
| | | pointValues.addAll(cumulateHandle.handle(collectTime, pointCumulateList, listGood, listBad)); |
| | | pointValues.addAll(cumulateHandle.handle(collectTime, pointCumulateList, dataMap, listGood, listBad)); |
| | | |
| | | log.info("读取极值点"); |
| | | List<DaPointDTO> pointExtremalList = daPointService.getExtremalPoint(minfreq); |
| | | pointValues.addAll(extremalHandle.handle(collectTime, pointExtremalList, listGood, listBad)); |
| | | pointValues.addAll(extremalHandle.handle(collectTime, pointExtremalList, dataMap, listGood, listBad)); |
| | | |
| | | log.info("读取计算点"); |
| | | List<DaPointDTO> pointCalculateList = daPointService.getMathPoint(minfreq); |
| | | pointValues.addAll(calculateHandle.handle(collectTime, pointCalculateList, dataMap, listGood, listBad)); |
| | | |
| | | log.info("存入时序库"); |
| | | log.info("pointValueTimestamp=" + (pointValues.get(0) == null ? 0 : pointValues.get(0).getTimestamp().getNano())); |
| | |
| | | private ConstantHandle constantHandle; |
| | | |
| | | @Resource |
| | | private CumulateHandle cumulateHandle; |
| | | |
| | | @Resource |
| | | private ExtremalHandle extremalHandle; |
| | | |
| | | @Resource |
| | | private JavaScriptHandler javaScriptHandler; |
| | | |
| | | @Autowired |
| | |
| | | pointNos.add(s); |
| | | dataMap.putAll(measureHandle.getCurrent(pointNos)); |
| | | dataMap.putAll(constantHandle.getCurrent(pointNos)); |
| | | dataMap.putAll(cumulateHandle.getCurrent(pointNos)); |
| | | dataMap.putAll(extremalHandle.getCurrent(pointNos)); |
| | | if (dataMap.get(s) == null) { |
| | | log.info("计算点数据异常"); |
| | | log.info("pointNo=" + dto.getPointNo() + ";dataMap.key=" + s); |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | return result; |
| | | } |
| | | dtos.forEach(dto -> { |
| | | InfluxPointValuePOJO pojo = GenInfluxPointValueUtils.getByPoint(dto); |
| | | BigDecimal defaultValue = dto.getDefaultValue(); |
| | | BigDecimal coefficient = dto.getUnittransfactor() == null ? BigDecimal.ONE : dto.getUnittransfactor(); |
| | | defaultValue = defaultValue.multiply(coefficient); |
| | | InfluxPointValuePOJO pojo = GenInfluxPointValueUtils.getByPoint(dto,defaultValue); |
| | | pojo.setTimestamp(GenInfluxPointValueUtils.getByMin(collectTime, DataPointFreqEnum.getEumByCode(dto.getMinfreqid()))); |
| | | dataMap.put(dto.getPointNo(), dto.getDefaultValue()); |
| | | |
| | | dataMap.put(dto.getPointNo(), defaultValue); |
| | | result.add(pojo); |
| | | listGood.add(dto.getPointNo()); |
| | | }); |
| | |
| | | List<DaPointDTO> pointConstantList = daPointService.getConstantPoint(pointNos); |
| | | if (!CollectionUtils.isEmpty(pointConstantList)) { |
| | | pointConstantList.forEach(item -> { |
| | | data.put(item.getPointNo(), item.getDefaultValue()); |
| | | BigDecimal coefficient = item.getUnittransfactor() == null ? BigDecimal.ONE : item.getUnittransfactor(); |
| | | data.put(item.getPointNo(), item.getDefaultValue().multiply(coefficient)); |
| | | }); |
| | | } |
| | | return data; |
| | |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | public List<InfluxPointValuePOJO> handle(Date collectTime, List<DaPointDTO> dtos, List<String> listGood, List<String> listBad) { |
| | | public List<InfluxPointValuePOJO> handle(Date collectTime, List<DaPointDTO> dtos, Map<String, Object> dataMap, List<String> listGood, List<String> listBad) { |
| | | List<InfluxPointValuePOJO> result = new ArrayList<>(); |
| | | try { |
| | | log.info("累计点处理开始"); |
| | |
| | | BigDecimal calValue = new BigDecimal(rawValue.toString()).multiply(coefficient); |
| | | InfluxPointValuePOJO pojo = GenInfluxPointValueUtils.getByPoint(dto, calValue); |
| | | pojo.setTimestamp(GenInfluxPointValueUtils.getByMin(collectTime, DataPointFreqEnum.getEumByCode(dto.getMinfreqid()))); |
| | | dataMap.put(dto.getPointNo(), calValue); |
| | | result.add(pojo); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | |
| | | long start = startTime.getTime(); |
| | | long end = endTime.getTime(); |
| | | long oneMin = 1000L * DataPointFreqEnum.getEumByCode(minfreqid).getValue(); |
| | | long mins = (end - start) / oneMin; |
| | | long mins = ((end - start) / oneMin) + 1; |
| | | |
| | | //找出缺少项 |
| | | Map<Long, Double> sourceDataMap = new HashMap<>(dataList.size()); |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private RedisTemplate<String, Object> redisTemplate; |
| | | |
| | | public List<InfluxPointValuePOJO> handle(Date collectTime, List<DaPointDTO> dtos, List<String> listGood, List<String> listBad) { |
| | | public List<InfluxPointValuePOJO> handle(Date collectTime, List<DaPointDTO> dtos, Map<String, Object> dataMap, List<String> listGood, List<String> listBad) { |
| | | List<InfluxPointValuePOJO> result = new ArrayList<>(); |
| | | try { |
| | | log.info("极值点处理开始"); |
| | |
| | | } |
| | | dtos.forEach(dto -> { |
| | | try { |
| | | Object value = singleCompute(dto, collectTime, listGood, listBad); |
| | | InfluxPointValuePOJO pojo = GenInfluxPointValueUtils.getByPoint(dto, value); |
| | | Object rawValue = singleCompute(dto, collectTime, listGood, listBad); |
| | | BigDecimal coefficient = dto.getUnittransfactor() == null ? BigDecimal.ONE : dto.getUnittransfactor(); |
| | | BigDecimal calValue = new BigDecimal(rawValue.toString()).multiply(coefficient); |
| | | InfluxPointValuePOJO pojo = GenInfluxPointValueUtils.getByPoint(dto, calValue); |
| | | pojo.setTimestamp(GenInfluxPointValueUtils.getByMin(collectTime, DataPointFreqEnum.getEumByCode(dto.getMinfreqid()))); |
| | | dataMap.put(dto.getPointNo(), calValue); |
| | | result.add(pojo); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | |
| | | value = redisTemplate.opsForValue().get(PointCollector.PV + item.getPointNo()); |
| | | } else { |
| | | value = singleCompute(item, calendar.getTime(), new ArrayList<>(), new ArrayList<>()); |
| | | BigDecimal coefficient = item.getUnittransfactor() == null ? BigDecimal.ONE : item.getUnittransfactor(); |
| | | value = new BigDecimal(value.toString()).multiply(coefficient); |
| | | } |
| | | data.put(item.getPointNo(), value); |
| | | }); |
| | |
| | | public Map<String, Object> getCurrent(List<String> pointNos) { |
| | | Map<String, Object> data = new HashMap<>(); |
| | | List<DaPointDTO> pointMeasureList = daPointService.getMeasurePoint(pointNos); |
| | | pointMeasureList.forEach( |
| | | item -> { |
| | | for (DaPointDTO item : pointMeasureList) { |
| | | try { |
| | | Object value = CommonConstant.BAD_VALUE; |
| | | boolean hasKey = redisTemplate.hasKey(PointCollector.PV + item.getPointNo()); |
| | | if (hasKey) { |
| | | if (hasKey && !StrUtils.isNumeric(value.toString())) { |
| | | value = redisTemplate.opsForValue().get(PointCollector.PV + item.getPointNo()); |
| | | } |
| | | if(hasKey && StrUtils.isNumeric(value.toString()) && |
| | | new BigDecimal(value.toString()).compareTo(CommonConstant.BAD_VALUE) != 0 ) { |
| | | data.put(item.getPointNo(), value); |
| | | continue; |
| | | } else if(hasKey && StrUtils.isNumeric(value.toString()) && new BigDecimal(value.toString()).compareTo(CommonConstant.BAD_VALUE) != 0 ) { |
| | | value = redisTemplate.opsForValue().get(PointCollector.PV + item.getPointNo()); |
| | | data.put(item.getPointNo(), value); |
| | | continue; |
| | | } else if (DataSourceType.OPCUA.getCode().equals(item.getSourceType())) { |
| | | value = opcUaCollector.getTagValue(item.getSourceId(), item.getTagNo()); |
| | | } else if (DataSourceType.ModBus.getCode().equals(item.getSourceType())) { |
| | |
| | | } |
| | | log.info("TagNo=" + item.getTagNo() + ",value=" + value.toString()); |
| | | if (!PointDataTypeEnum.BOOLEAN.getCode().equals(item.getDataType())) { |
| | | BigDecimal decValue = new BigDecimal(value.toString()); |
| | | BigDecimal coefficient = item.getUnittransfactor() == null ? BigDecimal.ONE : item.getUnittransfactor(); |
| | | BigDecimal decValue = new BigDecimal(value.toString()).multiply(coefficient); |
| | | if (PointDataTypeEnum.FLOAT.getCode().equals(item.getDataType())) { |
| | | decValue = decValue.setScale(2, BigDecimal.ROUND_HALF_UP); |
| | | } else if (PointDataTypeEnum.INT.getCode().equals(item.getDataType())) { |
| | |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | |
| | | } |
| | | ); |
| | | return data; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | Calendar startCal = unit.calculate(endTime, length); |
| | | Calendar startCal = unit.calculate(endTime, length-1); |
| | | return startCal.getTime(); |
| | | } |
| | | } |
| | |
| | | t1.point_type, |
| | | t1.store_type, |
| | | t1.data_type, |
| | | t1.unittransfactor, |
| | | t1.minfreqid |
| | | FROM t_da_point t1 |
| | | <where> |
| | |
| | | @Schema(description = "操作(已采纳,取消采纳,已忽略等)") |
| | | private String operate; |
| | | |
| | | @Schema(description = "原因") |
| | | private String reason; |
| | | |
| | | @Schema(description = "处理人ID") |
| | | private String handlerId; |
| | | |
| | |
| | | `adjust_value_rule` varchar(36) DEFAULT NULL COMMENT '调整值计算规则', |
| | | `is_enable` tinyint DEFAULT NULL COMMENT '是否启用(0禁用 1启用)', |
| | | `create_time` datetime DEFAULT NULL, |
| | | PRIMARY KEY (`id`), |
| | | UNIQUE KEY `config_code` (`config_code`) |
| | | `adjust_coefficient` decimal(10,6) DEFAULT '1.000000' COMMENT '调整系数', |
| | | PRIMARY KEY (`id`) |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='预测结果自动调整配置表'; |
| | | |
| | | alter table t_mm_predict_auto_adjust_config add column `adjust_coefficient` decimal(10,6) DEFAULT 1 COMMENT '调整系数'; |
| | | |
| | | -- 预测项影响因素 |
| | | |
| | |
| | | CREATE TABLE `t_st_suggest_snapshot_conf_det` |
| | | ( |
| | | `id` varchar(36) NOT NULL, |
| | | `conf_id` varchar(36) COMMENT '模型ID', |
| | | `conf_id` varchar(36) COMMENT '快照配置ID', |
| | | `data_type` varchar(20) DEFAULT NULL COMMENT '数据类型(DATAPOINT,IND,PLAN,PREDICTITEM)', |
| | | `data_no` varchar(36) COMMENT '数据编号', |
| | | `data_name` varchar(36) COMMENT '数据名称', |
| | |
| | | PRIMARY KEY (`id`) USING BTREE, |
| | | KEY `idx_suggest_id` (`suggest_id`) USING BTREE |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=DYNAMIC COMMENT='调度建议快照记录表'; |
| | | |
| | | ALTER TABLE `iailab_expert_tenant_shasteel`.`t_st_suggest_operation_record` |
| | | ADD COLUMN `reason` varchar(255) NULL COMMENT '原因' AFTER `operate`; |
| | |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; |
| | | import com.iailab.module.model.mcs.sche.service.*; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleRecordRespVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestOperationRecordReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestSaveReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestOperationRecordReqVO; |
| | | import com.iailab.module.model.mdk.vo.ItemVO; |
| | | import com.iailab.module.model.mpk.service.ChartParamService; |
| | | import com.iailab.module.model.mpk.service.ChartService; |
| | |
| | | @Override |
| | | public Boolean saveSuggestOperationRecord(SuggestOperationRecordReqVO reqVO) { |
| | | StSuggestOperationRecordReqVO operationRecordVo = new StSuggestOperationRecordReqVO(); |
| | | operationRecordVo.setSuggestId(reqVO.getId()); |
| | | operationRecordVo.setOperate(reqVO.getOperate()); |
| | | operationRecordVo.setReason(reqVO.getReason()); |
| | | operationRecordVo.setHandler(reqVO.getHandler()); |
| | | operationRecordVo.setHandlerId(reqVO.getHandlerId()); |
| | | //获取建议信息 |
| | |
| | | stSuggestOperationRecordService.create(operationRecordVo); |
| | | return true; |
| | | } |
| | | |
| | | private Date[] calResultTime(ItemVO predictItem, Date startTimeReq, Date endTimeReq, int lengthLeft, int lengthRight) { |
| | | Date[] result = new Date[3]; |
| | | Date predictTime = predictItem.getLastTime(); |
| | |
| | | public enum ScheduleSuggestStatusEnum { |
| | | |
| | | S0(0, "未处理"), |
| | | S1(1, "已采纳"); |
| | | S1(1, "已采纳"), |
| | | S2(2, "已忽略"); |
| | | |
| | | private Integer code; |
| | | private String desc; |
| | |
| | | |
| | | MmPredictAutoAdjustConfigEntity getInfo(String id); |
| | | |
| | | MmPredictAutoAdjustConfigEntity getByCode(String code); |
| | | List<MmPredictAutoAdjustConfigEntity> getByCode(String code); |
| | | |
| | | void create(MmPredictAutoAdjustConfigEntity entity); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public MmPredictAutoAdjustConfigEntity getByCode(String code) { |
| | | return baseDao.selectOne("config_code",code,"is_enable",1); |
| | | public List<MmPredictAutoAdjustConfigEntity> getByCode(String code) { |
| | | return baseDao.selectList(MmPredictAutoAdjustConfigEntity::getConfigCode,code,MmPredictAutoAdjustConfigEntity::getIsEnable,1); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public boolean autoAdjustByCode(String configCode,long adjustStartTime) { |
| | | log.info("开始自动调整:configCode:" + configCode + ",adjustStartTime:" + new Date(adjustStartTime)); |
| | | // 查询调整配置 |
| | | MmPredictAutoAdjustConfigEntity configEntity = getByCode(configCode); |
| | | if (configEntity == null) { |
| | | log.info("自动调整失败原因:configEntity为null"); |
| | | List<MmPredictAutoAdjustConfigEntity> configEntityList = getByCode(configCode); |
| | | if (CollectionUtils.isEmpty(configEntityList)) { |
| | | log.info("自动调整失败原因:configEntityList为空"); |
| | | return false; |
| | | } |
| | | |
| | | |
| | | // 根据outputId分组 |
| | | Map<String, List<MmPredictAutoAdjustConfigEntity>> outputIdMap = configEntityList.stream().collect(Collectors.groupingBy(MmPredictAutoAdjustConfigEntity::getOutputId)); |
| | | for (Map.Entry<String, List<MmPredictAutoAdjustConfigEntity>> entry : outputIdMap.entrySet()) { |
| | | String outputId = entry.getKey(); |
| | | // 查询调整用户adjustStartTime 至 adjustStartTime - 预测长度 * 预测粒度 范围的值 |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTimeInMillis(adjustStartTime); |
| | | Date endTime = calendar.getTime(); |
| | | ItemVO item = mmPredictItemService.getItemByOutPutId(configEntity.getOutputId()); |
| | | ItemVO item = mmPredictItemService.getItemByOutPutId(outputId); |
| | | if (item == null) { |
| | | log.info("自动调整失败原因:getItemByOutPutId为null,outputId:" + configEntity.getOutputId()); |
| | | return false; |
| | | log.info("自动调整失败原因:getItemByOutPutId为null,outputId:" + outputId); |
| | | continue; |
| | | } |
| | | calendar.add(Calendar.SECOND,item.getPredictLength() * item.getGranularity() * -1); |
| | | Date startTime = calendar.getTime(); |
| | | |
| | | // 获取预测历史结果 |
| | | InfluxModelResultPOJO pojo = new InfluxModelResultPOJO(); |
| | | pojo.setType(DataTypeEnum.FLOAT_LAST_BAK.getCode()); |
| | | pojo.setOutPutId(outputId); |
| | | List<InfluxModelResultVO> influxModelResult = influxDBService.queryModelResults(pojo, new Date(adjustStartTime), new Date(adjustStartTime)); |
| | | if (CollectionUtils.isEmpty(influxModelResult)) { |
| | | log.info("自动调整失败原因:预测历史结果为空。itemNo:" + item.getItemNo() + ",itemName:" + item.getItemName() + ",outputId:" + outputId + ",time:" + adjustStartTime); |
| | | continue; |
| | | } |
| | | |
| | | // 计算所有影响用户的最终调整值 |
| | | Double finalAdjustValue = 0.0; |
| | | for (MmPredictAutoAdjustConfigEntity configEntity : entry.getValue()) { |
| | | Double adjustValue = null; |
| | | // 查询影响用户历史值 |
| | | ApiPointValueQueryDTO queryDTO = new ApiPointValueQueryDTO(); |
| | | ApiPointDTO pointInfo = dataPointApi.getInfoById(configEntity.getPointId()); |
| | | queryDTO.setPointNo(pointInfo.getPointNo()); |
| | |
| | | queryDTO.setStart(startTime); |
| | | List<ApiPointValueDTO> apiPointValueDTOS = dataPointApi.queryPointHistoryValue(queryDTO); |
| | | if (CollectionUtils.isEmpty(apiPointValueDTOS)) { |
| | | log.info("自动调整失败原因:测点数据长度为0。queryDTO:" + queryDTO); |
| | | return false; |
| | | log.info("影响用户[" + pointInfo.getPointName() + "]调整失败原因:测点数据长度为0。queryDTO:" + queryDTO); |
| | | continue; |
| | | } |
| | | // 过滤掉-2 |
| | | apiPointValueDTOS = apiPointValueDTOS.stream().filter(e -> !Double.valueOf(e.getV()).equals(-2.0)).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(apiPointValueDTOS)) { |
| | | log.info("自动调整失败原因:过滤掉-2之后测点数据长度为0。queryDTO:" + queryDTO); |
| | | return false; |
| | | } |
| | | |
| | | // 获取预测历史结果 |
| | | InfluxModelResultPOJO pojo = new InfluxModelResultPOJO(); |
| | | pojo.setType(DataTypeEnum.FLOAT_LAST.getCode()); |
| | | pojo.setOutPutId(configEntity.getOutputId()); |
| | | List<InfluxModelResultVO> influxModelResult = influxDBService.queryModelResults(pojo, new Date(adjustStartTime), new Date(adjustStartTime)); |
| | | if (CollectionUtils.isEmpty(influxModelResult)) { |
| | | log.info("自动调整失败原因:预测历史结果为空。itemNo:" + item.getItemNo() + ",itemName" + item.getItemName() + ",outputId" + configEntity.getOutputId() + ",time" + adjustStartTime); |
| | | return false; |
| | | log.info("影响用户调整失败原因:过滤掉-2之后测点数据长度为0。queryDTO:" + queryDTO); |
| | | continue; |
| | | } |
| | | |
| | | // 触发规则 |
| | | AutoAdjustTriggerRuleEnum triggerRuleEnum = AutoAdjustTriggerRuleEnum.fromCode(configEntity.getTriggerRule()); |
| | | Double adjustValue = null; |
| | | // 判断是否符合触发条件 并计算调整值 |
| | | switch (triggerRuleEnum) { |
| | | case SLOPE: |
| | |
| | | slopeCalendar.add(Calendar.MINUTE,configEntity.getT()); |
| | | Date slopeEndTime = slopeCalendar.getTime(); |
| | | if (slopeEndTime.after(endTime)) { |
| | | log.info("自动调整失败原因:△t设置过大,大于模型预测长度 * 预测粒度。△t:" + configEntity.getT()); |
| | | return false; |
| | | log.info("影响用户[" + pointInfo.getPointName() + "]调整失败原因:△t设置过大,大于模型预测长度 * 预测粒度。△t:" + configEntity.getT()); |
| | | continue; |
| | | } |
| | | while (!slopeEndTime.after(endTime)) { |
| | | //计算斜率 |
| | |
| | | Date averageEndTime = averageCalendar.getTime(); |
| | | |
| | | if (averageEndTime.after(endTime)) { |
| | | log.info("自动调整失败原因:△t设置过大,△t*2大于模型预测长度 * 预测粒度。△t:" + configEntity.getT()); |
| | | return false; |
| | | log.info("影响用户[" + pointInfo.getPointName() + "]调整失败原因:△t设置过大,△t*2大于模型预测长度 * 预测粒度。△t:" + configEntity.getT()); |
| | | continue; |
| | | } |
| | | while (!averageEndTime.after(endTime)) { |
| | | //计算均值差 |
| | |
| | | } |
| | | break; |
| | | default: |
| | | log.info("自动调整失败原因:未知触发规则,triggerRule" + configEntity.getTriggerRule()); |
| | | return false; |
| | | log.info("影响用户[" + pointInfo.getPointName() + "]调整失败原因:未知触发规则,triggerRule" + configEntity.getTriggerRule()); |
| | | continue; |
| | | } |
| | | if (adjustValue == null) { |
| | | log.info("自动调整失败原因:未达到触发条件"); |
| | | return false; |
| | | log.info("影响用户[" + pointInfo.getPointName() + "]调整失败原因:未达到触发条件"); |
| | | continue; |
| | | } |
| | | |
| | | // 调整系数 |
| | | adjustValue = adjustValue * configEntity.getAdjustCoefficient(); |
| | | // 调整方向 |
| | | adjustValue = adjustValue * configEntity.getAdjustDirection(); |
| | | |
| | | |
| | | // 累加到最终调整值 |
| | | finalAdjustValue += adjustValue; |
| | | } |
| | | // 执行调整 |
| | | if (finalAdjustValue.equals(0.0)) { |
| | | log.info("自动调整失败原因:finalAdjustValue为0,outputId:" + outputId + ",configCode:" + configCode); |
| | | continue; |
| | | } |
| | | List<InfluxModelResultPOJO> lastList = new ArrayList<>(); |
| | | for (InfluxModelResultVO resultVO : influxModelResult) { |
| | | InfluxModelResultLastSimPOJO adjustPojo = new InfluxModelResultLastSimPOJO(); |
| | | // 设置新的调整值 |
| | | adjustPojo.setValue(Double.parseDouble(resultVO.getValue().toString()) + adjustValue); |
| | | adjustPojo.setValue(Double.parseDouble(resultVO.getValue().toString()) + finalAdjustValue); |
| | | adjustPojo.setTimestamp(resultVO.getTimestamp()); |
| | | adjustPojo.setOutPutId(configEntity.getOutputId()); |
| | | adjustPojo.setOutPutId(outputId); |
| | | lastList.add(adjustPojo); |
| | | } |
| | | // 相同时间直接覆盖旧值 |
| | | influxDBService.asyncWriteModelResults(lastList); |
| | | log.info("t+l自动调整。configCode:" + configCode + ",adjustValue:" + adjustValue + ",itemNo:" + item.getItemNo() + ",itemName" + item.getItemName() + ",outputId" + configEntity.getOutputId() + ",adjustTime:" + adjustStartTime); |
| | | log.info("t+l自动调整。configCode:" + configCode + ",adjustValue:" + finalAdjustValue + ",itemNo:" + item.getItemNo() + ",itemName:" + item.getItemName() + ",outputId:" + outputId + ",adjustTime:" + adjustStartTime); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.sche.controller.admin; |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.module.model.mcs.pre.service.DmModuleItemService; |
| | | import com.iailab.module.model.mcs.pre.service.DmModuleService; |
| | | import com.iailab.module.model.mcs.pre.service.MmItemOutputService; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; |
| | | import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleSchemePageReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleSchemeRespVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestPageReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestRespVO; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | 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; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | |
| | | List<StScheduleSuggestEntity> list = stScheduleSuggestService.getList(moduleList, pageVO.getPredictTime()); |
| | | return success(BeanUtils.toBean(list, StScheduleSuggestRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得调度建议分页") |
| | | @PreAuthorize("@ss.hasPermission('sche:suggest:query')") |
| | | public CommonResult<PageResult<StScheduleSuggestRespVO>> getPage(@Valid StScheduleSuggestPageReqVO pageVO) { |
| | | PageResult<StScheduleSuggestEntity> pageResult = stScheduleSuggestService.page(pageVO); |
| | | return success(BeanUtils.toBean(pageResult, StScheduleSuggestRespVO.class)); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.sche.controller.admin; |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.module.model.mcs.sche.entity.StSuggestSnapshotConfDetEntity; |
| | | import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotConfDetService; |
| | | import com.iailab.module.model.mcs.sche.vo.*; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | | /** |
| | | * @author DongYukun |
| | | * @Description |
| | | * @createTime 2025年05月23日 |
| | | */ |
| | | @Tag(name = "调度建议快照配置详情") |
| | | @RestController |
| | | @RequestMapping("/model/suggest/snapshot/conf-det") |
| | | public class StSuggestSnapshotConfDetController { |
| | | |
| | | @Autowired |
| | | private StSuggestSnapshotConfDetService stSuggestSnapshotConfDetService; |
| | | |
| | | @GetMapping("/page") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:query')") |
| | | public CommonResult<PageResult<StSuggestSnapshotConfDetRespVO>> getPage(@Valid StSuggestSnapshotConfDetPageReqVO pageVO) { |
| | | PageResult<StSuggestSnapshotConfDetEntity> pageResult = stSuggestSnapshotConfDetService.page(pageVO); |
| | | return success(BeanUtils.toBean(pageResult, StSuggestSnapshotConfDetRespVO.class)); |
| | | } |
| | | |
| | | @PostMapping("/create") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:create')") |
| | | public CommonResult<Boolean> create(@Valid @RequestBody StSuggestSnapshotConfDetSaveReqVO createReqVO) { |
| | | stSuggestSnapshotConfDetService.create(createReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:update')") |
| | | public CommonResult<Boolean> update(@Valid @RequestBody StSuggestSnapshotConfDetSaveReqVO updateReqVO) { |
| | | stSuggestSnapshotConfDetService.update(updateReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:delete')") |
| | | public CommonResult<Boolean> deleteTenant(@RequestParam("id") String id) { |
| | | stSuggestSnapshotConfDetService.delete(id); |
| | | return success(true); |
| | | } |
| | | |
| | | @GetMapping("/get") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:info')") |
| | | public CommonResult<StSuggestSnapshotConfDetRespVO> get(@RequestParam("id") String id) { |
| | | StSuggestSnapshotConfDetRespVO result = stSuggestSnapshotConfDetService.get(id); |
| | | return success(result); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.sche.controller.admin; |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.module.model.api.mcs.dto.StScheduleModelOutDTO; |
| | | import com.iailab.module.model.mcs.sche.entity.*; |
| | | import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotConfMainService; |
| | | import com.iailab.module.model.mcs.sche.vo.*; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import java.util.List; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | | /** |
| | | * @author DongYukun |
| | | * @Description |
| | | * @createTime 2025年05月23日 |
| | | */ |
| | | @Tag(name = "调度建议快照配置主表") |
| | | @RestController |
| | | @RequestMapping("/model/suggest/snapshot/conf-main") |
| | | public class StSuggestSnapshotConfMainController { |
| | | |
| | | @Autowired |
| | | private StSuggestSnapshotConfMainService stSuggestSnapshotConfMainService; |
| | | |
| | | @GetMapping("/page") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:query')") |
| | | public CommonResult<PageResult<StSuggestSnapshotConfMainRespVO>> getPage(@Valid StSuggestSnapshotConfMainPageReqVO pageVO) { |
| | | PageResult<StSuggestSnapshotConfMainEntity> pageResult = stSuggestSnapshotConfMainService.page(pageVO); |
| | | return success(BeanUtils.toBean(pageResult, StSuggestSnapshotConfMainRespVO.class)); |
| | | } |
| | | |
| | | @GetMapping("/get") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:info')") |
| | | public CommonResult<StSuggestSnapshotConfMainRespVO> get(@RequestParam("id") String id) { |
| | | StSuggestSnapshotConfMainRespVO result = stSuggestSnapshotConfMainService.get(id); |
| | | return success(result); |
| | | } |
| | | |
| | | @PostMapping("/create") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:create')") |
| | | public CommonResult<Boolean> create(@Valid @RequestBody StSuggestSnapshotConfMainSaveReqVO createReqVO) { |
| | | stSuggestSnapshotConfMainService.create(createReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:update')") |
| | | public CommonResult<Boolean> update(@Valid @RequestBody StSuggestSnapshotConfMainSaveReqVO updateReqVO) { |
| | | stSuggestSnapshotConfMainService.update(updateReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @PreAuthorize("@ss.hasPermission('suggest:snapshot:delete')") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | public CommonResult<Boolean> deleteTenant(@RequestParam("id") String id) { |
| | | stSuggestSnapshotConfMainService.delete(id); |
| | | return success(true); |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.sche.controller.admin; |
| | | |
| | | import com.iailab.framework.common.pojo.CommonResult; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotRecordService; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotRecordChartReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotRecordRespVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotRecordSaveReqVO; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | | public class StSuggestSnapshotRecordController { |
| | | |
| | | @Autowired |
| | | private StSuggestSnapshotRecordService stSuggestSnapshotRecordService; |
| | | |
| | | @PostMapping("/create") |
| | | public CommonResult<Boolean> create(@Valid @RequestBody StSuggestSnapshotRecordSaveReqVO createReqVO) { |
| | | stSuggestSnapshotRecordService.create(createReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @PutMapping("/update") |
| | | public CommonResult<Boolean> update(@Valid @RequestBody StSuggestSnapshotRecordSaveReqVO updateReqVO) { |
| | | stSuggestSnapshotRecordService.update(updateReqVO); |
| | | return success(true); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | public CommonResult<Boolean> deleteTenant(@RequestParam("id") String id) { |
| | | stSuggestSnapshotRecordService.delete(id); |
| | | return success(true); |
| | | } |
| | | } |
| | |
| | | default PageResult<StScheduleSuggestEntity> selectPage(StScheduleSuggestPageReqVO reqVO) { |
| | | return selectPage(reqVO, new LambdaQueryWrapperX<StScheduleSuggestEntity>() |
| | | .likeIfPresent(StScheduleSuggestEntity::getTitle, reqVO.getTitle()) |
| | | .eqIfPresent(StScheduleSuggestEntity::getModelId, reqVO.getModelId()) |
| | | .likeIfPresent(StScheduleSuggestEntity::getScheduleObj, reqVO.getScheduleObj()) |
| | | .orderByDesc(StScheduleSuggestEntity::getCreateTime)); |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.sche.dao; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import com.iailab.framework.tenant.core.db.dynamic.TenantDS; |
| | | import com.iailab.module.model.mcs.sche.entity.StSuggestSnapshotConfDetEntity; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfDetPageReqVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | |
| | | @TenantDS |
| | | @Mapper |
| | | public interface StSuggestSnapshotConfDetDao extends BaseMapperX<StSuggestSnapshotConfDetEntity> { |
| | | |
| | | default PageResult<StSuggestSnapshotConfDetEntity> selectPage(StSuggestSnapshotConfDetPageReqVO reqVO) { |
| | | return selectPage(reqVO,new LambdaQueryWrapperX<StSuggestSnapshotConfDetEntity>() |
| | | .likeIfPresent(StSuggestSnapshotConfDetEntity::getConfId,reqVO.getConfId())); |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.sche.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import com.iailab.framework.tenant.core.db.dynamic.TenantDS; |
| | | import com.iailab.module.model.mcs.sche.entity.StSuggestSnapshotConfMainEntity; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfMainPageReqVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | |
| | | @TenantDS |
| | | @Mapper |
| | | public interface StSuggestSnapshotConfMainDao extends BaseMapperX<StSuggestSnapshotConfMainEntity> { |
| | | |
| | | default PageResult<StSuggestSnapshotConfMainEntity> selectPage(StSuggestSnapshotConfMainPageReqVO reqVO) { |
| | | return selectPage(reqVO,new LambdaQueryWrapperX<StSuggestSnapshotConfMainEntity>() |
| | | .likeIfPresent(StSuggestSnapshotConfMainEntity::getModelId,reqVO.getModelId())); |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.sche.dao; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.mybatis.core.mapper.BaseMapperX; |
| | | import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; |
| | | import com.iailab.framework.tenant.core.db.dynamic.TenantDS; |
| | | import com.iailab.module.model.mcs.sche.entity.StSuggestSnapshotRecordEntity; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotRecordChartReqVO; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | |
| | | @TenantDS |
| | | @Mapper |
| | | public interface StSuggestSnapshotRecordDao extends BaseMapperX<StSuggestSnapshotRecordEntity> { |
| | | |
| | | default PageResult<StSuggestSnapshotRecordEntity> selectPage(StSuggestSnapshotRecordChartReqVO reqVO) { |
| | | return selectPage(reqVO); |
| | | } |
| | | } |
| | |
| | | private String operate; |
| | | |
| | | /** |
| | | * 原因 |
| | | */ |
| | | private String reason; |
| | | |
| | | /** |
| | | * 处理人ID |
| | | */ |
| | | private String handlerId; |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.iailab.framework.mybatis.core.dataobject.BaseDO; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | private String id; |
| | | |
| | | /** |
| | | * 模型ID |
| | | * 快照配置ID |
| | | */ |
| | | private String confId; |
| | | |
| | |
| | | private Integer leftLength; |
| | | |
| | | /** |
| | | * 右侧侧长度(min) |
| | | * 右侧长度(min) |
| | | */ |
| | | private Integer rightLength; |
| | | |
| | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private Date scheduleTime; |
| | | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | private Date startTime; |
| | | |
| | | /** |
| | |
| | | package com.iailab.module.model.mcs.sche.service; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.BaseService; |
| | | import com.iailab.module.model.mcs.sche.entity.StSuggestSnapshotConfDetEntity; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfDetPageReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfDetRespVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfDetSaveReqVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | public interface StSuggestSnapshotConfDetService extends BaseService<StSuggestSnapshotConfDetEntity> { |
| | | PageResult<StSuggestSnapshotConfDetEntity> page(StSuggestSnapshotConfDetPageReqVO reqVO); |
| | | |
| | | void create(StSuggestSnapshotConfDetSaveReqVO createReqVO); |
| | | |
| | | void update(StSuggestSnapshotConfDetSaveReqVO createReqVO); |
| | | |
| | | void delete(String id); |
| | | |
| | | List<StSuggestSnapshotConfDetRespVO> getByConfId(String confId); |
| | | |
| | | StSuggestSnapshotConfDetRespVO get(String id); |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.sche.service; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.BaseService; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; |
| | | import com.iailab.module.model.mcs.sche.entity.StSuggestSnapshotConfMainEntity; |
| | | |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfMainPageReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfMainRespVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfMainSaveReqVO; |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | public interface StSuggestSnapshotConfMainService extends BaseService<StSuggestSnapshotConfMainEntity> { |
| | | PageResult<StSuggestSnapshotConfMainEntity> page(StSuggestSnapshotConfMainPageReqVO reqVO); |
| | | |
| | | void create(StSuggestSnapshotConfMainSaveReqVO createReqVO); |
| | | |
| | | void update(StSuggestSnapshotConfMainSaveReqVO createReqVO); |
| | | |
| | | void delete(String id); |
| | | |
| | | StSuggestSnapshotConfMainRespVO getByModelIdAndScheduleObj(String modelId, String scheduleObj); |
| | | |
| | | StSuggestSnapshotConfMainRespVO get(String id); |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.sche.service; |
| | | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.service.BaseService; |
| | | import com.iailab.module.model.mcs.sche.entity.StSuggestSnapshotRecordEntity; |
| | | |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotRecordChartReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotRecordRespVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotRecordSaveReqVO; |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | public interface StSuggestSnapshotRecordService extends BaseService<StSuggestSnapshotRecordEntity> { |
| | | |
| | | void create(StSuggestSnapshotRecordSaveReqVO createReqVO); |
| | | |
| | | void update(StSuggestSnapshotRecordSaveReqVO createReqVO); |
| | | |
| | | void delete(String id); |
| | | } |
| | |
| | | import com.iailab.module.model.api.mcs.dto.ScheduleSuggestReqDTO; |
| | | import com.iailab.module.model.api.mcs.dto.ScheduleSuggestRespDTO; |
| | | import com.iailab.module.model.api.mcs.dto.StAlarmAndSuggestReqVO; |
| | | import com.iailab.module.model.api.mcs.dto.StAlarmAndSuggestRespVO; |
| | | import com.iailab.module.model.common.enums.ScheduleSuggestStatusEnum; |
| | | import com.iailab.module.model.mcs.sche.dao.StScheduleSuggestDao; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; |
| | | import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestPageReqVO; |
| | |
| | | public Boolean ignoreSuggest(StAlarmAndSuggestReqVO reqVO) { |
| | | StScheduleSuggestEntity entity = new StScheduleSuggestEntity(); |
| | | entity.setId(reqVO.getId()); |
| | | entity.setStatus(ScheduleSuggestStatusEnum.S0.getCode()); |
| | | entity.setStatus(ScheduleSuggestStatusEnum.S2.getCode()); |
| | | entity.setHandleTime(new Date()); |
| | | baseDao.updateById(entity); |
| | | return true; |
| | |
| | | import com.iailab.module.model.mcs.sche.dao.StSuggestOperationRecordDao; |
| | | import com.iailab.module.model.mcs.sche.entity.StSuggestOperationRecordEntity; |
| | | import com.iailab.module.model.mcs.sche.service.StSuggestOperationRecordService; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestOperationRecordPageReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestOperationRecordReqVO; |
| | | import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotConfDetService; |
| | | import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotConfMainService; |
| | | import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotRecordService; |
| | | import com.iailab.module.model.mcs.sche.vo.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneId; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | |
| | |
| | | public class StSuggestOperationRecordServiceImpl extends BaseServiceImpl<StSuggestOperationRecordDao, StSuggestOperationRecordEntity> |
| | | implements StSuggestOperationRecordService { |
| | | |
| | | @Autowired |
| | | private StSuggestSnapshotConfMainService stSuggestSnapshotConfMainService; |
| | | |
| | | @Autowired |
| | | private StSuggestSnapshotConfDetService stSuggestSnapshotConfDetService; |
| | | |
| | | @Autowired |
| | | private StSuggestSnapshotRecordService stSuggestSnapshotRecordService; |
| | | |
| | | @Override |
| | | public PageResult<StSuggestOperationRecordEntity> page(StSuggestOperationRecordPageReqVO reqVO) { |
| | | return baseDao.selectPage(reqVO); |
| | |
| | | public void create(StSuggestOperationRecordReqVO reqVo) { |
| | | StSuggestOperationRecordEntity entity = BeanUtils.toBean(reqVo, StSuggestOperationRecordEntity.class); |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | entity.setHandleTime(new Date()); |
| | | baseDao.insert(entity); |
| | | |
| | | //获取调度建议快照配置表信息 |
| | | StSuggestSnapshotConfMainRespVO confMain = stSuggestSnapshotConfMainService.getByModelIdAndScheduleObj(reqVo.getModelId(), reqVo.getSuggestId()); |
| | | if (confMain != null){ |
| | | StSuggestSnapshotRecordSaveReqVO snapshotRecordSaveReqVO = new StSuggestSnapshotRecordSaveReqVO(); |
| | | snapshotRecordSaveReqVO.setModelId(entity.getModelId()); |
| | | List<StSuggestSnapshotConfDetRespVO> confDetList = stSuggestSnapshotConfDetService.getByConfId(confMain.getId()); |
| | | confDetList.forEach(confDet -> { |
| | | snapshotRecordSaveReqVO.setDataNo(confDet.getDataNo()); |
| | | snapshotRecordSaveReqVO.setDataType(confDet.getDataType()); |
| | | snapshotRecordSaveReqVO.setScheduleTime(entity.getScheduleTime()); |
| | | //计算开始时间,开始时间为当前调度时间减去快照配置表配置的左侧时间长度 |
| | | LocalDateTime localStartDateTime = entity.getScheduleTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().minusMinutes(confDet.getLeftLength()); |
| | | Date startTime = Date.from(localStartDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | snapshotRecordSaveReqVO.setStartTime(startTime); |
| | | //计算结束时间,结束时间为当前调度时间加上快照配置表配置的右侧时间长度 |
| | | LocalDateTime localEndDateTime = entity.getScheduleTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().plusMinutes(confDet.getRightLength()); |
| | | Date endTime = Date.from(localEndDateTime.atZone(ZoneId.systemDefault()).toInstant()); |
| | | snapshotRecordSaveReqVO.setEndTime(endTime); |
| | | stSuggestSnapshotRecordService.create(snapshotRecordSaveReqVO); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.sche.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DSTransactional; |
| | | 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.mcs.sche.dao.StSuggestSnapshotConfDetDao; |
| | | import com.iailab.module.model.mcs.sche.entity.StSuggestSnapshotConfDetEntity; |
| | | import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotConfDetService; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfDetPageReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfDetRespVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfDetSaveReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfMainRespVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | | |
| | | /** |
| | |
| | | implements StSuggestSnapshotConfDetService { |
| | | |
| | | |
| | | @Autowired |
| | | private StSuggestSnapshotConfDetService stSuggestSnapshotConfDetService; |
| | | |
| | | @Override |
| | | public PageResult<StSuggestSnapshotConfDetEntity> page(StSuggestSnapshotConfDetPageReqVO reqVO) { |
| | | return baseDao.selectPage(reqVO); |
| | | } |
| | | |
| | | @Override |
| | | @DSTransactional(rollbackFor = Exception.class) |
| | | public void create(StSuggestSnapshotConfDetSaveReqVO createReqVO) { |
| | | StSuggestSnapshotConfDetEntity entity = BeanUtils.toBean(createReqVO, StSuggestSnapshotConfDetEntity.class); |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | baseDao.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | @DSTransactional(rollbackFor = Exception.class) |
| | | public void update(StSuggestSnapshotConfDetSaveReqVO updateReqVO) { |
| | | StSuggestSnapshotConfDetEntity entity = BeanUtils.toBean(updateReqVO, StSuggestSnapshotConfDetEntity.class); |
| | | baseDao.updateById(entity); |
| | | } |
| | | |
| | | @Override |
| | | @DSTransactional(rollbackFor = Exception.class) |
| | | public void delete(String id) { |
| | | baseDao.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public List<StSuggestSnapshotConfDetRespVO> getByConfId(String confId) { |
| | | return ConvertUtils.sourceToTarget(baseDao.selectList("conf_id", confId), StSuggestSnapshotConfDetRespVO.class); |
| | | } |
| | | |
| | | @Override |
| | | public StSuggestSnapshotConfDetRespVO get(String id) { |
| | | return ConvertUtils.sourceToTarget( baseDao.selectById(id), StSuggestSnapshotConfDetRespVO.class); |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.sche.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DSTransactional; |
| | | 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.mcs.sche.dao.StSuggestSnapshotConfMainDao; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; |
| | | import com.iailab.module.model.mcs.sche.entity.StSuggestSnapshotConfMainEntity; |
| | | import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotConfMainService; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfMainPageReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfMainRespVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotConfMainSaveReqVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.UUID; |
| | | |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class StSuggestSnapshotConfMainServiceImpl extends BaseServiceImpl<StSuggestSnapshotConfMainDao, StSuggestSnapshotConfMainEntity> |
| | | implements StSuggestSnapshotConfMainService { |
| | | |
| | | @Override |
| | | public PageResult<StSuggestSnapshotConfMainEntity> page(StSuggestSnapshotConfMainPageReqVO reqVO) { |
| | | return baseDao.selectPage(reqVO); |
| | | } |
| | | |
| | | @Override |
| | | @DSTransactional(rollbackFor = Exception.class) |
| | | public void create(StSuggestSnapshotConfMainSaveReqVO createReqVO) { |
| | | StSuggestSnapshotConfMainEntity entity = BeanUtils.toBean(createReqVO, StSuggestSnapshotConfMainEntity.class); |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | baseDao.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | @DSTransactional(rollbackFor = Exception.class) |
| | | public void update(StSuggestSnapshotConfMainSaveReqVO updateReqVO) { |
| | | StSuggestSnapshotConfMainEntity entity = BeanUtils.toBean(updateReqVO, StSuggestSnapshotConfMainEntity.class); |
| | | baseDao.updateById(entity); |
| | | } |
| | | |
| | | @Override |
| | | @DSTransactional(rollbackFor = Exception.class) |
| | | public void delete(String id) { |
| | | baseDao.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public StSuggestSnapshotConfMainRespVO getByModelIdAndScheduleObj(String modelId, String scheduleObj) { |
| | | return ConvertUtils.sourceToTarget( baseDao.selectOne("model_id", modelId, "schedule_obj", scheduleObj), StSuggestSnapshotConfMainRespVO.class); |
| | | } |
| | | |
| | | @Override |
| | | public StSuggestSnapshotConfMainRespVO get(String id) { |
| | | return ConvertUtils.sourceToTarget( baseDao.selectById(id), StSuggestSnapshotConfMainRespVO.class); |
| | | } |
| | | } |
| | |
| | | package com.iailab.module.model.mcs.sche.service.impl; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DSTransactional; |
| | | 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.module.model.mcs.sche.dao.StSuggestSnapshotRecordDao; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; |
| | | import com.iailab.module.model.mcs.sche.entity.StSuggestSnapshotRecordEntity; |
| | | import com.iailab.module.model.mcs.sche.service.StSuggestSnapshotRecordService; |
| | | import com.iailab.module.model.mcs.sche.vo.StScheduleModelRespVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotRecordChartReqVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotRecordRespVO; |
| | | import com.iailab.module.model.mcs.sche.vo.StSuggestSnapshotRecordSaveReqVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.UUID; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | | |
| | | /** |
| | |
| | | @Service |
| | | public class StSuggestSnapshotRecordServiceImpl extends BaseServiceImpl<StSuggestSnapshotRecordDao, StSuggestSnapshotRecordEntity> |
| | | implements StSuggestSnapshotRecordService { |
| | | |
| | | |
| | | @Autowired |
| | | private StSuggestSnapshotRecordService StSuggestSnapshotRecordService; |
| | | |
| | | @Override |
| | | @DSTransactional(rollbackFor = Exception.class) |
| | | public void create(StSuggestSnapshotRecordSaveReqVO createReqVO) { |
| | | StSuggestSnapshotRecordEntity entity = BeanUtils.toBean(createReqVO, StSuggestSnapshotRecordEntity.class); |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | baseDao.insert(entity); |
| | | } |
| | | |
| | | @Override |
| | | @DSTransactional(rollbackFor = Exception.class) |
| | | public void update(StSuggestSnapshotRecordSaveReqVO updateReqVO) { |
| | | StSuggestSnapshotRecordEntity entity = BeanUtils.toBean(updateReqVO, StSuggestSnapshotRecordEntity.class); |
| | | baseDao.updateById(entity); |
| | | } |
| | | |
| | | @Override |
| | | @DSTransactional(rollbackFor = Exception.class) |
| | | public void delete(String id) { |
| | | baseDao.deleteById(id); |
| | | } |
| | | } |
| | |
| | | @Schema(description = "标题,模糊匹配", example = "") |
| | | private String title; |
| | | |
| | | @Schema(description = "模型id", example = "") |
| | | private String modelId; |
| | | |
| | | @Schema(description = "调整对象,模糊匹配", example = "") |
| | | private String scheduleObj; |
| | | |
| | |
| | | private String modelName; |
| | | |
| | | @Schema(description = "调度时间") |
| | | @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = "GMT+8") |
| | | private LocalDateTime scheduleTime; |
| | | private String scheduleTime; |
| | | |
| | | @Schema(description = "开始时间") |
| | | @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
| | |
| | | @Schema(description = "操作(已采纳,取消采纳,已忽略等)") |
| | | private String operate; |
| | | |
| | | @Schema(description = "原因") |
| | | private String reason; |
| | | |
| | | @Schema(description = "处理人ID") |
| | | private String handlerId; |
| | | |
| | |
| | | @Schema(description = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @Schema(description = "建议ID") |
| | | private String suggestId; |
| | | } |
| | |
| | | @Schema(description = "操作(已采纳,取消采纳,已忽略等)") |
| | | private String operate; |
| | | |
| | | @Schema(description = "原因") |
| | | private String reason; |
| | | |
| | | @Schema(description = "处理人ID") |
| | | private String handlerId; |
| | | |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.sche.vo; |
| | | |
| | | import com.iailab.framework.common.pojo.PageParam; |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | @Schema(description = "模型服务 - 调度建议快照配置分页 Request VO") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ToString(callSuper = true) |
| | | public class StSuggestSnapshotConfDetPageReqVO extends PageParam { |
| | | |
| | | @Schema(description = "模型ID") |
| | | private String confId; |
| | | } |
| | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "模型ID") |
| | | @Schema(description = "快照配置ID") |
| | | private String confId; |
| | | |
| | | @Schema(description = "数据类型(DATAPOINT,IND,PLAN,PREDICTITEM)") |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.sche.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | @Schema(description = "模型服务 - 调度建议创建/修改 Request VO") |
| | | @Data |
| | | public class StSuggestSnapshotConfDetRespVO { |
| | | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "模型ID") |
| | | private String confId; |
| | | |
| | | @Schema(description = "数据类型(DATAPOINT,IND,PLAN,PREDICTITEM)") |
| | | private String dataType; |
| | | |
| | | @Schema(description = "数据编号") |
| | | private String dataNo; |
| | | |
| | | @Schema(description = "左侧长度(min)") |
| | | private Integer leftLength; |
| | | |
| | | @Schema(description = "右侧侧长度(min)") |
| | | private Integer rightLength; |
| | | |
| | | @Schema(description = "排序") |
| | | private Integer sort; |
| | | |
| | | @Schema(description = "拓展字段1") |
| | | private String ext1; |
| | | |
| | | @Schema(description = "拓展字段2") |
| | | private String ext2; |
| | | |
| | | @Schema(description = "拓展字段3") |
| | | private String ext3; |
| | | |
| | | @Schema(description = "拓展字段4") |
| | | private String ext4; |
| | | |
| | | @Schema(description = "拓展字段5") |
| | | private String ext5; |
| | | } |
对比新文件 |
| | |
| | | package com.iailab.module.model.mcs.sche.vo; |
| | | |
| | | import io.swagger.v3.oas.annotations.media.Schema; |
| | | import lombok.Data; |
| | | |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | @Schema(description = "模型服务 - 调度建议创建/修改 Request VO") |
| | | @Data |
| | | public class StSuggestSnapshotConfDetSaveReqVO { |
| | | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "模型ID") |
| | | private String confId; |
| | | |
| | | @Schema(description = "数据类型(DATAPOINT,IND,PLAN,PREDICTITEM)") |
| | | private String dataType; |
| | | |
| | | @Schema(description = "数据编号") |
| | | private String dataNo; |
| | | |
| | | @Schema(description = "左侧长度(min)") |
| | | private Integer leftLength; |
| | | |
| | | @Schema(description = "右侧侧长度(min)") |
| | | private Integer rightLength; |
| | | |
| | | @Schema(description = "排序") |
| | | private Integer sort; |
| | | |
| | | @Schema(description = "拓展字段1") |
| | | private String ext1; |
| | | |
| | | @Schema(description = "拓展字段2") |
| | | private String ext2; |
| | | |
| | | @Schema(description = "拓展字段3") |
| | | private String ext3; |
| | | |
| | | @Schema(description = "拓展字段4") |
| | | private String ext4; |
| | | |
| | | @Schema(description = "拓展字段5") |
| | | private String ext5; |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.ToString; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | @Schema(description = "模型服务 - 调度建议快照配置详情分页 Request VO") |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ToString(callSuper = true) |
| | | public class StSuggestSnapshotConfMainPageReqVO extends PageParam { |
| | | |
| | | @Schema(description = "标题") |
| | | private String title; |
| | | |
| | | @Schema(description = "模型ID") |
| | | private String modelId; |
| | | |
| | | @Schema(description = "调整对象") |
| | | private String scheduleObj; |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | @Schema(description = "模型服务 - 调度建议创建/修改 Request VO") |
| | | @Data |
| | | public class StSuggestSnapshotConfMainRespVO { |
| | | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "标题") |
| | | private String title; |
| | | |
| | | @Schema(description = "模型ID") |
| | | private String modelId; |
| | | |
| | | @Schema(description = "调整对象") |
| | | private String scheduleObj; |
| | | |
| | | @Schema(description = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | @Schema(description = "模型服务 - 调度建议创建/修改 Request VO") |
| | | @Data |
| | | public class StSuggestSnapshotConfMainSaveReqVO { |
| | | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "标题") |
| | | private String title; |
| | | |
| | | @Schema(description = "模型ID") |
| | | private String modelId; |
| | | |
| | | @Schema(description = "调整对象") |
| | | private String scheduleObj; |
| | | |
| | | @Schema(description = "创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | @Schema(description = "模型服务 - 调度建议快照图表查询 Request VO") |
| | | @Data |
| | | public class StSuggestSnapshotRecordChartReqVO { |
| | | |
| | | @Schema(description = "数据类型(DATAPOINT,IND,PLAN,PREDICTITEM)") |
| | | private String dataType; |
| | | |
| | | @Schema(description = "数据编号") |
| | | private String dataNo; |
| | | |
| | | @Schema(description = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | |
| | | @Schema(description = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | @Schema(description = "模型服务 - 调度建议创建/修改 Request VO") |
| | | @Data |
| | | public class StSuggestSnapshotRecordRespVO { |
| | | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "建议ID(只记录采纳)") |
| | | private String suggestId; |
| | | |
| | | @Schema(description = "操作记录ID(只记录采纳)") |
| | | private String operationId; |
| | | |
| | | @Schema(description = "模型ID") |
| | | private String modelId; |
| | | |
| | | @Schema(description = "数据类型(DATAPOINT,IND,PLAN,PREDICTITEM)") |
| | | private String dataType; |
| | | |
| | | @Schema(description = "数据编号") |
| | | private String dataNo; |
| | | |
| | | @Schema(description = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | |
| | | @Schema(description = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | |
| | | @Schema(description = "序列化的数据") |
| | | private String jsonValue; |
| | | |
| | | @Schema(description = "排序") |
| | | private Integer sort; |
| | | |
| | | |
| | | } |
对比新文件 |
| | |
| | | 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; |
| | | |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * @author Jay |
| | | */ |
| | | @Schema(description = "模型服务 - 调度建议创建/修改 Request VO") |
| | | @Data |
| | | public class StSuggestSnapshotRecordSaveReqVO { |
| | | |
| | | @Schema(description = "ID") |
| | | private String id; |
| | | |
| | | @Schema(description = "建议ID(只记录采纳)") |
| | | private String suggestId; |
| | | |
| | | @Schema(description = "操作记录ID(只记录采纳)") |
| | | private String operationId; |
| | | |
| | | @Schema(description = "模型ID") |
| | | private String modelId; |
| | | |
| | | @Schema(description = "数据类型(DATAPOINT,IND,PLAN,PREDICTITEM)") |
| | | private String dataType; |
| | | |
| | | @Schema(description = "数据编号") |
| | | private String dataNo; |
| | | |
| | | @Schema(description = "调度时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date scheduleTime; |
| | | |
| | | @Schema(description = "开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | |
| | | @Schema(description = "结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | |
| | | @Schema(description = "序列化的数据") |
| | | private String jsonValue; |
| | | |
| | | @Schema(description = "排序") |
| | | private Integer sort; |
| | | |
| | | |
| | | } |
| | |
| | | - t_mm_predict_influence_factor |
| | | - t_mm_predict_influence_factor_result |
| | | - t_st_suggest_operation_record |
| | | - t_st_suggest_snapshot_conf_det |
| | | - t_st_suggest_snapshot_conf_main |
| | | - t_st_suggest_snapshot_record |
| | | app: |
| | | app-key: model |
| | | app-secret: 85b0df7edc3df3611913df34ed695011 |
| | |
| | | if (CollUtil.isEmpty(ids)) { |
| | | return Lists.newArrayList(); |
| | | } |
| | | return menuMapper.selectBatchIds(ids); |
| | | return menuMapper.selectList( |
| | | new LambdaQueryWrapper<MenuDO>() |
| | | .in(MenuDO::getId, ids) |
| | | .eq(MenuDO::getStatus, CommonStatusEnum.ENABLE)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | httpPost.addHeader("Content-Type", "application/json;charset=UTF-8"); |
| | | httpPost.addHeader("Authorization", "Bearer " + IailabClient.accessToken); |
| | | httpPost.addHeader("Tenant-Id", SdkAutoConfiguration.TENANT_ID.toString()); |
| | | StringEntity stringEntity = new StringEntity(json); |
| | | StringEntity stringEntity = new StringEntity(json,"UTF-8"); |
| | | stringEntity.setContentEncoding("UTF-8"); |
| | | stringEntity.setContentType("application/json"); |
| | | httpPost.setEntity(stringEntity); |