|
|
@@ -1,5 +1,6 @@ |
|
|
|
package com.hz.pm.api.projectdeclared.utils; |
|
|
|
|
|
|
|
import cn.hutool.core.date.StopWatch; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
@@ -45,12 +46,16 @@ public class ProjectIdCodeCacheUtil { |
|
|
|
|
|
|
|
@PostConstruct |
|
|
|
public void initProjectIdCodeCache() { |
|
|
|
StopWatch watch = new StopWatch(); |
|
|
|
watch.start(); |
|
|
|
Wrapper<Project> query = Wrappers.lambdaQuery(Project.class) |
|
|
|
.select(Project::getProjectCode, Project::getId, Project::getCreateOn, Project::getNewest); |
|
|
|
for (Project project : projectService.list(query)) { |
|
|
|
put(project.getId(), project, false); |
|
|
|
} |
|
|
|
log.info("初始化项目ID编码缓存:{}", CACHE.size()); |
|
|
|
watch.stop(); |
|
|
|
log.info("初始化项目ID编码缓存耗时:{} ms", watch.getTotalTimeMillis()); |
|
|
|
log.info("初始化项目ID编码缓存:{} 个", CACHE.size()); |
|
|
|
} |
|
|
|
|
|
|
|
//================================================================================================================== |
|
|
|