Merge remote-tracking branch 'origin/master'
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date scheduleTime; |
| | | |
| | | private String statusCode; |
| | | |
| | | private Map<String, Object> result; |
| | | } |
| | |
| | | `disturbance_point_no` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '无扰切换点位', |
| | | PRIMARY KEY (`id`) USING BTREE, |
| | | INDEX `ind_model_id`(`model_id` ASC) USING BTREE |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='模型下发信息表'; |
| | | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='模型下发信息表'; |
| | | |
| | | alter table t_st_schedule_scheme add column `run_status` varchar(4) DEFAULT NULL COMMENT '运行状态'; |
| | |
| | | try { |
| | | log.info("调度计算开始: " + System.currentTimeMillis()); |
| | | ScheduleResultVO scheduleResult = scheduleModelHandler.doSchedule(reqDTO.getScheduleCode(), reqDTO.getScheduleTime()); |
| | | resp.setStatusCode(scheduleResult.getResultCode()); |
| | | resp.setResult(scheduleResult.getResult()); |
| | | stScheduleRecordService.create(scheduleResult); |
| | | stScheduleSchemeService.updateTime(scheduleResult.getSchemeId(), scheduleResult.getScheduleTime()); |
| | | stScheduleSchemeService.updateTime(scheduleResult.getSchemeId(), scheduleResult.getScheduleTime(), scheduleResult.getResultCode()); |
| | | log.info("预测计算结束: " + System.currentTimeMillis()); |
| | | } catch (Exception ex) { |
| | | log.info("调度计算异常: " + System.currentTimeMillis()); |
| | |
| | | /** |
| | | * 预测时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date predicttime; |
| | | |
| | | /** |
| | | * 收集时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date collecttime; |
| | | |
| | | /** |
| | |
| | | * 项目ID |
| | | */ |
| | | private String mpkprojectid; |
| | | |
| | | /** |
| | | * 运行状态 |
| | | */ |
| | | private String runStatus; |
| | | } |
| | |
| | | |
| | | StScheduleSchemeEntity getInfo(String id); |
| | | |
| | | void updateTime(String id, Date scheduleTime); |
| | | void updateTime(String id, Date scheduleTime, String statusCode); |
| | | |
| | | StScheduleSchemeEntity getByCode(String code); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateTime(String id, Date scheduleTime) { |
| | | public void updateTime(String id, Date scheduleTime, String statusCode) { |
| | | StScheduleSchemeEntity entity = new StScheduleSchemeEntity(); |
| | | entity.setId(id); |
| | | entity.setRunStatus(statusCode); |
| | | entity.setScheduleTime(scheduleTime); |
| | | baseDao.updateById(entity); |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | private String modelId; |
| | | |
| | | @Schema(description = "调度时间", example = "2024-09-01 00:00:00") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date scheduleTime; |
| | | |
| | | @Schema(description = "备注", example = "备注") |
| | |
| | | |
| | | @Schema(description = "项目ID") |
| | | private String mpkprojectid; |
| | | |
| | | @Schema(description = "运行状态") |
| | | private String runStatus; |
| | | } |
| | |
| | | log.info("参数: " + JSON.toJSONString(param2Values)); |
| | | //IAILMDK.run |
| | | HashMap<String, Object> modelResult = DllUtils.run(newModelBean, param2Values, scheduleScheme.getMpkprojectid()); |
| | | if (!modelResult.containsKey(CommonConstant.MDK_STATUS_CODE) || !modelResult.containsKey(CommonConstant.MDK_RESULT) || |
| | | !modelResult.get(CommonConstant.MDK_STATUS_CODE).toString().equals(CommonConstant.MDK_STATUS_100)) { |
| | | if (!modelResult.containsKey(CommonConstant.MDK_STATUS_CODE) || !modelResult.containsKey(CommonConstant.MDK_RESULT)) { |
| | | throw new RuntimeException("模型结果异常:" + modelResult); |
| | | } |
| | | String statusCode = modelResult.get(CommonConstant.MDK_STATUS_CODE).toString(); |
| | | modelResult = (HashMap<String, Object>) modelResult.get(CommonConstant.MDK_RESULT); |
| | | HashMap<String, Object> result = (HashMap<String, Object>) modelResult.get(CommonConstant.MDK_RESULT); |
| | | //打印结果 |
| | | JSONObject jsonObjResult = new JSONObject(); |
| | | jsonObjResult.put("result", modelResult); |
| | | jsonObjResult.put("result", result); |
| | | log.info(String.valueOf(jsonObjResult)); |
| | | |
| | | //5.返回调度结果 |
| | | scheduleResult.setResultCode(statusCode); |
| | | scheduleResult.setResult(modelResult); |
| | | scheduleResult.setResult(result); |
| | | scheduleResult.setModelId(modelId); |
| | | scheduleResult.setSchemeId(scheduleScheme.getId()); |
| | | scheduleResult.setScheduleTime(scheduleTime); |