(1)加入HTTP协议的Object-Group Policy
(2)修复增域删域的逻辑错误 (3)调整拦截自定义域
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.*;
|
||||
|
||||
import com.google.gson.*;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.configuration.*;
|
||||
import com.nis.web.service.BaseService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@@ -585,13 +586,13 @@ public class ConfigConvertUtil {
|
||||
* 配置分组列表
|
||||
* @return
|
||||
*/
|
||||
public static <T> Map<String, List> objGroupCfgConvert(List dstList, List<T> srcList, Integer cfgType, BaseCfg baseCfg,
|
||||
public static <T> Map<String, List> objGroupCfgConvert(Map<Integer,FunctionServiceDict> dictMap,List dstList, List<T> srcList, Integer cfgType, BaseCfg baseCfg,
|
||||
List groupRelationList, Map<String,Object> maatTableMap, Set<Integer> groupIdSet) {
|
||||
Map<String, List> map = new HashMap();
|
||||
if (cfgType == 1) {
|
||||
List numRegionList = new ArrayList();
|
||||
|
||||
Integer numGroupId = 0;
|
||||
Set<Integer> numGroupVals = new HashSet<>();
|
||||
List<Integer> regionIdList = new ArrayList<>();//ConfigServiceUtil.getId(3, srcList.size());
|
||||
for (int i = 0; i < srcList.size(); i++) {
|
||||
T srcCfg = srcList.get(i);
|
||||
@@ -632,18 +633,20 @@ public class ConfigConvertUtil {
|
||||
|
||||
// 如果protocolId非空非零,需要构造数值型域配置,多条相同协议的IP只需要一条数值域配置(目前没有不同协议IP&情况)
|
||||
//分组复用每个IP组还需要不同的数值域组么?????
|
||||
if (baseIpCfg.getProtocolId() != null && baseIpCfg.getProtocolId() != 0) {
|
||||
if (numGroupId == 0) {
|
||||
if (baseCfg!=null&&baseCfg.getServiceId()!=null&&baseCfg.getServiceId()!=0&&dictMap.containsKey(baseCfg.getServiceId())) {
|
||||
FunctionServiceDict dict=dictMap.get(baseCfg.getServiceId());
|
||||
Integer protocolId=dict.getProtocolId();
|
||||
if (!numGroupVals.contains(protocolId)) {
|
||||
GroupCfg group1 = new GroupCfg();
|
||||
group1.setGroupId(ConfigServiceUtil.getId(2, 1).get(0));
|
||||
group1.setCompileId(baseIpCfg.getCompileId());
|
||||
group1.setCompileId(baseCfg.getCompileId());
|
||||
group1.setAuditTime(baseCfg.getAuditTime());
|
||||
group1.setIsValid(baseCfg.getIsValid());
|
||||
groupRelationList.add(group1);
|
||||
NumBoundaryCfg numCfg = new NumBoundaryCfg();
|
||||
numCfg.initDefaultValue();
|
||||
numCfg.setLowBoundary(baseIpCfg.getProtocolId());
|
||||
numCfg.setUpBoundary(baseIpCfg.getProtocolId());
|
||||
numCfg.setLowBoundary(protocolId);
|
||||
numCfg.setUpBoundary(protocolId);
|
||||
numCfg.setRegionId(ConfigServiceUtil.getId(3, 1).get(0));
|
||||
numCfg.setAuditTime(baseCfg.getAuditTime());
|
||||
numCfg.setGroupId(group1.getGroupId());
|
||||
@@ -653,7 +656,7 @@ public class ConfigConvertUtil {
|
||||
}
|
||||
numRegionList.add(numCfg);
|
||||
map.put("numRegionList", numRegionList);
|
||||
numGroupId++;
|
||||
numGroupVals.add(protocolId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -835,24 +838,25 @@ public class ConfigConvertUtil {
|
||||
//exclusions
|
||||
map.put("ev_cert", 0);
|
||||
map.put("cert_transparency", 0);
|
||||
map.put("pinning", 0);
|
||||
map.put("client_cert_req", 0);
|
||||
map.put("pinning", 1);
|
||||
map.put("client_cert_req", 1);
|
||||
map.put("protocol_errors", 1);
|
||||
userRegionMap.put("exclusions", map);
|
||||
//cert_verify
|
||||
Map<String,Object> map1=new HashMap<>();
|
||||
map=new HashMap<>();
|
||||
map.put("cn",0);
|
||||
map.put("issuer",0);
|
||||
map.put("self-signed",0);
|
||||
map.put("expiration",0);
|
||||
map.put("cn",1);
|
||||
map.put("issuer",1);
|
||||
map.put("self-signed",1);
|
||||
map.put("expiration",1);
|
||||
map1.put("approach", map);
|
||||
userRegionMap.put("cert_verify", map1);
|
||||
//ssl_ver
|
||||
map=new HashMap<>();
|
||||
map.put("mirror_client", 0);
|
||||
map.put("mirror_client", 1);
|
||||
map.put("allow_http2", 1);
|
||||
map.put("min", "ssl3");
|
||||
map.put("max", "tls13");
|
||||
// map.put("min", "ssl3");
|
||||
// map.put("max", "tls13");
|
||||
userRegionMap.put("ssl_ver", map);
|
||||
//decrypt_mirror
|
||||
map=new HashMap<>();
|
||||
@@ -865,13 +869,13 @@ public class ConfigConvertUtil {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Map<String,Object> convertCommonGroupMaatTable(CfgIndexInfo cfgIndexInfo,List<Map<String, Object>> cfgList){
|
||||
public static Map<String,Object> convertCommonGroupMaatTable(CfgIndexInfo cfgIndexInfo, List<Map<String, Object>> cfgList){
|
||||
Map<String,Object> maatTableMap=new HashMap<>();
|
||||
Map<String,Object> commonGroupIds= MapUtils.isEmpty(cfgIndexInfo.getUserRegion())?(Map<String,Object>)gsonFromJson(cfgIndexInfo.getCommonGroupIds(),Map.class):cfgIndexInfo.getUserRegion();
|
||||
for (Map<String, Object> map : cfgList) {
|
||||
String cfgType = map.get("cfgType").toString();
|
||||
if (cfgType.equals("1")) {
|
||||
if(commonGroupIds.containsKey("ipGroup")){
|
||||
if(commonGroupIds.containsKey("ipGroup")&&map.containsKey("maatTable")){
|
||||
Map<String,String> ipMaatMap=new HashMap<>();
|
||||
for(String group:commonGroupIds.get("ipGroup").toString().split(",")){
|
||||
if(StringUtils.isNotBlank(group)){
|
||||
@@ -885,26 +889,28 @@ public class ConfigConvertUtil {
|
||||
maatTableMap.put("protocolMaatTable",map.get("protocolMaatTable").toString());
|
||||
}
|
||||
} else if (cfgType.equals("2")) {
|
||||
String _maatTable = map.get("maatTable").toString();
|
||||
String _maatTable = map.containsKey("maatTable")?map.get("maatTable").toString():null;
|
||||
Map<String,String> stringMaatMap=new HashMap<>();
|
||||
if(commonGroupIds.containsKey("urlGroup")&&_maatTable.toUpperCase().contains("URL")){
|
||||
for(String group:commonGroupIds.get("urlGroup").toString().split(",")){
|
||||
if(StringUtils.isNotBlank(group)){
|
||||
stringMaatMap.put(group,_maatTable);
|
||||
if(StringUtils.isNotBlank(_maatTable)){
|
||||
if(commonGroupIds.containsKey("urlGroup")&&_maatTable.toUpperCase().contains("URL")){
|
||||
for(String group:commonGroupIds.get("urlGroup").toString().split(",")){
|
||||
if(StringUtils.isNotBlank(group)){
|
||||
stringMaatMap.put(group,_maatTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(commonGroupIds.containsKey("domainGroup")&&_maatTable.toUpperCase().contains("DOMAIN")){
|
||||
for(String group:commonGroupIds.get("domainGroup").toString().split(",")){
|
||||
if(StringUtils.isNotBlank(group)){
|
||||
stringMaatMap.put(group,_maatTable);
|
||||
if(commonGroupIds.containsKey("domainGroup")&&_maatTable.toUpperCase().contains("DOMAIN")){
|
||||
for(String group:commonGroupIds.get("domainGroup").toString().split(",")){
|
||||
if(StringUtils.isNotBlank(group)){
|
||||
stringMaatMap.put(group,_maatTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(commonGroupIds.containsKey("subscribeIdGroup")&&_maatTable.toUpperCase().contains("SUBSCRIBE_ID")){
|
||||
for(String group:commonGroupIds.get("subscribeIdGroup").toString().split(",")){
|
||||
if(StringUtils.isNotBlank(group)){
|
||||
stringMaatMap.put(group,_maatTable);
|
||||
if(commonGroupIds.containsKey("subscribeIdGroup")&&_maatTable.toUpperCase().contains("SUBSCRIBE_ID")){
|
||||
for(String group:commonGroupIds.get("subscribeIdGroup").toString().split(",")){
|
||||
if(StringUtils.isNotBlank(group)){
|
||||
stringMaatMap.put(group,_maatTable);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -917,4 +923,40 @@ public class ConfigConvertUtil {
|
||||
}
|
||||
return maatTableMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取obj-list-group业务的function_service_dict
|
||||
* @param functionId
|
||||
* @return
|
||||
*/
|
||||
public static Map<Integer,FunctionServiceDict> objGetServiceDict(Integer functionId){
|
||||
Map<Integer,FunctionServiceDict> dictMap=new HashMap<>();
|
||||
ServiceConfigTemplateUtil util=new ServiceConfigTemplateUtil();
|
||||
List<Map<String,Object>> list=util.getServiceListByFunctionId(functionId);
|
||||
for(Map<String,Object> map:list){
|
||||
if(map.containsKey("serviceIds")){
|
||||
String serviceIds=map.get("serviceIds").toString();
|
||||
for(String serviceId:serviceIds.split(",")){
|
||||
List<Map<String,Object>> _mapList=util.getServiceListByServiceId(Integer.parseInt(serviceId));
|
||||
for(Map<String,Object> _map:_mapList){
|
||||
if(_map.containsKey("functionId")){
|
||||
List<FunctionServiceDict> dictList=DictUtils.getFunctionServiceDictList(Integer.parseInt(_map.get("functionId").toString()));
|
||||
for(FunctionServiceDict dict:dictList){
|
||||
dictMap.put(dict.getServiceId(),dict);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(map.containsKey("functionId")){
|
||||
List<FunctionServiceDict> dictList=DictUtils.getFunctionServiceDictList(Integer.parseInt(map.get("functionId").toString()));
|
||||
for(FunctionServiceDict dict:dictList){
|
||||
dictMap.put(dict.getServiceId(),dict);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return dictMap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.*;
|
||||
|
||||
import com.google.gson.*;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.basics.*;
|
||||
import com.nis.domain.configuration.*;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
@@ -77,6 +78,7 @@ public class SchedulerTaskUtil {
|
||||
String tableName = service.get("tableName").toString();
|
||||
String serviceType = service.get("serviceType").toString();
|
||||
String className = service.get("className").toString();
|
||||
String functionId= service.get("functionId").toString();
|
||||
BaseCfg entity = new BaseCfg();
|
||||
entity.setServiceId(serviceId);
|
||||
entity.setTableName(tableName);
|
||||
@@ -125,6 +127,7 @@ public class SchedulerTaskUtil {
|
||||
List<Map<String,Object>> userRegionList = (List<Map<String, Object>>) service.get("userRegionList");
|
||||
entity.setCompileId(compileId);
|
||||
compileIds.add(compileId);
|
||||
Map<Integer, FunctionServiceDict> serviceDictMap=ConfigConvertUtil.objGetServiceDict(Integer.parseInt(functionId));
|
||||
//查询配置
|
||||
if("cfg_index_info".equals(tableName)){
|
||||
List<CfgIndexInfo> list = configSynchronizationDao.getCfgIndexList(entity);
|
||||
@@ -208,7 +211,7 @@ public class SchedulerTaskUtil {
|
||||
if(CollectionUtils.isNotEmpty(cfg.getIpCommGroupCfgList())){
|
||||
IpPortCfg _cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(ipRegionList,cfg.getIpCommGroupCfgList(),1,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
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){
|
||||
@@ -220,7 +223,7 @@ public class SchedulerTaskUtil {
|
||||
if(CollectionUtils.isNotEmpty(cfg.getUrlCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,cfg.getUrlCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getUrlCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
@@ -229,7 +232,7 @@ public class SchedulerTaskUtil {
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,cfg.getScriberIdCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getScriberIdCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
|
||||
@@ -239,7 +242,7 @@ public class SchedulerTaskUtil {
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId","menuNameCode"});
|
||||
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,cfg.getDomainCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getDomainCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.basics.*;
|
||||
import com.nis.web.dao.configuration.*;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
@@ -3332,12 +3333,17 @@ public abstract class BaseService {
|
||||
//遍历,获取需要下发配置的组
|
||||
StringBuffer realGroupIds=new StringBuffer();
|
||||
for(PolicyGroupInfo policyGroupInfo:policyGroupInfos){
|
||||
/*
|
||||
UdFlag=0时,为组新建或者域全部删除,域全部删除时需要清空cfg_index_info与policy_group_info的关系,如果cfg_index_info已经下发,则需要更新配置去除这个组,如果是cfg_index_info中最后一个组,取消maat配置
|
||||
UdFlag=1时,组中有可选配置,obj-group-policy界面中组处于可选状态,该方法应不做任何处理
|
||||
UdFlag=2时,组跟配置有明确关联,新增组下的域配置时,如果该配置未下发过,则不用处理,如果有下发过,则需下发最新的域。
|
||||
*/
|
||||
|
||||
//if(policyGroupInfo.getUdFlag().equals(2)){
|
||||
if(!policyGroupInfo.getUdFlag().equals(1)){
|
||||
realGroupIds.append(policyGroupInfo.getServiceGroupId()).append(",");
|
||||
//}
|
||||
//所有域都删除的时候
|
||||
if(policyGroupInfo.getUdFlag().equals(0)){
|
||||
}
|
||||
//realGroupIds中包含ipDeletedGroups,urlDeletedGroups,subIdDeletedGroups,domainDeletedGroups
|
||||
if(policyGroupInfo.getUdFlag().equals(0)){//所有域都删除的时候或者新建组的时候
|
||||
if(policyGroupInfo.getGroupType().equals(Constants.IP_OBJ_GROUP_TYPE)){
|
||||
ipDeletedGroups.add(policyGroupInfo.getServiceGroupId().toString());
|
||||
}
|
||||
@@ -3364,17 +3370,13 @@ public abstract class BaseService {
|
||||
//查询cfg_index_info表,获取所有用到了这个group_id的非删除配置
|
||||
List<CfgIndexInfo> cfgIndexInfos=commonPolicyDao.getObjGroupListByGroupIds(realGroupIds.toString(),null,null);
|
||||
|
||||
CfgIndexInfo auditCfg=new CfgIndexInfo();
|
||||
auditCfg.setTableName(CfgIndexInfo.getTablename());
|
||||
auditCfg.setIsAudit(Constants.AUDIT_YES);
|
||||
auditCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
auditCfg.setAuditTime(new Date());
|
||||
List compileIds=new ArrayList();
|
||||
//组织一个大的json
|
||||
ToMaatBean maatBean = new ToMaatBean();
|
||||
ToMaatBean cancelMaatBean = new ToMaatBean();
|
||||
ServiceConfigTemplateUtil templateUtil=new ServiceConfigTemplateUtil();
|
||||
Map<String,Object> interceptUserRegionMap=new HashMap<>();
|
||||
Map<Integer,FunctionServiceDict> serviceDictMap=cfgIndexInfos.size()>0?ConfigConvertUtil.objGetServiceDict(cfgIndexInfos.get(0).getFunctionId()):new HashMap<Integer, FunctionServiceDict>();
|
||||
for(CfgIndexInfo cfgIndexInfo:cfgIndexInfos){
|
||||
Integer serviceId=cfgIndexInfo.getServiceId();
|
||||
if(serviceId!=null&&StringUtils.isNotBlank(cfgIndexInfo.getCommonGroupIds())){
|
||||
@@ -3391,35 +3393,31 @@ public abstract class BaseService {
|
||||
Map<String,Object> userRgionMap=gsonFromJson(cfgIndexInfo.getCommonGroupIds(),Map.class);
|
||||
cfgIndexInfo.setUserRegion(userRgionMap);
|
||||
String oldCommonGroupIds=cfgIndexInfo.getCommonGroupIds();
|
||||
|
||||
//将所有要从配置中删除的组从配置中删除
|
||||
this.processUserRegionMap(userRgionMap,"ipGroup",ipDeletedGroups,cfgIndexInfo,ipCommGroupCfgDao,IpCommCfg.class);
|
||||
this.processUserRegionMap(userRgionMap,"urlGroup",urlDeletedGroups,cfgIndexInfo,urlCommGroupCfgDao,UrlCommCfg.class);
|
||||
this.processUserRegionMap(userRgionMap,"subscribeIdGroup",subIdDeletedGroups,cfgIndexInfo,scriberIdCommGroupDao,ScriberIdCommCfg.class);
|
||||
this.processUserRegionMap(userRgionMap,"domainGroup",domainDeletedGroups,cfgIndexInfo,domainCommGroupDao,DomainCommCfg.class);
|
||||
|
||||
//需要更新的组
|
||||
//需要更新的组,组可能增加了,可能减少了,也有可能清空了(所有的域全删了)
|
||||
cfgIndexInfo.setCommonGroupIds(gsonToJson(userRgionMap));
|
||||
if(CollectionUtils.isEmpty(cfgIndexInfo.getIpCommGroupCfgList())&&
|
||||
CollectionUtils.isEmpty(cfgIndexInfo.getUrlCommGroupList())&&CollectionUtils.isEmpty(cfgIndexInfo.getScriberIdCommGroupList())&&
|
||||
CollectionUtils.isEmpty(cfgIndexInfo.getDomainCommGroupList())){
|
||||
if(MapUtils.isEmpty(userRgionMap)){//组清空了
|
||||
cfgIndexInfo.setCommonGroupIds("");
|
||||
if(cfgIndexInfo.getIsValid()==Constants.VALID_NO){//未生效
|
||||
if(cfgIndexInfo.getIsValid()==Constants.VALID_NO){//未生效,直接更新配置,不用下发
|
||||
toUpdateCfgIndexInfos.add(cfgIndexInfo);
|
||||
}else{//生效
|
||||
}else{//生效,需要取消配置
|
||||
cfgIndexInfo.setIsValid(Constants.VALID_NO);
|
||||
cfgIndexInfo.setIsAudit(Constants.AUDIT_NOT_YES);
|
||||
toCancelCfgIndexInfos.add(cfgIndexInfo);
|
||||
}
|
||||
}else if(!oldCommonGroupIds.equals(cfgIndexInfo.getCommonGroupIds())){
|
||||
}else if(!oldCommonGroupIds.equals(cfgIndexInfo.getCommonGroupIds())){//组有变化
|
||||
toUpdateCfgIndexInfos.add(cfgIndexInfo);
|
||||
//commonPolicyDao.updateCfgIndexCommonGroupIds(cfgIndexInfo);
|
||||
}
|
||||
|
||||
if(cfgIndexInfo.getIsValid().equals(Constants.VALID_YES)){
|
||||
if(cfgIndexInfo.getIsValid().equals(Constants.VALID_YES)){//生效配置
|
||||
//没组了,取消配置,没域了,取消配置
|
||||
if(userRgionMap.isEmpty()||(CollectionUtils.isEmpty(cfgIndexInfo.getIpCommGroupCfgList())&&
|
||||
CollectionUtils.isEmpty(cfgIndexInfo.getUrlCommGroupList())&&CollectionUtils.isEmpty(cfgIndexInfo.getScriberIdCommGroupList())&&
|
||||
CollectionUtils.isEmpty(cfgIndexInfo.getDomainCommGroupList()))){
|
||||
if(userRgionMap.isEmpty()){
|
||||
maatCfg.setCompileId(cfgIndexInfo.getCompileId());
|
||||
maatCfg.setServiceId(cfgIndexInfo.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
@@ -3466,7 +3464,7 @@ public abstract class BaseService {
|
||||
if(CollectionUtils.isNotEmpty(cfgIndexInfo.getIpCommGroupCfgList())){
|
||||
IpPortCfg cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId"});
|
||||
Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(ipRegionList,cfgIndexInfo.getIpCommGroupCfgList(),1,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
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){
|
||||
@@ -3478,7 +3476,7 @@ public abstract class BaseService {
|
||||
if(CollectionUtils.isNotEmpty(cfgIndexInfo.getUrlCommGroupList())){
|
||||
CommonStringCfg cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId"});
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,cfgIndexInfo.getUrlCommGroupList(),2,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfgIndexInfo.getUrlCommGroupList(),2,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
@@ -3487,7 +3485,7 @@ public abstract class BaseService {
|
||||
CommonStringCfg cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId"});
|
||||
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,cfgIndexInfo.getScriberIdCommGroupList(),2,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfgIndexInfo.getScriberIdCommGroupList(),2,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
|
||||
@@ -3497,7 +3495,7 @@ public abstract class BaseService {
|
||||
CommonStringCfg cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfgIndexInfo, cfg, new String[]{"cfgId"});
|
||||
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,cfgIndexInfo.getDomainCommGroupList(),2,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfgIndexInfo.getDomainCommGroupList(),2,cfgIndexInfo,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
|
||||
@@ -3539,12 +3537,12 @@ public abstract class BaseService {
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
}
|
||||
}else if(cfgIndexInfo.getIsValid().equals(Constants.VALID_NO)&&cfgIndexInfo.getIsAudit().equals(Constants.AUDIT_NOT_YES)){//生效的配置 置为了失效
|
||||
}/*else if(cfgIndexInfo.getIsValid().equals(Constants.VALID_NO)&&cfgIndexInfo.getIsAudit().equals(Constants.AUDIT_NOT_YES)){//生效的配置 置为了失效
|
||||
maatCfg.setCompileId(cfgIndexInfo.getCompileId());
|
||||
maatCfg.setServiceId(cfgIndexInfo.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
cancelConfigCompileList.add(maatCfg);
|
||||
}
|
||||
}*/
|
||||
if(cancelConfigCompileList.size()>0&&CollectionUtils.isEmpty(cancelMaatBean.getConfigCompileList())){
|
||||
cancelMaatBean.setConfigCompileList(cancelConfigCompileList);
|
||||
cancelMaatBean.setAuditTime(cfgIndexInfo.getAuditTime());
|
||||
@@ -3566,10 +3564,10 @@ 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();
|
||||
|
||||
@@ -2393,6 +2393,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
commonPolicyDao.auditCfgBatch( entity.getTableName(), entity,compileIds,null);
|
||||
}
|
||||
}
|
||||
Map<Integer,FunctionServiceDict> serviceDictMap=ConfigConvertUtil.objGetServiceDict(entity.getFunctionId());
|
||||
//批量获取regionId,groupId(相同编译下的IP类配置多条ip只获取一个组号),分组复用的域配置不需要重新获取regionId,groupId
|
||||
// List<Integer> regionIds = ConfigServiceUtil.getId(3, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size());
|
||||
// List<Integer> groupIds = ConfigServiceUtil.getId(2, ipList.size()+strList.size()+complexStrList.size()+numList.size()+fileList.size());
|
||||
@@ -2436,7 +2437,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
_cfg.setIsValid(entity.getIsValid());
|
||||
_cfg.setIsAudit(entity.getIsAudit());
|
||||
_cfg.setAuditTime(entity.getAuditTime());
|
||||
Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(ipRegionList,cfg.getIpCommGroupCfgList(),1,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
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){
|
||||
@@ -2451,7 +2452,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
_cfg.setIsValid(entity.getIsValid());
|
||||
_cfg.setIsAudit(entity.getIsAudit());
|
||||
_cfg.setAuditTime(entity.getAuditTime());
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,cfg.getUrlCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getUrlCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
@@ -2462,7 +2463,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
_cfg.setIsValid(entity.getIsValid());
|
||||
_cfg.setIsAudit(entity.getIsAudit());
|
||||
_cfg.setAuditTime(entity.getAuditTime());
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,cfg.getScriberIdCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getScriberIdCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
|
||||
@@ -2474,7 +2475,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
_cfg.setIsValid(entity.getIsValid());
|
||||
_cfg.setIsAudit(entity.getIsAudit());
|
||||
_cfg.setAuditTime(entity.getAuditTime());
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,cfg.getDomainCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,cfg.getDomainCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
|
||||
@@ -93,9 +93,7 @@ public class ObjectGroupService extends BaseService {
|
||||
entity.setIsValid(0);
|
||||
entity.setIsAudit(0);
|
||||
//设置service_id
|
||||
if("HTTP".equalsIgnoreCase(protocolType)){
|
||||
|
||||
}else if("HTTPS".equalsIgnoreCase(protocolType)){
|
||||
if("HTTPS".equalsIgnoreCase(protocolType)){
|
||||
if(entity.getAction().equals(1)){
|
||||
entity.setServiceId(592);
|
||||
}else if(entity.getAction().equals(16)){
|
||||
@@ -103,6 +101,12 @@ public class ObjectGroupService extends BaseService {
|
||||
}
|
||||
}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);
|
||||
}
|
||||
}
|
||||
if(entity.getCfgId()==null){
|
||||
Integer compileId = 0;
|
||||
@@ -296,6 +300,8 @@ public class ObjectGroupService extends BaseService {
|
||||
Integer serviceId=entity.getServiceId();
|
||||
Map<String,Object> maatTableMap=new HashMap<>();
|
||||
|
||||
Map<Integer,FunctionServiceDict> serviceDictMap=ConfigConvertUtil.objGetServiceDict(entity.getFunctionId());
|
||||
|
||||
StringBuffer userRegion=new StringBuffer();
|
||||
if(serviceId!=null){
|
||||
if(isAudit==1){
|
||||
@@ -326,7 +332,7 @@ public class ObjectGroupService extends BaseService {
|
||||
//cfg.setTableName("ip_comm_cfg");
|
||||
//commonPolicyDao.auditCfg(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(ipRegionList,entity.getIpCommGroupCfgList(),1,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
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){
|
||||
@@ -341,7 +347,7 @@ public class ObjectGroupService extends BaseService {
|
||||
//cfg.setTableName(CommonStringCfg.getTablename());
|
||||
//commonPolicyDao.auditCfg(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,entity.getUrlCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,entity.getUrlCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
@@ -353,7 +359,7 @@ public class ObjectGroupService extends BaseService {
|
||||
//cfg.setTableName(CommonStringCfg.getTablename());
|
||||
//commonPolicyDao.auditCfg(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,entity.getScriberIdCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,entity.getScriberIdCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
@@ -365,7 +371,7 @@ public class ObjectGroupService extends BaseService {
|
||||
//cfg.setTableName(CommonStringCfg.getTablename());
|
||||
//commonPolicyDao.auditCfg(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,entity.getDomainCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(serviceDictMap,strRegionList,entity.getDomainCommGroupList(),2,cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user