From 730d1944e3a13c517c77df2b0712df05645a38dd Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期一, 06 一月 2025 16:00:58 +0800 Subject: [PATCH] chartParamList api --- 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