缓存策略增加导出excel和csv功能
This commit is contained in:
@@ -16,9 +16,11 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CachePolicyUserRegion;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.CommonStringCfg;
|
||||
import com.nis.domain.configuration.HttpBodyCfg;
|
||||
@@ -38,6 +40,7 @@ import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
import com.nis.web.dao.configuration.CommonPolicyDao;
|
||||
@@ -69,26 +72,81 @@ public class CachePolicyService extends CrudService<WebsiteCfgDao,CfgIndexInfo>
|
||||
return entity;
|
||||
}
|
||||
|
||||
/*public Map<String, List> exportCachePolicy(CfgIndexInfo entity){
|
||||
public Page<CachePolicyUserRegion> getCachePolicyUserRegionList(Page<CachePolicyUserRegion> page, CachePolicyUserRegion entity){
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
|
||||
entity.setPage(page);
|
||||
List<CachePolicyUserRegion> list = commonPolicyDao.getCachePolicyUserRegionList(entity);
|
||||
for (CachePolicyUserRegion c : list) {
|
||||
JSONObject jsonObject=JSONObject.fromObject(c.getUserRegion1());
|
||||
CachePolicyUserRegion stu=(CachePolicyUserRegion)JSONObject.toBean(jsonObject, CachePolicyUserRegion.class);
|
||||
c.setCache_cookied_cont(stu.getCache_cookied_cont());
|
||||
c.setCache_dyn_url(stu.getCache_dyn_url());
|
||||
c.setForce_caching(stu.getForce_caching());
|
||||
c.setIgnore_req_nocache(stu.getIgnore_req_nocache());
|
||||
c.setIgnore_res_nocache(stu.getIgnore_res_nocache());
|
||||
c.setInactive_time(stu.getInactive_time());
|
||||
c.setMax_cache_obj_size(stu.getMax_cache_obj_size());
|
||||
c.setMax_cache_size(stu.getMax_cache_size());
|
||||
c.setMin_use(stu.getMin_use());
|
||||
c.setNo_revalidate(stu.getNo_revalidate());
|
||||
c.setPinning_time(stu.getPinning_time());
|
||||
if(stu.getCache_key()!=null){
|
||||
String ignore=String.valueOf(stu.getCache_key().get("ignore_qs"));
|
||||
String cookie=String.valueOf(stu.getCache_key().get("cookie"));
|
||||
if(!ignore.equals("null") && ignore!=null){
|
||||
c.setIgnore_qs(ignore);
|
||||
}
|
||||
if(!cookie.equals("null") && cookie!=null){
|
||||
c.setCookie(cookie);
|
||||
}
|
||||
}
|
||||
}
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
public List<CachePolicyUserRegion> getCachePolicyByUserRegionList(String ids){
|
||||
List<CachePolicyUserRegion> list = commonPolicyDao.getCachePolicyByUserRegionList(ids);
|
||||
for (CachePolicyUserRegion c : list) {
|
||||
JSONObject jsonObject=JSONObject.fromObject(c.getUserRegion1());
|
||||
CachePolicyUserRegion stu=(CachePolicyUserRegion)JSONObject.toBean(jsonObject, CachePolicyUserRegion.class);
|
||||
c.setCache_cookied_cont(stu.getCache_cookied_cont());
|
||||
c.setCache_dyn_url(stu.getCache_dyn_url());
|
||||
c.setForce_caching(stu.getForce_caching());
|
||||
c.setIgnore_req_nocache(stu.getIgnore_req_nocache());
|
||||
c.setIgnore_res_nocache(stu.getIgnore_res_nocache());
|
||||
c.setInactive_time(stu.getInactive_time());
|
||||
c.setMax_cache_obj_size(stu.getMax_cache_obj_size());
|
||||
c.setMax_cache_size(stu.getMax_cache_size());
|
||||
c.setMin_use(stu.getMin_use());
|
||||
c.setNo_revalidate(stu.getNo_revalidate());
|
||||
c.setPinning_time(stu.getPinning_time());
|
||||
if(stu.getCache_key()!=null){
|
||||
String ignore=String.valueOf(stu.getCache_key().get("ignore_qs"));
|
||||
String cookie=String.valueOf(stu.getCache_key().get("cookie"));
|
||||
if(!ignore.equals("null") && ignore!=null){
|
||||
c.setIgnore_qs(ignore);
|
||||
}
|
||||
if(!cookie.equals("null") && cookie!=null){
|
||||
c.setCookie(cookie);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public Map<String, List> getExport(Long cfgId){
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
List<HttpUrlCfg> httpUrlList = commonPolicyDao.getHttpUrlList(entity);
|
||||
List<HttpReqHeadCfg> httpReqHdrList = commonPolicyDao.getHttpReqHdrList(entity);
|
||||
List<HttpResHeadCfg> httpResHdrList = commonPolicyDao.getHttpResHdrList(entity);
|
||||
List<IpPortCfg> ipPortCfgList = commonPolicyDao.getIpPortList(entity);
|
||||
entity.setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION);
|
||||
List<HttpBodyCfg> httpReqBodyList = commonPolicyDao.getHttpReqBodyList(entity);
|
||||
entity.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION);
|
||||
List<HttpBodyCfg> httpResBodyList = commonPolicyDao.getHttpResBodyList(entity);
|
||||
List<NtcSubscribeIdCfg> subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
|
||||
dataMap.put("NTC_UNIVERSAL_IP", ipPortCfgList);
|
||||
dataMap.put("NTC_CACHE_URL", httpUrlList);
|
||||
dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList);
|
||||
dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList);
|
||||
dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList);
|
||||
dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList);
|
||||
CfgIndexInfo entity = commonPolicyDao.getPolicyById(cfgId);
|
||||
entity.setCfgType("PXY_CACHE_HTTP_URL");
|
||||
List<BaseStringCfg> urlList = commonPolicyDao.getCommonStringList(entity);
|
||||
entity.setCfgType("PXY_CACHE_HTTP_COOKIE");
|
||||
List<BaseStringCfg> cookieList = commonPolicyDao.getCommonStringList(entity);
|
||||
dataMap.put("PXY_CACHE_HTTP_URL", urlList);
|
||||
dataMap.put("PXY_CACHE_HTTP_COOKIE", cookieList);
|
||||
return dataMap;
|
||||
}*/
|
||||
}
|
||||
|
||||
public Page<CfgIndexInfo> getCachePolicyList(Page<CfgIndexInfo> page, CfgIndexInfo entity){
|
||||
// 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL)
|
||||
|
||||
Reference in New Issue
Block a user