From c06f48bded461209f117167fbf89ed57a3f37ef4 Mon Sep 17 00:00:00 2001
From: 潘志宝 <979469083@qq.com>
Date: 星期五, 06 九月 2024 11:08:01 +0800
Subject: [PATCH] pre admin

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/MdkApiImpl.java |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/MdkApiImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/MdkApiImpl.java
index 8f73d14..40a2600 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/MdkApiImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/api/MdkApiImpl.java
@@ -13,9 +13,11 @@
 import com.iailab.module.model.mdk.predict.PredictItemHandler;
 import com.iailab.module.model.mdk.predict.PredictModuleHandler;
 import com.iailab.module.model.mdk.predict.PredictResultHandler;
+import com.iailab.module.model.mdk.schedule.ScheduleModelHandler;
 import com.iailab.module.model.mdk.vo.DataValueVO;
 import com.iailab.module.model.mdk.vo.ItemVO;
 import com.iailab.module.model.mdk.vo.PredictResultVO;
+import com.iailab.module.model.mdk.vo.ScheduleResultVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
@@ -61,6 +63,9 @@
 
     @Autowired
     private PredictResultHandler predictResultHandler;
+
+    @Autowired
+    private ScheduleModelHandler scheduleModelHandler;
 
     /**
      * 按模块预测
@@ -169,7 +174,17 @@
     @Override
     public CommonResult<MdkScheduleRespDTO> doSchedule(@Valid @RequestBody MdkScheduleReqDTO reqDTO) {
         MdkScheduleRespDTO resp = new MdkScheduleRespDTO();
-
+        resp.setScheduleCode(reqDTO.getScheduleCode());
+        resp.setScheduleTime(reqDTO.getScheduleTime());
+        try {
+            log.info("调度计算开始: " + System.currentTimeMillis());
+            ScheduleResultVO scheduleResult = scheduleModelHandler.doSchedule(reqDTO.getModelCode(), reqDTO.getScheduleTime());
+            resp.setResult(scheduleResult.getResult());
+            log.info("预测计算结束: " + System.currentTimeMillis());
+        } catch (Exception ex) {
+            log.info("调度计算异常: " + System.currentTimeMillis());
+            ex.printStackTrace();
+        }
         return success(resp);
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3