Commit d6ac7a3e by 陶光胜

Merge branch 'developer' into 'master'

门店控件增加接口

See merge request !8
parents 1a5bf12f 6283db84
......@@ -40,7 +40,7 @@ public class ProvincesApiServiceImpl implements ProvincesApiService {
public ServiceResponse<List<ProvinceDTO>> selectAllProvince() {
String key = "enterprise:province";
List<ProvinceDTO> list = (List<ProvinceDTO>)RedisUtil.getCache(key);
if(list == null){
if(CollectionUtils.isEmpty(list)){
list = EntityUtil.changeEntityListByJSON(ProvinceDTO.class, this.provincesService.selectAllProvince());
RedisUtil.setCache(key, list, 6*30l, TimeUnit.DAYS);
}
......@@ -51,7 +51,7 @@ public class ProvincesApiServiceImpl implements ProvincesApiService {
public ServiceResponse<List<CityDTO>> selectAllCity() {
String key = "enterprise:city";
List<CityDTO> list = (List<CityDTO>)RedisUtil.getCache(key);
if(list == null){
if(CollectionUtils.isEmpty(list)){
list = EntityUtil.changeEntityListByJSON(CityDTO.class, this.provincesService.selectAllCity());
RedisUtil.setCache(key, list, 6*30l, TimeUnit.DAYS);
}
......@@ -96,7 +96,7 @@ public class ProvincesApiServiceImpl implements ProvincesApiService {
public ServiceResponse<List<CountyDTO>> selectAllCounty() {
String key = "enterprise:county";
List<CountyDTO> list = (List<CountyDTO>)RedisUtil.getCache(key);
if(list == null){
if(CollectionUtils.isEmpty(list)){
list = EntityUtil.changeEntityListByJSON(CountyDTO.class, this.provincesService.selectAllCounty());
RedisUtil.setCache(key, list, 6*30l, TimeUnit.DAYS);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment