|
@@ -11,6 +11,8 @@ import io.platform.sys.biz.entity.SysConfig;
|
|
|
import io.platform.sys.biz.service.SysConfigService;
|
|
|
import io.platform.sys.dto.SysConfigDto;
|
|
|
import io.platform.sys.service.client.api.SysConfigServiceClient;
|
|
|
+import io.platform.utils.RedisUtils;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
@@ -18,8 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* Created by sevelli on 2017/8/31.
|
|
@@ -34,6 +35,9 @@ public class SysConfigServiceClientImpl extends BaseServiceClient<SysConfig, Sys
|
|
|
@Autowired
|
|
|
private SysConfigRedis sysConfigRedis;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private RedisUtils redisUtils;
|
|
|
+
|
|
|
@Override
|
|
|
public SysConfigDto queryObject(Long id) {
|
|
|
SysConfig sysConfig = sysConfigService.getById(id);
|
|
@@ -129,9 +133,26 @@ public class SysConfigServiceClientImpl extends BaseServiceClient<SysConfig, Sys
|
|
|
SysConfig sysConfig = new SysConfig();
|
|
|
revert(sysConfigDto, sysConfig);
|
|
|
wrapper.setEntity(sysConfig);
|
|
|
- List<SysConfigDto> sysConfigDtoList = convertList(sysConfigService.page(page, wrapper).getRecords(), SysConfigDto.class);
|
|
|
- pageDto.setTotal(sysConfigService.count(wrapper));
|
|
|
- pageDto.setRecords(sysConfigDtoList);
|
|
|
+
|
|
|
+// List<SysConfigDto> sysConfigDtoList = convertList(sysConfigService.page(page, wrapper).getRecords(), SysConfigDto.class);
|
|
|
+
|
|
|
+ List keys = new ArrayList<String>();
|
|
|
+ keys.add("sys:config:shop_plus_msg");
|
|
|
+ keys.add("sys:config:agent_version");
|
|
|
+ keys.add("sys:config:agent_url");
|
|
|
+ keys.add("sys:config:shop_url");
|
|
|
+ keys.add("sys:config:agent_plus_msg");
|
|
|
+ keys.add("sys:config:shop_version");
|
|
|
+ List<SysConfigDto> values = redisUtils.multiGet(keys,SysConfigDto.class);
|
|
|
+ Iterator<SysConfigDto> iterator = values.listIterator();
|
|
|
+ while (iterator.hasNext()){
|
|
|
+ SysConfigDto sysConfigDto1 = iterator.next();
|
|
|
+ if (!StringUtils.contains(sysConfigDto1.getParamLabel(),sysConfigDto.getParamKey())){
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pageDto.setTotal(values.size());
|
|
|
+ pageDto.setRecords(values);
|
|
|
return pageDto;
|
|
|
}
|
|
|
|