|
@@ -1,7 +1,12 @@
|
|
package com.ruoyi.project.system.service.impl;
|
|
package com.ruoyi.project.system.service.impl;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
|
+import java.util.concurrent.Executors;
|
|
import javax.annotation.PostConstruct;
|
|
import javax.annotation.PostConstruct;
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+
|
|
|
|
+import com.ruoyi.project.ehs.domain.TJobticket;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -26,7 +31,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|
@Autowired
|
|
@Autowired
|
|
private SysDictTypeMapper dictTypeMapper;
|
|
private SysDictTypeMapper dictTypeMapper;
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
|
+ @Resource
|
|
private SysDictDataMapper dictDataMapper;
|
|
private SysDictDataMapper dictDataMapper;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -35,12 +40,16 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|
@PostConstruct
|
|
@PostConstruct
|
|
public void init()
|
|
public void init()
|
|
{
|
|
{
|
|
- List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll();
|
|
|
|
- for (SysDictType dictType : dictTypeList)
|
|
|
|
- {
|
|
|
|
- List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType());
|
|
|
|
- DictUtils.setDictCache(dictType.getDictType(), dictDatas);
|
|
|
|
- }
|
|
|
|
|
|
+ ExecutorService executorService = Executors.newFixedThreadPool(2);
|
|
|
|
+ executorService.execute(() -> {
|
|
|
|
+ List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll();
|
|
|
|
+ for (SysDictType dictType : dictTypeList)
|
|
|
|
+ {
|
|
|
|
+ List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType());
|
|
|
|
+ DictUtils.setDictCache(dictType.getDictType(), dictDatas);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ executorService.shutdown();
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|