Compare commits
28 Commits
develop_20
...
develop-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34ba8abbf4 | ||
|
|
4e2a5570fd | ||
|
|
94cf096be4 | ||
|
|
e37128e2c8 | ||
|
|
d2d52b0b13 | ||
|
|
121fab31ea | ||
|
|
0c639a2d30 | ||
|
|
7afa89951c | ||
|
|
3f952f6a83 | ||
|
|
8c514c4e7e | ||
|
|
12a77173ca | ||
|
|
7949dc7da5 | ||
|
|
b665c4bc75 | ||
|
|
41d2e6ae2f | ||
|
|
9763cb3093 | ||
|
|
ef04251ef1 | ||
|
|
377cca923c | ||
|
|
ff444747ee | ||
|
|
e0b6f18615 | ||
|
|
61e920e9ec | ||
|
|
360fdd574a | ||
|
|
44d8b842a6 | ||
|
|
d2ddba9362 | ||
|
|
6034fa5bff | ||
|
|
ef82ba822f | ||
|
|
d587c67c03 | ||
|
|
dd0133b2d2 | ||
|
|
7d911e748a |
@@ -26,7 +26,7 @@ public class ProxyObjKeyring {
|
||||
private String privateKeyFile;
|
||||
@Expose
|
||||
private String publicKeyFile;
|
||||
@Expose
|
||||
//@Expose
|
||||
private Integer expireAfter;
|
||||
@Expose
|
||||
private String publicKeyAlgo;
|
||||
|
||||
@@ -575,6 +575,25 @@ public class ConfigConvertUtil {
|
||||
dstIp.setDstPortMask("65535");
|
||||
}
|
||||
}
|
||||
private static <T> Map<Integer,Integer> getGroupIdList(List<T> srcList){
|
||||
Set<Integer> groupIdSet=new HashSet<>();
|
||||
Map<Integer,Integer> groupIdMap=new HashMap<>();
|
||||
for(T src:srcList){
|
||||
BaseCfg cfg=(BaseCfg)src;
|
||||
if(!groupIdSet.contains(cfg.getGroupId())){
|
||||
groupIdSet.add(cfg.getGroupId());
|
||||
}
|
||||
|
||||
}
|
||||
if(groupIdSet.size()>0){
|
||||
List<Integer> groupIds= ConfigServiceUtil.getId(2,groupIdSet.size());
|
||||
for(Integer id:groupIdSet){
|
||||
groupIdMap.put(id,groupIds.get(0));
|
||||
}
|
||||
groupIds.remove(0);
|
||||
}
|
||||
return groupIdMap;
|
||||
}
|
||||
/**
|
||||
*Obj 组maat配置转换
|
||||
* @param <T>
|
||||
@@ -591,6 +610,7 @@ public class ConfigConvertUtil {
|
||||
List groupRelationList, Map<String,Object> maatTableMap, Set<Integer> groupIdSet) {
|
||||
long start=System.currentTimeMillis(),end=0l;
|
||||
Map<String, List> map = new HashMap();
|
||||
Map<Integer,Integer> groupIdMap=getGroupIdList(srcList);
|
||||
if (cfgType == 1) {
|
||||
List numRegionList = new ArrayList();
|
||||
int pos=0;
|
||||
@@ -607,15 +627,17 @@ public class ConfigConvertUtil {
|
||||
|
||||
if (!groupIdSet.contains(baseIpCfg.getGroupId())) {
|
||||
GroupCfg group = new GroupCfg();
|
||||
//groupId = ConfigServiceUtil.getId(2, 1).get(0);
|
||||
group.setGroupId(baseIpCfg.getGroupId());
|
||||
// group.setGroupId(baseIpCfg.getGroupId());
|
||||
Integer groupId =groupIdMap.get(baseIpCfg.getGroupId());
|
||||
group.setGroupId(groupId);
|
||||
group.setCompileId(baseCfg.getCompileId());
|
||||
group.setAuditTime(baseCfg.getAuditTime());
|
||||
group.setIsValid(baseCfg.getIsValid());
|
||||
groupRelationList.add(group);
|
||||
groupIdSet.add(baseIpCfg.getGroupId());
|
||||
}
|
||||
cfg.setGroupId(baseIpCfg.getGroupId());
|
||||
// cfg.setGroupId(baseIpCfg.getGroupId());
|
||||
cfg.setGroupId(groupIdMap.get(baseIpCfg.getGroupId()));
|
||||
cfg.setAuditTime(baseCfg.getAuditTime());
|
||||
cfg.setIsValid(baseCfg.getIsValid());
|
||||
if(maatTableMap.containsKey("ipMaatTable")){
|
||||
@@ -623,11 +645,11 @@ public class ConfigConvertUtil {
|
||||
cfg.setCfgType(ipMaatTable.get(baseIpCfg.getGroupId().toString()));
|
||||
}
|
||||
List<IpCfg> cfgs = ipConvert(cfg, baseIpCfg);
|
||||
if (cfgs.size() > 1) {
|
||||
if (cfgs.size() > 0) {
|
||||
List<Integer> ids =regionIdList.subList(pos,pos+cfgs.size());
|
||||
//支持range????
|
||||
for (int j = 1; j < cfgs.size(); j++) {
|
||||
cfgs.get(j).setRegionId(ids.get(j-1));
|
||||
for (int j = 0; j < cfgs.size(); j++) {
|
||||
cfgs.get(j).setRegionId(ids.get(j));
|
||||
}
|
||||
pos+=cfgs.size();
|
||||
}
|
||||
@@ -664,14 +686,16 @@ public class ConfigConvertUtil {
|
||||
}
|
||||
regionIdList.clear();
|
||||
} else if (cfgType == 2 || cfgType == 3) {
|
||||
//List<Integer> groupIdList = ConfigServiceUtil.getId(2, srcList.size());
|
||||
//List<Integer> regionIdList = ConfigServiceUtil.getId(3, srcList.size());
|
||||
// List<Integer> groupIdList = ConfigServiceUtil.getId(2, srcList.size());
|
||||
List<Integer> regionIdList = ConfigServiceUtil.getId(3, srcList.size());
|
||||
for (int i = 0; i < srcList.size(); i++) {
|
||||
BaseStringCfg baserStringCfg=new BaseStringCfg();
|
||||
BeanUtils.copyProperties(srcList.get(i),baserStringCfg);
|
||||
if(!groupIdSet.contains(baserStringCfg.getGroupId())){
|
||||
GroupCfg group = new GroupCfg();
|
||||
group.setGroupId(baserStringCfg.getGroupId());
|
||||
// group.setGroupId(baserStringCfg.getGroupId());
|
||||
Integer groupId =groupIdMap.get(baserStringCfg.getGroupId());
|
||||
group.setGroupId(groupId);
|
||||
group.setCompileId(baseCfg.getCompileId());
|
||||
group.setAuditTime(baseCfg.getAuditTime());
|
||||
group.setIsValid(baseCfg.getIsValid());
|
||||
@@ -680,8 +704,10 @@ public class ConfigConvertUtil {
|
||||
}
|
||||
StringCfg cfg = new StringCfg();
|
||||
BeanUtils.copyProperties(srcList.get(i), cfg);
|
||||
cfg.setGroupId(baserStringCfg.getGroupId());
|
||||
cfg.setRegionId(baserStringCfg.getRegionId());
|
||||
// cfg.setGroupId(baserStringCfg.getGroupId());
|
||||
// cfg.setRegionId(baserStringCfg.getRegionId());
|
||||
cfg.setGroupId(groupIdMap.get(baserStringCfg.getGroupId()));
|
||||
cfg.setRegionId(regionIdList.get(i));
|
||||
cfg.setAuditTime(baseCfg.getAuditTime());
|
||||
cfg.setIsValid(baseCfg.getIsValid());
|
||||
// 处理配置关键字转译
|
||||
@@ -696,44 +722,52 @@ public class ConfigConvertUtil {
|
||||
}
|
||||
} else if (cfgType == 4) {
|
||||
// List<Integer> groupIdList = ConfigServiceUtil.getId(2, srcList.size());
|
||||
// List<Integer> regionIdList = ConfigServiceUtil.getId(3, srcList.size());
|
||||
List<Integer> regionIdList = ConfigServiceUtil.getId(3, srcList.size());
|
||||
for (int i = 0; i < srcList.size(); i++) {
|
||||
// 一条业务配置创建一个分组
|
||||
NumBoundaryCfg cfg = new NumBoundaryCfg();
|
||||
BeanUtils.copyProperties(srcList.get(i), cfg);
|
||||
if(!groupIdSet.contains(cfg.getGroupId())){
|
||||
GroupCfg group = new GroupCfg();
|
||||
group.setGroupId(cfg.getGroupId());
|
||||
// group.setGroupId(cfg.getGroupId());
|
||||
Integer groupId =groupIdMap.get(cfg.getGroupId());
|
||||
group.setGroupId(groupId);
|
||||
group.setCompileId(baseCfg.getCompileId());
|
||||
group.setAuditTime(baseCfg.getAuditTime());
|
||||
group.setIsValid(baseCfg.getIsValid());
|
||||
groupRelationList.add(group);
|
||||
groupIdSet.add(cfg.getGroupId());
|
||||
}
|
||||
cfg.setGroupId(cfg.getGroupId());
|
||||
cfg.setRegionId(cfg.getRegionId());
|
||||
// cfg.setGroupId(cfg.getGroupId());
|
||||
// cfg.setRegionId(cfg.getRegionId());
|
||||
cfg.setGroupId(groupIdMap.get(cfg.getGroupId()));
|
||||
cfg.setRegionId(regionIdList.get(i));
|
||||
cfg.setAuditTime(baseCfg.getAuditTime());
|
||||
cfg.setIsValid(baseCfg.getIsValid());
|
||||
dstList.add(cfg);
|
||||
}
|
||||
} else if (cfgType == 5) {
|
||||
//List<Integer> groupIdList = ConfigServiceUtil.getId(2, srcList.size());
|
||||
//List<Integer> regionIdList = ConfigServiceUtil.getId(3, srcList.size());
|
||||
List<Integer> regionIdList = ConfigServiceUtil.getId(3, srcList.size());
|
||||
for (int i = 0; i < srcList.size(); i++) {
|
||||
// 一条业务配置创建一个分组
|
||||
com.nis.domain.maat.MaatCfg.DigestCfg cfg = new com.nis.domain.maat.MaatCfg.DigestCfg();
|
||||
BeanUtils.copyProperties(srcList.get(i), cfg);
|
||||
if(!groupIdSet.contains(cfg.getGroupId())){
|
||||
GroupCfg group = new GroupCfg();
|
||||
group.setGroupId(cfg.getGroupId());
|
||||
// group.setGroupId(cfg.getGroupId());
|
||||
Integer groupId =groupIdMap.get(cfg.getGroupId());
|
||||
group.setGroupId(groupId);
|
||||
group.setCompileId(baseCfg.getCompileId());
|
||||
group.setAuditTime(baseCfg.getAuditTime());
|
||||
group.setIsValid(baseCfg.getIsValid());
|
||||
groupRelationList.add(group);
|
||||
groupIdSet.add(cfg.getGroupId());
|
||||
}
|
||||
cfg.setGroupId(cfg.getGroupId());
|
||||
cfg.setRegionId(cfg.getRegionId());
|
||||
// cfg.setGroupId(cfg.getGroupId());
|
||||
// cfg.setRegionId(cfg.getRegionId());
|
||||
cfg.setGroupId(groupIdMap.get(cfg.getGroupId()));
|
||||
cfg.setRegionId(regionIdList.get(i));
|
||||
cfg.setAuditTime(baseCfg.getAuditTime());
|
||||
cfg.setIsValid(baseCfg.getIsValid());
|
||||
dstList.add(cfg);
|
||||
@@ -833,6 +867,8 @@ public class ConfigConvertUtil {
|
||||
return gsonToJson(userRegionMap);
|
||||
}else if(serviceId.equals(592)){
|
||||
return "{}";
|
||||
}else if(serviceId.equals(18)){
|
||||
return "DNS_STRATEGY=0";
|
||||
}else{
|
||||
return "0";
|
||||
}
|
||||
@@ -927,6 +963,13 @@ public class ConfigConvertUtil {
|
||||
}
|
||||
return dictMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 策略对象Obj list group估算ip range需要获取的region id数量
|
||||
* @param srcList
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
public static <T>List<Integer> calRangeIps(List<T> srcList ){
|
||||
List<Integer> regionIdsList=new ArrayList<>();
|
||||
int total=0;
|
||||
@@ -976,6 +1019,7 @@ public class ConfigConvertUtil {
|
||||
return regionIdsList;
|
||||
}
|
||||
}
|
||||
//拆分IP数量大于1获取ID
|
||||
if(total>0){
|
||||
regionIdsList=ConfigServiceUtil.getId(3,total);
|
||||
}
|
||||
|
||||
@@ -437,5 +437,24 @@ public class DictUtils {
|
||||
}
|
||||
return null;
|
||||
}*/
|
||||
|
||||
public static Map<Integer,Object> getObjGroupListServiceDicts(Integer functionId){
|
||||
Map<Integer,Object> dictMap=new HashMap<>();
|
||||
List<Map<String,Object>> templateList= ServiceConfigTemplateUtil.getServiceListByFunctionId(functionId);
|
||||
StringBuffer buf=new StringBuffer();
|
||||
for(Map<String,Object> temp:templateList){
|
||||
if(temp.containsKey("serviceIds")){
|
||||
String serviceIds= temp.get("serviceIds").toString();
|
||||
buf.append(serviceIds).append(",");
|
||||
}
|
||||
}
|
||||
List<FunctionServiceDict> serviceDicts=getFunctionServiceDictList();
|
||||
for(FunctionServiceDict dict:serviceDicts){
|
||||
for(String serviceId:buf.toString().split(",")){
|
||||
if(StringUtils.isNotBlank(serviceId)&&dict.getServiceId().toString().equals(serviceId)){
|
||||
dictMap.put(Integer.parseInt(serviceId),dict);
|
||||
}
|
||||
}
|
||||
}
|
||||
return dictMap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.basics.*;
|
||||
import com.nis.domain.configuration.*;
|
||||
import com.nis.web.service.configuration.ObjGroupCfgConvert;
|
||||
import com.nis.web.service.configuration.ObjectGroupService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
@@ -141,7 +143,7 @@ public class SchedulerTaskUtil {
|
||||
//查询子域配置详情
|
||||
if(cfgList!=null){
|
||||
if(isCommonGroup){
|
||||
groupIdSet=new HashSet<>();
|
||||
groupIdSet=Collections.synchronizedSet(new HashSet<Integer>());
|
||||
commGroupMap=ConfigConvertUtil.gsonFromJson(list.get(0).getCommonGroupIds(),Map.class);
|
||||
//将组中的域设置到cfg_index_info中
|
||||
covertCommongroupIdsMap(commGroupMap,"ipGroup",list.get(0),configSynchronizationDao,IpCommCfg.class);
|
||||
@@ -195,10 +197,10 @@ public class SchedulerTaskUtil {
|
||||
entity.setIsValid(isValid);//将最新的配置状态赋给配置对象
|
||||
entity.setAuditTime(updateTime);
|
||||
for(CfgIndexInfo cfg:list){
|
||||
groupRelationList = new ArrayList();
|
||||
ipRegionList = new ArrayList();
|
||||
strRegionList = new ArrayList();
|
||||
numRegionList = new ArrayList();
|
||||
groupRelationList = Collections.synchronizedList(new ArrayList());
|
||||
ipRegionList = Collections.synchronizedList(new ArrayList());
|
||||
strRegionList = Collections.synchronizedList(new ArrayList());
|
||||
numRegionList =Collections.synchronizedList(new ArrayList());
|
||||
digestRegionList = new ArrayList();
|
||||
areaIpRegionList = new ArrayList();
|
||||
if(StringUtils.isNotBlank(cfg.getCommonGroupIds())){//公共分组
|
||||
@@ -207,45 +209,82 @@ public class SchedulerTaskUtil {
|
||||
userRegion.append(ConfigConvertUtil.generateCommonGroupDefaultUserRegion(null,cfg.getServiceId()));
|
||||
//子配置
|
||||
Map<String,Object> maatTableMap=ConfigConvertUtil.convertCommonGroupMaatTable(cfg,cfgList);
|
||||
//多线程转换
|
||||
ObjGroupCfgConvert ipConvert=new ObjGroupCfgConvert("ipGroup",cfg,1,serviceDictMap,maatTableMap,groupIdSet);
|
||||
ipConvert.setGroupRelationList(groupRelationList);
|
||||
ipConvert.setIpRegionList(ipRegionList);
|
||||
ipConvert.setNumRegionList(numRegionList);
|
||||
ipConvert.setStrRegionList(strRegionList);
|
||||
ObjGroupCfgConvert subscribeIdConvert=new ObjGroupCfgConvert("subscribeIdGroup",cfg,1,serviceDictMap,maatTableMap,groupIdSet);
|
||||
subscribeIdConvert.setGroupRelationList(groupRelationList);
|
||||
subscribeIdConvert.setIpRegionList(ipRegionList);
|
||||
subscribeIdConvert.setNumRegionList(numRegionList);
|
||||
subscribeIdConvert.setStrRegionList(strRegionList);
|
||||
ObjGroupCfgConvert urlConvert=new ObjGroupCfgConvert("urlGroup",cfg,1,serviceDictMap,maatTableMap,groupIdSet);
|
||||
urlConvert.setGroupRelationList(groupRelationList);
|
||||
urlConvert.setIpRegionList(ipRegionList);
|
||||
urlConvert.setNumRegionList(numRegionList);
|
||||
urlConvert.setStrRegionList(strRegionList);
|
||||
ObjGroupCfgConvert domainConvert=new ObjGroupCfgConvert("domainGroup",cfg,1,serviceDictMap,maatTableMap,groupIdSet);
|
||||
domainConvert.setGroupRelationList(groupRelationList);
|
||||
domainConvert.setIpRegionList(ipRegionList);
|
||||
domainConvert.setNumRegionList(numRegionList);
|
||||
domainConvert.setStrRegionList(strRegionList);
|
||||
Thread t1=new Thread(ipConvert);
|
||||
Thread t2=new Thread(subscribeIdConvert);
|
||||
Thread t3=new Thread(urlConvert);
|
||||
Thread t4=new Thread(domainConvert);
|
||||
t1.start();
|
||||
t2.start();
|
||||
t3.start();
|
||||
t4.start();
|
||||
try {
|
||||
t1.join();
|
||||
t2.join();
|
||||
t3.join();
|
||||
t4.join();
|
||||
} catch (InterruptedException e) {
|
||||
logger.error("多线程join异常",e);
|
||||
}
|
||||
//IP公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfg.getIpCommGroupCfgList())){
|
||||
IpPortCfg _cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,ipRegionList,cfg.getIpCommGroupCfgList(),1,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
ipRegionList=map.get("dstList");
|
||||
if(map.get("numRegionList")!=null){
|
||||
numRegionList.addAll(map.get("numRegionList"));
|
||||
}
|
||||
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(cfg.getIpCommGroupCfgList())){
|
||||
// IpPortCfg _cfg = new IpPortCfg();
|
||||
// BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
// Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,ipRegionList,cfg.getIpCommGroupCfgList(),1,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// ipRegionList=map.get("dstList");
|
||||
// if(map.get("numRegionList")!=null){
|
||||
// numRegionList.addAll(map.get("numRegionList"));
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//URL公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfg.getUrlCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getUrlCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(cfg.getUrlCommGroupList())){
|
||||
// CommonStringCfg _cfg = new CommonStringCfg();
|
||||
// BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
// Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getUrlCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// strRegionList=map.get("dstList");
|
||||
// }
|
||||
//账号公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfg.getScriberIdCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getScriberIdCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(cfg.getScriberIdCommGroupList())){
|
||||
// CommonStringCfg _cfg = new CommonStringCfg();
|
||||
// BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
//
|
||||
// Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getScriberIdCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// strRegionList=map.get("dstList");
|
||||
//
|
||||
// }
|
||||
//域名公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfg.getDomainCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getDomainCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(cfg.getDomainCommGroupList())){
|
||||
// CommonStringCfg _cfg = new CommonStringCfg();
|
||||
// BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
//
|
||||
// Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getDomainCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// strRegionList=map.get("dstList");
|
||||
// }
|
||||
BeanUtils.copyProperties(cfg, maatCfg);
|
||||
if(cfg.getServiceId().equals(512)){
|
||||
maatCfg.setAction(2);
|
||||
@@ -1034,7 +1073,7 @@ public class SchedulerTaskUtil {
|
||||
logger.info("定时器修改配置状态:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||
logger.info("定时器修改配置状态响应时间:"+result.getMsg());
|
||||
logger.info("定时器修改配置状态响应:"+result.getMsg());
|
||||
}
|
||||
|
||||
}else if("2".equals(serviceType)){//回调类配置
|
||||
|
||||
@@ -2,11 +2,14 @@ package com.nis.web.controller.configuration;
|
||||
|
||||
|
||||
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.ObjGroupCfg;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.exceptions.CallExternalProceduresException;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.*;
|
||||
|
||||
@@ -492,23 +492,24 @@ public class HttpRedirectPolicyController extends BaseController {
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_HTTP_URL");
|
||||
titleList.add("NTC_HTTP_REQ_HDR");
|
||||
titleList.add("NTC_HTTP_RES_HDR");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
||||
classMap.put("NTC_HTTP_REQ_HDR", HttpReqHeadCfg.class);
|
||||
classMap.put("NTC_HTTP_RES_HDR", HttpResHeadCfg.class);
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport);
|
||||
noExportMap.put("NTC_HTTP_REQ_HDR", httpReqHeadCfgNoExport);
|
||||
noExportMap.put("NTC_HTTP_RES_HDR", httpResHeadCfgNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_HTTP_URL", httpUrlList);
|
||||
dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList);
|
||||
dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList);
|
||||
|
||||
if (entity.getFunctionId() != 211) {
|
||||
titleList.add("NTC_HTTP_RES_HDR");
|
||||
titleList.add("NTC_HTTP_REQ_BODY");
|
||||
classMap.put("NTC_HTTP_RES_HDR", HttpResHeadCfg.class);
|
||||
classMap.put("NTC_HTTP_REQ_BODY", HttpBodyCfg.class);
|
||||
noExportMap.put("NTC_HTTP_RES_HDR", httpResHeadCfgNoExport);
|
||||
noExportMap.put("NTC_HTTP_REQ_BODY", httpReqBodyCfgNoExport);
|
||||
dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList);
|
||||
dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList);
|
||||
if (entity.getFunctionId() != 208) {
|
||||
titleList.add("NTC_HTTP_RES_BODY");
|
||||
|
||||
@@ -523,12 +523,16 @@ public class ManipulatPolicyController extends BaseController {
|
||||
|
||||
titleList.add("NTC_HTTP_RES_HDR");
|
||||
titleList.add("NTC_HTTP_REQ_BODY");
|
||||
titleList.add("NTC_HTTP_RES_BODY");
|
||||
classMap.put("NTC_HTTP_RES_HDR", HttpResHeadCfg.class);
|
||||
classMap.put("NTC_HTTP_REQ_BODY", HttpBodyCfg.class);
|
||||
classMap.put("NTC_HTTP_RES_BODY", HttpBodyCfg.class);
|
||||
noExportMap.put("NTC_HTTP_RES_HDR", httpResHeadCfgNoExport);
|
||||
noExportMap.put("NTC_HTTP_REQ_BODY", httpReqBodyCfgNoExport);
|
||||
noExportMap.put("NTC_HTTP_RES_BODY", httpResBodyCfgNoExport);
|
||||
dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList);
|
||||
dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList);
|
||||
dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList);
|
||||
|
||||
titleList.add("NTC_UNIVERSAL_IP");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
|
||||
@@ -231,7 +231,6 @@ public class PxyObjKeyringController extends BaseController {
|
||||
ResponseData data = result.getData();
|
||||
publicKeyFileAccessUrl = data.getAccessUrl();
|
||||
cfg.setPublicKeyFile(publicKeyFileAccessUrl);
|
||||
;
|
||||
}
|
||||
}
|
||||
if (privateKeyFileI != null) {
|
||||
@@ -510,7 +509,7 @@ public class PxyObjKeyringController extends BaseController {
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), PxyObjKeyring.class);
|
||||
String cfgIndexInfoNoExport = ",config_describe,whether_area_block,block_type,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport = ",expire_after,config_describe,whether_area_block,block_type,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
|
||||
@@ -58,7 +58,7 @@ public class P2pLogController extends BaseController {
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_P2P_LOG;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
logger.error("查询结果:" + recv);
|
||||
// logger.error("查询结果:" + recv);
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcP2pLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcP2pLog>>() {
|
||||
|
||||
@@ -454,7 +454,7 @@
|
||||
AND r.group_id in(${commonGroupIds})
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
<!--${sqlMap.dsf}-->
|
||||
</trim>
|
||||
|
||||
</select>
|
||||
|
||||
@@ -642,87 +642,87 @@
|
||||
AND r.group_id in(${commonGroupIds})
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<select id="getGroupIds" parameterType="com.nis.domain.basics.IpCommCfg" resultMap="IpCommGroupCfgMap">
|
||||
SELECT
|
||||
<include refid="columns"></include>
|
||||
FROM
|
||||
ip_comm_cfg r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE like concat(concat('%',#{CFG_TYPE,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destPort != null and destPort !=''">
|
||||
AND r.DEST_PORT=#{destPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="direction != null">
|
||||
AND r.DIRECTION=#{direction,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND r.group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<delete id="deleteCfgByGroupIds" parameterType="java.lang.String" >
|
||||
delete from ip_comm_cfg where group_id in (${groupIds})
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
<!-- ${sqlMap.dsf} -->
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<select id="getGroupIds" parameterType="com.nis.domain.basics.IpCommCfg" resultMap="IpCommGroupCfgMap">
|
||||
SELECT
|
||||
<include refid="columns"></include>
|
||||
FROM
|
||||
ip_comm_cfg r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE like concat(concat('%',#{CFG_TYPE,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destPort != null and destPort !=''">
|
||||
AND r.DEST_PORT=#{destPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="direction != null">
|
||||
AND r.DIRECTION=#{direction,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND r.group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
<delete id="deleteCfgByGroupIds" parameterType="java.lang.String" >
|
||||
delete from ip_comm_cfg where group_id in (${groupIds})
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -454,72 +454,72 @@
|
||||
AND r.group_id in(${commonGroupIds})
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
</trim>
|
||||
<!-- ${sqlMap.dsf}-->
|
||||
</trim>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getGroupIds" parameterType="com.nis.domain.basics.ScriberIdCommCfg" resultMap="commGroupCfgMap">
|
||||
SELECT
|
||||
<include refid="columns"></include>
|
||||
FROM
|
||||
scriberid_comm_cfg r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgKeywords != null and cfgKeywords != ''">
|
||||
AND r.cfg_keywords like concat(concat('%',#{cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="classify != null and classify !=''">
|
||||
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="attribute != null and attribute !=''">
|
||||
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="lable != null and lable !=''">
|
||||
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null and areaEffectiveIds !=''">
|
||||
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND r.group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="commonGroupIds != null">
|
||||
AND r.group_id in(${commonGroupIds})
|
||||
</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
</select>
|
||||
|
||||
<select id="getGroupIds" parameterType="com.nis.domain.basics.ScriberIdCommCfg" resultMap="commGroupCfgMap">
|
||||
SELECT
|
||||
<include refid="columns"></include>
|
||||
FROM
|
||||
scriberid_comm_cfg r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgKeywords != null and cfgKeywords != ''">
|
||||
AND r.cfg_keywords like concat(concat('%',#{cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="classify != null and classify !=''">
|
||||
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="attribute != null and attribute !=''">
|
||||
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="lable != null and lable !=''">
|
||||
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null and areaEffectiveIds !=''">
|
||||
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND r.group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="commonGroupIds != null">
|
||||
AND r.group_id in(${commonGroupIds})
|
||||
</if>
|
||||
</trim>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -466,7 +466,7 @@
|
||||
AND r.group_id in(${commonGroupIds})
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
<!--${sqlMap.dsf}-->
|
||||
</trim>
|
||||
|
||||
</select>
|
||||
|
||||
@@ -8,22 +8,17 @@ import java.math.BigDecimal;
|
||||
import java.nio.charset.Charset;
|
||||
import java.sql.SQLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
import com.nis.domain.basics.*;
|
||||
import com.nis.domain.configuration.*;
|
||||
import com.nis.util.*;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.basics.*;
|
||||
import com.nis.web.dao.configuration.*;
|
||||
import com.nis.web.service.configuration.ObjGroupCfgConvert;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
@@ -1716,9 +1711,7 @@ public abstract class BaseService {
|
||||
this.saveComplexkeywordCfgBatch(regionDict,serviceDict,listPage, "http_req_head_cfg",send);
|
||||
}else
|
||||
// HTTP(s)响应头域
|
||||
if(regionDict.getDictId().intValue()==102 || regionDict.getDictId().intValue()==81 ||
|
||||
regionDict.getDictId().intValue()==87 || regionDict.getDictId().intValue()==93 ||
|
||||
regionDict.getDictId().intValue()==702) {
|
||||
if(regionDict.getConfigRegionValue().equals(Constants.HTTP_REDIRECT_RES_HEAD_REGION)) {
|
||||
this.saveComplexkeywordCfgBatch(regionDict,serviceDict,listPage, "http_res_head_cfg",send);
|
||||
}
|
||||
}else if("DnsResStrategy".equals(type)) {
|
||||
@@ -3325,6 +3318,7 @@ public abstract class BaseService {
|
||||
ScriberIdCommGroupDao scriberIdCommGroupDao=SpringContextHolder.getBean(ScriberIdCommGroupDao.class);
|
||||
DomainCommGroupDao domainCommGroupDao=SpringContextHolder.getBean(DomainCommGroupDao.class);
|
||||
CommonPolicyDao commonPolicyDao=SpringContextHolder.getBean(CommonPolicyDao.class);
|
||||
//SchedulerDao schedulerDao=SpringContextHolder.getBean(SchedulerDao.class);
|
||||
AreaIpCfgDao areaIpCfgDao=SpringContextHolder.getBean(AreaIpCfgDao.class);
|
||||
Set<String> ipDeletedGroups=new HashSet<>();
|
||||
Set<String> urlDeletedGroups=new HashSet<>();
|
||||
@@ -3362,6 +3356,7 @@ public abstract class BaseService {
|
||||
realGroupIds.deleteCharAt(realGroupIds.toString().length()-1);
|
||||
}
|
||||
List<CfgIndexInfo> toUpdateCfgIndexInfos=new ArrayList<>();
|
||||
List<CfgIndexInfo> toDelSchedualCfgIndexInfos=new ArrayList<>();
|
||||
List<CfgIndexInfo> toCancelCfgIndexInfos=new ArrayList<>();
|
||||
//没有
|
||||
if(StringUtils.isBlank(realGroupIds.toString())){
|
||||
@@ -3381,13 +3376,13 @@ public abstract class BaseService {
|
||||
Integer serviceId=cfgIndexInfo.getServiceId();
|
||||
if(serviceId!=null&&StringUtils.isNotBlank(cfgIndexInfo.getCommonGroupIds())){
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
Set<Integer> groupIdSet=new HashSet<>();
|
||||
Set<Integer> groupIdSet=Collections.synchronizedSet(new HashSet<Integer>());
|
||||
List<MaatCfg> configCompileList = new ArrayList();
|
||||
List<MaatCfg> cancelConfigCompileList = new ArrayList();
|
||||
List<GroupCfg> groupRelationList = new ArrayList();
|
||||
List<IpCfg> ipRegionList = new ArrayList();
|
||||
List<StringCfg> strRegionList = new ArrayList();
|
||||
List<NumBoundaryCfg> numRegionList = new ArrayList();
|
||||
List<GroupCfg> groupRelationList = Collections.synchronizedList(new ArrayList());
|
||||
List<IpCfg> ipRegionList = Collections.synchronizedList(new ArrayList());
|
||||
List<StringCfg> strRegionList = Collections.synchronizedList(new ArrayList());
|
||||
List<NumBoundaryCfg> numRegionList = Collections.synchronizedList(new ArrayList());
|
||||
List<DigestCfg> digestRegionList = new ArrayList();
|
||||
List<IpCfg> areaIpRegionList = new ArrayList();
|
||||
Map<String,Object> userRgionMap=gsonFromJson(cfgIndexInfo.getCommonGroupIds(),Map.class);
|
||||
@@ -3405,6 +3400,7 @@ public abstract class BaseService {
|
||||
cfgIndexInfo.setCommonGroupIds("");
|
||||
if(cfgIndexInfo.getIsValid()==Constants.VALID_NO){//未生效,直接更新配置,不用下发
|
||||
toUpdateCfgIndexInfos.add(cfgIndexInfo);
|
||||
toDelSchedualCfgIndexInfos.add(cfgIndexInfo);
|
||||
}else{//生效,需要取消配置
|
||||
cfgIndexInfo.setIsValid(Constants.VALID_NO);
|
||||
cfgIndexInfo.setIsAudit(Constants.AUDIT_NOT_YES);
|
||||
@@ -3459,47 +3455,84 @@ public abstract class BaseService {
|
||||
}
|
||||
}
|
||||
compileIds.add(cfgIndexInfo.getCompileId());
|
||||
//多线程转换配置
|
||||
ObjGroupCfgConvert ipConvert=new ObjGroupCfgConvert("ipGroup",cfgIndexInfo,1,serviceDictMap,maatTableMap,groupIdSet);
|
||||
ipConvert.setGroupRelationList(groupRelationList);
|
||||
ipConvert.setIpRegionList(ipRegionList);
|
||||
ipConvert.setNumRegionList(numRegionList);
|
||||
ipConvert.setStrRegionList(strRegionList);
|
||||
ObjGroupCfgConvert subscribeIdConvert=new ObjGroupCfgConvert("subscribeIdGroup",cfgIndexInfo,1,serviceDictMap,maatTableMap,groupIdSet);
|
||||
subscribeIdConvert.setGroupRelationList(groupRelationList);
|
||||
subscribeIdConvert.setIpRegionList(ipRegionList);
|
||||
subscribeIdConvert.setNumRegionList(numRegionList);
|
||||
subscribeIdConvert.setStrRegionList(strRegionList);
|
||||
ObjGroupCfgConvert urlConvert=new ObjGroupCfgConvert("urlGroup",cfgIndexInfo,1,serviceDictMap,maatTableMap,groupIdSet);
|
||||
urlConvert.setGroupRelationList(groupRelationList);
|
||||
urlConvert.setIpRegionList(ipRegionList);
|
||||
urlConvert.setNumRegionList(numRegionList);
|
||||
urlConvert.setStrRegionList(strRegionList);
|
||||
ObjGroupCfgConvert domainConvert=new ObjGroupCfgConvert("domainGroup",cfgIndexInfo,1,serviceDictMap,maatTableMap,groupIdSet);
|
||||
domainConvert.setGroupRelationList(groupRelationList);
|
||||
domainConvert.setIpRegionList(ipRegionList);
|
||||
domainConvert.setNumRegionList(numRegionList);
|
||||
domainConvert.setStrRegionList(strRegionList);
|
||||
Thread t1=new Thread(ipConvert);
|
||||
Thread t2=new Thread(subscribeIdConvert);
|
||||
Thread t3=new Thread(urlConvert);
|
||||
Thread t4=new Thread(domainConvert);
|
||||
t1.start();
|
||||
t2.start();
|
||||
t3.start();
|
||||
t4.start();
|
||||
try {
|
||||
t1.join();
|
||||
t2.join();
|
||||
t3.join();
|
||||
t4.join();
|
||||
} catch (InterruptedException e) {
|
||||
logger.error("多线程join异常",e);
|
||||
}
|
||||
//子表
|
||||
//IP公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfgIndexInfo.getIpCommGroupCfgList())){
|
||||
IpPortCfg cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId"});
|
||||
Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,ipRegionList,cfgIndexInfo.getIpCommGroupCfgList(),1,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
ipRegionList=map.get("dstList");
|
||||
if(map.get("numRegionList")!=null){
|
||||
numRegionList.addAll(map.get("numRegionList"));
|
||||
}
|
||||
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(cfgIndexInfo.getIpCommGroupCfgList())){
|
||||
// IpPortCfg cfg = new IpPortCfg();
|
||||
// BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId"});
|
||||
// Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,ipRegionList,cfgIndexInfo.getIpCommGroupCfgList(),1,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// ipRegionList=map.get("dstList");
|
||||
// if(map.get("numRegionList")!=null){
|
||||
// numRegionList.addAll(map.get("numRegionList"));
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//URL公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfgIndexInfo.getUrlCommGroupList())){
|
||||
CommonStringCfg cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId"});
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfgIndexInfo.getUrlCommGroupList(),2,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(cfgIndexInfo.getUrlCommGroupList())){
|
||||
// CommonStringCfg cfg = new CommonStringCfg();
|
||||
// BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId"});
|
||||
// Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfgIndexInfo.getUrlCommGroupList(),2,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// strRegionList=map.get("dstList");
|
||||
// }
|
||||
//账号公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfgIndexInfo.getScriberIdCommGroupList())){
|
||||
CommonStringCfg cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId"});
|
||||
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfgIndexInfo.getScriberIdCommGroupList(),2,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(cfgIndexInfo.getScriberIdCommGroupList())){
|
||||
// CommonStringCfg cfg = new CommonStringCfg();
|
||||
// BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId"});
|
||||
//
|
||||
// Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfgIndexInfo.getScriberIdCommGroupList(),2,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// strRegionList=map.get("dstList");
|
||||
//
|
||||
// }
|
||||
//域名公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfgIndexInfo.getDomainCommGroupList())){
|
||||
CommonStringCfg cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId"});
|
||||
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfgIndexInfo.getDomainCommGroupList(),2,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(cfgIndexInfo.getDomainCommGroupList())){
|
||||
// CommonStringCfg cfg = new CommonStringCfg();
|
||||
// BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId"});
|
||||
//
|
||||
// Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfgIndexInfo.getDomainCommGroupList(),2,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// strRegionList=map.get("dstList");
|
||||
//
|
||||
// }
|
||||
//构造提交综合服务参数格式
|
||||
maatCfg.initDefaultValue();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, maatCfg);
|
||||
@@ -3564,15 +3597,23 @@ public abstract class BaseService {
|
||||
}
|
||||
}
|
||||
//查询定时任务,失效定时任务
|
||||
// if(ids.toString().length()>0){
|
||||
// ids.deleteCharAt(ids.toString().length()-1);
|
||||
// commonPolicyDao.cancelScheduCfg(ids.toString(),CfgIndexInfo.getTablename());
|
||||
// }
|
||||
if(ids.toString().length()>0){
|
||||
ids.deleteCharAt(ids.toString().length()-1);
|
||||
commonPolicyDao.cancelScheduCfg(ids.toString(),CfgIndexInfo.getTablename());
|
||||
}
|
||||
}
|
||||
if(toUpdateCfgIndexInfos.size()>0){
|
||||
StringBuffer ids=new StringBuffer();
|
||||
for(CfgIndexInfo info:toUpdateCfgIndexInfos){
|
||||
commonPolicyDao.updateCfgIndexCommonGroupIds(info);
|
||||
// if(StringUtils.isBlank(info.getCommonGroupIds())){
|
||||
// ids.append(info.getCompileId()+",");
|
||||
// }
|
||||
}
|
||||
}
|
||||
if(toDelSchedualCfgIndexInfos.size()>0){
|
||||
StringBuffer ids=new StringBuffer();
|
||||
for(CfgIndexInfo info:toDelSchedualCfgIndexInfos){
|
||||
if(StringUtils.isBlank(info.getCommonGroupIds())){
|
||||
ids.append(info.getCompileId()+",");
|
||||
}
|
||||
@@ -3596,7 +3637,12 @@ public abstract class BaseService {
|
||||
if(CollectionUtils.isNotEmpty(maatBean.getConfigCompileList())){
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("策略对象组下发配置参数:"+json);
|
||||
if(json.length()<Constants.JSON_PRINT_LENTH) {
|
||||
logger.info("策略对象组下发配置参数:" + json);
|
||||
}else{
|
||||
logger.info("策略对象组下发配置内容超过"+Constants.JSON_PRINT_LENTH+",不打印");
|
||||
// FileUtils.writeToFile("D:\\send.json",json,false);
|
||||
}
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
logger.info("策略对象组下发响应信息:"+result.getMsg());
|
||||
@@ -3619,36 +3665,38 @@ public abstract class BaseService {
|
||||
contains=false;
|
||||
}
|
||||
if(contains&&cfgIndexInfo.getIsValid()==Constants.VALID_YES){
|
||||
if("IpCommCfg".equals(clazz.getSimpleName())){
|
||||
IpCommCfg searchCfg=new IpCommCfg();
|
||||
searchCfg.setCommonGroupIds(userRgionMap.get(key).toString().substring(1,userRgionMap.get(key).toString().length()-1));
|
||||
List commCfgs=dao.findAllList(searchCfg);
|
||||
if(CollectionUtils.isNotEmpty(commCfgs)){
|
||||
cfgIndexInfo.setIpCommGroupCfgList(commCfgs);
|
||||
}
|
||||
}else if("ScriberIdCommCfg".equals(clazz.getSimpleName()) ){
|
||||
ScriberIdCommCfg searchCfg=new ScriberIdCommCfg();
|
||||
searchCfg.setCommonGroupIds(userRgionMap.get(key).toString().substring(1,userRgionMap.get(key).toString().length()-1));
|
||||
List commCfgs=dao.findAllList(searchCfg);
|
||||
if(CollectionUtils.isNotEmpty(commCfgs)){
|
||||
cfgIndexInfo.setScriberIdCommGroupList(commCfgs);
|
||||
}
|
||||
}else if("UrlCommCfg".equals(clazz.getSimpleName())){
|
||||
UrlCommCfg searchCfg=new UrlCommCfg();
|
||||
searchCfg.setCommonGroupIds(userRgionMap.get(key).toString().substring(1,userRgionMap.get(key).toString().length()-1));
|
||||
List commCfgs=dao.findAllList(searchCfg);
|
||||
if(CollectionUtils.isNotEmpty(commCfgs)){
|
||||
cfgIndexInfo.setUrlCommGroupList(commCfgs);
|
||||
}
|
||||
}else if("DomainCommCfg".equals(clazz.getSimpleName())){
|
||||
DomainCommCfg searchCfg=new DomainCommCfg();
|
||||
searchCfg.setCommonGroupIds(userRgionMap.get(key).toString().substring(1,userRgionMap.get(key).toString().length()-1));
|
||||
List commCfgs=dao.findAllList(searchCfg);
|
||||
if(CollectionUtils.isNotEmpty(commCfgs)){
|
||||
cfgIndexInfo.setDomainCommGroupList(commCfgs);
|
||||
String commonGroupIds=userRgionMap.get(key).toString().substring(1,userRgionMap.get(key).toString().length()-1);
|
||||
if(StringUtils.isNotBlank(commonGroupIds)){
|
||||
if("IpCommCfg".equals(clazz.getSimpleName())){
|
||||
IpCommCfg searchCfg=new IpCommCfg();
|
||||
searchCfg.setCommonGroupIds(commonGroupIds);
|
||||
List commCfgs=dao.findAllList(searchCfg);
|
||||
if(CollectionUtils.isNotEmpty(commCfgs)){
|
||||
cfgIndexInfo.setIpCommGroupCfgList(commCfgs);
|
||||
}
|
||||
}else if("ScriberIdCommCfg".equals(clazz.getSimpleName()) ){
|
||||
ScriberIdCommCfg searchCfg=new ScriberIdCommCfg();
|
||||
searchCfg.setCommonGroupIds(commonGroupIds);
|
||||
List commCfgs=dao.findAllList(searchCfg);
|
||||
if(CollectionUtils.isNotEmpty(commCfgs)){
|
||||
cfgIndexInfo.setScriberIdCommGroupList(commCfgs);
|
||||
}
|
||||
}else if("UrlCommCfg".equals(clazz.getSimpleName())){
|
||||
UrlCommCfg searchCfg=new UrlCommCfg();
|
||||
searchCfg.setCommonGroupIds(commonGroupIds);
|
||||
List commCfgs=dao.findAllList(searchCfg);
|
||||
if(CollectionUtils.isNotEmpty(commCfgs)){
|
||||
cfgIndexInfo.setUrlCommGroupList(commCfgs);
|
||||
}
|
||||
}else if("DomainCommCfg".equals(clazz.getSimpleName())){
|
||||
DomainCommCfg searchCfg=new DomainCommCfg();
|
||||
searchCfg.setCommonGroupIds(commonGroupIds);
|
||||
List commCfgs=dao.findAllList(searchCfg);
|
||||
if(CollectionUtils.isNotEmpty(commCfgs)){
|
||||
cfgIndexInfo.setDomainCommGroupList(commCfgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,11 +191,11 @@ public class DomainCommGroupService extends CrudService<CrudDao<DomainCommCfg>,
|
||||
serviceGroupIds = "";
|
||||
for (String groupId : strings) {
|
||||
Integer size = domainCommGroupDao.getCfgInfoByGroupIds(groupId);
|
||||
if(size == 0) { // 需配置取消
|
||||
if(size == 0) {
|
||||
boolean flag = groupManageService.checkCancelCfg(groupId, Constants.DOMAIN_OBJ_GROUP_TYPE);
|
||||
if(flag) { // 需配置更新
|
||||
if(flag) { // 需配置取消
|
||||
serviceGroupIds += ","+groupId;
|
||||
}else {
|
||||
}else { // 需配置更新
|
||||
groupIds += ","+groupId;
|
||||
}
|
||||
}else { // 需配置更新
|
||||
|
||||
@@ -184,11 +184,11 @@ public class IpCommGroupCfgService extends BaseService {
|
||||
serviceGroupIds = "";
|
||||
for (String groupId : strings) {
|
||||
Integer size = ipCommGroupCfgDao.getCfgInfoByGroupIds(groupId);
|
||||
if(size == 0) { // 需配置取消
|
||||
if(size == 0) {
|
||||
boolean flag = groupManageService.checkCancelCfg(groupId, Constants.IP_OBJ_GROUP_TYPE);
|
||||
if(flag) { // 需配置更新
|
||||
if(flag) { // 需配置取消
|
||||
serviceGroupIds += ","+groupId;
|
||||
}else {
|
||||
}else { // 需配置更新
|
||||
groupIds += ","+groupId;
|
||||
}
|
||||
}else { // 需配置更新
|
||||
|
||||
@@ -191,11 +191,11 @@ public class ScriberIdCommGroupService extends CrudService<CrudDao<ScriberIdComm
|
||||
serviceGroupIds = "";
|
||||
for (String groupId : strings) {
|
||||
Integer size = scriberIdCommGroupDao.getCfgInfoByGroupIds(groupId);
|
||||
if(size == 0) { // 需配置取消
|
||||
if(size == 0) {
|
||||
boolean flag = groupManageService.checkCancelCfg(groupId, Constants.SUBID_OBJ_GROUP_TYPE);
|
||||
if(flag) { // 需配置更新
|
||||
if(flag) { // 需配置取消
|
||||
serviceGroupIds += ","+groupId;
|
||||
}else {
|
||||
}else { // 需配置更新
|
||||
groupIds += ","+groupId;
|
||||
}
|
||||
}else { // 需配置更新
|
||||
|
||||
@@ -191,11 +191,11 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
||||
serviceGroupIds = "";
|
||||
for (String groupId : strings) {
|
||||
Integer size = urlCommGroupDao.getCfgInfoByGroupIds(groupId);
|
||||
if(size == 0) { // 需配置取消
|
||||
if(size == 0) {
|
||||
boolean flag = groupManageService.checkCancelCfg(groupId, Constants.URL_OBJ_GROUP_TYPE);
|
||||
if(flag) { // 需配置更新
|
||||
if(flag) { // 需配置取消
|
||||
serviceGroupIds += ","+groupId;
|
||||
}else {
|
||||
}else { // 需配置更新
|
||||
groupIds += ","+groupId;
|
||||
}
|
||||
}else { // 需配置更新
|
||||
|
||||
@@ -2430,55 +2430,100 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
List<Map<String,Object>> cfgList=(List<Map<String,Object>>)cfgMap.get(cfg.getServiceId());
|
||||
Map<String,Object> maatTableMap=ConfigConvertUtil.convertCommonGroupMaatTable(cfg,cfgList);
|
||||
Set<Integer> groupIdSet=new HashSet<>();
|
||||
//多线程转换配置
|
||||
ObjGroupCfgConvert ipConvert=new ObjGroupCfgConvert("ipGroup",cfg,1,serviceDictMap,maatTableMap,groupIdSet);
|
||||
ipConvert.setGroupRelationList(groupRelationList);
|
||||
ipConvert.setIpRegionList(ipRegionList);
|
||||
ipConvert.setNumRegionList(numRegionList);
|
||||
ipConvert.setStrRegionList(strRegionList);
|
||||
ipConvert.setIsValid(entity.getIsValid());
|
||||
ipConvert.setAuditTime(entity.getAuditTime());
|
||||
ObjGroupCfgConvert subscribeIdConvert=new ObjGroupCfgConvert("subscribeIdGroup",cfg,1,serviceDictMap,maatTableMap,groupIdSet);
|
||||
subscribeIdConvert.setGroupRelationList(groupRelationList);
|
||||
subscribeIdConvert.setIpRegionList(ipRegionList);
|
||||
subscribeIdConvert.setNumRegionList(numRegionList);
|
||||
subscribeIdConvert.setStrRegionList(strRegionList);
|
||||
subscribeIdConvert.setIsValid(entity.getIsValid());
|
||||
subscribeIdConvert.setAuditTime(entity.getAuditTime());
|
||||
ObjGroupCfgConvert urlConvert=new ObjGroupCfgConvert("urlGroup",cfg,1,serviceDictMap,maatTableMap,groupIdSet);
|
||||
urlConvert.setGroupRelationList(groupRelationList);
|
||||
urlConvert.setIpRegionList(ipRegionList);
|
||||
urlConvert.setNumRegionList(numRegionList);
|
||||
urlConvert.setStrRegionList(strRegionList);
|
||||
urlConvert.setIsValid(entity.getIsValid());
|
||||
urlConvert.setAuditTime(entity.getAuditTime());
|
||||
ObjGroupCfgConvert domainConvert=new ObjGroupCfgConvert("domainGroup",cfg,1,serviceDictMap,maatTableMap,groupIdSet);
|
||||
domainConvert.setGroupRelationList(groupRelationList);
|
||||
domainConvert.setIpRegionList(ipRegionList);
|
||||
domainConvert.setNumRegionList(numRegionList);
|
||||
domainConvert.setStrRegionList(strRegionList);
|
||||
domainConvert.setIsValid(entity.getIsValid());
|
||||
domainConvert.setAuditTime(entity.getAuditTime());
|
||||
Thread t1=new Thread(ipConvert);
|
||||
Thread t2=new Thread(subscribeIdConvert);
|
||||
Thread t3=new Thread(urlConvert);
|
||||
Thread t4=new Thread(domainConvert);
|
||||
t1.start();
|
||||
t2.start();
|
||||
t3.start();
|
||||
t4.start();
|
||||
try {
|
||||
t1.join();
|
||||
t2.join();
|
||||
t3.join();
|
||||
t4.join();
|
||||
} catch (InterruptedException e) {
|
||||
logger.error("多线程join异常",e);
|
||||
}
|
||||
//IP公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfg.getIpCommGroupCfgList())){
|
||||
IpPortCfg _cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId"});
|
||||
_cfg.setIsValid(entity.getIsValid());
|
||||
_cfg.setIsAudit(entity.getIsAudit());
|
||||
_cfg.setAuditTime(entity.getAuditTime());
|
||||
Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,ipRegionList,cfg.getIpCommGroupCfgList(),1,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
ipRegionList=map.get("dstList");
|
||||
if(map.get("numRegionList")!=null){
|
||||
numRegionList.addAll(map.get("numRegionList"));
|
||||
}
|
||||
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(cfg.getIpCommGroupCfgList())){
|
||||
// IpPortCfg _cfg = new IpPortCfg();
|
||||
// BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId"});
|
||||
// _cfg.setIsValid(entity.getIsValid());
|
||||
// _cfg.setIsAudit(entity.getIsAudit());
|
||||
// _cfg.setAuditTime(entity.getAuditTime());
|
||||
// Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,ipRegionList,cfg.getIpCommGroupCfgList(),1,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// ipRegionList=map.get("dstList");
|
||||
// if(map.get("numRegionList")!=null){
|
||||
// numRegionList.addAll(map.get("numRegionList"));
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//URL公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfg.getUrlCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId"});
|
||||
_cfg.setIsValid(entity.getIsValid());
|
||||
_cfg.setIsAudit(entity.getIsAudit());
|
||||
_cfg.setAuditTime(entity.getAuditTime());
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getUrlCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(cfg.getUrlCommGroupList())){
|
||||
// CommonStringCfg _cfg = new CommonStringCfg();
|
||||
// BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId"});
|
||||
// _cfg.setIsValid(entity.getIsValid());
|
||||
// _cfg.setIsAudit(entity.getIsAudit());
|
||||
// _cfg.setAuditTime(entity.getAuditTime());
|
||||
// Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getUrlCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// strRegionList=map.get("dstList");
|
||||
// }
|
||||
//账号公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfg.getScriberIdCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId"});
|
||||
_cfg.setIsValid(entity.getIsValid());
|
||||
_cfg.setIsAudit(entity.getIsAudit());
|
||||
_cfg.setAuditTime(entity.getAuditTime());
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getScriberIdCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(cfg.getScriberIdCommGroupList())){
|
||||
// CommonStringCfg _cfg = new CommonStringCfg();
|
||||
// BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId"});
|
||||
// _cfg.setIsValid(entity.getIsValid());
|
||||
// _cfg.setIsAudit(entity.getIsAudit());
|
||||
// _cfg.setAuditTime(entity.getAuditTime());
|
||||
// Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getScriberIdCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// strRegionList=map.get("dstList");
|
||||
//
|
||||
// }
|
||||
//域名公共分组
|
||||
if(CollectionUtils.isNotEmpty(cfg.getDomainCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId",});
|
||||
_cfg.setIsValid(entity.getIsValid());
|
||||
_cfg.setIsAudit(entity.getIsAudit());
|
||||
_cfg.setAuditTime(entity.getAuditTime());
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getDomainCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(cfg.getDomainCommGroupList())){
|
||||
// CommonStringCfg _cfg = new CommonStringCfg();
|
||||
// BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId",});
|
||||
// _cfg.setIsValid(entity.getIsValid());
|
||||
// _cfg.setIsAudit(entity.getIsAudit());
|
||||
// _cfg.setAuditTime(entity.getAuditTime());
|
||||
// Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getDomainCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// strRegionList=map.get("dstList");
|
||||
// }
|
||||
BeanUtils.copyProperties(cfg, maatCfg);
|
||||
if(cfg.getServiceId().equals(512)){
|
||||
maatCfg.setAction(2);
|
||||
@@ -2514,6 +2559,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
//调用服务接口下发配置数据
|
||||
if(isUpdateCfg) {
|
||||
//logger.info("配置批量下发:"+json);
|
||||
// FileUtils.writeToFile("D:\\send.json",json,false);
|
||||
//调用服务接口同步回调类配置
|
||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
if(result!=null){
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.CommonStringCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.util.ConfigConvertUtil;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class ObjGroupCfgConvert implements Runnable{
|
||||
private static final Logger logger= Logger.getLogger(ObjGroupCfgConvert.class);
|
||||
private CfgIndexInfo cfgIndexInfo;
|
||||
private Integer isAudit;
|
||||
private Map<Integer, FunctionServiceDict> serviceDictMap;
|
||||
private Set<Integer> groupIdSet;
|
||||
private List<MaatCfg.GroupCfg> groupRelationList;
|
||||
private List<MaatCfg.IpCfg> ipRegionList;
|
||||
private List<MaatCfg.StringCfg> strRegionList;
|
||||
private List<MaatCfg.NumBoundaryCfg> numRegionList;
|
||||
private Map<String,Object> maatTableMap;
|
||||
private String groupName;
|
||||
private Integer isValid;
|
||||
private Date auditTime;
|
||||
public ObjGroupCfgConvert(String groupName,CfgIndexInfo cfgIndexInfo,Integer isAudit,Map<Integer,FunctionServiceDict> serviceDictMap,Map<String,Object> maatTableMap,Set<Integer> groupIdSet){
|
||||
this.cfgIndexInfo=cfgIndexInfo;
|
||||
this.isAudit=isAudit;
|
||||
this.serviceDictMap=serviceDictMap;
|
||||
this.groupIdSet=groupIdSet;
|
||||
this.groupName=groupName;
|
||||
this.maatTableMap=maatTableMap;
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
//IP公共分组
|
||||
if("ipGroup".equalsIgnoreCase(groupName)&& CollectionUtils.isNotEmpty(cfgIndexInfo.getIpCommGroupCfgList())){
|
||||
IpPortCfg cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId","menuNameCode"});
|
||||
if(isValid!=null){
|
||||
cfg.setIsValid(isValid);
|
||||
}
|
||||
cfg.setIsAudit(isAudit);
|
||||
if(auditTime!=null){
|
||||
cfg.setAuditTime(auditTime);
|
||||
}
|
||||
if(isAudit==1){
|
||||
Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,ipRegionList,cfgIndexInfo.getIpCommGroupCfgList(),1,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
ipRegionList=map.get("dstList");
|
||||
if(map.get("numRegionList")!=null){
|
||||
numRegionList.addAll(map.get("numRegionList"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if("urlGroup".equalsIgnoreCase(groupName)&&CollectionUtils.isNotEmpty(cfgIndexInfo.getUrlCommGroupList())){
|
||||
CommonStringCfg cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId","menuNameCode"});
|
||||
if(isValid!=null){
|
||||
cfg.setIsValid(isValid);
|
||||
}
|
||||
cfg.setIsAudit(isAudit);
|
||||
if(auditTime!=null){
|
||||
cfg.setAuditTime(auditTime);
|
||||
}
|
||||
if(isAudit==1){
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfgIndexInfo.getUrlCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
//账号公共分组
|
||||
if("subscribeIdGroup".equalsIgnoreCase(groupName)&&CollectionUtils.isNotEmpty(cfgIndexInfo.getScriberIdCommGroupList())){
|
||||
CommonStringCfg cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId","menuNameCode"});
|
||||
if(isValid!=null){
|
||||
cfg.setIsValid(isValid);
|
||||
}
|
||||
cfg.setIsAudit(isAudit);
|
||||
if(auditTime!=null){
|
||||
cfg.setAuditTime(auditTime);
|
||||
}
|
||||
if(isAudit==1){
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfgIndexInfo.getScriberIdCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
//域名公共分组
|
||||
if("domainGroup".equalsIgnoreCase(groupName)&&CollectionUtils.isNotEmpty(cfgIndexInfo.getDomainCommGroupList())){
|
||||
CommonStringCfg cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId","menuNameCode"});
|
||||
if(isValid!=null){
|
||||
cfg.setIsValid(isValid);
|
||||
}
|
||||
cfg.setIsAudit(isAudit);
|
||||
if(auditTime!=null){
|
||||
cfg.setAuditTime(auditTime);
|
||||
}
|
||||
if(isAudit==1){
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfgIndexInfo.getDomainCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
}catch (Throwable e){
|
||||
logger.error("ObjGroupCfgConvert failed",e);
|
||||
}
|
||||
}
|
||||
|
||||
public List<MaatCfg.GroupCfg> getGroupRelationList() {
|
||||
return groupRelationList;
|
||||
}
|
||||
|
||||
public void setGroupRelationList(List<MaatCfg.GroupCfg> groupRelationList) {
|
||||
this.groupRelationList = groupRelationList;
|
||||
}
|
||||
|
||||
public List<MaatCfg.IpCfg> getIpRegionList() {
|
||||
return ipRegionList;
|
||||
}
|
||||
|
||||
public void setIpRegionList(List<MaatCfg.IpCfg> ipRegionList) {
|
||||
this.ipRegionList = ipRegionList;
|
||||
}
|
||||
|
||||
public List<MaatCfg.StringCfg> getStrRegionList() {
|
||||
return strRegionList;
|
||||
}
|
||||
|
||||
public void setStrRegionList(List<MaatCfg.StringCfg> strRegionList) {
|
||||
this.strRegionList = strRegionList;
|
||||
}
|
||||
|
||||
public List<MaatCfg.NumBoundaryCfg> getNumRegionList() {
|
||||
return numRegionList;
|
||||
}
|
||||
|
||||
public void setNumRegionList(List<MaatCfg.NumBoundaryCfg> numRegionList) {
|
||||
this.numRegionList = numRegionList;
|
||||
}
|
||||
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
|
||||
public Date getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(Date auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
}
|
||||
@@ -16,8 +16,6 @@ import com.nis.web.dao.configuration.CommonPolicyDao;
|
||||
import com.nis.web.dao.configuration.ObjectGroupDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -92,30 +90,78 @@ public class ObjectGroupService extends BaseService {
|
||||
}
|
||||
entity.setIsValid(0);
|
||||
entity.setIsAudit(0);
|
||||
//设置service_id
|
||||
if("HTTPS".equalsIgnoreCase(protocolType)){
|
||||
if(entity.getAction().equals(1)){
|
||||
entity.setServiceId(592);
|
||||
}else if(entity.getAction().equals(16)){
|
||||
entity.setServiceId(576);
|
||||
}
|
||||
}else if("INTERCEPT".equalsIgnoreCase(protocolType)){
|
||||
entity.setServiceId(512);
|
||||
}else if("HTTP".equalsIgnoreCase(protocolType)){
|
||||
if(entity.getAction().equals(1)){
|
||||
entity.setServiceId(129);
|
||||
}else if(entity.getAction().equals(16)){
|
||||
entity.setServiceId(17);
|
||||
}
|
||||
}else if(StringUtils.isBlank(protocolType)){
|
||||
if(MapUtils.isNotEmpty(entity.getUserRegion())&&entity.getUserRegion().containsKey("ipGroup")){
|
||||
if(entity.getAction().equals(1)){
|
||||
entity.setServiceId(128);
|
||||
}else if(entity.getAction().equals(16)){
|
||||
entity.setServiceId(16);
|
||||
}
|
||||
}
|
||||
}
|
||||
//设置service_id 改为从jsp页面获取
|
||||
// if("HTTPS".equalsIgnoreCase(protocolType)){
|
||||
// if(entity.getAction().equals(1)){
|
||||
// entity.setServiceId(592);
|
||||
// }else if(entity.getAction().equals(16)){
|
||||
// entity.setServiceId(576);
|
||||
// }
|
||||
// }else if("INTERCEPT".equalsIgnoreCase(protocolType)){
|
||||
// entity.setServiceId(512);
|
||||
// }else if("HTTP".equalsIgnoreCase(protocolType)){
|
||||
// if(entity.getAction().equals(1)){
|
||||
// entity.setServiceId(129);
|
||||
// }else if(entity.getAction().equals(16)){
|
||||
// entity.setServiceId(17);
|
||||
// }
|
||||
// }else if("MAIL".equalsIgnoreCase(protocolType)){
|
||||
// if(entity.getAction().equals(1)){
|
||||
// entity.setServiceId(132);
|
||||
// }else if(entity.getAction().equals(16)){
|
||||
// entity.setServiceId(20);
|
||||
// }
|
||||
// }else if("DNS".equalsIgnoreCase(protocolType)){
|
||||
// if(entity.getAction().equals(1)){
|
||||
// entity.setServiceId(130);
|
||||
// }else if(entity.getAction().equals(16)){
|
||||
// entity.setServiceId(18);
|
||||
// }
|
||||
// }else if("FTP".equalsIgnoreCase(protocolType)){
|
||||
// if(entity.getAction().equals(1)){
|
||||
// entity.setServiceId(133);
|
||||
// }else if(entity.getAction().equals(16)){
|
||||
// entity.setServiceId(21);
|
||||
// }
|
||||
// }else if("BGP".equalsIgnoreCase(protocolType)){
|
||||
// if(entity.getAction().equals(1)){
|
||||
// entity.setServiceId(143);
|
||||
// }else if(entity.getAction().equals(16)){
|
||||
// entity.setServiceId(31);
|
||||
// }
|
||||
// }else if("SSL".equalsIgnoreCase(protocolType)){
|
||||
// if(entity.getAction().equals(1)){
|
||||
// entity.setServiceId(131);
|
||||
// }else if(entity.getAction().equals(16)){
|
||||
// entity.setServiceId(19);
|
||||
// }
|
||||
// }else if("P2P".equalsIgnoreCase(protocolType)){
|
||||
// if(entity.getAction().equals(1)){
|
||||
// entity.setServiceId(146);
|
||||
// }else if(entity.getAction().equals(16)){
|
||||
// entity.setServiceId(34);
|
||||
// }
|
||||
// }else if("streaming_media".equalsIgnoreCase(protocolType)){
|
||||
// if(entity.getAction().equals(1)){
|
||||
// entity.setServiceId(151);
|
||||
// }else if(entity.getAction().equals(16)){
|
||||
// entity.setServiceId(39);
|
||||
// }
|
||||
// }else if("voip".equalsIgnoreCase(protocolType)){
|
||||
// if(entity.getAction().equals(1)){
|
||||
// entity.setServiceId(150);
|
||||
// }else if(entity.getAction().equals(16)){
|
||||
// entity.setServiceId(38);
|
||||
// }
|
||||
// }else if(StringUtils.isBlank(protocolType)){
|
||||
// if(MapUtils.isNotEmpty(entity.getUserRegion())&&entity.getUserRegion().containsKey("ipGroup")){
|
||||
// if(entity.getAction().equals(1)){
|
||||
// entity.setServiceId(128);
|
||||
// }else if(entity.getAction().equals(16)){
|
||||
// entity.setServiceId(16);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if(entity.getCfgId()==null){
|
||||
Integer compileId = 0;
|
||||
try {
|
||||
@@ -144,13 +190,6 @@ public class ObjectGroupService extends BaseService {
|
||||
logger.info("数据保存出错");
|
||||
throw e;
|
||||
}
|
||||
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditPolicy(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}
|
||||
|
||||
}else{
|
||||
//处理公共分组
|
||||
if(MapUtils.isNotEmpty(entity.getUserRegion())){
|
||||
@@ -180,12 +219,6 @@ public class ObjectGroupService extends BaseService {
|
||||
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditPolicy(entity, entity.getIsAudit(), Constants.UPDATE_ACTION);
|
||||
}
|
||||
}
|
||||
//更新UD_FLAG
|
||||
if(StringUtils.isNotBlank(oldCommonGroupIds)){
|
||||
@@ -255,6 +288,17 @@ public class ObjectGroupService extends BaseService {
|
||||
}
|
||||
//处理定时任务
|
||||
handelScheduleCfg(entity, entity.getIndexTable(), entity);
|
||||
//修复已经生效的配置添加定时任务
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
if(entity.getCfgId()==null){
|
||||
auditPolicy(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||
}else{
|
||||
auditPolicy(entity, entity.getIsAudit(), Constants.UPDATE_ACTION);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public CfgIndexInfo getObjGroupPolicyWithoutSubCfg(Long cfgId){
|
||||
CfgIndexInfo entity = commonPolicyDao.getPolicyById(cfgId);
|
||||
@@ -291,8 +335,38 @@ public class ObjectGroupService extends BaseService {
|
||||
|
||||
return entity;
|
||||
}
|
||||
public CfgIndexInfo getObjGroupPolicyMultyThread(Long cfgId){
|
||||
CfgIndexInfo entity = commonPolicyDao.getPolicyById(cfgId);
|
||||
entity.setUserRegion((Map<String,Object>)this.gsonFromJson(entity.getCommonGroupIds(),Map.class));
|
||||
GetSubBeanThread GetSubBeanThread1=new GetSubBeanThread(entity,"ipGroup");
|
||||
GetSubBeanThread GetSubBeanThread2=new GetSubBeanThread(entity,"subscribeIdGroup");
|
||||
GetSubBeanThread GetSubBeanThread3=new GetSubBeanThread(entity,"domainGroup");
|
||||
GetSubBeanThread GetSubBeanThread4=new GetSubBeanThread(entity,"urlGroup");
|
||||
GetSubBeanThread1.setObjectGroupDao(objectGroupDao);
|
||||
GetSubBeanThread2.setObjectGroupDao(objectGroupDao);
|
||||
GetSubBeanThread3.setObjectGroupDao(objectGroupDao);
|
||||
GetSubBeanThread4.setObjectGroupDao(objectGroupDao);
|
||||
Thread t1= new Thread(GetSubBeanThread1);
|
||||
t1.start();
|
||||
Thread t2=new Thread(GetSubBeanThread2);
|
||||
t2.start();
|
||||
Thread t3=new Thread(GetSubBeanThread3);
|
||||
t3.start();
|
||||
Thread t4= new Thread(GetSubBeanThread4);
|
||||
t4.start();
|
||||
try {
|
||||
t1.join();
|
||||
t2.join();
|
||||
t3.join();
|
||||
t4.join();
|
||||
} catch (InterruptedException e) {
|
||||
logger.error("多线程join异常",e);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
public void auditPolicy(CfgIndexInfo entity,Integer isAudit,Integer opAction) throws MaatConvertException {
|
||||
long start=System.currentTimeMillis(),end=System.currentTimeMillis();
|
||||
//修改数据库审核状态信息
|
||||
entity.setTableName(CfgIndexInfo.getTablename());
|
||||
entity.setIsAudit(isAudit);
|
||||
@@ -303,17 +377,23 @@ public class ObjectGroupService extends BaseService {
|
||||
|
||||
ToMaatBean maatBean = new ToMaatBean();
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
Set<Integer> groupIdSet=new HashSet<>();
|
||||
//确保线程安全
|
||||
Set<Integer> groupIdSet=Collections.synchronizedSet(new HashSet<Integer>());
|
||||
List<MaatCfg> configCompileList = new ArrayList();
|
||||
List<MaatCfg.GroupCfg> groupRelationList = new ArrayList();
|
||||
List<MaatCfg.IpCfg> ipRegionList = new ArrayList();
|
||||
List<MaatCfg.StringCfg> strRegionList = new ArrayList();
|
||||
List<MaatCfg.NumBoundaryCfg> numRegionList = new ArrayList();
|
||||
//确保线程安全
|
||||
List<MaatCfg.GroupCfg> groupRelationList = Collections.synchronizedList(new ArrayList<MaatCfg.GroupCfg>());
|
||||
List<MaatCfg.IpCfg> ipRegionList = Collections.synchronizedList(new ArrayList());
|
||||
List<MaatCfg.StringCfg> strRegionList = Collections.synchronizedList(new ArrayList());
|
||||
List<MaatCfg.NumBoundaryCfg> numRegionList = Collections.synchronizedList(new ArrayList());
|
||||
List<MaatCfg.DigestCfg> digestRegionList = new ArrayList();
|
||||
List<MaatCfg.IpCfg> areaIpRegionList = new ArrayList();
|
||||
|
||||
//查询子配置并修改审核状态
|
||||
//查询子配置
|
||||
entity = this.getObjGroupPolicy(entity.getCfgId());
|
||||
//多线程查询
|
||||
// entity = this.getObjGroupPolicyMultyThread(entity.getCfgId());
|
||||
end=System.currentTimeMillis();
|
||||
logger.info("查询子配置完成,耗时"+(end-start)+"ms");
|
||||
// if(StringUtils.isBlank(entity.getCommonGroupIds())){
|
||||
//
|
||||
// }
|
||||
@@ -348,57 +428,98 @@ public class ObjectGroupService extends BaseService {
|
||||
}
|
||||
}
|
||||
}
|
||||
//多线程转换配置
|
||||
long start1=System.currentTimeMillis();
|
||||
ObjGroupCfgConvert ipConvert=new ObjGroupCfgConvert("ipGroup",entity,isAudit,serviceDictMap,maatTableMap,groupIdSet);
|
||||
ipConvert.setGroupRelationList(groupRelationList);
|
||||
ipConvert.setIpRegionList(ipRegionList);
|
||||
ipConvert.setNumRegionList(numRegionList);
|
||||
ipConvert.setStrRegionList(strRegionList);
|
||||
ObjGroupCfgConvert subscribeIdConvert=new ObjGroupCfgConvert("subscribeIdGroup",entity,isAudit,serviceDictMap,maatTableMap,groupIdSet);
|
||||
subscribeIdConvert.setGroupRelationList(groupRelationList);
|
||||
subscribeIdConvert.setIpRegionList(ipRegionList);
|
||||
subscribeIdConvert.setNumRegionList(numRegionList);
|
||||
subscribeIdConvert.setStrRegionList(strRegionList);
|
||||
ObjGroupCfgConvert urlConvert=new ObjGroupCfgConvert("urlGroup",entity,isAudit,serviceDictMap,maatTableMap,groupIdSet);
|
||||
urlConvert.setGroupRelationList(groupRelationList);
|
||||
urlConvert.setIpRegionList(ipRegionList);
|
||||
urlConvert.setNumRegionList(numRegionList);
|
||||
urlConvert.setStrRegionList(strRegionList);
|
||||
ObjGroupCfgConvert domainConvert=new ObjGroupCfgConvert("domainGroup",entity,isAudit,serviceDictMap,maatTableMap,groupIdSet);
|
||||
domainConvert.setGroupRelationList(groupRelationList);
|
||||
domainConvert.setIpRegionList(ipRegionList);
|
||||
domainConvert.setNumRegionList(numRegionList);
|
||||
domainConvert.setStrRegionList(strRegionList);
|
||||
Thread t1=new Thread(ipConvert);
|
||||
Thread t2=new Thread(subscribeIdConvert);
|
||||
Thread t3=new Thread(urlConvert);
|
||||
Thread t4=new Thread(domainConvert);
|
||||
t1.start();
|
||||
t2.start();
|
||||
t3.start();
|
||||
t4.start();
|
||||
try {
|
||||
t1.join();
|
||||
t2.join();
|
||||
t3.join();
|
||||
t4.join();
|
||||
} catch (InterruptedException e) {
|
||||
logger.error("多线程join异常",e);
|
||||
}
|
||||
|
||||
//IP公共分组
|
||||
if(CollectionUtils.isNotEmpty(entity.getIpCommGroupCfgList())){
|
||||
IpPortCfg cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
//cfg.setTableName("ip_comm_cfg");
|
||||
//commonPolicyDao.auditCfg(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,ipRegionList,entity.getIpCommGroupCfgList(),1,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
ipRegionList=map.get("dstList");
|
||||
if(map.get("numRegionList")!=null){
|
||||
numRegionList.addAll(map.get("numRegionList"));
|
||||
}
|
||||
}
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(entity.getIpCommGroupCfgList())){
|
||||
// IpPortCfg cfg = new IpPortCfg();
|
||||
// BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
// //cfg.setTableName("ip_comm_cfg");
|
||||
// //commonPolicyDao.auditCfg(cfg);
|
||||
// if(isAudit==1){
|
||||
// Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,ipRegionList,entity.getIpCommGroupCfgList(),1,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// ipRegionList=map.get("dstList");
|
||||
// if(map.get("numRegionList")!=null){
|
||||
// numRegionList.addAll(map.get("numRegionList"));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//URL公共分组
|
||||
if(CollectionUtils.isNotEmpty(entity.getUrlCommGroupList())){
|
||||
CommonStringCfg cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
//cfg.setTableName(CommonStringCfg.getTablename());
|
||||
//commonPolicyDao.auditCfg(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,entity.getUrlCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(entity.getUrlCommGroupList())){
|
||||
// CommonStringCfg cfg = new CommonStringCfg();
|
||||
// BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
// //cfg.setTableName(CommonStringCfg.getTablename());
|
||||
// //commonPolicyDao.auditCfg(cfg);
|
||||
// if(isAudit==1){
|
||||
// Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,entity.getUrlCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// strRegionList=map.get("dstList");
|
||||
// }
|
||||
// }
|
||||
//账号公共分组
|
||||
if(CollectionUtils.isNotEmpty(entity.getScriberIdCommGroupList())){
|
||||
CommonStringCfg cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
//cfg.setTableName(CommonStringCfg.getTablename());
|
||||
//commonPolicyDao.auditCfg(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,entity.getScriberIdCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(entity.getScriberIdCommGroupList())){
|
||||
// CommonStringCfg cfg = new CommonStringCfg();
|
||||
// BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
// //cfg.setTableName(CommonStringCfg.getTablename());
|
||||
// //commonPolicyDao.auditCfg(cfg);
|
||||
// if(isAudit==1){
|
||||
// Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,entity.getScriberIdCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// strRegionList=map.get("dstList");
|
||||
// }
|
||||
// }
|
||||
//域名公共分组
|
||||
if(CollectionUtils.isNotEmpty(entity.getDomainCommGroupList())){
|
||||
CommonStringCfg cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
//cfg.setTableName(CommonStringCfg.getTablename());
|
||||
//commonPolicyDao.auditCfg(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,entity.getDomainCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
// if(CollectionUtils.isNotEmpty(entity.getDomainCommGroupList())){
|
||||
// CommonStringCfg cfg = new CommonStringCfg();
|
||||
// BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
// //cfg.setTableName(CommonStringCfg.getTablename());
|
||||
// //commonPolicyDao.auditCfg(cfg);
|
||||
// if(isAudit==1){
|
||||
// Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,entity.getDomainCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
// groupRelationList=map.get("groupList");
|
||||
// strRegionList=map.get("dstList");
|
||||
// }
|
||||
// }
|
||||
end=System.currentTimeMillis();
|
||||
logger.info("配置转换完成,耗时"+(end-start1)+"ms");
|
||||
//保存区域IP信息
|
||||
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||
if(!StringUtil.isEmpty(areaIpCfgList)){
|
||||
@@ -412,7 +533,6 @@ public class ObjectGroupService extends BaseService {
|
||||
areaIpRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
|
||||
//构造提交综合服务参数格式,一条配置提交一次综合服务
|
||||
if(isAudit==1){
|
||||
maatCfg.initDefaultValue();
|
||||
@@ -453,16 +573,22 @@ public class ObjectGroupService extends BaseService {
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(opAction);
|
||||
start1=System.currentTimeMillis();
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
end=System.currentTimeMillis();
|
||||
logger.info("json转换完成,耗时"+(end-start1)+"ms");
|
||||
if(json.length()<Constants.JSON_PRINT_LENTH){
|
||||
logger.info("策略对象组下发配置参数:"+json);
|
||||
}else{
|
||||
logger.info("策略对象组下发配置内容超过"+Constants.JSON_PRINT_LENTH+",不打印");
|
||||
// FileUtils.writeToFile("D:\\send.json",json,false);
|
||||
}
|
||||
//调用服务接口下发配置
|
||||
start1=System.currentTimeMillis();
|
||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
logger.info("策略对象组下发响应信息:"+result.getMsg());
|
||||
end=System.currentTimeMillis();
|
||||
logger.info("策略对象组下发响应信息:"+result.getMsg()+",耗时"+(end-start1));
|
||||
|
||||
}else if(isAudit==3){
|
||||
maatCfg.setCompileId(entity.getCompileId());
|
||||
@@ -585,6 +711,7 @@ public class ObjectGroupService extends BaseService {
|
||||
StringBuffer groupIds=new StringBuffer();
|
||||
List<PolicyGroupInfo> policyGroupInfos=new ArrayList<>();
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(functionId);
|
||||
Map<String,String> dicts=DictUtils.getDictMap("OBJ_GROUP_PROTOCOL");
|
||||
for (ObjGroupCfg c : list) {
|
||||
if(!StringUtil.isBlank(c.getCommonGroupIds())) {
|
||||
Map<String,String> groupIdMap=ConfigConvertUtil.gsonFromJson(c.getCommonGroupIds(),Map.class);
|
||||
@@ -600,12 +727,8 @@ public class ObjectGroupService extends BaseService {
|
||||
c.setActionCode(msgProp.getProperty("action_"+service.getActionCode(),"action_"+service.getActionCode()));
|
||||
}
|
||||
}
|
||||
if(c.getUserRegion1().equalsIgnoreCase("https")){
|
||||
c.setUserRegion1("HTTPS");
|
||||
}else if(c.getUserRegion1().equalsIgnoreCase("http")){
|
||||
c.setUserRegion1("HTTP");
|
||||
}else if(c.getUserRegion1().equalsIgnoreCase("intercept")){
|
||||
c.setUserRegion1(msgProp.getProperty("intercept","intercept"));
|
||||
if(dicts.containsKey(c.getUserRegion1())){
|
||||
c.setUserRegion1(msgProp.getProperty(dicts.get(c.getUserRegion1()),dicts.get(c.getUserRegion1())));
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(groupIds.toString())){
|
||||
@@ -653,7 +776,7 @@ public class ObjectGroupService extends BaseService {
|
||||
List<ObjGroupCfg> list = commonPolicyDao.getObjGroupPagedList(entity);
|
||||
List<PolicyGroupInfo> policyGroupInfos=new ArrayList<>();
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||
|
||||
Map<String,String> dicts=DictUtils.getDictMap("OBJ_GROUP_PROTOCOL");
|
||||
for (ObjGroupCfg c : list) {
|
||||
if(StringUtils.isNotBlank(c.getCommonGroupIds())) {
|
||||
Map<String,String> groupIdMap=ConfigConvertUtil.gsonFromJson(c.getCommonGroupIds(),Map.class);
|
||||
@@ -669,12 +792,8 @@ public class ObjectGroupService extends BaseService {
|
||||
c.setActionCode(msgProp.getProperty("action_"+service.getActionCode(),"action_"+service.getActionCode()));
|
||||
}
|
||||
}
|
||||
if(c.getUserRegion1().equalsIgnoreCase("https")){
|
||||
c.setUserRegion1("HTTPS");
|
||||
}else if(c.getUserRegion1().equalsIgnoreCase("http")){
|
||||
c.setUserRegion1("HTTP");
|
||||
}else if(c.getUserRegion1().equalsIgnoreCase("intercept")){
|
||||
c.setUserRegion1(msgProp.getProperty("intercept","intercept"));
|
||||
if(dicts.containsKey(c.getUserRegion1())){
|
||||
c.setUserRegion1(msgProp.getProperty(dicts.get(c.getUserRegion1()),dicts.get(c.getUserRegion1())));
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(groupIds.toString())){
|
||||
@@ -718,4 +837,57 @@ public class ObjectGroupService extends BaseService {
|
||||
|
||||
public void saveAndSend(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<BaseStringCfg<?>> stringCfgs) {
|
||||
}
|
||||
}
|
||||
}
|
||||
class GetSubBeanThread implements Runnable{
|
||||
private CfgIndexInfo cfgIndexInfo;
|
||||
private ObjectGroupDao objectGroupDao;
|
||||
private boolean isDone=false;
|
||||
private boolean isCancelled=false;
|
||||
private boolean mayInterruptIfRunning=false;
|
||||
private String groupName;
|
||||
public GetSubBeanThread(CfgIndexInfo cfgIndexInfo,String groupName){
|
||||
this.cfgIndexInfo=cfgIndexInfo;
|
||||
this.groupName=groupName;
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
getObjGroupPolicy(groupName);
|
||||
isDone=true;
|
||||
}
|
||||
|
||||
public void getObjGroupPolicy(String groupName){
|
||||
if(cfgIndexInfo.getUserRegion().containsKey(groupName)){
|
||||
String ids=cfgIndexInfo.getUserRegion().get(groupName).toString().startsWith(",")?cfgIndexInfo.getUserRegion().get(groupName).toString().substring(1):cfgIndexInfo.getUserRegion().get(groupName).toString();
|
||||
ids=ids.endsWith(",")?ids.substring(0,ids.length()-1):ids;
|
||||
if("ipGroup".equalsIgnoreCase(groupName)){
|
||||
List<IpCommCfg> ipList = objectGroupDao.getIpCommonList(ids,null);
|
||||
// synchronized (cfgIndexInfo){
|
||||
cfgIndexInfo.setIpCommGroupCfgList(ipList);
|
||||
// }
|
||||
}else if("subscribeIdGroup".equalsIgnoreCase(groupName)){
|
||||
List<ScriberIdCommCfg> stringList=objectGroupDao.getScriberIdCommonList(ids,null);
|
||||
//synchronized (cfgIndexInfo){
|
||||
cfgIndexInfo.setScriberIdCommGroupList(stringList);
|
||||
// }
|
||||
}else if("domainGroup".equalsIgnoreCase(groupName)){
|
||||
List<DomainCommCfg> stringList=objectGroupDao.getDomainCommonList(ids,null);
|
||||
// synchronized (cfgIndexInfo){
|
||||
cfgIndexInfo.setDomainCommGroupList(stringList);
|
||||
//}
|
||||
}else if("urlGroup".equalsIgnoreCase(groupName)){
|
||||
List<UrlCommCfg> stringList = objectGroupDao.getUrlCommonList(ids,null);
|
||||
// synchronized (cfgIndexInfo){
|
||||
cfgIndexInfo.setUrlCommGroupList(stringList);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ObjectGroupDao getObjectGroupDao() {
|
||||
return objectGroupDao;
|
||||
}
|
||||
|
||||
public void setObjectGroupDao(ObjectGroupDao objectGroupDao) {
|
||||
this.objectGroupDao = objectGroupDao;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1642,7 +1642,7 @@ obj_group_configuration=\u5BF9\u8C61\u7EC4\u7BA1\u7406
|
||||
domain_group=\u57DF\u540D\u7EC4
|
||||
url_group=URL\u7EC4
|
||||
subscribe_id_group=\u8D26\u53F7\u7EC4
|
||||
at_least_one_group=\u8FB7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u7EC4
|
||||
at_least_one_group=\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u7EC4
|
||||
most_seven_group=\u81F3\u591A\u53EF\u9009\u62E9\u0037\u4E2A\u7EC4
|
||||
most_eight_group=\u81F3\u591A\u53EF\u9009\u62E9\u0038\u4E2A\u7EC4
|
||||
no_common_group=ID\u4E3A%s\u7684\u914D\u7F6E\u7F3A\u5C11\u7EC4
|
||||
|
||||
@@ -106,35 +106,35 @@
|
||||
<userRegion regionKey="config_id" regionColumn="compileId" userRegionPosition="1"></userRegion>
|
||||
</service>
|
||||
<service id="31" functionId="61" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="BGP封堵">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_bgp_as_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
<service id="143" functionId="61" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="BGP监测">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_bgp_as_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
<service id="18" functionId="7" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="DNS封堵">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="3" tableName="dns_domain_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
<userRegion regionKey="DNS_STRATEGY" regionColumn="dnsStrategyId" userRegionPosition="1"></userRegion>
|
||||
</service>
|
||||
<service id="130" functionId="7" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="DNS监测">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="3" tableName="dns_domain_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
<service id="131" functionId="34" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="SSL监测">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ssl_keyword_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
<service id="19" functionId="34" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="SSL封堵">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ssl_keyword_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
<service id="67" functionId="6" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="URL白名单">
|
||||
<serviceCfg cfgType="2" tableName="http_url_cfg" ></serviceCfg>
|
||||
@@ -180,61 +180,63 @@
|
||||
</service> -->
|
||||
|
||||
<service id="132" functionId="35" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="邮件监测">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="3" tableName="mail_keyword_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID" ></serviceCfg>
|
||||
</service>
|
||||
<service id="20" functionId="35" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="邮件封堵">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="3" tableName="mail_keyword_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
|
||||
<service id="133" functionId="51" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="FTP监测">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ftp_keyword_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<!--策略对象分组只用到NTC_FTP_URL,maatTable只有策略对象下发用到 -->
|
||||
<serviceCfg cfgType="2" tableName="ftp_keyword_cfg" maatTable="NTC_FTP_URL"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
<service id="21" functionId="51" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="FTP封堵">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ftp_keyword_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE" ></serviceCfg>
|
||||
<!--策略对象分组只用到NTC_FTP_URL,maatTable只有策略对象下发用到 -->
|
||||
<serviceCfg cfgType="2" tableName="ftp_keyword_cfg" maatTable="NTC_FTP_URL"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
<service id="34" functionId="510" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="P2P封堵">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg"></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_P2P_IP"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="p2p_hash_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="p2p_keyword_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
<userRegion regionKey="P2P_IP_TYPE" regionColumn="userRegion2" userRegionPosition="0"></userRegion>
|
||||
<userRegion regionKey="P2P_HASH_TYPE" regionColumn="userRegion1" userRegionPosition="0"></userRegion>
|
||||
</service>
|
||||
<service id="146" functionId="510" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="P2P监测">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg"></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_P2P_IP"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="p2p_hash_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="p2p_keyword_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
<userRegion regionKey="P2P_IP_TYPE" regionColumn="userRegion2" userRegionPosition="0"></userRegion>
|
||||
<userRegion regionKey="P2P_HASH_TYPE" regionColumn="userRegion1" userRegionPosition="0"></userRegion>
|
||||
</service>
|
||||
<service id="39" functionId="22" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="流媒体封堵">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="av_cont_url_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="av_cont_url_cfg" maatTable="NTC_STREAMING_MEDIA_URL"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
<service id="151" functionId="22" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="流媒体监测">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="av_cont_url_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="av_cont_url_cfg" maatTable="NTC_STREAMING_MEDIA_URL"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
<service id="38" functionId="24" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="VOIP封堵">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="av_voip_account_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
<service id="150" functionId="24" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="VOIP监测">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="av_voip_account_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
|
||||
<service id="399" functionId="52" serviceType="1" tableName="file_digest_cfg" className="FileDigestCfg" desc="文件摘要监测">
|
||||
@@ -435,6 +437,6 @@
|
||||
<serviceCfg cfgType="3" tableName="http_res_head_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
</service>
|
||||
<service id="0" serviceIds="512,592,128,129" functionId="888" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="公共分组监测"></service>
|
||||
<service id="-1" serviceIds="576,16,17" functionId="888" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="公共分组阻断"></service>
|
||||
<service id="0" serviceIds="512,592,128,129,130,131,132,133,143,146,150,151" functionId="888" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="公共分组监测"></service>
|
||||
<service id="-1" serviceIds="576,16,17,18,19,20,21,31,34,38,39" functionId="888" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="公共分组阻断"></service>
|
||||
</serviceList>
|
||||
13
src/main/resources/sql/20190701/obj_protocol.sql
Normal file
13
src/main/resources/sql/20190701/obj_protocol.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
#字典值
|
||||
INSERT INTO `sys_data_dictionary_name`(`module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) VALUES ( '策略对象的几种协议', 'OBJ_GROUP_PROTOCOL', '', '', '2019-07-02 09:29:10', '2019-07-02 09:29:10', 1);
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'ftp', 'FTP', 'FTP协议', 6, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO`sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'dns', 'DNS', 'DNS协议', 5, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'mail', 'mail', '邮件协议', 4, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'intercept', 'intercept', 'HTTPS拦截', 3, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'https', 'HTTPS', 'HTTPS协议', 2, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'http', 'HTTP', 'HTTP协议', 1, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'bgp', 'BGP', 'BGP协议', 7, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'ssl', 'SSL', 'SSL协议', 8, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'p2p', 'P2P', 'P2P协议', 9, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'streaming_media', 'streaming_media', '流媒体协议', 10, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'voip', 'VoIP', 'VoIP协议', 11, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
@@ -0,0 +1,6 @@
|
||||
# HTTP(s)WhiteList 增加应答头域
|
||||
INSERT INTO `function_region_dict` (`function_id`, `config_district`, `config_region_code`, `config_region_value`, `config_desc`, `is_valid`, `is_maat`, `region_type`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('211', 'set-cookie,Content-Type,others', '4', 'PXY_CTRL_HTTP_RES_HDR', 'HTTP应答头域替换配置', '1', '1', '3', NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', '', '0,1', '0,1,2,3', '', '0,1,2', '1', '', '', '', '', '', '3', '1');
|
||||
|
||||
# HTTP(s)WhiteList 修改域配置排序
|
||||
UPDATE function_region_dict SET config_region_sort = 4 WHERE function_id = 211 AND config_region_value = 'PXY_CTRL_IP';
|
||||
UPDATE function_region_dict SET config_region_sort = 5 WHERE function_id = 211 AND config_region_value = 'PXY_CTRL_SUBSCRIBE_ID';
|
||||
@@ -148,7 +148,7 @@
|
||||
<example>${fns:unescapeHtml(html)}</example>
|
||||
</function>
|
||||
|
||||
<!-- ProcessUtil -->
|
||||
<!-- ProcessUtil wx:ProcessUtil 不存在
|
||||
<function>
|
||||
<description>根据案件状态获取标签颜色样式</description>
|
||||
<name>getCaseStateColor</name>
|
||||
@@ -162,7 +162,7 @@
|
||||
<function-class>com.nis.util.ProcessUtil</function-class>
|
||||
<function-signature>java.lang.String isAlarmDesc(int)</function-signature>
|
||||
<example>${fns:isAlarmDesc(caseState)}</example>
|
||||
</function>
|
||||
</function>-->
|
||||
|
||||
<!-- StringUtils -->
|
||||
<function>
|
||||
@@ -244,7 +244,7 @@
|
||||
<description>获取字典Map列表</description>
|
||||
<name>getDictOption</name>
|
||||
<function-class>com.nis.util.DictUtils</function-class>
|
||||
<function-signature>java.util.List getDictOption(java.lang.String)</function-signature>
|
||||
<function-signature>java.util.Map getDictOption(java.lang.String)</function-signature>
|
||||
<example>${fns:getDictOption(key)}</example>
|
||||
</function>
|
||||
|
||||
@@ -300,7 +300,7 @@
|
||||
<description>获取特征域字典对象列表</description>
|
||||
<name>getFeaturesDictData</name>
|
||||
<function-class>com.nis.util.DictUtils</function-class>
|
||||
<function-signature>java.lang.String getFeaturesDictData(java.lang.String)</function-signature>
|
||||
<function-signature>java.util.List getFeaturesDictData(java.lang.String)</function-signature>
|
||||
<example>${fns:getFeaturesDictData(itemCode)}</example>
|
||||
</function>
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
<description>根据id获取服务字典配置</description>
|
||||
<name>getServiceDictInfoById</name>
|
||||
<function-class>com.nis.util.ConfigDictUtils</function-class>
|
||||
<function-signature>java.lang.String getServiceDictInfoById(java.lang.Integer)</function-signature>
|
||||
<function-signature>com.nis.domain.basics.ServiceDictInfo getServiceDictInfoById(java.lang.Integer)</function-signature>
|
||||
<example>${fns:getServiceDictInfoById(id)}</example>
|
||||
</function>
|
||||
|
||||
@@ -341,7 +341,7 @@
|
||||
<description>根据id获取系统字典配置</description>
|
||||
<name>getSysDictInfoById</name>
|
||||
<function-class>com.nis.util.ConfigDictUtils</function-class>
|
||||
<function-signature>java.lang.String getSysDictInfoById(java.lang.Integer)</function-signature>
|
||||
<function-signature>com.nis.domain.basics.SysDictInfo getSysDictInfoById(java.lang.Integer)</function-signature>
|
||||
<example>${fns:getSysDictInfoById(id)}</example>
|
||||
</function>
|
||||
|
||||
@@ -349,7 +349,7 @@
|
||||
<description>根据id获取特定服务配置</description>
|
||||
<name>getBySpecServiceId</name>
|
||||
<function-class>com.nis.util.ConfigDictUtils</function-class>
|
||||
<function-signature>java.lang.String getBySpecServiceId(java.lang.Integer)</function-signature>
|
||||
<function-signature>com.nis.domain.specific.SpecificServiceCfg getBySpecServiceId(java.lang.Integer)</function-signature>
|
||||
<example>${fns:getBySpecServiceId(id)}</example>
|
||||
</function>
|
||||
|
||||
@@ -358,7 +358,7 @@
|
||||
<description>计算序号</description>
|
||||
<name>getNumberResult</name>
|
||||
<function-class>com.nis.util.ConfigDictUtils</function-class>
|
||||
<function-signature>java.lang.String getNumberResult(java.lang.Integer,java.lang.Integer,java.lang.Integer)</function-signature>
|
||||
<function-signature>java.lang.Integer getNumberResult(java.lang.Integer,java.lang.Integer,java.lang.Integer)</function-signature>
|
||||
<example>${fns:getNumberResult(integer1,integer2,integer3)}</example>
|
||||
</function>
|
||||
|
||||
@@ -368,7 +368,7 @@
|
||||
<description>取出数据类型</description>
|
||||
<name>getItemTypeByNo</name>
|
||||
<function-class>com.nis.util.ConfigDictUtils</function-class>
|
||||
<function-signature>java.lang.String getItemTypeByNo(java.lang.String,java.util.List)</function-signature>
|
||||
<function-signature>java.util.List getItemTypeByNo(java.lang.String,java.util.List)</function-signature>
|
||||
<example>${fns:getItemTypeByNo(str1,list)}</example>
|
||||
</function>
|
||||
|
||||
@@ -410,7 +410,7 @@
|
||||
<description>根据compileId获取crl</description>
|
||||
<name>getTrustedCrlByCerId</name>
|
||||
<function-class>com.nis.util.ConfigDictUtils</function-class>
|
||||
<function-signature>java.util.List getTrustedCrlByCerId(java.lang.Integer)</function-signature>
|
||||
<function-signature>java.lang.String getTrustedCrlByCerId(java.lang.Integer)</function-signature>
|
||||
<example>${fns:getTrustedCrlByCerId(cerId)}</example>
|
||||
</function>
|
||||
<!-- 根据表名取出运营商ISP标签集合 -->
|
||||
@@ -429,4 +429,12 @@
|
||||
<function-signature>java.util.List getASNIPNum(java.lang.Integer)</function-signature>
|
||||
<example>${fns:getASNIPNum(str)}</example>
|
||||
</function>
|
||||
<!--策略对象获取当前页面相关serviceDict-->
|
||||
<function>
|
||||
<description>获取字典对象列表</description>
|
||||
<name>getObjGroupListServiceDicts</name>
|
||||
<function-class>com.nis.util.DictUtils</function-class>
|
||||
<function-signature>java.util.Map getObjGroupListServiceDicts(java.lang.Integer)</function-signature>
|
||||
<example>${fns:getObjGroupListServiceDicts(key)}</example>
|
||||
</function>
|
||||
</taglib>
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
data:{"grouIdAndCfgId":str,"groupType":8},
|
||||
async:false,
|
||||
success:function(data,textStatus){// 处理返回结果
|
||||
if(data.length > 0){
|
||||
if(data.length > 0 && typeof(data) == 'object'){
|
||||
canDel = false;
|
||||
for(var index in data){
|
||||
tipCompileIds += ","+data[index]
|
||||
@@ -103,12 +103,15 @@
|
||||
|
||||
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
|
||||
if(v=="ok"){
|
||||
loading('onloading');
|
||||
window.location = url+"&ids="+ids+"&groupIds="+groupIds;
|
||||
}
|
||||
},{buttonsFocus:1});
|
||||
top.$('.jbox-body .jbox-icon').css('top','55px');
|
||||
|
||||
}else{ // 未选中任何 批量
|
||||
loading('onloading');
|
||||
|
||||
var myData = {};
|
||||
var groupId = $("#groupId").val();
|
||||
if($("#intype").val() != null && $("#intype").val() != ""){
|
||||
@@ -118,13 +121,12 @@
|
||||
myData["groupId"] = groupId;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
myAjax = $.ajax({
|
||||
type:'post',
|
||||
url:'${ctx}/basics/domain/ajaxCheckIsLastOneCfgBatch',
|
||||
data:myData,
|
||||
async:false,
|
||||
success:function(data,textStatus){// 处理返回结果
|
||||
if(data.length > 0){
|
||||
if(data.length > 0 && typeof(data) == 'object'){
|
||||
canDel = false;
|
||||
for(var index in data){
|
||||
tipCompileIds += ","+data[index]
|
||||
@@ -134,17 +136,24 @@
|
||||
}
|
||||
});
|
||||
|
||||
if(!canDel){
|
||||
var shortStr = tipCompileIds.length > 6? tipCompileIds.substr(0,6)+"..." : tipCompileIds ;
|
||||
tipInfoAdd = $.validator.messages.cancel_config_warn.replace("{0}","<b title='"+tipCompileIds+"'>'"+shortStr+"'</b>")+",";
|
||||
}
|
||||
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='delete_all'/>",function(v,h,f){
|
||||
if(v=="ok"){
|
||||
$("#searchForm").attr("action",url);
|
||||
page();
|
||||
}
|
||||
});
|
||||
|
||||
// myAjax异步请求完毕后执行
|
||||
$.when(myAjax).done(function() {
|
||||
if(!canDel){
|
||||
var shortStr = tipCompileIds.length > 6? tipCompileIds.substr(0,6)+"..." : tipCompileIds ;
|
||||
tipInfoAdd = $.validator.messages.cancel_config_warn.replace("{0}","<b title='"+tipCompileIds+"'>'"+shortStr+"'</b>")+",";
|
||||
}
|
||||
|
||||
top.$.jBox.closeTip();
|
||||
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='delete_all'/>",function(v,h,f){
|
||||
|
||||
if(v=="ok"){
|
||||
$("#searchForm").attr("action",url);
|
||||
page();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
data:{"grouIdAndCfgId":str,"groupType":5},
|
||||
async:false,
|
||||
success:function(data,textStatus){// 处理返回结果
|
||||
if(data.length > 0){
|
||||
if(data.length > 0 && typeof(data) == 'object'){
|
||||
canDel = false;
|
||||
for(var index in data){
|
||||
tipCompileIds += ","+data[index]
|
||||
@@ -104,12 +104,15 @@
|
||||
|
||||
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
|
||||
if(v=="ok"){
|
||||
loading('onloading');
|
||||
window.location = url+"&ids="+ids+"&groupIds="+groupIds;
|
||||
}
|
||||
},{buttonsFocus:1});
|
||||
top.$('.jbox-body .jbox-icon').css('top','55px');
|
||||
|
||||
}else{ // 未选中任何 批量
|
||||
loading('onloading');
|
||||
|
||||
var myData = {};
|
||||
var groupId = $("#groupId").val();
|
||||
if($("#intype").val() != null && $("#intype").val() != ""){
|
||||
@@ -119,13 +122,12 @@
|
||||
myData["groupId"] = groupId;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
myAjax = $.ajax({
|
||||
type:'post',
|
||||
url:'${ctx}/basics/ip/ajaxCheckIsLastOneCfgBatch',
|
||||
data:myData,
|
||||
async:false,
|
||||
success:function(data,textStatus){// 处理返回结果
|
||||
if(data.length > 0){
|
||||
if(data.length > 0 && typeof(data) == 'object'){
|
||||
canDel = false;
|
||||
for(var index in data){
|
||||
tipCompileIds += ","+data[index]
|
||||
@@ -135,16 +137,22 @@
|
||||
}
|
||||
});
|
||||
|
||||
if(!canDel){
|
||||
var shortStr = tipCompileIds.length > 6? tipCompileIds.substr(0,6)+"..." : tipCompileIds ;
|
||||
tipInfoAdd = $.validator.messages.cancel_config_warn.replace("{0}","<b title='"+tipCompileIds+"'>'"+shortStr+"'</b>")+",";
|
||||
}
|
||||
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='delete_all'/>",function(v,h,f){
|
||||
if(v=="ok"){
|
||||
$("#searchForm").attr("action",url);
|
||||
page();
|
||||
}
|
||||
});
|
||||
// myAjax异步请求完毕后执行
|
||||
$.when(myAjax).done(function() {
|
||||
if(!canDel){
|
||||
var shortStr = tipCompileIds.length > 6? tipCompileIds.substr(0,6)+"..." : tipCompileIds ;
|
||||
tipInfoAdd = $.validator.messages.cancel_config_warn.replace("{0}","<b title='"+tipCompileIds+"'>'"+shortStr+"'</b>")+",";
|
||||
}
|
||||
|
||||
top.$.jBox.closeTip();
|
||||
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='delete_all'/>",function(v,h,f){
|
||||
if(v=="ok"){
|
||||
$("#searchForm").attr("action",url);
|
||||
page();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
data:{"grouIdAndCfgId":str,"groupType":9},
|
||||
async:false,
|
||||
success:function(data,textStatus){// 处理返回结果
|
||||
if(data.length > 0){
|
||||
if(data.length > 0 && typeof(data) == 'object'){
|
||||
canDel = false;
|
||||
for(var index in data){
|
||||
tipCompileIds += ","+data[index]
|
||||
@@ -107,12 +107,15 @@
|
||||
|
||||
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
|
||||
if(v=="ok"){
|
||||
loading('onloading');
|
||||
window.location = url+"&ids="+ids+"&groupIds="+groupIds;
|
||||
}
|
||||
},{buttonsFocus:1});
|
||||
top.$('.jbox-body .jbox-icon').css('top','55px');
|
||||
|
||||
}else{ // 未选中任何 批量
|
||||
loading('onloading');
|
||||
|
||||
var myData = {};
|
||||
var groupId = $("#groupId").val();
|
||||
if($("#intype").val() != null && $("#intype").val() != ""){
|
||||
@@ -122,13 +125,12 @@
|
||||
myData["groupId"] = groupId;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
myAjax = $.ajax({
|
||||
type:'post',
|
||||
url:'${ctx}/basics/scriberId/ajaxCheckIsLastOneCfgBatch',
|
||||
data:myData,
|
||||
async:false,
|
||||
success:function(data,textStatus){// 处理返回结果
|
||||
if(data.length > 0){
|
||||
if(data.length > 0 && typeof(data) == 'object'){
|
||||
canDel = false;
|
||||
for(var index in data){
|
||||
tipCompileIds += ","+data[index]
|
||||
@@ -138,17 +140,23 @@
|
||||
}
|
||||
});
|
||||
|
||||
if(!canDel){
|
||||
var shortStr = tipCompileIds.length > 6? tipCompileIds.substr(0,6)+"..." : tipCompileIds ;
|
||||
tipInfoAdd = $.validator.messages.cancel_config_warn.replace("{0}","<b title='"+tipCompileIds+"'>'"+shortStr+"'</b>")+",";
|
||||
}
|
||||
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='delete_all'/>",function(v,h,f){
|
||||
if(v=="ok"){
|
||||
$("#searchForm").attr("action",url);
|
||||
page();
|
||||
}
|
||||
});
|
||||
|
||||
// myAjax异步请求完毕后执行
|
||||
$.when(myAjax).done(function() {
|
||||
if(!canDel){
|
||||
var shortStr = tipCompileIds.length > 6? tipCompileIds.substr(0,6)+"..." : tipCompileIds ;
|
||||
tipInfoAdd = $.validator.messages.cancel_config_warn.replace("{0}","<b title='"+tipCompileIds+"'>'"+shortStr+"'</b>")+",";
|
||||
}
|
||||
|
||||
top.$.jBox.closeTip();
|
||||
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='delete_all'/>",function(v,h,f){
|
||||
if(v=="ok"){
|
||||
$("#searchForm").attr("action",url);
|
||||
page();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
data:{"grouIdAndCfgId":str,"groupType":7},
|
||||
async:false,
|
||||
success:function(data,textStatus){// 处理返回结果
|
||||
if(data.length > 0){
|
||||
if(data.length > 0 && typeof(data) == 'object'){
|
||||
canDel = false;
|
||||
for(var index in data){
|
||||
tipCompileIds += ","+data[index]
|
||||
@@ -102,12 +102,15 @@
|
||||
|
||||
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
|
||||
if(v=="ok"){
|
||||
loading('onloading');
|
||||
window.location = url+"&ids="+ids+"&groupIds="+groupIds;
|
||||
}
|
||||
},{buttonsFocus:1});
|
||||
top.$('.jbox-body .jbox-icon').css('top','55px');
|
||||
|
||||
}else{ // 未选中任何 批量
|
||||
loading('onloading');
|
||||
|
||||
var myData = {};
|
||||
var groupId = $("#groupId").val();
|
||||
if($("#intype").val() != null && $("#intype").val() != ""){
|
||||
@@ -117,13 +120,12 @@
|
||||
myData["groupId"] = groupId;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
myAjax = $.ajax({
|
||||
type:'post',
|
||||
url:'${ctx}/basics/url/ajaxCheckIsLastOneCfgBatch',
|
||||
data:myData,
|
||||
async:false,
|
||||
success:function(data,textStatus){// 处理返回结果
|
||||
if(data.length > 0){
|
||||
if(data.length > 0 && typeof(data) == 'object'){
|
||||
canDel = false;
|
||||
for(var index in data){
|
||||
tipCompileIds += ","+data[index]
|
||||
@@ -133,16 +135,22 @@
|
||||
}
|
||||
});
|
||||
|
||||
if(!canDel){
|
||||
var shortStr = tipCompileIds.length > 6? tipCompileIds.substr(0,6)+"..." : tipCompileIds ;
|
||||
tipInfoAdd = $.validator.messages.cancel_config_warn.replace("{0}","<b title='"+tipCompileIds+"'>'"+shortStr+"'</b>")+",";
|
||||
}
|
||||
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='delete_all'/>",function(v,h,f){
|
||||
if(v=="ok"){
|
||||
$("#searchForm").attr("action",url);
|
||||
page();
|
||||
}
|
||||
});
|
||||
// myAjax异步请求完毕后执行
|
||||
$.when(myAjax).done(function() {
|
||||
if(!canDel){
|
||||
var shortStr = tipCompileIds.length > 6? tipCompileIds.substr(0,6)+"..." : tipCompileIds ;
|
||||
tipInfoAdd = $.validator.messages.cancel_config_warn.replace("{0}","<b title='"+tipCompileIds+"'>'"+shortStr+"'</b>")+",";
|
||||
}
|
||||
|
||||
top.$.jBox.closeTip();
|
||||
top.$.jBox.confirm(tipInfoAdd+"<spring:message code='confirm_message'/>","<spring:message code='delete_all'/>",function(v,h,f){
|
||||
if(v=="ok"){
|
||||
$("#searchForm").attr("action",url);
|
||||
page();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<c:if test="${cfg.functionId eq 214}">
|
||||
<c:set var="interceptType" value="Ip"/>
|
||||
<c:set var="interceptType" value="IpPayload"/>
|
||||
</c:if>
|
||||
<c:if test="${cfg.functionId eq 200}">
|
||||
<c:set var="interceptType" value="Ip"/>
|
||||
|
||||
@@ -96,12 +96,12 @@ var switchKeyringType=function(){
|
||||
|
||||
if(keyringType =='end-entity'){ //实体证书不允许输入,并且默认0
|
||||
$("input[name=expireAfter]").val(0);
|
||||
$(".expireAfter").addClass("hidden");
|
||||
//$(".expireAfter").addClass("hidden");
|
||||
}else{
|
||||
if(expireAfter == ''){
|
||||
$("input[name=expireAfter]").val(30);
|
||||
}
|
||||
$(".expireAfter").removeClass("hidden");
|
||||
//$(".expireAfter").removeClass("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ function privateFileValidate(){
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ">
|
||||
<div class="col-md-6 expireAfter">
|
||||
<div class="col-md-6 expireAfter hidden">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="expire_after"/></label>
|
||||
<div class="col-md-6">
|
||||
|
||||
@@ -313,7 +313,7 @@
|
||||
<th column="keyring_type" ><spring:message code="keyring_type"/></th>
|
||||
<th column="private_key_file" ><spring:message code="private_key_file"/></th>
|
||||
<th column="public_key_file" ><spring:message code="public_key_file"/></th>
|
||||
<th column="expire_after" ><spring:message code="expire_after"/></th>
|
||||
<%--<th column="expire_after" ><spring:message code="expire_after"/></th>--%>
|
||||
<th column="CRL" ><spring:message code="CRL"/></th>
|
||||
<th column="issuer" ><spring:message code="issuer"/></th>
|
||||
<th column="certificate_subject" ><spring:message code="certificate_subject"/></th>
|
||||
@@ -362,7 +362,7 @@
|
||||
${fn:substring(cfg.publicKeyFile,0,20) }
|
||||
</a>
|
||||
</td>
|
||||
<td>${cfg.expireAfter }</td>
|
||||
<%--<td>${cfg.expireAfter }</td>--%>
|
||||
<td>
|
||||
<a href="${cfg.crl }" target="_blank" data-original-title="${cfg.crl }"
|
||||
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||
|
||||
@@ -13,53 +13,40 @@ $(function(){
|
||||
if('${_cfg.action}'!=1 && '${_cfg.action}'!=""){
|
||||
$("[name='userRegion1'] option[value=intercept]").addClass("hidden").addClass("disabled");
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
//处理do_log
|
||||
$("[name='doLog']").each(function () {
|
||||
if($(this).val()==0){
|
||||
$(this).parent(".radio-inline").removeClass("hidden");
|
||||
}
|
||||
})
|
||||
}else{
|
||||
//处理do_log
|
||||
$("[name='doLog']").each(function () {
|
||||
if($(this).val()==0){
|
||||
$(this).parent(".radio-inline").addClass("hidden");
|
||||
}
|
||||
})
|
||||
}
|
||||
}else{}
|
||||
if('${_cfg.userRegion1}'=='intercept'){
|
||||
$(".domainGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".urlGroup").addClass("hidden").addClass("disabled");
|
||||
$(".subscribeIdGroup").addClass("hidden").addClass("disabled");
|
||||
//处理do_log
|
||||
$(".doLog").addClass("hidden");
|
||||
$("[name='doLog']").find("[value=2]").prop("checked",true);
|
||||
}else if('${_cfg.userRegion1}'=='https'||'${_cfg.userRegion1}'=='http'){
|
||||
}else if('${_cfg.userRegion1}'=='https'||'${_cfg.userRegion1}'=='http'||'${_cfg.userRegion1}'=='ftp'||'${_cfg.userRegion1}'=='streaming_media'){
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
$(".subscribeIdGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".urlGroup").removeClass("hidden").removeClass("disabled");
|
||||
}else if("${_cfg.userRegion1}"==""){
|
||||
}else if("${_cfg.userRegion1}"==""||"${_cfg.userRegion1}"=="bgp"){
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
$(".subscribeIdGroup").addClass("hidden").addClass("disabled");
|
||||
$(".urlGroup").addClass("hidden").addClass("disabled");
|
||||
}else if($("[name=userRegion1]").val()!="intercept"){
|
||||
}else if($("[name=userRegion1]").val()=="mail"||$("[name=userRegion1]").val()=="dns"||$("[name=userRegion1]").val()=="ssl"||$("[name=userRegion1]").val()=="p2p"||$("[name=userRegion1]").val()=="voip"){
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
$(".subscribeIdGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".urlGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".urlGroup").addClass("hidden").addClass("disabled");
|
||||
}
|
||||
|
||||
|
||||
changeServiceId();
|
||||
var serviceId=$("[name='serviceId']").val();
|
||||
var configDoLog=$("#serviceId_"+serviceId).attr("configDoLog");
|
||||
processDoLog(configDoLog);
|
||||
$(".action").on("change", function() {
|
||||
$("#serviceId").val($(this).attr("serviceId"));
|
||||
//$("#serviceId").val($(this).attr("serviceId"));
|
||||
changeServiceId();
|
||||
$("#protocolId").val($(this).attr("protocolId"));
|
||||
|
||||
var action=$("input[name='action']:checked").val();
|
||||
switchAction(action);
|
||||
processDoLog($(this).attr("configDoLog"));
|
||||
|
||||
//处理页面协议
|
||||
if($(this).val()!="1"){
|
||||
if($("[name='userRegion1']").val()=="intercept"){
|
||||
$("[name='userRegion1']").selectpicker("val","https");
|
||||
if($("[name='userRegion1']").val()=="intercept"){//拦截隐藏
|
||||
$("[name='userRegion1']").selectpicker("val","");
|
||||
$("[name='userRegion1']").change();
|
||||
}
|
||||
$("[name='userRegion1'] option[value=intercept]").addClass("hidden").addClass("disabled");
|
||||
@@ -68,65 +55,42 @@ $(function(){
|
||||
$("[name='userRegion1'] option[value=intercept]").removeClass("hidden").removeClass("disabled");
|
||||
if($("[name='userRegion1']").val()=="intercept"){
|
||||
$(".domainGroup").removeClass("hidden").removeClass("disabled");
|
||||
//处理do_log
|
||||
$(".doLog").addClass("hidden");
|
||||
$("[name='doLog']").each(function () {
|
||||
if($(this).val()==2){
|
||||
$(this).prop("checked",true);
|
||||
}else{
|
||||
$(this).removeAttr("checked");
|
||||
}
|
||||
})
|
||||
}else{
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
//处理do_log
|
||||
$(".doLog").removeClass("hidden");
|
||||
}
|
||||
}
|
||||
$("[name='userRegion1']").selectpicker("refresh");
|
||||
var serviceId=$("[name='serviceId']").val();
|
||||
var configDoLog=$("#serviceId_"+serviceId).attr("configDoLog");
|
||||
processDoLog(configDoLog);
|
||||
});
|
||||
$("[name='userRegion1']").on("change",function () {
|
||||
if("intercept"==$(this).val()){
|
||||
$(".urlGroup").addClass("hidden").addClass("disabled");
|
||||
$(".subscribeIdGroup").addClass("hidden").addClass("disabled");
|
||||
$(".domainGroup").removeClass("hidden").removeClass("disabled");
|
||||
//处理do_log
|
||||
$(".doLog").addClass("hidden");
|
||||
$("[name='doLog']").each(function () {
|
||||
if($(this).val()==2){
|
||||
$(this).prop("checked",true);
|
||||
}else{
|
||||
$(this).removeAttr("checked");
|
||||
}
|
||||
})
|
||||
}else if("https"==$(this).val()){
|
||||
}else if("https"==$(this).val()||"http"==$(this).val()||"ftp"==$(this).val()||"streaming_media"==$(this).val()){
|
||||
$(".urlGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".subscribeIdGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
//处理do_log
|
||||
$(".doLog").removeClass("hidden");
|
||||
}else if("http"==$(this).val()){
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
$(".urlGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".subscribeIdGroup").removeClass("hidden").removeClass("disabled");
|
||||
//处理do_log
|
||||
$(".doLog").removeClass("hidden");
|
||||
}else if(""==$(this).val()){
|
||||
}else if(""==$(this).val()||"bgp"==$(this).val()){
|
||||
$(".urlGroup").addClass("hidden").addClass("disabled");
|
||||
$(".subscribeIdGroup").addClass("hidden").addClass("disabled");
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
//处理do_log
|
||||
$(".doLog").removeClass("hidden");
|
||||
}else if("mail"==$(this).val()||"dns"==$(this).val()||"ssl"==$(this).val()||"p2p"==$(this).val()||"voip"==$(this).val()){
|
||||
$(".urlGroup").addClass("hidden").addClass("disabled");
|
||||
$(".subscribeIdGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
}else{
|
||||
$(".urlGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".subscribeIdGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".domainGroup").removeClass("hidden").removeClass("disabled");
|
||||
//处理do_log
|
||||
$(".doLog").removeClass("hidden");
|
||||
}
|
||||
changeServiceId();
|
||||
var serviceId=$("[name='serviceId']").val();
|
||||
var configDoLog=$("#serviceId_"+serviceId).attr("configDoLog");
|
||||
processDoLog(configDoLog);
|
||||
})
|
||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
@@ -162,7 +126,10 @@ $(function(){
|
||||
top.$.jBox.tip("<spring:message code='at_least_one_group'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}else{
|
||||
if($("[name='userRegion1']").val()=="http"&&ipGroupLen>0){
|
||||
if(($("[name='userRegion1']").val()=="http"||$("[name='userRegion1']").val()=="mail"||
|
||||
$("[name='userRegion1']").val()=="dns"||$("[name='userRegion1']").val()=="ftp"||
|
||||
$("[name='userRegion1']").val()=="bgp"||$("[name='userRegion1']").val()=="ssl"||
|
||||
$("[name='userRegion1']").val()=="streaming_media"||$("[name='userRegion1']").val()=="voip")&&ipGroupLen>0){
|
||||
if(grouplen>7){
|
||||
top.$.jBox.tip("<spring:message code='most_seven_group'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
@@ -177,6 +144,23 @@ $(function(){
|
||||
flag=flag1;
|
||||
}
|
||||
if(flag){
|
||||
if($("[name='userRegion1']").val()=="dns"&&$("[name='action']:checked").val()==16){
|
||||
var flag2 = true;
|
||||
var url = "${ctx}/cfg/dnsIp/dnsNoStrategyCheck";
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url: url,
|
||||
data:{"dnsStrategyId":0},
|
||||
success:function(data){
|
||||
flag2 = data;
|
||||
}
|
||||
});
|
||||
if(!flag2){
|
||||
top.$.jBox.tip($.validator.messages.noStrategyCheck, "<spring:message code='info'/>");
|
||||
return
|
||||
}
|
||||
}
|
||||
//将disable属性的元素删除
|
||||
$(".disabled").each(function(){
|
||||
$(this).remove();
|
||||
@@ -206,7 +190,64 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
$("." + contentClassName).addClass("hidden").addClass("disabled");
|
||||
$("." + addBtnClassName).removeClass("hidden");
|
||||
}
|
||||
var changeServiceId=function () {
|
||||
var action=$("[name='action']:checked").val();
|
||||
var protocolType=$("[name='userRegion1']").val();
|
||||
if(1==action){
|
||||
//512,592,128,129,130,131,132,133,143,146,150,151
|
||||
if(""==protocolType){
|
||||
|
||||
$("#serviceId").val(128);
|
||||
}else if("https"==protocolType){
|
||||
$("#serviceId").val(592);
|
||||
}else if("http"==protocolType){
|
||||
$("#serviceId").val(129);
|
||||
}else if("mail"==protocolType){
|
||||
$("#serviceId").val(132);
|
||||
}else if("dns"==protocolType){
|
||||
$("#serviceId").val(130);
|
||||
}else if("ftp"==protocolType){
|
||||
$("#serviceId").val(133);
|
||||
}else if("bgp"==protocolType){
|
||||
$("#serviceId").val(143);
|
||||
}else if("ssl"==protocolType){
|
||||
$("#serviceId").val(131);
|
||||
}else if("p2p"==protocolType){
|
||||
$("#serviceId").val(146);
|
||||
}else if("streaming_media"==protocolType){
|
||||
$("#serviceId").val(151);
|
||||
}else if("voip"==protocolType){
|
||||
$("#serviceId").val(150);
|
||||
}else if("intercept"==protocolType){
|
||||
$("#serviceId").val(512);
|
||||
}
|
||||
}else if(16==action){
|
||||
//576,16,17,18,19,20,21,31,34,38,39
|
||||
if(""==protocolType){
|
||||
$("#serviceId").val(16);
|
||||
}else if("https"==protocolType){
|
||||
$("#serviceId").val(576);
|
||||
}else if("http"==protocolType){
|
||||
$("#serviceId").val(17);
|
||||
}else if("mail"==protocolType){
|
||||
$("#serviceId").val(20);
|
||||
}else if("dns"==protocolType){
|
||||
$("#serviceId").val(18);
|
||||
}else if("ftp"==protocolType){
|
||||
$("#serviceId").val(21);
|
||||
}else if("bgp"==protocolType){
|
||||
$("#serviceId").val(31);
|
||||
}else if("ssl"==protocolType){
|
||||
$("#serviceId").val(19);
|
||||
}else if("p2p"==protocolType){
|
||||
$("#serviceId").val(34);
|
||||
}else if("streaming_media"==protocolType){
|
||||
$("#serviceId").val(39);
|
||||
}else if("voip"==protocolType){
|
||||
$("#serviceId").val(38);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -235,7 +276,10 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
<input type="hidden" name="isValid" value="${_cfg.isValid}">
|
||||
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||
<input type="hidden" id="commonGroupIds" name="commonGroupIds" value='${_cfg.commonGroupIds}'>
|
||||
<input type="hidden" id="commonGroupIds" name="commonGroupIds" value='${_cfg.commonGroupIds}'>
|
||||
<c:forEach items="${fns:getObjGroupListServiceDicts(_cfg.functionId)}" var="entry" varStatus="status">
|
||||
<input type="hidden" id="${'serviceId_'.concat(entry.key)}" value="${entry.key}" configDoLog="${entry.value['configDoLog']}">
|
||||
</c:forEach>
|
||||
<%--<input type="hidden" id="exprType" name="exprType" value="0">
|
||||
<input type="hidden" id="matchMethod" name="matchMethod" value="0">
|
||||
<input type="hidden" id="isHexbin" name="isHexbin" value="0">--%>
|
||||
@@ -342,9 +386,18 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
<div class="col-md-6">
|
||||
<select name="userRegion1" data-live-search="true" class="selectpicker form-control">
|
||||
<option value="" <c:if test="${_cfg.userRegion1 eq ''}">selected</c:if>> <spring:message code="select"/></option>
|
||||
<%-- <option value="https" <c:if test="${_cfg.userRegion1 eq 'https'}">selected</c:if>><spring:message code="HTTPS"/></option>
|
||||
<option value="intercept" <c:if test="${_cfg.userRegion1 eq 'intercept'}">selected</c:if>> <spring:message code="intercept"/></option>--%>
|
||||
<option value="http" <c:if test="${_cfg.userRegion1 eq 'http'}">selected</c:if>> <spring:message code="HTTP"/></option>
|
||||
<c:forEach items="${fns:getDictList('OBJ_GROUP_PROTOCOL')}" var="protocol">
|
||||
<c:choose>
|
||||
<c:when test="${protocol.itemCode eq 'https'}"></c:when>
|
||||
<c:when test="${protocol.itemCode eq 'intercept'}"></c:when>
|
||||
<c:otherwise>
|
||||
<option value="${protocol.itemCode}" <c:if test="${_cfg.userRegion1 eq protocol.itemCode}">selected</c:if>> <spring:message code="${protocol.itemValue}"/></option>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:forEach>
|
||||
<%--<option value="https" <c:if test="${_cfg.userRegion1 eq 'https'}">selected</c:if>><spring:message code="HTTPS"/></option>
|
||||
<option value="intercept" <c:if test="${_cfg.userRegion1 eq 'intercept'}">selected</c:if>> <spring:message code="intercept"/></option>
|
||||
<option value="http" <c:if test="${_cfg.userRegion1 eq 'http'}">selected</c:if>> <spring:message code="HTTP"/></option>--%>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -428,7 +428,7 @@
|
||||
</div>
|
||||
<sys:message content="${message}" type="${messageType }"/>
|
||||
<div class="table-responsive">
|
||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap commonGroup">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
@@ -482,9 +482,9 @@
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>
|
||||
<c:if test="${cfg.userRegion1 eq 'http'}">HTTP</c:if>
|
||||
<c:if test="${cfg.userRegion1 eq 'https'}">HTTPS</c:if>
|
||||
<c:if test="${cfg.userRegion1 eq 'intercept'}"><spring:message code="intercept"/></c:if>
|
||||
<c:forEach items="${fns:getDictList('OBJ_GROUP_PROTOCOL')}" var="protocol">
|
||||
<c:if test="${cfg.userRegion1 eq protocol.itemCode}"><spring:message code="${protocol.itemValue}"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td commonGroupIds='${cfg.commonGroupIds}'>${fn:substring(cfg.userRegion.ipGroup,1,fn:length(cfg.userRegion.ipGroup)-1)}</td>
|
||||
<td subscribeIdGroup>${fn:substring(cfg.userRegion.subscribeIdGroup,1,fn:length(cfg.userRegion.subscribeIdGroup)-1)}</td>
|
||||
|
||||
@@ -120,17 +120,13 @@
|
||||
$("select[name='httpResHdrList[0].district']").selectpicker("refresh");
|
||||
|
||||
// 域配置隐藏/显示
|
||||
if(selValue == 48){ // Redirect 隐藏响应体
|
||||
$(".resBodyCfg").addClass("hidden");
|
||||
addContent(this,'httpUrlTab');
|
||||
}else if(selValue == 80){ // Replace 隐藏请求响应体
|
||||
if(selValue == 80){ // Replace 隐藏请求响应体
|
||||
$(".reqBodyCfg").addClass("hidden");
|
||||
$(".resBodyCfg").addClass("hidden");
|
||||
}else if(selValue == 85 || selValue == 90){ // Hijack/Insert 隐藏请求头、请求体和响应体
|
||||
$(".reqHdrCfg").addClass("hidden");
|
||||
$(".resBodyCfg").addClass("hidden");
|
||||
$(".reqBodyCfg").addClass("hidden");
|
||||
$(".ntcSubscribeIdCfgCfg").addClass("hidden");
|
||||
// 且响应头匹配区域只能为Content-Type
|
||||
$("select[name='httpResHdrList[0].district']").find("option").each(function(){
|
||||
if($(this).val() != "Content-Type"){
|
||||
@@ -197,6 +193,9 @@
|
||||
getFileInfo("profileSelId",$(".profileSelDiv").attr("source"));
|
||||
}
|
||||
|
||||
// URL域必选(打开URL域并隐藏关闭按钮)
|
||||
addContent(document.getElementById("httpUrlAddButton"),'httpUrlTab');
|
||||
$(".httpUrlTab0").find("span[title='remove']").hide();
|
||||
}
|
||||
|
||||
var getFileInfo = function(selectId,source){
|
||||
@@ -255,9 +254,6 @@
|
||||
var delContent = function(contentClassName, addBtnClassName) {
|
||||
$("." + contentClassName).addClass("hidden").addClass("disabled");
|
||||
$("." + addBtnClassName).removeClass("hidden");
|
||||
if($(".userRegion5:checked").val()==48){
|
||||
addContent(this,"httpUrlTab");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
@@ -433,7 +429,7 @@
|
||||
<spring:message code="http_url_title" />
|
||||
<small> <span
|
||||
class="glyphicon glyphicon-plus ${tabName}Add"
|
||||
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
||||
onClick="addContent(this,'${tabName}')" title="add" id="httpUrlAddButton"></span></small>
|
||||
</h4>
|
||||
|
||||
<%-- <c:set var="regionValue" value="${_cfg.httpUrl.cfgType}"></c:set> --%>
|
||||
|
||||
@@ -10,8 +10,10 @@ $(function(){
|
||||
processDoLog(doLog);
|
||||
}
|
||||
$(".action").on("change",function(){
|
||||
var _doLog=$(this).attr("configDoLog");
|
||||
if(_doLog&&_doLog!=""){
|
||||
var _doLog=$(this).attr("configDoLog");
|
||||
var functionId=$("[name='functionId']").val();
|
||||
//888为策略对象策略,比较特殊
|
||||
if(_doLog&&_doLog!=""&&888!=functionId){
|
||||
processDoLog(_doLog);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -229,12 +229,7 @@ function profileChange(val){
|
||||
|
||||
// 根据动作隐藏配置域,若该域隐藏前已被选中则默认选中首个
|
||||
var resetFlag = false;
|
||||
if(val == 48){
|
||||
if($(resBodyInput).prop("checked") == true){
|
||||
resetFlag = true;
|
||||
}
|
||||
$(resBodyInput).parents("label:first").hide();
|
||||
}else if(val == 80){
|
||||
if(val == 80){
|
||||
if($(reqBodyInput).prop("checked") == true || $(resBodyInput).prop("checked") == true){
|
||||
resetFlag = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user