From 6957a3e704e5128b994ffc94e50548a8af5e9093 Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期二, 17 十二月 2024 11:40:13 +0800
Subject: [PATCH] 模型运行log

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/PredictModelHandler.java               |    2 +-
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictModelHandlerImpl.java      |    7 ++++---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemNormalHandlerImpl.java |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/PredictModelHandler.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/PredictModelHandler.java
index 9379a02..1f3050b 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/PredictModelHandler.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/PredictModelHandler.java
@@ -21,5 +21,5 @@
      * @return
      * @throws ModelInvokeException
      */
-    PredictResultVO predictByModel(Date predictTime, MmPredictModelEntity predictModel) throws ModelInvokeException;
+    PredictResultVO predictByModel(Date predictTime, MmPredictModelEntity predictModel,String itemName) throws ModelInvokeException;
 }
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemNormalHandlerImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemNormalHandlerImpl.java
index 2d8ea79..37c9d0d 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemNormalHandlerImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictItemNormalHandlerImpl.java
@@ -46,7 +46,7 @@
                 throw new ModelInvokeException(MessageFormat.format("{0},itemId={1}",
                         ModelInvokeException.errorGetModelEntity, itemId));
             }
-            predictResult = predictModelHandler.predictByModel(predictTime, predictModel);
+            predictResult = predictModelHandler.predictByModel(predictTime, predictModel,predictItemDto.getItemName());
             predictResult.setPredictId(itemId);
         } catch (Exception ex) {
             throw new ItemInvokeException(MessageFormat.format("{0},itemId={1}",
diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictModelHandlerImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictModelHandlerImpl.java
index a15f603..c39f706 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictModelHandlerImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mdk/predict/impl/PredictModelHandlerImpl.java
@@ -1,5 +1,6 @@
 package com.iailab.module.model.mdk.predict.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.iail.model.IAILModel;
@@ -54,7 +55,7 @@
      * @throws ModelInvokeException
      */
     @Override
-    public synchronized PredictResultVO predictByModel(Date predictTime, MmPredictModelEntity predictModel) throws ModelInvokeException {
+    public synchronized PredictResultVO predictByModel(Date predictTime, MmPredictModelEntity predictModel,String itemName) throws ModelInvokeException {
         PredictResultVO result = new PredictResultVO();
         if (predictModel == null) {
             throw new ModelInvokeException("modelEntity is null");
@@ -86,13 +87,13 @@
             param2Values[portLength] = newModelBean.getDataMap().get("models");
             param2Values[portLength + 1] = settings;
 
-            log.info("####################### 预测模型 "+ "【itemId:" + predictModel.getItemid() + ",modelName" + predictModel.getMethodname() + "】 ##########################");
+            log.info("####################### 预测模型 "+ "【itemId:" + predictModel.getItemid() + ",itemName" + itemName + "】 ##########################");
 //            JSONObject jsonObjNewModelBean = new JSONObject();
 //            jsonObjNewModelBean.put("newModelBean", newModelBean);
 //            log.info(String.valueOf(jsonObjNewModelBean));
 //            JSONObject jsonObjParam2Values = new JSONObject();
 //            jsonObjParam2Values.put("param2Values", param2Values);
-//            log.info(String.valueOf(jsonObjParam2Values));
+            log.info("参数: " + JSON.toJSONString(param2Values));
 
             //IAILMDK.run
             HashMap<String, Object> modelResult = DllUtils.run(newModelBean, param2Values, predictModel.getMpkprojectid());

--
Gitblit v1.9.3