Merge branch 'develop_no_common_group' of git@git.mesalab.cn:K18_NTCS_WEB/NTC.git into develop_no_common_group
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.nis.util;
|
package com.nis.util;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -588,12 +589,13 @@ public class ConfigConvertUtil {
|
|||||||
*/
|
*/
|
||||||
public static <T> Map<String, List> objGroupCfgConvert(Map<Integer,FunctionServiceDict> dictMap,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) {
|
List groupRelationList, Map<String,Object> maatTableMap, Set<Integer> groupIdSet) {
|
||||||
|
long start=System.currentTimeMillis(),end=0l;
|
||||||
Map<String, List> map = new HashMap();
|
Map<String, List> map = new HashMap();
|
||||||
if (cfgType == 1) {
|
if (cfgType == 1) {
|
||||||
List numRegionList = new ArrayList();
|
List numRegionList = new ArrayList();
|
||||||
|
int pos=0;
|
||||||
Set<Integer> numGroupVals = new HashSet<>();
|
Set<Integer> numGroupVals = new HashSet<>();
|
||||||
List<Integer> regionIdList = new ArrayList<>();//ConfigServiceUtil.getId(3, srcList.size());
|
List<Integer> regionIdList = calRangeIps(srcList);//ConfigServiceUtil.getId(3, srcList.size());
|
||||||
for (int i = 0; i < srcList.size(); i++) {
|
for (int i = 0; i < srcList.size(); i++) {
|
||||||
T srcCfg = srcList.get(i);
|
T srcCfg = srcList.get(i);
|
||||||
BaseIpCfg baseIpCfg = new BaseIpCfg();
|
BaseIpCfg baseIpCfg = new BaseIpCfg();
|
||||||
@@ -622,17 +624,17 @@ public class ConfigConvertUtil {
|
|||||||
}
|
}
|
||||||
List<IpCfg> cfgs = ipConvert(cfg, baseIpCfg);
|
List<IpCfg> cfgs = ipConvert(cfg, baseIpCfg);
|
||||||
if (cfgs.size() > 1) {
|
if (cfgs.size() > 1) {
|
||||||
List<Integer> ids = ConfigServiceUtil.getId(3, cfgs.size() - 1);
|
List<Integer> ids =regionIdList.subList(pos,pos+cfgs.size());
|
||||||
regionIdList.addAll(ids);
|
|
||||||
//支持range????
|
//支持range????
|
||||||
for (int j = 1; j < cfgs.size(); j++) {
|
for (int j = 1; j < cfgs.size(); j++) {
|
||||||
cfgs.get(j).setRegionId(ids.get(j-1));
|
cfgs.get(j).setRegionId(ids.get(j-1));
|
||||||
}
|
}
|
||||||
|
pos+=cfgs.size();
|
||||||
}
|
}
|
||||||
dstList.addAll(cfgs);
|
dstList.addAll(cfgs);
|
||||||
|
|
||||||
// 如果protocolId非空非零,需要构造数值型域配置,多条相同协议的IP只需要一条数值域配置(目前没有不同协议IP&情况)
|
// 如果protocolId非空非零,需要构造数值型域配置,多条相同协议的IP只需要一条数值域配置(目前没有不同协议IP&情况)
|
||||||
//分组复用每个IP组还需要不同的数值域组么?????
|
//分组复用每个IP组还需要不同的数值域组么????? answer:一个就行了
|
||||||
if (baseCfg!=null&&baseCfg.getServiceId()!=null&&baseCfg.getServiceId()>0&&dictMap.containsKey(baseCfg.getServiceId())) {
|
if (baseCfg!=null&&baseCfg.getServiceId()!=null&&baseCfg.getServiceId()>0&&dictMap.containsKey(baseCfg.getServiceId())) {
|
||||||
FunctionServiceDict dict=dictMap.get(baseCfg.getServiceId());
|
FunctionServiceDict dict=dictMap.get(baseCfg.getServiceId());
|
||||||
Integer protocolId=dict.getProtocolId();
|
Integer protocolId=dict.getProtocolId();
|
||||||
@@ -741,43 +743,8 @@ public class ConfigConvertUtil {
|
|||||||
}
|
}
|
||||||
map.put("groupList", groupRelationList);
|
map.put("groupList", groupRelationList);
|
||||||
map.put("dstList", dstList);
|
map.put("dstList", dstList);
|
||||||
return map;
|
end=System.currentTimeMillis();
|
||||||
}
|
logger.info("objGroupCfgConvert cost:"+(end-start));
|
||||||
public static <T> Map<String, List> emptyGroupConvert(Integer cfgType, BaseCfg baseCfg,
|
|
||||||
List groupRelationList, Map<String,Object> maatTableMap, Set<Integer> groupIdSet) {
|
|
||||||
Map<String, List> map = new HashMap();
|
|
||||||
if (cfgType == 1) {
|
|
||||||
if(maatTableMap.containsKey("ipMaatTable")){
|
|
||||||
Map<String,String> groupMap=(Map<String,String>)maatTableMap.get("ipMaatTable");
|
|
||||||
for(Map.Entry<String,String> e:groupMap.entrySet()){
|
|
||||||
if(!groupIdSet.contains(Integer.parseInt(e.getKey()))){
|
|
||||||
GroupCfg group = new GroupCfg();
|
|
||||||
group.setGroupId(Integer.parseInt(e.getKey()));
|
|
||||||
group.setCompileId(baseCfg.getCompileId());
|
|
||||||
group.setAuditTime(baseCfg.getAuditTime());
|
|
||||||
group.setIsValid(baseCfg.getIsValid());
|
|
||||||
groupRelationList.add(group);
|
|
||||||
groupIdSet.add(Integer.parseInt(e.getKey()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (cfgType == 2 || cfgType == 3) {
|
|
||||||
if(maatTableMap.containsKey("stringMaatTable")){
|
|
||||||
Map<String,String> groupMap=(Map<String,String>)maatTableMap.get("stringMaatTable");
|
|
||||||
for(Map.Entry<String,String> e:groupMap.entrySet()){
|
|
||||||
if(!groupIdSet.contains(Integer.parseInt(e.getKey()))){
|
|
||||||
GroupCfg group = new GroupCfg();
|
|
||||||
group.setGroupId(Integer.parseInt(e.getKey()));
|
|
||||||
group.setCompileId(baseCfg.getCompileId());
|
|
||||||
group.setAuditTime(baseCfg.getAuditTime());
|
|
||||||
group.setIsValid(baseCfg.getIsValid());
|
|
||||||
groupRelationList.add(group);
|
|
||||||
groupIdSet.add(Integer.parseInt(e.getKey()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
map.put("groupList", groupRelationList);
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -960,4 +927,59 @@ public class ConfigConvertUtil {
|
|||||||
}
|
}
|
||||||
return dictMap;
|
return dictMap;
|
||||||
}
|
}
|
||||||
|
public static <T>List<Integer> calRangeIps(List<T> srcList ){
|
||||||
|
List<Integer> regionIdsList=new ArrayList<>();
|
||||||
|
int total=0;
|
||||||
|
//通过反射获取IP的src ip地址,目的IP地址
|
||||||
|
Class clazz=null;
|
||||||
|
Field srcIpAddressField=null,destIpAddressField=null,ipTypeFild=null;
|
||||||
|
for(T instance:srcList){
|
||||||
|
if(clazz==null&&srcIpAddressField==null&&destIpAddressField==null){
|
||||||
|
try {
|
||||||
|
clazz=instance.getClass();
|
||||||
|
srcIpAddressField=clazz.getDeclaredField("srcIpAddress");
|
||||||
|
srcIpAddressField.setAccessible(true);
|
||||||
|
destIpAddressField=clazz.getDeclaredField("destIpAddress");
|
||||||
|
destIpAddressField.setAccessible(true);
|
||||||
|
ipTypeFild=clazz.getDeclaredField("ipType");
|
||||||
|
ipTypeFild.setAccessible(true);
|
||||||
|
} catch (NoSuchFieldException e) {
|
||||||
|
return regionIdsList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
String srcIpAddressValue=(String)srcIpAddressField.get(instance);
|
||||||
|
String destIpAddressValue=(String)destIpAddressField.get(instance);
|
||||||
|
Integer ipType=(Integer)ipTypeFild.get(instance);
|
||||||
|
if(ipType.equals(4)){
|
||||||
|
long left=1,right=1;
|
||||||
|
if(srcIpAddressValue.indexOf("-")>-1){
|
||||||
|
String[] srcIpAddressValueArray=srcIpAddressValue.split("-");
|
||||||
|
int startPos=0,endPos=0;
|
||||||
|
startPos=Integer.parseInt(srcIpAddressValueArray[0].split("\\.")[3]);
|
||||||
|
endPos=Integer.parseInt(srcIpAddressValueArray[1].split("\\.")[3]);
|
||||||
|
left=endPos-startPos+1;
|
||||||
|
}
|
||||||
|
if(destIpAddressValue.indexOf("-")>-1){
|
||||||
|
String[] destIpAddressValueArray=srcIpAddressValue.split("-");
|
||||||
|
int startPos=0,endPos=0;
|
||||||
|
startPos=Integer.parseInt(destIpAddressValueArray[0].split("\\.")[3]);
|
||||||
|
endPos=Integer.parseInt(destIpAddressValueArray[1].split("\\.")[3]);
|
||||||
|
right=endPos-startPos+1;
|
||||||
|
}
|
||||||
|
total+=left*right;
|
||||||
|
}else{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return regionIdsList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(total>0){
|
||||||
|
regionIdsList=ConfigServiceUtil.getId(3,total);
|
||||||
|
}
|
||||||
|
|
||||||
|
return regionIdsList;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ public class ObjectGroupController extends BaseController {
|
|||||||
entity.setFunctionId(functionId);
|
entity.setFunctionId(functionId);
|
||||||
try {
|
try {
|
||||||
if(StringUtils.isBlank(entity.getCommonGroupIds())){
|
if(StringUtils.isBlank(entity.getCommonGroupIds())){
|
||||||
tip.append(String.format(props.getProperty("no_common_group","The configuration ID of %s does not have an group;"),id));
|
tip.append(String.format(props.getProperty("no_common_group","The configuration ID of %s does not have an group;"),entity.getCompileId()));
|
||||||
tip.append("<br/>");
|
tip.append("<br/>");
|
||||||
}else{
|
}else{
|
||||||
objectGroupService.auditPolicy(entity,isAudit,Constants.INSERT_ACTION);
|
objectGroupService.auditPolicy(entity,isAudit,Constants.INSERT_ACTION);
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ public class ConfigStatisticsController extends BaseController {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("带宽详情数据获取错误"+e);
|
logger.error("带宽详情数据获取错误"+e);
|
||||||
|
map.put("error","request_service_failed");
|
||||||
LogUtils.saveLog(request, null, e, null);
|
LogUtils.saveLog(request, null, e, null);
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
|
|||||||
@@ -324,5 +324,29 @@ public class CommonGroupManageService extends BaseService{
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean checkCancelCfg(String groupId, Integer groupType) {
|
||||||
|
boolean flag = false;
|
||||||
|
String keyString = "";
|
||||||
|
if(groupType == Constants.IP_OBJ_GROUP_TYPE) { // IP
|
||||||
|
keyString = "ipGroup";
|
||||||
|
}else if(groupType == Constants.URL_OBJ_GROUP_TYPE) { // URL
|
||||||
|
keyString = "urlGroup";
|
||||||
|
}else if(groupType == Constants.DOMAIN_OBJ_GROUP_TYPE) { // Domain
|
||||||
|
keyString = "domainGroup";
|
||||||
|
}else if(groupType == Constants.SUBID_OBJ_GROUP_TYPE) { // ScriberId
|
||||||
|
keyString = "subscribeIdGroup";
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String,String> searchMap = new HashMap<String,String>();
|
||||||
|
searchMap.put(keyString, ","+groupId+",");
|
||||||
|
|
||||||
|
Integer compileId = commonGroupManageDao.getCompileIdByGroupId(gsonToJson(searchMap));
|
||||||
|
if(compileId != null) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.nis.domain.configuration.CfgIndexInfo;
|
|||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.ConfigServiceUtil;
|
import com.nis.util.ConfigServiceUtil;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.util.StringUtils;
|
import com.nis.util.StringUtils;
|
||||||
import com.nis.web.controller.configuration.ObjectGroupController;
|
import com.nis.web.controller.configuration.ObjectGroupController;
|
||||||
import com.nis.web.dao.CrudDao;
|
import com.nis.web.dao.CrudDao;
|
||||||
@@ -154,16 +155,27 @@ public class DomainCommGroupService extends CrudService<CrudDao<DomainCommCfg>,
|
|||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void delete(String ids, String groupIds, DomainCommCfg cfg, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
public void delete(String ids, String groupIds, DomainCommCfg cfg, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
if(ids == null) {
|
if(ids == null) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
|
Page<DomainCommCfg> page = new Page<DomainCommCfg>(request, response, "r");
|
||||||
|
page.setOrderBy("");
|
||||||
|
page.setPageSize(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
|
||||||
|
boolean hasData = true;
|
||||||
|
while(hasData){
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
cfg.setIsValid(null);
|
||||||
|
|
||||||
|
List<DomainCommCfg> list = this.findPage(page, cfg).getList();
|
||||||
|
if(!StringUtil.isEmpty(list)) {
|
||||||
groupIds = "";
|
groupIds = "";
|
||||||
String cfgIds = "";
|
String cfgIds = "";
|
||||||
String serviceGroupIds = "";
|
String serviceGroupIds = "";
|
||||||
|
|
||||||
// 删除操作后获取 ①需配置更新的分组(存在域配置)②需配置取消的分组(无域配置) -> 配置分别操作更新或取消
|
for (DomainCommCfg domainCommCfg : list) {
|
||||||
List<DomainCommCfg> set = domainCommGroupDao.getGroupIds(cfg);
|
|
||||||
if(set.size() == 0) { // 无可删除配置
|
|
||||||
return;
|
|
||||||
}else {
|
|
||||||
for (DomainCommCfg domainCommCfg : set) {
|
|
||||||
Integer groupId = domainCommCfg.getGroupId();
|
Integer groupId = domainCommCfg.getGroupId();
|
||||||
cfgIds += ","+domainCommCfg.getCfgId();
|
cfgIds += ","+domainCommCfg.getCfgId();
|
||||||
if(!serviceGroupIds.contains(groupId+"")) {
|
if(!serviceGroupIds.contains(groupId+"")) {
|
||||||
@@ -172,15 +184,20 @@ public class DomainCommGroupService extends CrudService<CrudDao<DomainCommCfg>,
|
|||||||
}
|
}
|
||||||
cfgIds = cfgIds.substring(1);
|
cfgIds = cfgIds.substring(1);
|
||||||
serviceGroupIds = serviceGroupIds.substring(1);
|
serviceGroupIds = serviceGroupIds.substring(1);
|
||||||
}
|
|
||||||
domainCommGroupDao.delete(cfgIds);
|
domainCommGroupDao.delete(cfgIds);
|
||||||
|
|
||||||
|
// 删除操作后获取 ①需配置更新的分组(存在域配置)②需配置取消的分组(无域配置) -> 配置分别操作更新或取消
|
||||||
String[] strings = serviceGroupIds.split(",");
|
String[] strings = serviceGroupIds.split(",");
|
||||||
serviceGroupIds = "";
|
serviceGroupIds = "";
|
||||||
for (String groupId : strings) {
|
for (String groupId : strings) {
|
||||||
Integer size = domainCommGroupDao.getCfgInfoByGroupIds(groupId);
|
Integer size = domainCommGroupDao.getCfgInfoByGroupIds(groupId);
|
||||||
if(size == 0) { // 需配置取消
|
if(size == 0) { // 需配置取消
|
||||||
|
boolean flag = groupManageService.checkCancelCfg(groupId, Constants.DOMAIN_OBJ_GROUP_TYPE);
|
||||||
|
if(flag) { // 需配置更新
|
||||||
serviceGroupIds += ","+groupId;
|
serviceGroupIds += ","+groupId;
|
||||||
|
}else {
|
||||||
|
groupIds += ","+groupId;
|
||||||
|
}
|
||||||
}else { // 需配置更新
|
}else { // 需配置更新
|
||||||
groupIds += ","+groupId;
|
groupIds += ","+groupId;
|
||||||
}
|
}
|
||||||
@@ -193,28 +210,6 @@ public class DomainCommGroupService extends CrudService<CrudDao<DomainCommCfg>,
|
|||||||
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request,response,"r");
|
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request,response,"r");
|
||||||
Properties props = groupController.getMsgProp();
|
Properties props = groupController.getMsgProp();
|
||||||
|
|
||||||
// 配置未生效
|
|
||||||
/*String updateStatusGroupIds = "";
|
|
||||||
for (String groupId : serviceGroupIds.split(",")) {
|
|
||||||
List<CfgIndexInfo> list = commonPolicyDao.getObjGroupListByGroupIds(groupId, 888, Constants.VALID_NO);
|
|
||||||
if(list.size() > 0) {
|
|
||||||
updateStatusGroupIds += ","+groupId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(updateStatusGroupIds)) {
|
|
||||||
updateStatusGroupIds = updateStatusGroupIds.substring(1);
|
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
|
||||||
entity.setUserRegion5(updateStatusGroupIds);
|
|
||||||
entity.setFunctionId(888);
|
|
||||||
entity.setCommonGroupIds("");
|
|
||||||
entity.setIsValid(Constants.VALID_NO);
|
|
||||||
commonPolicyDao.updateCfgIndexCommonGroupIdsBatch(entity);
|
|
||||||
|
|
||||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(updateStatusGroupIds);
|
|
||||||
groupManageService.updateGroupStatus(policyGroupInfos, Constants.DOMAIN_OBJ_GROUP_TYPE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// 配置已生效
|
|
||||||
// 组下无域配置common_group_ids -> "",ud_flag -> 0
|
// 组下无域配置common_group_ids -> "",ud_flag -> 0
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
entity.setUserRegion5(serviceGroupIds);
|
entity.setUserRegion5(serviceGroupIds);
|
||||||
@@ -235,9 +230,18 @@ public class DomainCommGroupService extends CrudService<CrudDao<DomainCommCfg>,
|
|||||||
if(StringUtils.isNotBlank(groupIds)) {
|
if(StringUtils.isNotBlank(groupIds)) {
|
||||||
groupIds = groupIds.substring(1);
|
groupIds = groupIds.substring(1);
|
||||||
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, Constants.DOMAIN_OBJ_GROUP_TYPE);
|
||||||
transObjGroupToMaat(policyGroupInfos);
|
transObjGroupToMaat(policyGroupInfos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
hasData = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long end = System.currentTimeMillis();
|
||||||
|
logger.warn("域名组域配置,批量删除耗时:"+(end-start));
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
||||||
domainCommGroupDao.delete(ids);
|
domainCommGroupDao.delete(ids);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import com.nis.domain.configuration.CfgIndexInfo;
|
|||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.ConfigServiceUtil;
|
import com.nis.util.ConfigServiceUtil;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.util.StringUtils;
|
import com.nis.util.StringUtils;
|
||||||
import com.nis.web.controller.configuration.ObjectGroupController;
|
import com.nis.web.controller.configuration.ObjectGroupController;
|
||||||
import com.nis.web.dao.basics.CommonGroupManageDao;
|
import com.nis.web.dao.basics.CommonGroupManageDao;
|
||||||
@@ -147,16 +148,27 @@ public class IpCommGroupCfgService extends BaseService {
|
|||||||
|
|
||||||
public void delete(String ids, String groupIds, IpCommCfg cfg, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
public void delete(String ids, String groupIds, IpCommCfg cfg, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
if(ids == null) {
|
if(ids == null) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
|
Page<IpCommCfg> page = new Page<IpCommCfg>(request, response, "r");
|
||||||
|
page.setOrderBy("");
|
||||||
|
page.setPageSize(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
|
||||||
|
boolean hasData = true;
|
||||||
|
while(hasData){
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
cfg.setIsValid(null);
|
||||||
|
|
||||||
|
List<IpCommCfg> list = this.findPage(page, cfg).getList();
|
||||||
|
if(!StringUtil.isEmpty(list)) {
|
||||||
groupIds = "";
|
groupIds = "";
|
||||||
String cfgIds = "";
|
String cfgIds = "";
|
||||||
String serviceGroupIds = "";
|
String serviceGroupIds = "";
|
||||||
|
|
||||||
// 删除操作后获取 ①需配置更新的分组(存在域配置)②需配置取消的分组(无域配置)-> 配置分别操作更新或取消
|
for (IpCommCfg ipCommCfg : list) {
|
||||||
List<IpCommCfg> set = ipCommGroupCfgDao.getGroupIds(cfg);
|
|
||||||
if(set.size() == 0) { // 无可删除配置
|
|
||||||
return;
|
|
||||||
}else {
|
|
||||||
for (IpCommCfg ipCommCfg : set) {
|
|
||||||
Integer groupId = ipCommCfg.getGroupId();
|
Integer groupId = ipCommCfg.getGroupId();
|
||||||
cfgIds += ","+ipCommCfg.getCfgId();
|
cfgIds += ","+ipCommCfg.getCfgId();
|
||||||
if(!serviceGroupIds.contains(groupId+"")) {
|
if(!serviceGroupIds.contains(groupId+"")) {
|
||||||
@@ -165,15 +177,20 @@ public class IpCommGroupCfgService extends BaseService {
|
|||||||
}
|
}
|
||||||
cfgIds = cfgIds.substring(1);
|
cfgIds = cfgIds.substring(1);
|
||||||
serviceGroupIds = serviceGroupIds.substring(1);
|
serviceGroupIds = serviceGroupIds.substring(1);
|
||||||
}
|
|
||||||
ipCommGroupCfgDao.delete(cfgIds);
|
ipCommGroupCfgDao.delete(cfgIds);
|
||||||
|
|
||||||
|
// 删除操作后获取 ①需配置更新的分组(存在域配置)②需配置取消的分组(无域配置)-> 配置分别操作更新或取消
|
||||||
String[] strings = serviceGroupIds.split(",");
|
String[] strings = serviceGroupIds.split(",");
|
||||||
serviceGroupIds = "";
|
serviceGroupIds = "";
|
||||||
for (String groupId : strings) {
|
for (String groupId : strings) {
|
||||||
Integer size = ipCommGroupCfgDao.getCfgInfoByGroupIds(groupId);
|
Integer size = ipCommGroupCfgDao.getCfgInfoByGroupIds(groupId);
|
||||||
if(size == 0) { // 需配置取消
|
if(size == 0) { // 需配置取消
|
||||||
|
boolean flag = groupManageService.checkCancelCfg(groupId, Constants.IP_OBJ_GROUP_TYPE);
|
||||||
|
if(flag) { // 需配置更新
|
||||||
serviceGroupIds += ","+groupId;
|
serviceGroupIds += ","+groupId;
|
||||||
|
}else {
|
||||||
|
groupIds += ","+groupId;
|
||||||
|
}
|
||||||
}else { // 需配置更新
|
}else { // 需配置更新
|
||||||
groupIds += ","+groupId;
|
groupIds += ","+groupId;
|
||||||
}
|
}
|
||||||
@@ -186,28 +203,6 @@ public class IpCommGroupCfgService extends BaseService {
|
|||||||
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request,response,"r");
|
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request,response,"r");
|
||||||
Properties props = groupController.getMsgProp();
|
Properties props = groupController.getMsgProp();
|
||||||
|
|
||||||
// 配置未生效
|
|
||||||
/*String updateStatusGroupIds = "";
|
|
||||||
for (String groupId : serviceGroupIds.split(",")) {
|
|
||||||
List<CfgIndexInfo> list = commonPolicyDao.getObjGroupListByGroupIds(groupId, 888, Constants.VALID_NO);
|
|
||||||
if(list.size() > 0) {
|
|
||||||
updateStatusGroupIds += ","+groupId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(updateStatusGroupIds)) {
|
|
||||||
updateStatusGroupIds = updateStatusGroupIds.substring(1);
|
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
|
||||||
entity.setUserRegion5(updateStatusGroupIds);
|
|
||||||
entity.setFunctionId(888);
|
|
||||||
entity.setCommonGroupIds("");
|
|
||||||
entity.setIsValid(Constants.VALID_NO);
|
|
||||||
commonPolicyDao.updateCfgIndexCommonGroupIdsBatch(entity);
|
|
||||||
|
|
||||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(updateStatusGroupIds);
|
|
||||||
groupManageService.updateGroupStatus(policyGroupInfos, Constants.IP_OBJ_GROUP_TYPE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// 配置已生效×
|
|
||||||
// 组下无域配置common_group_ids -> "",ud_flag -> 0
|
// 组下无域配置common_group_ids -> "",ud_flag -> 0
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
entity.setUserRegion5(serviceGroupIds);
|
entity.setUserRegion5(serviceGroupIds);
|
||||||
@@ -228,8 +223,64 @@ public class IpCommGroupCfgService extends BaseService {
|
|||||||
if(StringUtils.isNotBlank(groupIds)) {
|
if(StringUtils.isNotBlank(groupIds)) {
|
||||||
groupIds = groupIds.substring(1);
|
groupIds = groupIds.substring(1);
|
||||||
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, Constants.IP_OBJ_GROUP_TYPE);
|
||||||
transObjGroupToMaat(policyGroupInfos);
|
transObjGroupToMaat(policyGroupInfos);
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
hasData = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// 配置取消
|
||||||
|
if(StringUtils.isNotBlank(serviceGroupIds)) {
|
||||||
|
serviceGroupIds = serviceGroupIds.substring(1);
|
||||||
|
ObjectGroupController groupController = SpringContextHolder.getBean(ObjectGroupController.class);
|
||||||
|
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request,response,"r");
|
||||||
|
Properties props = groupController.getMsgProp();
|
||||||
|
|
||||||
|
// 配置未生效
|
||||||
|
String updateStatusGroupIds = "";
|
||||||
|
for (String groupId : serviceGroupIds.split(",")) {
|
||||||
|
List<CfgIndexInfo> list = commonPolicyDao.getObjGroupListByGroupIds(groupId, 888, Constants.VALID_NO);
|
||||||
|
if(list.size() > 0) {
|
||||||
|
updateStatusGroupIds += ","+groupId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(updateStatusGroupIds)) {
|
||||||
|
updateStatusGroupIds = updateStatusGroupIds.substring(1);
|
||||||
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
|
entity.setUserRegion5(updateStatusGroupIds);
|
||||||
|
entity.setFunctionId(888);
|
||||||
|
entity.setCommonGroupIds("");
|
||||||
|
entity.setIsValid(Constants.VALID_NO);
|
||||||
|
commonPolicyDao.updateCfgIndexCommonGroupIdsBatch(entity);
|
||||||
|
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(updateStatusGroupIds);
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, Constants.IP_OBJ_GROUP_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 配置已生效×
|
||||||
|
// 组下无域配置common_group_ids -> "",ud_flag -> 0
|
||||||
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
|
entity.setUserRegion5(serviceGroupIds);
|
||||||
|
entity.setFunctionId(888);
|
||||||
|
entity.setCommonGroupIds("");
|
||||||
|
commonPolicyDao.updateCfgIndexCommonGroupIdsBatch(entity);
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(serviceGroupIds);
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, Constants.IP_OBJ_GROUP_TYPE);
|
||||||
|
|
||||||
|
entity.setServiceId(0);
|
||||||
|
entity.setIsValid(Constants.VALID_NO);
|
||||||
|
entity.setIsAudit(Constants.AUDIT_NOT_YES);
|
||||||
|
entity.setBatchAuditValue("1");
|
||||||
|
entity.setBatchValidValue("1,0");
|
||||||
|
groupController.auditAll(auditPage, Constants.AUDIT_NOT_YES, entity, props);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
long end = System.currentTimeMillis();
|
||||||
|
logger.warn("IP组域配置批量删除耗时:"+(end-start));
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
||||||
@@ -345,4 +396,9 @@ public class IpCommGroupCfgService extends BaseService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void checkCancelCfg() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,7 @@ import com.nis.domain.configuration.CfgIndexInfo;
|
|||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.ConfigServiceUtil;
|
import com.nis.util.ConfigServiceUtil;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.util.StringUtils;
|
import com.nis.util.StringUtils;
|
||||||
import com.nis.web.controller.configuration.ObjectGroupController;
|
import com.nis.web.controller.configuration.ObjectGroupController;
|
||||||
import com.nis.web.dao.CrudDao;
|
import com.nis.web.dao.CrudDao;
|
||||||
@@ -154,16 +155,27 @@ public class ScriberIdCommGroupService extends CrudService<CrudDao<ScriberIdComm
|
|||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void delete(String ids, String groupIds, ScriberIdCommCfg cfg, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
public void delete(String ids, String groupIds, ScriberIdCommCfg cfg, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
if(ids == null) {
|
if(ids == null) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
|
Page<ScriberIdCommCfg> page = new Page<ScriberIdCommCfg>(request, response, "r");
|
||||||
|
page.setOrderBy("");
|
||||||
|
page.setPageSize(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
|
||||||
|
boolean hasData = true;
|
||||||
|
while(hasData){
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
cfg.setIsValid(null);
|
||||||
|
|
||||||
|
List<ScriberIdCommCfg> list = this.findPage(page, cfg).getList();
|
||||||
|
if(!StringUtil.isEmpty(list)) {
|
||||||
groupIds = "";
|
groupIds = "";
|
||||||
String cfgIds = "";
|
String cfgIds = "";
|
||||||
String serviceGroupIds = "";
|
String serviceGroupIds = "";
|
||||||
|
|
||||||
// 删除操作后获取 ①需配置更新的分组(存在域配置)②需配置取消的分组(无域配置) -> 配置分别操作更新或取消
|
for (ScriberIdCommCfg scriberIdCommCfg : list) {
|
||||||
List<ScriberIdCommCfg> set = scriberIdCommGroupDao.getGroupIds(cfg);
|
|
||||||
if(set.size() == 0) { // 无可删除配置
|
|
||||||
return;
|
|
||||||
}else {
|
|
||||||
for (ScriberIdCommCfg scriberIdCommCfg : set) {
|
|
||||||
Integer groupId = scriberIdCommCfg.getGroupId();
|
Integer groupId = scriberIdCommCfg.getGroupId();
|
||||||
cfgIds += ","+scriberIdCommCfg.getCfgId();
|
cfgIds += ","+scriberIdCommCfg.getCfgId();
|
||||||
if(!serviceGroupIds.contains(groupId+"")) {
|
if(!serviceGroupIds.contains(groupId+"")) {
|
||||||
@@ -172,15 +184,20 @@ public class ScriberIdCommGroupService extends CrudService<CrudDao<ScriberIdComm
|
|||||||
}
|
}
|
||||||
cfgIds = cfgIds.substring(1);
|
cfgIds = cfgIds.substring(1);
|
||||||
serviceGroupIds = serviceGroupIds.substring(1);
|
serviceGroupIds = serviceGroupIds.substring(1);
|
||||||
}
|
|
||||||
scriberIdCommGroupDao.delete(cfgIds);
|
scriberIdCommGroupDao.delete(cfgIds);
|
||||||
|
|
||||||
|
// 删除操作后获取 ①需配置更新的分组(存在域配置)②需配置取消的分组(无域配置) -> 配置分别操作更新或取消
|
||||||
String[] strings = serviceGroupIds.split(",");
|
String[] strings = serviceGroupIds.split(",");
|
||||||
serviceGroupIds = "";
|
serviceGroupIds = "";
|
||||||
for (String groupId : strings) {
|
for (String groupId : strings) {
|
||||||
Integer size = scriberIdCommGroupDao.getCfgInfoByGroupIds(groupId);
|
Integer size = scriberIdCommGroupDao.getCfgInfoByGroupIds(groupId);
|
||||||
if(size == 0) { // 需配置取消
|
if(size == 0) { // 需配置取消
|
||||||
|
boolean flag = groupManageService.checkCancelCfg(groupId, Constants.SUBID_OBJ_GROUP_TYPE);
|
||||||
|
if(flag) { // 需配置更新
|
||||||
serviceGroupIds += ","+groupId;
|
serviceGroupIds += ","+groupId;
|
||||||
|
}else {
|
||||||
|
groupIds += ","+groupId;
|
||||||
|
}
|
||||||
}else { // 需配置更新
|
}else { // 需配置更新
|
||||||
groupIds += ","+groupId;
|
groupIds += ","+groupId;
|
||||||
}
|
}
|
||||||
@@ -193,28 +210,6 @@ public class ScriberIdCommGroupService extends CrudService<CrudDao<ScriberIdComm
|
|||||||
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request,response,"r");
|
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request,response,"r");
|
||||||
Properties props = groupController.getMsgProp();
|
Properties props = groupController.getMsgProp();
|
||||||
|
|
||||||
// 配置未生效
|
|
||||||
/*String updateStatusGroupIds = "";
|
|
||||||
for (String groupId : serviceGroupIds.split(",")) {
|
|
||||||
List<CfgIndexInfo> list = commonPolicyDao.getObjGroupListByGroupIds(groupId, 888, Constants.VALID_NO);
|
|
||||||
if(list.size() > 0) {
|
|
||||||
updateStatusGroupIds += ","+groupId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(updateStatusGroupIds)) {
|
|
||||||
updateStatusGroupIds = updateStatusGroupIds.substring(1);
|
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
|
||||||
entity.setUserRegion5(updateStatusGroupIds);
|
|
||||||
entity.setFunctionId(888);
|
|
||||||
entity.setCommonGroupIds("");
|
|
||||||
entity.setIsValid(Constants.VALID_NO);
|
|
||||||
commonPolicyDao.updateCfgIndexCommonGroupIdsBatch(entity);
|
|
||||||
|
|
||||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(updateStatusGroupIds);
|
|
||||||
groupManageService.updateGroupStatus(policyGroupInfos, Constants.SUBID_OBJ_GROUP_TYPE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// 配置已生效×
|
|
||||||
// 组下无域配置common_group_ids -> "",ud_flag -> 0
|
// 组下无域配置common_group_ids -> "",ud_flag -> 0
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
entity.setUserRegion5(serviceGroupIds);
|
entity.setUserRegion5(serviceGroupIds);
|
||||||
@@ -235,9 +230,20 @@ public class ScriberIdCommGroupService extends CrudService<CrudDao<ScriberIdComm
|
|||||||
if(StringUtils.isNotBlank(groupIds)) {
|
if(StringUtils.isNotBlank(groupIds)) {
|
||||||
groupIds = groupIds.substring(1);
|
groupIds = groupIds.substring(1);
|
||||||
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, Constants.SUBID_OBJ_GROUP_TYPE);
|
||||||
transObjGroupToMaat(policyGroupInfos);
|
transObjGroupToMaat(policyGroupInfos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
hasData = false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
long end = System.currentTimeMillis();
|
||||||
|
logger.warn("账号组域配置,批量删除耗时:"+(end-start));
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
||||||
scriberIdCommGroupDao.delete(ids);
|
scriberIdCommGroupDao.delete(ids);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.nis.domain.configuration.CfgIndexInfo;
|
|||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.ConfigServiceUtil;
|
import com.nis.util.ConfigServiceUtil;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.util.StringUtils;
|
import com.nis.util.StringUtils;
|
||||||
import com.nis.web.controller.configuration.ObjectGroupController;
|
import com.nis.web.controller.configuration.ObjectGroupController;
|
||||||
import com.nis.web.dao.CrudDao;
|
import com.nis.web.dao.CrudDao;
|
||||||
@@ -154,16 +155,27 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
|||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void delete(String ids, String groupIds, UrlCommCfg cfg, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
public void delete(String ids, String groupIds, UrlCommCfg cfg, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||||
if(ids == null) {
|
if(ids == null) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
|
Page<UrlCommCfg> page = new Page<UrlCommCfg>(request, response, "r");
|
||||||
|
page.setOrderBy("");
|
||||||
|
page.setPageSize(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
|
||||||
|
boolean hasData = true;
|
||||||
|
while(hasData){
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
cfg.setIsValid(null);
|
||||||
|
|
||||||
|
List<UrlCommCfg> list = this.findPage(page, cfg).getList();
|
||||||
|
if(!StringUtil.isEmpty(list)) {
|
||||||
groupIds = "";
|
groupIds = "";
|
||||||
String cfgIds = "";
|
String cfgIds = "";
|
||||||
String serviceGroupIds = "";
|
String serviceGroupIds = "";
|
||||||
|
|
||||||
// 删除操作后获取 ①需配置更新的分组(存在域配置)②需配置取消的分组(无域配置) -> 配置分别操作更新或取消
|
for (UrlCommCfg urlCommCfg : list) {
|
||||||
List<UrlCommCfg> set = urlCommGroupDao.getGroupIds(cfg);
|
|
||||||
if(set.size() == 0) { // 无可删除配置
|
|
||||||
return;
|
|
||||||
}else {
|
|
||||||
for (UrlCommCfg urlCommCfg : set) {
|
|
||||||
Integer groupId = urlCommCfg.getGroupId();
|
Integer groupId = urlCommCfg.getGroupId();
|
||||||
cfgIds += ","+urlCommCfg.getCfgId();
|
cfgIds += ","+urlCommCfg.getCfgId();
|
||||||
if(!serviceGroupIds.contains(groupId+"")) {
|
if(!serviceGroupIds.contains(groupId+"")) {
|
||||||
@@ -172,15 +184,20 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
|||||||
}
|
}
|
||||||
cfgIds = cfgIds.substring(1);
|
cfgIds = cfgIds.substring(1);
|
||||||
serviceGroupIds = serviceGroupIds.substring(1);
|
serviceGroupIds = serviceGroupIds.substring(1);
|
||||||
}
|
|
||||||
urlCommGroupDao.delete(cfgIds);
|
urlCommGroupDao.delete(cfgIds);
|
||||||
|
|
||||||
|
// 删除操作后获取 ①需配置更新的分组(存在域配置)②需配置取消的分组(无域配置) -> 配置分别操作更新或取消
|
||||||
String[] strings = serviceGroupIds.split(",");
|
String[] strings = serviceGroupIds.split(",");
|
||||||
serviceGroupIds = "";
|
serviceGroupIds = "";
|
||||||
for (String groupId : strings) {
|
for (String groupId : strings) {
|
||||||
Integer size = urlCommGroupDao.getCfgInfoByGroupIds(groupId);
|
Integer size = urlCommGroupDao.getCfgInfoByGroupIds(groupId);
|
||||||
if(size == 0) { // 需配置取消
|
if(size == 0) { // 需配置取消
|
||||||
|
boolean flag = groupManageService.checkCancelCfg(groupId, Constants.URL_OBJ_GROUP_TYPE);
|
||||||
|
if(flag) { // 需配置更新
|
||||||
serviceGroupIds += ","+groupId;
|
serviceGroupIds += ","+groupId;
|
||||||
|
}else {
|
||||||
|
groupIds += ","+groupId;
|
||||||
|
}
|
||||||
}else { // 需配置更新
|
}else { // 需配置更新
|
||||||
groupIds += ","+groupId;
|
groupIds += ","+groupId;
|
||||||
}
|
}
|
||||||
@@ -193,28 +210,6 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
|||||||
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request,response,"r");
|
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request,response,"r");
|
||||||
Properties props = groupController.getMsgProp();
|
Properties props = groupController.getMsgProp();
|
||||||
|
|
||||||
// 配置未生效
|
|
||||||
/*String updateStatusGroupIds = "";
|
|
||||||
for (String groupId : serviceGroupIds.split(",")) {
|
|
||||||
List<CfgIndexInfo> list = commonPolicyDao.getObjGroupListByGroupIds(groupId, 888, Constants.VALID_NO);
|
|
||||||
if(list.size() > 0) {
|
|
||||||
updateStatusGroupIds += ","+groupId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(updateStatusGroupIds)) {
|
|
||||||
updateStatusGroupIds = updateStatusGroupIds.substring(1);
|
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
|
||||||
entity.setUserRegion5(updateStatusGroupIds);
|
|
||||||
entity.setFunctionId(888);
|
|
||||||
entity.setCommonGroupIds("");
|
|
||||||
entity.setIsValid(Constants.VALID_NO);
|
|
||||||
commonPolicyDao.updateCfgIndexCommonGroupIdsBatch(entity);
|
|
||||||
|
|
||||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(updateStatusGroupIds);
|
|
||||||
groupManageService.updateGroupStatus(policyGroupInfos, Constants.URL_OBJ_GROUP_TYPE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// 配置已生效×
|
|
||||||
// 组下无域配置common_group_ids -> "",ud_flag -> 0
|
// 组下无域配置common_group_ids -> "",ud_flag -> 0
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
entity.setUserRegion5(serviceGroupIds);
|
entity.setUserRegion5(serviceGroupIds);
|
||||||
@@ -235,9 +230,18 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
|||||||
if(StringUtils.isNotBlank(groupIds)) {
|
if(StringUtils.isNotBlank(groupIds)) {
|
||||||
groupIds = groupIds.substring(1);
|
groupIds = groupIds.substring(1);
|
||||||
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, Constants.URL_OBJ_GROUP_TYPE);
|
||||||
transObjGroupToMaat(policyGroupInfos);
|
transObjGroupToMaat(policyGroupInfos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
hasData = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long end = System.currentTimeMillis();
|
||||||
|
logger.warn("URL组域配置,批量删除耗时:"+(end-start));
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
||||||
urlCommGroupDao.delete(ids);
|
urlCommGroupDao.delete(ids);
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
<div id="errorTipDiv" style="display: none;padding-top: 3px;"><sys:message content="server_internal_error"/></div>
|
<div id="errorTipDiv" style="display: none;padding-top: 3px;"><sys:message content="server_internal_error"/></div>
|
||||||
<div id="chart" style="width:97%;height:550px;"></div>
|
<div id="chart" style="width:97%;height:550px;"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
||||||
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>--%>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>--%>
|
||||||
@@ -201,6 +203,11 @@ function showActionTransChart(chartType,xData,series){
|
|||||||
async:true,
|
async:true,
|
||||||
timeout:50000,
|
timeout:50000,
|
||||||
success:function (rs) {
|
success:function (rs) {
|
||||||
|
if(rs!=null&&rs.length>0&&rs[0].error!=null){
|
||||||
|
// top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
||||||
|
$("#errorTipDiv").show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
var xData=new Array();
|
var xData=new Array();
|
||||||
var series=new Array();
|
var series=new Array();
|
||||||
var total=[];
|
var total=[];
|
||||||
|
|||||||
@@ -101,7 +101,8 @@ function ajaxClientIPList(start,end,entranceId){
|
|||||||
traditional:true,
|
traditional:true,
|
||||||
success:function (data){
|
success:function (data){
|
||||||
if(data!=null&&data.length>0&&data[0].error!=null){
|
if(data!=null&&data.length>0&&data[0].error!=null){
|
||||||
top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
// top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
||||||
|
$("#errorTipDiv").show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fileData =data;
|
fileData =data;
|
||||||
|
|||||||
@@ -101,7 +101,8 @@ function ajaxServerIPList(start,end,entranceId){
|
|||||||
traditional:true,
|
traditional:true,
|
||||||
success:function (data){
|
success:function (data){
|
||||||
if(data!=null&&data.length>0&&data[0].error!=null){
|
if(data!=null&&data.length>0&&data[0].error!=null){
|
||||||
top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
// top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
||||||
|
$("#errorTipDiv").show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fileData =data;
|
fileData =data;
|
||||||
|
|||||||
@@ -103,7 +103,8 @@ function ajaxAppList(start,end,entranceId){
|
|||||||
traditional:true,
|
traditional:true,
|
||||||
success:function (data){
|
success:function (data){
|
||||||
if(data!=null&&data.length>0&&data[0].error!=null){
|
if(data!=null&&data.length>0&&data[0].error!=null){
|
||||||
top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
// top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
||||||
|
$("#errorTipDiv").show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fileData =data;
|
fileData =data;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<div class="col-md-12">
|
||||||
<div id="errorTipDiv" style="display: none;padding-top: 3px;"><sys:message content="server_internal_error"/></div>
|
<div id="errorTipDiv" style="display: none;padding-top: 3px;"><sys:message content="server_internal_error"/></div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="chartDiv1" class="col-md-12">
|
<div id="chartDiv1" class="col-md-12">
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
</div>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
||||||
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script> --%>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script> --%>
|
||||||
@@ -91,6 +91,11 @@ function changeBandwidth(unitType,beginDate,endDate){
|
|||||||
async:true,
|
async:true,
|
||||||
timeout:50000,
|
timeout:50000,
|
||||||
success:function (data){
|
success:function (data){
|
||||||
|
if(data!=null && data.error!=null){
|
||||||
|
// top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
||||||
|
$("#errorTipDiv").show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
var xdata=null;
|
var xdata=null;
|
||||||
var ipv4data=null;
|
var ipv4data=null;
|
||||||
var ipv6data=null;
|
var ipv6data=null;
|
||||||
|
|||||||
@@ -114,9 +114,10 @@
|
|||||||
traditional:true,
|
traditional:true,
|
||||||
success : function(data) {
|
success : function(data) {
|
||||||
if (data != null && data.length > 0 && data[0].error != null) {
|
if (data != null && data.length > 0 && data[0].error != null) {
|
||||||
top.$.jBox.tip(
|
// top.$.jBox.tip(
|
||||||
"<spring:message code='request_service_failed'/>",
|
// "<spring:message code='request_service_failed'/>",
|
||||||
"<spring:message code='info'/>");
|
// "<spring:message code='info'/>");
|
||||||
|
$("#errorTipDiv").show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
webTypeChart(data,chartType);
|
webTypeChart(data,chartType);
|
||||||
|
|||||||
@@ -104,7 +104,8 @@ function ajaxProtocolList(start,end,entranceId){
|
|||||||
},
|
},
|
||||||
success:function (data){
|
success:function (data){
|
||||||
if(data!=null&&data.length>0&&data[0].error!=null){
|
if(data!=null&&data.length>0&&data[0].error!=null){
|
||||||
top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
// top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
||||||
|
$("#errorTipDiv").show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fileData =data;
|
fileData =data;
|
||||||
|
|||||||
@@ -101,7 +101,8 @@ function ajaxSubscriberIDList(start,end,entranceId){
|
|||||||
traditional:true,
|
traditional:true,
|
||||||
success:function (data){
|
success:function (data){
|
||||||
if(data!=null&&data.length>0&&data[0].error!=null){
|
if(data!=null&&data.length>0&&data[0].error!=null){
|
||||||
top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
// top.$.jBox.tip("<spring:message code='request_service_failed'/>", "<spring:message code='info'/>");
|
||||||
|
$("#errorTipDiv").show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fileData =data;
|
fileData =data;
|
||||||
|
|||||||
Reference in New Issue
Block a user