Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into develop
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.nis.web.controller.configuration.maintenance;
|
package com.nis.web.controller.configuration.maintenance;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -16,6 +17,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.PolicyGroupInfo;
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
import com.nis.domain.configuration.IpAddrPoolCfg;
|
import com.nis.domain.configuration.IpAddrPoolCfg;
|
||||||
import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
import com.nis.domain.configuration.IpMultiplexPoolCfg;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
@@ -160,4 +162,24 @@ public class IpAddrPoolController extends BaseController{
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验地址池是否被策略引用
|
||||||
|
* @param addrPoolIds
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping(value = {"/ajaxIsUsed"})
|
||||||
|
public boolean ajaxIsUsed(String addrPoolIds, HttpServletRequest request, HttpServletResponse response){
|
||||||
|
for (String addrPoolId : addrPoolIds.split(",")) {
|
||||||
|
List<BaseIpCfg> ipList = ipCfgService.checkAddrPoolIsUsed(addrPoolId);
|
||||||
|
if(ipList != null && ipList.size() > 0){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,10 @@
|
|||||||
<if test="groupType != null">
|
<if test="groupType != null">
|
||||||
AND r.group_type =#{groupType }
|
AND r.group_type =#{groupType }
|
||||||
</if>
|
</if>
|
||||||
|
<if test="groupType == null">
|
||||||
|
AND r.group_type != 2
|
||||||
|
AND r.group_type != 3
|
||||||
|
</if>
|
||||||
<if test="asnNo != null">
|
<if test="asnNo != null">
|
||||||
AND r.asn_no =#{asnNo }
|
AND r.asn_no =#{asnNo }
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -89,4 +89,5 @@ public interface ConfigSynchronizationDao {
|
|||||||
public List<BaseStringCfg> getStrListByService(BaseCfg entity);
|
public List<BaseStringCfg> getStrListByService(BaseCfg entity);
|
||||||
public List<ComplexkeywordCfg> getComplexStrListByService(BaseCfg entity);
|
public List<ComplexkeywordCfg> getComplexStrListByService(BaseCfg entity);
|
||||||
public List<IpPortCfg> getAppIpPortList(@Param("tableName")String tableName,@Param("compileIds")List compileIds);
|
public List<IpPortCfg> getAppIpPortList(@Param("tableName")String tableName,@Param("compileIds")List compileIds);
|
||||||
|
public List<AppIpCfg> getAppIpFeatureList(BaseCfg entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1278,7 +1278,7 @@
|
|||||||
a.area_effective_ids,a.function_id,a.do_log,a.user_region1,a.user_region2,
|
a.area_effective_ids,a.function_id,a.do_log,a.user_region1,a.user_region2,
|
||||||
a.user_region3,a.user_region4,a.user_region5,
|
a.user_region3,a.user_region4,a.user_region5,
|
||||||
<choose>
|
<choose>
|
||||||
<when test="serviceId==1026">
|
<when test="serviceId==1026 or serviceId==1152">
|
||||||
a.domain as cfg_keywords,
|
a.domain as cfg_keywords,
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
@@ -1341,6 +1341,35 @@
|
|||||||
</trim>
|
</trim>
|
||||||
ORDER BY a.CFG_ID
|
ORDER BY a.CFG_ID
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getAppIpFeatureList" resultType="com.nis.domain.configuration.AppIpCfg" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
||||||
|
select
|
||||||
|
a.cfg_id,a.cfg_desc,a.action,a.is_valid,a.is_audit,a.creator_id,a.audit_time,
|
||||||
|
a.service_id,a.request_id,a.is_area_effective,a.classify,a.attribute,a.lable,
|
||||||
|
a.area_effective_ids,a.function_id,a.do_log,a.user_region1,a.user_region2,
|
||||||
|
a.user_region3,a.user_region4,a.user_region5,
|
||||||
|
<include refid="AppIpCfg_Column"></include>
|
||||||
|
<trim prefix="," prefixOverrides=",">
|
||||||
|
,s.name as creator_name,u.name as auditor_name
|
||||||
|
,a.app_code,a.spec_service_id,a.behav_code
|
||||||
|
</trim>
|
||||||
|
from ${tableName} a
|
||||||
|
left join sys_user s on a.creator_id=s.id
|
||||||
|
left join sys_user u on a.auditor_id=u.id
|
||||||
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||||
|
<if test="serviceId != null">
|
||||||
|
AND a.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="functionId != null">
|
||||||
|
AND a.function_id=#{functionId,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="action != null">
|
||||||
|
AND a.action=#{action,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
and a.is_valid=#{isValid} and a.is_audit=#{isAudit}
|
||||||
|
and a.is_valid!=-1
|
||||||
|
</trim>
|
||||||
|
ORDER BY a.CFG_ID
|
||||||
|
</select>
|
||||||
<!-- <select id="findAppPolicyList" resultMap="AppPolicyCfgMap" parameterType="com.nis.domain.configuration.AppPolicyCfg" >
|
<!-- <select id="findAppPolicyList" resultMap="AppPolicyCfgMap" parameterType="com.nis.domain.configuration.AppPolicyCfg" >
|
||||||
select
|
select
|
||||||
<include refid="AppPolicyCfg_Column"/>
|
<include refid="AppPolicyCfg_Column"/>
|
||||||
|
|||||||
@@ -47,4 +47,7 @@ public interface IpCfgDao extends CrudDao<BaseIpCfg>{
|
|||||||
public void auditCfg(BaseCfg entity);
|
public void auditCfg(BaseCfg entity);
|
||||||
public List<CfgIndexInfo> getIpCfgList(CfgIndexInfo entity);
|
public List<CfgIndexInfo> getIpCfgList(CfgIndexInfo entity);
|
||||||
|
|
||||||
|
// 校验地址池是否被策略引用
|
||||||
|
public List<BaseIpCfg> checkAddrPoolIsUsed(@Param("addrPoolId")String addrPoolId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1142,4 +1142,15 @@
|
|||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="checkAddrPoolIsUsed" resultMap="BaseIpMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="BaseIpCfg_Column_List_with_id" />
|
||||||
|
FROM
|
||||||
|
ip_port_cfg
|
||||||
|
WHERE
|
||||||
|
is_valid != -1 AND
|
||||||
|
ir_type IS NOT NULL AND
|
||||||
|
user_region2 = #{addrPoolId,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -3,6 +3,7 @@ package com.nis.web.service.configuration;
|
|||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -24,6 +25,7 @@ import com.nis.domain.FunctionServiceDict;
|
|||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.AsnIpCfg;
|
import com.nis.domain.basics.AsnIpCfg;
|
||||||
import com.nis.domain.configuration.AppFeatureIndex;
|
import com.nis.domain.configuration.AppFeatureIndex;
|
||||||
|
import com.nis.domain.configuration.AppIpCfg;
|
||||||
import com.nis.domain.configuration.AppPolicyCfg;
|
import com.nis.domain.configuration.AppPolicyCfg;
|
||||||
import com.nis.domain.configuration.AvFileSampleCfg;
|
import com.nis.domain.configuration.AvFileSampleCfg;
|
||||||
import com.nis.domain.configuration.BaseCfg;
|
import com.nis.domain.configuration.BaseCfg;
|
||||||
@@ -46,6 +48,8 @@ import com.nis.domain.maat.MaatCfg.GroupCfg;
|
|||||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||||
|
import com.nis.domain.specific.ConfigGroupInfo;
|
||||||
|
import com.nis.domain.specific.SpecificServiceCfg;
|
||||||
import com.nis.util.ConfigServiceUtil;
|
import com.nis.util.ConfigServiceUtil;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DateUtils;
|
import com.nis.util.DateUtils;
|
||||||
@@ -54,6 +58,8 @@ import com.nis.util.ServiceConfigTemplateUtil;
|
|||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.web.dao.configuration.CommonPolicyDao;
|
import com.nis.web.dao.configuration.CommonPolicyDao;
|
||||||
import com.nis.web.dao.configuration.ConfigSynchronizationDao;
|
import com.nis.web.dao.configuration.ConfigSynchronizationDao;
|
||||||
|
import com.nis.web.dao.specific.ConfigGroupInfoDao;
|
||||||
|
import com.nis.web.dao.specific.SpecificServiceCfgDao;
|
||||||
import com.nis.web.security.UserUtils;
|
import com.nis.web.security.UserUtils;
|
||||||
import com.nis.web.service.BaseService;
|
import com.nis.web.service.BaseService;
|
||||||
|
|
||||||
@@ -68,6 +74,10 @@ public class ConfigSynchronizationService extends BaseService{
|
|||||||
protected ConfigSynchronizationDao configSynchronizationDao;
|
protected ConfigSynchronizationDao configSynchronizationDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
protected CommonPolicyDao commonPolicyDao;
|
protected CommonPolicyDao commonPolicyDao;
|
||||||
|
@Autowired
|
||||||
|
protected SpecificServiceCfgDao specificServiceCfgDao;
|
||||||
|
@Autowired
|
||||||
|
protected ConfigGroupInfoDao configGroupInfoDao;
|
||||||
/**
|
/**
|
||||||
* 配置全量更新下发
|
* 配置全量更新下发
|
||||||
* @param request
|
* @param request
|
||||||
@@ -1098,15 +1108,25 @@ public class ConfigSynchronizationService extends BaseService{
|
|||||||
entity.setPage(page);
|
entity.setPage(page);
|
||||||
List list = Lists.newArrayList();
|
List list = Lists.newArrayList();
|
||||||
if(cfgType==1){
|
if(cfgType==1){
|
||||||
list = configSynchronizationDao.getIpPortListByService(entity);
|
if(entity.getServiceId().equals(1028)){
|
||||||
|
list = configSynchronizationDao.getAppIpFeatureList(entity);
|
||||||
|
}else{
|
||||||
|
list = configSynchronizationDao.getIpPortListByService(entity);
|
||||||
|
}
|
||||||
}else if(cfgType==2){
|
}else if(cfgType==2){
|
||||||
list = configSynchronizationDao.getStrListByService(entity);
|
list = configSynchronizationDao.getStrListByService(entity);
|
||||||
}else if(cfgType==3){
|
}else if(cfgType==3){
|
||||||
list = configSynchronizationDao.getComplexStrListByService(entity);
|
list = configSynchronizationDao.getComplexStrListByService(entity);
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmpty(list)){
|
if(!StringUtil.isEmpty(list)){
|
||||||
hasData=auditSingleMaatData(cfgType,userRegionList,
|
if(entity.getServiceId().equals(1028)){
|
||||||
page,entity,list,hasData,isUpdateCfg);
|
hasData=auditAppIpData(userRegionList,
|
||||||
|
page,entity,list,hasData,isUpdateCfg);
|
||||||
|
}else{
|
||||||
|
hasData=auditSingleMaatData(cfgType,userRegionList,
|
||||||
|
page,entity,list,hasData,isUpdateCfg);
|
||||||
|
}
|
||||||
|
|
||||||
if(hasData) {
|
if(hasData) {
|
||||||
page.setPageNo(page.getNext());
|
page.setPageNo(page.getNext());
|
||||||
}
|
}
|
||||||
@@ -1146,9 +1166,6 @@ public class ConfigSynchronizationService extends BaseService{
|
|||||||
List<NumBoundaryCfg> numRegionList;
|
List<NumBoundaryCfg> numRegionList;
|
||||||
List<DigestCfg> digestRegionList;
|
List<DigestCfg> digestRegionList;
|
||||||
List<IpCfg> areaIpRegionList;
|
List<IpCfg> areaIpRegionList;
|
||||||
|
|
||||||
|
|
||||||
List<IpPortCfg> ipList = new ArrayList();
|
|
||||||
maatBean = new ToMaatBean();
|
maatBean = new ToMaatBean();
|
||||||
configCompileList = new ArrayList();
|
configCompileList = new ArrayList();
|
||||||
//批量获取regionId,groupId
|
//批量获取regionId,groupId
|
||||||
@@ -1202,7 +1219,6 @@ public class ConfigSynchronizationService extends BaseService{
|
|||||||
}
|
}
|
||||||
list1.add(cfg);
|
list1.add(cfg);
|
||||||
if(list1.size()>0){
|
if(list1.size()>0){
|
||||||
ipList.removeAll(list1);
|
|
||||||
Map<String,List> map = cfgToMaatConvert(ipRegionList,list1,1,groupRelationList);
|
Map<String,List> map = cfgToMaatConvert(ipRegionList,list1,1,groupRelationList);
|
||||||
groupRelationList=map.get("groupList");
|
groupRelationList=map.get("groupList");
|
||||||
ipRegionList=map.get("dstList");
|
ipRegionList=map.get("dstList");
|
||||||
@@ -1285,8 +1301,6 @@ public class ConfigSynchronizationService extends BaseService{
|
|||||||
List<DigestCfg> digestRegionList;
|
List<DigestCfg> digestRegionList;
|
||||||
List<IpCfg> areaIpRegionList;
|
List<IpCfg> areaIpRegionList;
|
||||||
|
|
||||||
|
|
||||||
List cfgList = new ArrayList();
|
|
||||||
maatBean = new ToMaatBean();
|
maatBean = new ToMaatBean();
|
||||||
configCompileList = new ArrayList();
|
configCompileList = new ArrayList();
|
||||||
//批量获取regionId,groupId
|
//批量获取regionId,groupId
|
||||||
@@ -1305,8 +1319,8 @@ public class ConfigSynchronizationService extends BaseService{
|
|||||||
BeanUtils.copyProperties(list.get(i), complexStrCfg);
|
BeanUtils.copyProperties(list.get(i), complexStrCfg);
|
||||||
}
|
}
|
||||||
BeanUtils.copyProperties(list.get(i), cfg);
|
BeanUtils.copyProperties(list.get(i), cfg);
|
||||||
cfg.setRegionId(regionIds.get(i));
|
// cfg.setRegionId(regionIds.get(i));
|
||||||
cfg.setGroupId(groupIds.get(i));
|
// cfg.setGroupId(groupIds.get(i));
|
||||||
cfg.setIsValid(entity.getIsValid());
|
cfg.setIsValid(entity.getIsValid());
|
||||||
cfg.setAuditTime(StringUtil.isEmpty(entity.getAuditTime()) ? cfg.getAuditTime():entity.getAuditTime());
|
cfg.setAuditTime(StringUtil.isEmpty(entity.getAuditTime()) ? cfg.getAuditTime():entity.getAuditTime());
|
||||||
maatCfg = new MaatCfg();
|
maatCfg = new MaatCfg();
|
||||||
@@ -1337,7 +1351,6 @@ public class ConfigSynchronizationService extends BaseService{
|
|||||||
}else if(cfgType==3){
|
}else if(cfgType==3){
|
||||||
aClass = ComplexkeywordCfg.class;
|
aClass = ComplexkeywordCfg.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Object value = "";
|
Object value = "";
|
||||||
Field field = aClass.getDeclaredField(regionColumn);
|
Field field = aClass.getDeclaredField(regionColumn);
|
||||||
@@ -1384,7 +1397,6 @@ public class ConfigSynchronizationService extends BaseService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(list1.size()>0){
|
if(list1.size()>0){
|
||||||
cfgList.removeAll(list1);
|
|
||||||
if(cfgType==1){
|
if(cfgType==1){
|
||||||
Map<String,List> map = cfgToMaatConvert(ipRegionList,list1,1,groupRelationList);
|
Map<String,List> map = cfgToMaatConvert(ipRegionList,list1,1,groupRelationList);
|
||||||
groupRelationList=map.get("groupList");
|
groupRelationList=map.get("groupList");
|
||||||
@@ -1442,26 +1454,121 @@ public class ConfigSynchronizationService extends BaseService{
|
|||||||
return hasData;
|
return hasData;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 处理app业务maat类配置
|
* 处理app ip特征(分组复用)配置
|
||||||
* @param serviceId
|
* @param serviceId
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
*/
|
*/
|
||||||
public void handleAppMaatData(List<Map<String,Object>>cfgList,List<Map<String,Object>>userRegionList,
|
public boolean auditAppIpData(List<Map<String,Object>>userRegionList,
|
||||||
Page<BaseCfg> page,Object entity,HttpServletRequest request,HttpServletResponse response){
|
Page<T> page,
|
||||||
/*if(entity instanceof AppPolicyCfg){
|
BaseCfg entity,
|
||||||
AppPolicyCfg newEntity = entity;
|
List<T> list,
|
||||||
entity.setPage(page);
|
boolean hasData,
|
||||||
}
|
boolean isUpdateCfg) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException{
|
||||||
|
|
||||||
boolean hasData = true;
|
ToMaatBean maatBean;
|
||||||
while(hasData){
|
MaatCfg maatCfg;
|
||||||
List<CfgIndexInfo> list = configSynchronizationDao.getCfgIndexList(entity);
|
List<MaatCfg> configCompileList;
|
||||||
page.setList(list);
|
List<GroupCfg> groupRelationList;
|
||||||
if(page.isLastPage()){
|
List<IpCfg> ipRegionList;
|
||||||
hasData = false;
|
List<StringCfg> strRegionList;
|
||||||
|
List<NumBoundaryCfg> numRegionList;
|
||||||
|
List<DigestCfg> digestRegionList;
|
||||||
|
List<IpCfg> areaIpRegionList;
|
||||||
|
|
||||||
|
maatBean = new ToMaatBean();
|
||||||
|
configCompileList = new ArrayList();
|
||||||
|
//同一编译IP的分组
|
||||||
|
Map<Integer,List<AppIpCfg>> dataMap=new HashMap<>();
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
AppIpCfg cfg = new AppIpCfg();
|
||||||
|
BeanUtils.copyProperties(list.get(i), cfg);
|
||||||
|
cfg.setIsValid(entity.getIsValid());
|
||||||
|
cfg.setAuditTime(StringUtil.isEmpty(entity.getAuditTime()) ? cfg.getAuditTime():entity.getAuditTime());
|
||||||
|
if(dataMap.containsKey(cfg.getCompileId())) {
|
||||||
|
dataMap.get(cfg.getCompileId()).add(cfg);
|
||||||
|
}else {
|
||||||
|
List<AppIpCfg> ipList=new ArrayList<>();
|
||||||
|
ipList.add(cfg);
|
||||||
|
dataMap.put(cfg.getCompileId(), ipList);
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
for(List<AppIpCfg> entitys:dataMap.values()) {
|
||||||
|
maatCfg = new MaatCfg();
|
||||||
|
maatCfg.initDefaultValue();
|
||||||
|
groupRelationList = new ArrayList();
|
||||||
|
ipRegionList = new ArrayList();
|
||||||
|
strRegionList = new ArrayList();
|
||||||
|
numRegionList = new ArrayList();
|
||||||
|
digestRegionList = new ArrayList();
|
||||||
|
areaIpRegionList = new ArrayList();
|
||||||
|
|
||||||
|
SpecificServiceCfg specificServiceCfg=specificServiceCfgDao.getBySpecServiceId(entitys.get(0).getSpecServiceId());
|
||||||
|
ConfigGroupInfo configGroupInfo=configGroupInfoDao.getConfigGroupInfoByGroupId(specificServiceCfg.getGroupId());
|
||||||
|
/*if(configGroupInfo==null) {
|
||||||
|
Integer groupId = ConfigServiceUtil.getId(2, 1).get(0);
|
||||||
|
specificServiceCfg.setGroupId(groupId);
|
||||||
|
configGroupInfo = new ConfigGroupInfo();
|
||||||
|
configGroupInfo.setGroupId(specificServiceCfg.getGroupId());
|
||||||
|
configGroupInfo.setGroupName(specificServiceCfg.getSpecServiceName());
|
||||||
|
configGroupInfo.setIsIssued(0);
|
||||||
|
configGroupInfo.setCompileId(entitys.get(0).getCompileId());
|
||||||
|
configGroupInfo.setGroupType(1);
|
||||||
|
configGroupInfoDao.insertConfigGroupInfo(configGroupInfo);
|
||||||
|
//更新group_id
|
||||||
|
specificServiceCfg.setOpTime(new Date());
|
||||||
|
specificServiceCfgDao.update(specificServiceCfg);
|
||||||
|
}*/
|
||||||
|
Integer groupId=configGroupInfo.getGroupId();
|
||||||
|
GroupCfg groupCfg=new GroupCfg();
|
||||||
|
groupCfg.setCompileId(entitys.get(0).getCompileId());
|
||||||
|
groupCfg.setGroupId(groupId);
|
||||||
|
groupCfg.setIsValid(Constants.VALID_YES);
|
||||||
|
groupCfg.setAuditTime(StringUtil.isEmpty(entity.getAuditTime())?entitys.get(0).getAuditTime():entity.getAuditTime());
|
||||||
|
groupRelationList.add(groupCfg);
|
||||||
|
BeanUtils.copyProperties(entitys.get(0), maatCfg);
|
||||||
|
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(entitys,Constants.VALID_YES,groupId));
|
||||||
|
maatCfg.setAction(entitys.get(0).getAction());
|
||||||
|
maatCfg.setAuditTime(entitys.get(0).getAuditTime());
|
||||||
|
maatCfg.setIpRegionList(ipRegionList);
|
||||||
|
maatCfg.setStrRegionList(strRegionList);
|
||||||
|
maatCfg.setNumRegionList(numRegionList);
|
||||||
|
maatCfg.setDigestRegionList(digestRegionList);
|
||||||
|
maatCfg.setGroupRelationList(groupRelationList);
|
||||||
|
maatCfg.setGroupNum(groupRelationList.size());
|
||||||
|
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||||
|
maatCfg.setIsValid(entitys.get(0).getIsValid());
|
||||||
|
// 设置APP自定义域
|
||||||
|
String userRegion = "APP_ID=" + entitys.get(0).getAppCode()/*+Constants.USER_REGION_SPLIT+"ASEV_ID="+businessType*/;
|
||||||
|
maatCfg.setUserRegion(userRegion);
|
||||||
|
configCompileList.add(maatCfg);
|
||||||
|
maatBean.setConfigCompileList(configCompileList);
|
||||||
|
maatBean.setAuditTime(entitys.get(0).getAuditTime());
|
||||||
|
maatBean.setCreatorName(entitys.get(0).getCurrentUser().getName());
|
||||||
|
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||||
|
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||||
|
}
|
||||||
|
page.setList(list);
|
||||||
|
if(page.isLastPage()){
|
||||||
|
hasData = false;
|
||||||
|
}
|
||||||
|
if(!StringUtil.isEmpty(configCompileList.size())){
|
||||||
|
String json=gsonToJson(maatBean);
|
||||||
|
//调用服务接口下发配置数据
|
||||||
|
if(isUpdateCfg) {
|
||||||
|
logger.info("配置批量下发:"+json);
|
||||||
|
//调用服务接口同步回调类配置
|
||||||
|
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||||
|
if(result!=null){
|
||||||
|
logger.info("配置批量下发响应信息:"+result.getMsg());
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
//调用服务接口配置全量更新
|
||||||
|
// JSONObject result = ConfigServiceUtil.configSync(json,1,entity.getServiceId(),null,(hasData?null:"FINISHED"));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return hasData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -931,4 +931,13 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
page.setList(list);
|
page.setList(list);
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验地址池是否被策略引用
|
||||||
|
* @param addrPoolId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<BaseIpCfg> checkAddrPoolIsUsed(String addrPoolId) {
|
||||||
|
return ipCfgDao.checkAddrPoolIsUsed(addrPoolId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1335,4 +1335,5 @@ address_pool=Address Pool
|
|||||||
ip_total=IP Total
|
ip_total=IP Total
|
||||||
available_ip_total=Available IP Total
|
available_ip_total=Available IP Total
|
||||||
address_pool_id=Address Pool ID
|
address_pool_id=Address Pool ID
|
||||||
log_to_cfg=Config
|
log_to_cfg=Config
|
||||||
|
address_pool_is_used=Address pool is used and cannot perform this operation!
|
||||||
@@ -1335,4 +1335,5 @@ address_pool=Address Pool
|
|||||||
ip_total=IP Total
|
ip_total=IP Total
|
||||||
available_ip_total=Available IP Total
|
available_ip_total=Available IP Total
|
||||||
address_pool_id=Address Pool ID
|
address_pool_id=Address Pool ID
|
||||||
log_to_cfg=\u041A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044F
|
log_to_cfg=\u041A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044F
|
||||||
|
address_pool_is_used=Address pool is used and cannot perform this operation!
|
||||||
@@ -1333,4 +1333,5 @@ address_pool=\u5730\u5740\u6C60
|
|||||||
ip_total=IP\u603B\u6570
|
ip_total=IP\u603B\u6570
|
||||||
available_ip_total=\u53EF\u7528IP\u6570
|
available_ip_total=\u53EF\u7528IP\u6570
|
||||||
address_pool_id=\u5730\u5740\u6C60ID
|
address_pool_id=\u5730\u5740\u6C60ID
|
||||||
log_to_cfg=\u914D\u7F6E
|
log_to_cfg=\u914D\u7F6E
|
||||||
|
address_pool_is_used=\u5730\u5740\u6C60\u5DF2\u88AB\u4F7F\u7528\uFF0C\u65E0\u6CD5\u6267\u884C\u8BE5\u64CD\u4F5C\uFF01
|
||||||
@@ -354,6 +354,9 @@
|
|||||||
<userRegion regionKey="APP_ID" regionColumn="appCode" userRegionPosition="1"></userRegion>
|
<userRegion regionKey="APP_ID" regionColumn="appCode" userRegionPosition="1"></userRegion>
|
||||||
<userRegion regionKey="" regionColumn="userRegion1" userRegionPosition="0"></userRegion>
|
<userRegion regionKey="" regionColumn="userRegion1" userRegionPosition="0"></userRegion>
|
||||||
</service>
|
</service>
|
||||||
|
<service id="1152" functionId="560" serviceType="1" cfgType="2" tableName="app_topic_domain_cfg" className="AppTopicDomainCfg" desc="关注话题域名">
|
||||||
|
<userRegion regionKey="DOMAIN_ID" regionColumn="compileId" userRegionPosition="0"></userRegion>
|
||||||
|
</service>
|
||||||
<!-- APP、基础协议、 加密协议行为配置结束-->
|
<!-- APP、基础协议、 加密协议行为配置结束-->
|
||||||
|
|
||||||
<!-- 回调类配置开始 -->
|
<!-- 回调类配置开始 -->
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ CREATE TABLE `ip_reuse_addr_pool` (
|
|||||||
`cfg_id` bigint(20) NOT NULL AUTO_INCREMENT,
|
`cfg_id` bigint(20) NOT NULL AUTO_INCREMENT,
|
||||||
`addr_pool_id` int(11) NOT NULL COMMENT '地址池ID',
|
`addr_pool_id` int(11) NOT NULL COMMENT '地址池ID',
|
||||||
`addr_pool_name` varchar(128) DEFAULT NULL COMMENT '地址池名称',
|
`addr_pool_name` varchar(128) DEFAULT NULL COMMENT '地址池名称',
|
||||||
`ip_total` int(11) DEFAULT NULL COMMENT '地址池IP总数',
|
`ip_total` int(11) NOT NULL DEFAULT 0 COMMENT '地址池IP总数',
|
||||||
`available_ip_total` int(11) DEFAULT NULL COMMENT '地址池可用IP数',
|
`available_ip_total` int(11) NOT NULL DEFAULT 0 COMMENT '地址池可用IP数',
|
||||||
`action` int(11) NOT NULL COMMENT '1:阻断,2:监测, 5: FD 白名单,6:监测白名单,7: FD 监测都白名单,应与业务ID所代表的逻辑相匹配,8-灰名单',
|
`action` int(11) NOT NULL COMMENT '1:阻断,2:监测, 5: FD 白名单,6:监测白名单,7: FD 监测都白名单,应与业务ID所代表的逻辑相匹配,8-灰名单',
|
||||||
`is_valid` int(11) NOT NULL COMMENT '0无效,1有效,-1删除\r\n1) 未审核时配置可删除\r\n2) 审核通过,此字段置1\r\n3) 取消审核通过,此字段置0',
|
`is_valid` int(11) NOT NULL COMMENT '0无效,1有效,-1删除\r\n1) 未审核时配置可删除\r\n2) 审核通过,此字段置1\r\n3) 取消审核通过,此字段置0',
|
||||||
`is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过\r\n1) 审核未通过,配置可修改\r\n2) 审核通过,配置不可删除,只能取消审核通过',
|
`is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过\r\n1) 审核未通过,配置可修改\r\n2) 审核通过,配置不可删除,只能取消审核通过',
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ function del(url){
|
|||||||
top.$.jBox.tip("<spring:message code='has_prohibit_delete'/>", "<spring:message code='info'/>");
|
top.$.jBox.tip("<spring:message code='has_prohibit_delete'/>", "<spring:message code='info'/>");
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
|
var addrPoolIds = [];
|
||||||
var serviceGroupIds=[],ids=[],canDel=true;
|
var serviceGroupIds=[],ids=[],canDel=true;
|
||||||
$(checkboxes).filter(":checked").each(function(){
|
$(checkboxes).filter(":checked").each(function(){
|
||||||
if($(this).attr("serviceGroupId")&&$(this).attr("isValid")){
|
if($(this).attr("serviceGroupId")&&$(this).attr("isValid")){
|
||||||
@@ -59,6 +60,10 @@ function del(url){
|
|||||||
}
|
}
|
||||||
ids.push($(this).attr("id"));
|
ids.push($(this).attr("id"));
|
||||||
}
|
}
|
||||||
|
var addrPoolId = $(this).attr("addressPoolId");
|
||||||
|
if(typeof addrPoolId != "undefined"){
|
||||||
|
addrPoolIds.push(addrPoolId);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
if(serviceGroupIds.length>0){
|
if(serviceGroupIds.length>0){
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -74,6 +79,23 @@ function del(url){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 地址池管理 (只有未被策略引用的地址池可删除)
|
||||||
|
if(addrPoolIds.length > 0){
|
||||||
|
$.ajax({
|
||||||
|
type:'post',
|
||||||
|
url:'${ctx}/maintenance/ipMultiplexPoolCfg/ajaxIsUsed',
|
||||||
|
data:{"addrPoolIds":addrPoolIds.join(',')},
|
||||||
|
async:false,
|
||||||
|
success:function(data){//处理返回结果
|
||||||
|
if(data == false){
|
||||||
|
top.$.jBox.tip('<spring:message code="address_pool_is_used"/>');
|
||||||
|
canDel=data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if(canDel){
|
if(canDel){
|
||||||
doAll(checkboxes,url);
|
doAll(checkboxes,url);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,9 @@ $(function(){
|
|||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select id="groupType" name="groupType" class="selectpicker select2 form-control required" >
|
<select id="groupType" name="groupType" class="selectpicker select2 form-control required" >
|
||||||
<c:forEach items="${fns:getDictList('GROUP_TYPE')}" var="groupTypeC">
|
<c:forEach items="${fns:getDictList('GROUP_TYPE')}" var="groupTypeC">
|
||||||
<option value="${groupTypeC.itemCode}" <c:if test="${_cfg.groupType==groupTypeC.itemCode || (_cfg.groupType==null && groupTypeC.itemCode==1)}">selected</c:if>><spring:message code="${groupTypeC.itemValue}"/></option>
|
<c:if test="${groupTypeC.itemCode ne 2 && groupTypeC.itemCode ne 3}">
|
||||||
|
<option value="${groupTypeC.itemCode}" <c:if test="${_cfg.groupType==groupTypeC.itemCode || (_cfg.groupType==null && groupTypeC.itemCode==1)}">selected</c:if>><spring:message code="${groupTypeC.itemValue}"/></option>
|
||||||
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -119,13 +119,15 @@
|
|||||||
<select name="groupType" class="selectpicker select2 input-small">
|
<select name="groupType" class="selectpicker select2 input-small">
|
||||||
<option value=""><spring:message code="all_types"/></option>
|
<option value=""><spring:message code="all_types"/></option>
|
||||||
<c:forEach items="${fns:getDictList('GROUP_TYPE')}" var="groupTypeC">
|
<c:forEach items="${fns:getDictList('GROUP_TYPE')}" var="groupTypeC">
|
||||||
<option value="${groupTypeC.itemCode}"
|
<c:if test="${groupTypeC.itemCode ne 2 && groupTypeC.itemCode ne 3}">
|
||||||
<c:if test="${cfg.groupType==groupTypeC.itemCode}">
|
<option value="${groupTypeC.itemCode}"
|
||||||
selected
|
<c:if test="${cfg.groupType==groupTypeC.itemCode}">
|
||||||
</c:if>
|
selected
|
||||||
>
|
</c:if>
|
||||||
<spring:message code="${groupTypeC.itemValue}"/>
|
>
|
||||||
</option>
|
<spring:message code="${groupTypeC.itemValue}"/>
|
||||||
|
</option>
|
||||||
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -314,7 +314,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="checkbox" class="i-checks" serviceId="${cfg.serviceId}" id="${cfg.cfgId}" value="${cfg.isAudit}"></td>
|
<td><input type="checkbox" class="i-checks" serviceId="${cfg.serviceId}" id="${cfg.cfgId}" value="${cfg.isAudit}" addressPoolId="${cfg.addrPoolId }" ></td>
|
||||||
<td>${cfg.addrPoolId }</td>
|
<td>${cfg.addrPoolId }</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="javascript:;" data-original-title="${cfg.addrPoolName}"
|
<a href="javascript:;" data-original-title="${cfg.addrPoolName}"
|
||||||
|
|||||||
Reference in New Issue
Block a user