Merge branch 'dev' of http://47.94.165.164:13000/geg-gas/geg-gas-pcitc into dev
This commit is contained in:
@ -35,6 +35,8 @@ import com.xjrsoft.common.model.result.R;
|
|||||||
import com.xjrsoft.common.page.ConventPage;
|
import com.xjrsoft.common.page.ConventPage;
|
||||||
import com.xjrsoft.common.page.PageOutput;
|
import com.xjrsoft.common.page.PageOutput;
|
||||||
import com.xjrsoft.common.utils.CacheUtil;
|
import com.xjrsoft.common.utils.CacheUtil;
|
||||||
|
import com.xjrsoft.common.utils.RedisUtil;
|
||||||
|
import com.xjrsoft.common.utils.TenantUtil;
|
||||||
import com.xjrsoft.common.utils.TreeUtil;
|
import com.xjrsoft.common.utils.TreeUtil;
|
||||||
import com.xjrsoft.common.utils.VoToColumnUtil;
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
||||||
import com.xjrsoft.module.common.db.utils.CommonCallUtils;
|
import com.xjrsoft.module.common.db.utils.CommonCallUtils;
|
||||||
@ -74,6 +76,7 @@ public class CountryRegionController {
|
|||||||
|
|
||||||
private final ICountryRegionService countryRegionService;
|
private final ICountryRegionService countryRegionService;
|
||||||
private final DatalogService dataService;
|
private final DatalogService dataService;
|
||||||
|
private final RedisUtil redisUtil;
|
||||||
|
|
||||||
@GetMapping(value = "/page")
|
@GetMapping(value = "/page")
|
||||||
@ApiOperation(value="LngBRegion列表(分页)")
|
@ApiOperation(value="LngBRegion列表(分页)")
|
||||||
@ -286,9 +289,20 @@ public class CountryRegionController {
|
|||||||
|
|
||||||
private void refreshCahe(){
|
private void refreshCahe(){
|
||||||
//异步更新
|
//异步更新
|
||||||
|
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
CacheUtil.refreshRegionList();
|
try {
|
||||||
|
TenantUtil.ignore(true);
|
||||||
|
Log.info("MDM: 加载所有国家地区表缓存开始");
|
||||||
|
List<LngBRegion> list = countryRegionService.list();
|
||||||
|
redisUtil.set(GlobalConstant.REGION_CACHE_KEY, list);
|
||||||
|
redisUtil.set(GlobalConstant.REGION_NAME_CACHE_KEY, list.stream().collect(Collectors.toMap(LngBRegion::getCode,LngBRegion::getFullPath)));
|
||||||
|
Log.info("MDM: 加载所有国家地区表缓存结束");
|
||||||
|
}catch (Exception e) {
|
||||||
|
Log.info(e.getLocalizedMessage(), e);
|
||||||
|
}finally {
|
||||||
|
TenantUtil.clear();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user