(1)审核修正userregion,定时userregion修正
(2)form表单monit修正,list group为空报错修复 (3)删除组下的域配置相关逻辑修正
This commit is contained in:
@@ -203,6 +203,87 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
|
||||
}
|
||||
return hasData;
|
||||
}
|
||||
/**
|
||||
* ObjGroupList配置批量失效
|
||||
* @param tableName
|
||||
* @param page
|
||||
* @param entity
|
||||
* @param list
|
||||
* @param hasData
|
||||
* @return
|
||||
* @throws NoSuchFieldException
|
||||
* @throws SecurityException
|
||||
* @throws IllegalArgumentException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
public boolean auditObjGroupListMaatData(String tableName,Page page,
|
||||
BaseCfg entity,
|
||||
List<BaseCfg> list,
|
||||
boolean hasData)throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException{
|
||||
long start=System.currentTimeMillis();
|
||||
long end=System.currentTimeMillis();
|
||||
ToMaatBean maatBean;
|
||||
MaatCfg maatCfg;
|
||||
List<MaatCfg> configCompileList;
|
||||
|
||||
maatBean = new ToMaatBean();
|
||||
configCompileList = new ArrayList();
|
||||
List<Integer> compileIds = new ArrayList();
|
||||
List<String> spoofingPoolCfgIds = new ArrayList();
|
||||
for(BaseCfg cfg:list){
|
||||
compileIds.add(cfg.getCompileId());
|
||||
}
|
||||
|
||||
if(!StringUtil.isEmpty(compileIds) && !StringUtil.isEmpty(entity.getTableName())) {
|
||||
List auditHttpCompileIds= new ArrayList();
|
||||
List deleteHttpCompileIds= new ArrayList();
|
||||
if(!StringUtil.isEmpty(auditHttpCompileIds)) {
|
||||
commonPolicyDao.auditCfgBatch("cfg_index_info", entity,auditHttpCompileIds,null);
|
||||
commonPolicyDao.auditCfgBatch("http_url_cfg", entity,auditHttpCompileIds,null);
|
||||
}
|
||||
if(!StringUtil.isEmpty(deleteHttpCompileIds)) {
|
||||
commonPolicyDao.deleteHttpUrlCfg("cfg_index_info", entity,deleteHttpCompileIds);
|
||||
commonPolicyDao.deleteHttpUrlCfg("http_url_cfg", entity,deleteHttpCompileIds);
|
||||
}
|
||||
commonPolicyDao.auditCfgBatch( entity.getTableName(), entity,compileIds,null);
|
||||
//更新各配置定时任务信息
|
||||
handelScheduleCfg(list, entity.getTableName(),entity);
|
||||
}
|
||||
commonPolicyDao.auditCfgBatch( tableName, entity,compileIds,null);
|
||||
|
||||
for(BaseCfg cfg:list){
|
||||
maatCfg = new MaatCfg();
|
||||
maatCfg.setCompileId(cfg.getCompileId());
|
||||
maatCfg.setServiceId(cfg.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
configCompileList.add(maatCfg);
|
||||
}
|
||||
page.setList(list);
|
||||
if(page.isLastPage()){
|
||||
hasData = false;
|
||||
}
|
||||
if(!StringUtil.isEmpty(configCompileList.size())){
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(maatBean);
|
||||
if(!StringUtil.isEmpty(list)) {
|
||||
logger.warn("批量配置取消("+page.getPageNo()+"次)个数:"+list.size());
|
||||
}
|
||||
//调用服务接口下发配置
|
||||
logger.warn("Maat配置批量失效-下发:start()");
|
||||
//logger.warn("Maat配置批量失效-下发:start()"+json);
|
||||
start=System.currentTimeMillis();
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||
end=System.currentTimeMillis();
|
||||
logger.warn("配置取消配置响应信息:"+result.getMsg());
|
||||
logger.warn("Maat配置批量失效-下发:end("+(end-start)+")");
|
||||
}
|
||||
return hasData;
|
||||
}
|
||||
public List<IpPortCfg> getIpDropList(String tabName,List compileIds){
|
||||
return synchronizationDao.getIpDropList(tabName, compileIds);
|
||||
}
|
||||
@@ -597,6 +678,40 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
|
||||
}
|
||||
return hasData;
|
||||
|
||||
}
|
||||
/**
|
||||
* ObjGroupList配置批量审核不通过
|
||||
* @param page
|
||||
* @param entity // 保存要审核的状态类
|
||||
* @param list // 主配置表数据(在调用前查出)
|
||||
* @param hasData // 标识是否还有数据
|
||||
* @return
|
||||
*/
|
||||
public boolean batchUnApproveObjGroupListatData(Page page, BaseCfg entity,
|
||||
List<BaseCfg> list, boolean hasData) {
|
||||
|
||||
// 1.获取所有配置的编译ID
|
||||
List<Integer> compileIds = new ArrayList();
|
||||
List<String> spoofingPoolCfgIds = new ArrayList();
|
||||
for(BaseCfg cfg:list){
|
||||
compileIds.add(cfg.getCompileId());
|
||||
}
|
||||
|
||||
// 2.更新配置审核状态(主表)
|
||||
if(!StringUtil.isEmpty(compileIds) && !StringUtil.isEmpty(entity.getTableName())) {
|
||||
commonPolicyDao.auditCfgBatch( entity.getTableName(), entity,compileIds,null); // 批量审核并修改配置审核状态(主表)
|
||||
//更新各配置定时任务信息
|
||||
handelScheduleCfg(list, entity.getTableName(),entity);
|
||||
}
|
||||
|
||||
|
||||
// 4.判断是否是当前检索条件下最后一页数据 并返回结果
|
||||
page.setList(list);
|
||||
if(page.isLastPage()){
|
||||
hasData = false;
|
||||
}
|
||||
return hasData;
|
||||
|
||||
}
|
||||
public boolean batchDeleteMaatData(List<Map<String, Object>> cfgList, Page page, BaseCfg entity,
|
||||
List<BaseCfg> list, boolean hasData) {
|
||||
|
||||
@@ -178,15 +178,21 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理ntc业务maat类配置
|
||||
* @param serviceId
|
||||
* 处理ntc业务maat类配置
|
||||
* @param cfgList
|
||||
* @param userRegionList
|
||||
* @param page
|
||||
* @param entity
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws SecurityException
|
||||
* @throws NoSuchFieldException
|
||||
* @throws IllegalAccessException
|
||||
* @throws IllegalArgumentException
|
||||
* @param isUpdateCfg
|
||||
* @param tableName
|
||||
* @throws NoSuchFieldException
|
||||
* @throws SecurityException
|
||||
* @throws IllegalArgumentException
|
||||
* @throws IllegalAccessException
|
||||
*/
|
||||
public void handleNtcMaatData(List<Map<String,Object>>cfgList,List<Map<String,Object>>userRegionList,
|
||||
Page<T> page,BaseCfg entity,HttpServletRequest request,HttpServletResponse response,
|
||||
@@ -2280,8 +2286,6 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
}
|
||||
ind++;
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
logger.info("全量同步未知业务");
|
||||
hasData = false;
|
||||
@@ -2379,7 +2383,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
cfg.setDomainCommGroupList(commIds);
|
||||
}
|
||||
}
|
||||
|
||||
compileIds.add(cfg.getCompileId());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2414,7 +2418,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
}
|
||||
|
||||
//Intercept Policy、http(s) 监测 、http(s) 白名单
|
||||
if("HTTPS".equalsIgnoreCase(entity.getUserRegion1())||"INTERCEPT".equalsIgnoreCase(entity.getUserRegion1())&&userRegion.toString().length()==0) {
|
||||
if("HTTPS".equalsIgnoreCase(cfg.getUserRegion1())||"INTERCEPT".equalsIgnoreCase(cfg.getUserRegion1())&&userRegion.toString().length()==0) {
|
||||
userRegion.append("{}");
|
||||
}
|
||||
//子配置
|
||||
@@ -2426,6 +2430,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
if(CollectionUtils.isNotEmpty(cfg.getIpCommGroupCfgList())){
|
||||
IpPortCfg _cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId"});
|
||||
_cfg.setIsValid(entity.getIsValid());
|
||||
Map<String,List> map = ConfigConvertUtil.objGroupCfgConvert(ipRegionList,cfg.getIpCommGroupCfgList(),1,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
ipRegionList=map.get("dstList");
|
||||
@@ -2438,6 +2443,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
if(CollectionUtils.isNotEmpty(cfg.getUrlCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId"});
|
||||
_cfg.setIsValid(entity.getIsValid());
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,cfg.getUrlCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
@@ -2446,7 +2452,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
if(CollectionUtils.isNotEmpty(cfg.getScriberIdCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId"});
|
||||
|
||||
_cfg.setIsValid(entity.getIsValid());
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,cfg.getScriberIdCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
@@ -2456,7 +2462,7 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
if(CollectionUtils.isNotEmpty(cfg.getDomainCommGroupList())){
|
||||
CommonStringCfg _cfg = new CommonStringCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg, new String[]{"cfgId",});
|
||||
|
||||
_cfg.setIsValid(entity.getIsValid());
|
||||
Map<String,List> map =ConfigConvertUtil.objGroupCfgConvert(strRegionList,cfg.getDomainCommGroupList(),2,_cfg,groupRelationList,maatTableMap,groupIdSet);
|
||||
groupRelationList=map.get("groupList");
|
||||
strRegionList=map.get("dstList");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.*;
|
||||
@@ -9,9 +10,7 @@ import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.*;
|
||||
import com.nis.web.dao.basics.IpCommGroupCfgDao;
|
||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||
import com.nis.web.dao.basics.UrlCommGroupDao;
|
||||
import com.nis.web.dao.basics.*;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
import com.nis.web.dao.configuration.CommonPolicyDao;
|
||||
import com.nis.web.dao.configuration.ObjectGroupDao;
|
||||
@@ -43,6 +42,10 @@ public class ObjectGroupService extends BaseService {
|
||||
private IpCommGroupCfgDao ipCommGroupCfgDao;
|
||||
@Autowired
|
||||
private UrlCommGroupDao urlCommGroupCfgDao;
|
||||
@Autowired
|
||||
private ScriberIdCommGroupDao scriberIdCommGroupDao;
|
||||
@Autowired
|
||||
private DomainCommGroupDao domainCommGroupDao;
|
||||
public Page getPolicyListList(Page searchPage, CfgIndexInfo searchCfg) {
|
||||
// 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL)
|
||||
searchCfg.getSqlMap().put("dsf", configScopeFilter(searchCfg.getCurrentUser(),"a"));
|
||||
@@ -474,7 +477,10 @@ public class ObjectGroupService extends BaseService {
|
||||
}
|
||||
//删除之后恢复组的ud_flag
|
||||
int size = ipCommGroupCfgDao.getCfgInfoByGroupIds(serviceGroupIds.toString());
|
||||
if(size==0){
|
||||
int size1 = urlCommGroupCfgDao.getCfgInfoByGroupIds(serviceGroupIds.toString());
|
||||
int size2 = scriberIdCommGroupDao.getCfgInfoByGroupIds(serviceGroupIds.toString());
|
||||
int size3 = domainCommGroupDao.getCfgInfoByGroupIds(serviceGroupIds.toString());
|
||||
if((size+size1+size2+size3)==0){
|
||||
policyGroupInfoDao.updateUdFlag(serviceGroupIds.toString(),0,null);
|
||||
}else{
|
||||
policyGroupInfoDao.updateUdFlag(serviceGroupIds.toString(),1,null);
|
||||
@@ -653,4 +659,7 @@ public class ObjectGroupService extends BaseService {
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
public void saveAndSend(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<BaseStringCfg<?>> stringCfgs) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user