From e88fba9645a57535d858ce48da8e9d9a3dc84adc Mon Sep 17 00:00:00 2001
From: dongyukun <1208714201@qq.com>
Date: 星期四, 02 一月 2025 16:48:01 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelParamServiceImpl.java |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelParamServiceImpl.java b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelParamServiceImpl.java
index 3680138..3e951df 100644
--- a/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelParamServiceImpl.java
+++ b/iailab-module-model/iailab-module-model-biz/src/main/java/com/iailab/module/model/mcs/sche/service/impl/StScheduleModelParamServiceImpl.java
@@ -11,7 +11,9 @@
 import org.springframework.util.CollectionUtils;
 
 import java.util.List;
+import java.util.Map;
 import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * @author PanZhibao
@@ -21,6 +23,8 @@
 @Service
 public class StScheduleModelParamServiceImpl extends BaseServiceImpl<StScheduleModelParamDao, StScheduleModelParamEntity>
         implements StScheduleModelParamService {
+
+    private static Map<String, List<StScheduleModelParamEntity>> modelInputParamMap = new ConcurrentHashMap<>();
 
     @Override
     public List<StScheduleModelParamEntity> getByModelId(String modelId) {
@@ -48,7 +52,26 @@
         saveList.forEach(item -> {
             StScheduleModelParamEntity entity = BeanUtils.toBean(item, StScheduleModelParamEntity.class);
             entity.setId(UUID.randomUUID().toString());
+            entity.setModelid(modelId);
             baseDao.insert(entity);
         });
+        clearCache();
+    }
+
+    @Override
+    public List<StScheduleModelParamEntity> getByModelidFromCache(String modelId) {
+        if (!modelInputParamMap.containsKey(modelId)) {
+            List<StScheduleModelParamEntity> list = getByModelId(modelId);
+            if (list != null) {
+                modelInputParamMap.put(modelId, list);
+            } else {
+                return null;
+            }
+        }
+        return modelInputParamMap.get(modelId);
+    }
+
+    public void clearCache() {
+        modelInputParamMap.clear();
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3