ASN 版本恢复1月4号之版本
This commit is contained in:
@@ -61,17 +61,6 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
|||||||
protected String exType;//导出类型
|
protected String exType;//导出类型
|
||||||
protected String hColumns;//导出隐藏列
|
protected String hColumns;//导出隐藏列
|
||||||
|
|
||||||
private String commonGroupIds; //公共组织id(考虑一个compile存在多个asn组织的情况)
|
|
||||||
public String getCommonGroupIds() {
|
|
||||||
return commonGroupIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCommonGroupIds(String commonGroupIds) {
|
|
||||||
this.commonGroupIds = commonGroupIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getExType() {
|
public String getExType() {
|
||||||
return exType;
|
return exType;
|
||||||
}
|
}
|
||||||
@@ -130,13 +119,13 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
|||||||
/**
|
/**
|
||||||
* 有效标识
|
* 有效标识
|
||||||
*/
|
*/
|
||||||
@ExcelField(title="valid_identifier",dictType="VALID_IDENTIFIER",sort=109)
|
@ExcelField(title="valid_identifier",dictType="VALID_IDENTIFIER",sort=90)
|
||||||
@Expose
|
@Expose
|
||||||
protected Integer isValid;
|
protected Integer isValid;
|
||||||
/**
|
/**
|
||||||
* 是否审核
|
* 是否审核
|
||||||
*/
|
*/
|
||||||
@ExcelField(title="is_audit",dictType="AUDIT_STATUS",sort=37)
|
@ExcelField(title="is_audit",dictType="AUDIT_STATUS",sort=25)
|
||||||
protected Integer isAudit;
|
protected Integer isAudit;
|
||||||
/**
|
/**
|
||||||
* 创建人员
|
* 创建人员
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class GroupReuseAddBean implements Serializable{
|
|||||||
@Expose
|
@Expose
|
||||||
private Integer opAction;
|
private Integer opAction;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("commonGroupList")
|
@SerializedName("groupReuseList")
|
||||||
private List<GroupReuseCfg> groupReuseCfgList;
|
private List<GroupReuseCfg> groupReuseCfgList;
|
||||||
|
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import com.nis.domain.maat.MaatCfg.StringCfg;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class GroupReuseCfg implements Serializable {
|
public class GroupReuseCfg implements Serializable {
|
||||||
/*@Expose
|
@Expose
|
||||||
@SerializedName("service")
|
@SerializedName("service")
|
||||||
private Integer serviceId;
|
private Integer serviceId;
|
||||||
public Integer getServiceId() {
|
public Integer getServiceId() {
|
||||||
@@ -23,7 +23,7 @@ public class GroupReuseCfg implements Serializable {
|
|||||||
public void setServiceId(Integer serviceId) {
|
public void setServiceId(Integer serviceId) {
|
||||||
this.serviceId = serviceId;
|
this.serviceId = serviceId;
|
||||||
}
|
}
|
||||||
*/ /**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 1830956100866313836L;
|
private static final long serialVersionUID = 1830956100866313836L;
|
||||||
|
|||||||
@@ -95,8 +95,6 @@ public class MaatCfg implements Serializable {
|
|||||||
@Expose
|
@Expose
|
||||||
@SerializedName("ipClientRangeList")
|
@SerializedName("ipClientRangeList")
|
||||||
private List<IpCfg> areaIpRegionList;
|
private List<IpCfg> areaIpRegionList;
|
||||||
@Expose
|
|
||||||
private List<GroupCfg> keepGroupList;
|
|
||||||
|
|
||||||
public static class GroupCfg{
|
public static class GroupCfg{
|
||||||
@Expose
|
@Expose
|
||||||
@@ -106,8 +104,6 @@ public class MaatCfg implements Serializable {
|
|||||||
@Expose
|
@Expose
|
||||||
private Integer isValid;
|
private Integer isValid;
|
||||||
@Expose
|
@Expose
|
||||||
private Integer isCommonGroup;
|
|
||||||
@Expose
|
|
||||||
@SerializedName("opTime")
|
@SerializedName("opTime")
|
||||||
private Date auditTime;
|
private Date auditTime;
|
||||||
public Integer getGroupId() {
|
public Integer getGroupId() {
|
||||||
@@ -134,12 +130,7 @@ public class MaatCfg implements Serializable {
|
|||||||
public void setAuditTime(Date auditTime) {
|
public void setAuditTime(Date auditTime) {
|
||||||
this.auditTime = auditTime;
|
this.auditTime = auditTime;
|
||||||
}
|
}
|
||||||
public Integer getIsCommonGroup() {
|
|
||||||
return isCommonGroup;
|
|
||||||
}
|
|
||||||
public void setIsCommonGroup(Integer isCommonGroup) {
|
|
||||||
this.isCommonGroup = isCommonGroup;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
public static class StringCfg{
|
public static class StringCfg{
|
||||||
@Expose
|
@Expose
|
||||||
@@ -688,13 +679,6 @@ public class MaatCfg implements Serializable {
|
|||||||
public void setRequestId(Integer requestId) {
|
public void setRequestId(Integer requestId) {
|
||||||
this.requestId = requestId;
|
this.requestId = requestId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<GroupCfg> getKeepGroupList() {
|
|
||||||
return keepGroupList;
|
|
||||||
}
|
|
||||||
public void setKeepGroupList(List<GroupCfg> keepGroupList) {
|
|
||||||
this.keepGroupList = keepGroupList;
|
|
||||||
}
|
|
||||||
public void initDefaultValue() {
|
public void initDefaultValue() {
|
||||||
this.doLog=Constants.MAAT_CFG_DOLOG_DEFAULT;
|
this.doLog=Constants.MAAT_CFG_DOLOG_DEFAULT;
|
||||||
// this.doBlackList=Constants.MAAT_CFG_DOLOG_DOBLACKLIST_DEFAULT;
|
// this.doBlackList=Constants.MAAT_CFG_DOLOG_DOBLACKLIST_DEFAULT;
|
||||||
|
|||||||
@@ -23,21 +23,6 @@ public class ConfigGroupInfo implements Serializable{
|
|||||||
@ExcelField(title="cfg_id",sort=301)
|
@ExcelField(title="cfg_id",sort=301)
|
||||||
private Integer compileId;
|
private Integer compileId;
|
||||||
private Long asnId;
|
private Long asnId;
|
||||||
private Integer isAuditAll; //是否有策略选择了此公共组下发所有;
|
|
||||||
private Integer isUsed; //是否有策略选择了此公共组;
|
|
||||||
|
|
||||||
public Integer getIsUsed() {
|
|
||||||
return isUsed;
|
|
||||||
}
|
|
||||||
public void setIsUsed(Integer isUsed) {
|
|
||||||
this.isUsed = isUsed;
|
|
||||||
}
|
|
||||||
public Integer getIsAuditAll() {
|
|
||||||
return isAuditAll;
|
|
||||||
}
|
|
||||||
public void setIsAuditAll(Integer isAuditAll) {
|
|
||||||
this.isAuditAll = isAuditAll;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getAsnId() {
|
public Long getAsnId() {
|
||||||
return asnId;
|
return asnId;
|
||||||
|
|||||||
@@ -356,7 +356,7 @@ public class ConfigServiceUtil {
|
|||||||
}else if(type==2){
|
}else if(type==2){
|
||||||
url = url+Constants.CALLBACK_CFG;
|
url = url+Constants.CALLBACK_CFG;
|
||||||
}else if(type==3) {
|
}else if(type==3) {
|
||||||
url = url+Constants.DELETE_COMMON_REIGON;
|
url = url+Constants.GROUP_REUSE_SOURCES;
|
||||||
}
|
}
|
||||||
//创建连接
|
//创建连接
|
||||||
WebTarget wt = ClientUtil.getWebTarger(url);
|
WebTarget wt = ClientUtil.getWebTarger(url);
|
||||||
@@ -400,9 +400,9 @@ public class ConfigServiceUtil {
|
|||||||
url = url+Constants.MAAT_CFG;
|
url = url+Constants.MAAT_CFG;
|
||||||
}else if(type==2){
|
}else if(type==2){
|
||||||
url = url+Constants.CALLBACK_CFG;
|
url = url+Constants.CALLBACK_CFG;
|
||||||
}/*else if(type==3) {
|
}else if(type==3) {
|
||||||
url = url+Constants.GROUP_REUSE_SOURCES;
|
url = url+Constants.GROUP_REUSE_SOURCES;
|
||||||
}*/
|
}
|
||||||
logger.info("put url:"+url);
|
logger.info("put url:"+url);
|
||||||
//创建连接
|
//创建连接
|
||||||
try {
|
try {
|
||||||
@@ -463,43 +463,26 @@ public class ConfigServiceUtil {
|
|||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 分组复用域配置新增,修改,删除
|
* 分组复用域配置新增
|
||||||
* @param params
|
* @param params
|
||||||
* @return
|
* @return
|
||||||
* @throws MaatConvertException
|
* @throws MaatConvertException
|
||||||
*/
|
*/
|
||||||
public static ToMaatResult auditCommonGroupRegionSources(String params,Integer action) throws MaatConvertException{
|
public static ToMaatResult postGroupReuseSources(String params) throws MaatConvertException{
|
||||||
ToMaatResult bean = null;
|
ToMaatResult bean = null;
|
||||||
Response response=null;
|
Response response=null;
|
||||||
try {
|
try {
|
||||||
logger.warn("postGroupReuseSources start");
|
logger.warn("postGroupReuseSources start");
|
||||||
long start=System.currentTimeMillis();
|
long start=System.currentTimeMillis();
|
||||||
String result = null;
|
String result = null;
|
||||||
String url = "";
|
String url = Constants.SERVICE_URL+Constants.GROUP_REUSE_SOURCES;
|
||||||
if(action.equals(Constants.OPACTION_POST)){
|
|
||||||
url=Constants.SERVICE_URL+Constants.ADD_COMMON_REGION;
|
|
||||||
}
|
|
||||||
if(action.equals(Constants.OPACTION_PUT)){
|
|
||||||
url=Constants.SERVICE_URL+Constants.UPDATE_COMMON_REIGON;
|
|
||||||
}
|
|
||||||
if(action.equals(Constants.OPACTION_DELETE)){
|
|
||||||
url=Constants.SERVICE_URL+Constants.DELETE_COMMON_REIGON;
|
|
||||||
}
|
|
||||||
//创建连接
|
//创建连接
|
||||||
WebTarget wt = ClientUtil.getWebTarger(url);
|
WebTarget wt = ClientUtil.getWebTarger(url);
|
||||||
logger.info("auditCommonGroupRegionSources url:"+url);
|
logger.info("postGroupReuseSources url:"+url);
|
||||||
//获取响应结果
|
//获取响应结果
|
||||||
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
|
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
|
||||||
try {
|
try {
|
||||||
if(action.equals(Constants.OPACTION_POST)){
|
|
||||||
response= header.post(Entity.entity(params, MediaType.APPLICATION_JSON));
|
response= header.post(Entity.entity(params, MediaType.APPLICATION_JSON));
|
||||||
}
|
|
||||||
if(action.equals(Constants.OPACTION_PUT)){
|
|
||||||
response= header.put(Entity.entity(params, MediaType.APPLICATION_JSON));
|
|
||||||
}
|
|
||||||
if(action.equals(Constants.OPACTION_DELETE)){
|
|
||||||
response= header.put(Entity.entity(params, MediaType.APPLICATION_JSON));
|
|
||||||
}
|
|
||||||
if(response != null) {
|
if(response != null) {
|
||||||
result=response.readEntity(String.class);
|
result=response.readEntity(String.class);
|
||||||
}
|
}
|
||||||
@@ -515,7 +498,7 @@ public class ConfigServiceUtil {
|
|||||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||||
}
|
}
|
||||||
long end=System.currentTimeMillis();
|
long end=System.currentTimeMillis();
|
||||||
logger.warn("auditCommonGroupRegionSources end,cost:"+(end-start));
|
logger.warn("postGroupReuseSources end,cost:"+(end-start));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
@@ -525,7 +508,6 @@ public class ConfigServiceUtil {
|
|||||||
}
|
}
|
||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* getReport(配置日志总量统计查询)
|
* getReport(配置日志总量统计查询)
|
||||||
|
|||||||
@@ -13,9 +13,7 @@ public final class Constants {
|
|||||||
*/
|
*/
|
||||||
public static final int IMPORT_LIMIT=Configurations.getIntProperty("import_limit",10000);
|
public static final int IMPORT_LIMIT=Configurations.getIntProperty("import_limit",10000);
|
||||||
public static final Object IMPORT_LOCK=new Object();
|
public static final Object IMPORT_LOCK=new Object();
|
||||||
public static final String ADD_COMMON_REGION=Configurations.getStringProperty("addRegionToCommonGroup","");
|
public static final String GROUP_REUSE_SOURCES=Configurations.getStringProperty("groupReuseSources","groupReuseSources");
|
||||||
public static final String UPDATE_COMMON_REIGON=Configurations.getStringProperty("updateRegionToCommonGroup","");
|
|
||||||
public static final String DELETE_COMMON_REIGON=Configurations.getStringProperty("deleteRegionToCommonGroup","");
|
|
||||||
public static Integer APP_SPEC_SERVICE_CODE_MIN_VAL=Configurations.getIntProperty("app_spec_service_code_min_val", 300001);
|
public static Integer APP_SPEC_SERVICE_CODE_MIN_VAL=Configurations.getIntProperty("app_spec_service_code_min_val", 300001);
|
||||||
public static Integer APP_SPEC_SERVICE_CODE_MAX_VAL=Configurations.getIntProperty("app_spec_service_code_max_val", 268435455);
|
public static Integer APP_SPEC_SERVICE_CODE_MAX_VAL=Configurations.getIntProperty("app_spec_service_code_max_val", 268435455);
|
||||||
public static String APP_CFG_USERREGION_SPLITOR=Configurations.getStringProperty("app_cfg_userregion_splitor", "&");
|
public static String APP_CFG_USERREGION_SPLITOR=Configurations.getStringProperty("app_cfg_userregion_splitor", "&");
|
||||||
@@ -496,8 +494,6 @@ public final class Constants {
|
|||||||
public static final String HTTP_URL_REGION = Configurations.getStringProperty("http_url_region","http_url");
|
public static final String HTTP_URL_REGION = Configurations.getStringProperty("http_url_region","http_url");
|
||||||
public static final String VOIP_IP_REGION = Configurations.getStringProperty("voip_ip","av_voip_ip");
|
public static final String VOIP_IP_REGION = Configurations.getStringProperty("voip_ip","av_voip_ip");
|
||||||
public static final String VOIP_ACCOUNT_REGION = Configurations.getStringProperty("voip_account","av_voip_account");
|
public static final String VOIP_ACCOUNT_REGION = Configurations.getStringProperty("voip_account","av_voip_account");
|
||||||
public static final String NTC_ASN_NUMBER = Configurations.getStringProperty("ntc_asn_number","NTC_ASN_NUMBER");
|
|
||||||
public static final String ASN_KEY = Configurations.getStringProperty("asn_key","AS");
|
|
||||||
public static final String MAAT_VERSION = Configurations.getStringProperty("maat_version","1.0");
|
public static final String MAAT_VERSION = Configurations.getStringProperty("maat_version","1.0");
|
||||||
public static final Integer INSERT_ACTION = Configurations.getIntProperty("insert_action",1);
|
public static final Integer INSERT_ACTION = Configurations.getIntProperty("insert_action",1);
|
||||||
public static final Integer UPDATE_ACTION = Configurations.getIntProperty("update_action",2);
|
public static final Integer UPDATE_ACTION = Configurations.getIntProperty("update_action",2);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class DeleteAsnIpTread implements Callable<Throwable> {
|
|||||||
while(!asnNos.isEmpty()) {
|
while(!asnNos.isEmpty()) {
|
||||||
asnNos.drainTo(asnNoList,5);
|
asnNos.drainTo(asnNoList,5);
|
||||||
for(Long asnNo:asnNoList) {
|
for(Long asnNo:asnNoList) {
|
||||||
AsnGroupInfo configGroupInfo=null;//AsnCacheUtils.get(asnNo);
|
AsnGroupInfo configGroupInfo=AsnCacheUtils.get(asnNo);
|
||||||
if(configGroupInfo==null) {
|
if(configGroupInfo==null) {
|
||||||
configGroupInfo=new AsnGroupInfo();
|
configGroupInfo=new AsnGroupInfo();
|
||||||
configGroupInfo.setAsnId(asnNo);
|
configGroupInfo.setAsnId(asnNo);
|
||||||
@@ -85,7 +85,7 @@ public class DeleteAsnIpTread implements Callable<Throwable> {
|
|||||||
}
|
}
|
||||||
sb.deleteCharAt(sb.toString().lastIndexOf(","));
|
sb.deleteCharAt(sb.toString().lastIndexOf(","));
|
||||||
asnIpCfgDao.delete(sb.toString());
|
asnIpCfgDao.delete(sb.toString());
|
||||||
new AsnIpCfgService().asnIPRegionSendToMaat(listPage, Constants.VALID_NO,1);
|
new AsnIpCfgService().asnIPRegionSendToMaat(listPage, Constants.VALID_NO);
|
||||||
transactionManager.commit(status);
|
transactionManager.commit(status);
|
||||||
listPage.clear();
|
listPage.clear();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ public class SaveAsnIpThread implements Callable<Throwable>{
|
|||||||
_cfg.setAsnIpGroup(asnNoMaps.get(1).get(Long.parseLong(_cfg.getUserRegion1())));
|
_cfg.setAsnIpGroup(asnNoMaps.get(1).get(Long.parseLong(_cfg.getUserRegion1())));
|
||||||
}else {
|
}else {
|
||||||
// ConfigGroupInfo info=asnIpCfgService.getConfigGroupInfoByAsnNo(Long.parseLong(_cfg.getUserRegion1()));
|
// ConfigGroupInfo info=asnIpCfgService.getConfigGroupInfoByAsnNo(Long.parseLong(_cfg.getUserRegion1()));
|
||||||
AsnGroupInfo info=null;//AsnCacheUtils.get(Long.parseLong(_cfg.getUserRegion1()));
|
AsnGroupInfo info=AsnCacheUtils.get(Long.parseLong(_cfg.getUserRegion1()));
|
||||||
if(info==null) {
|
if(info==null) {
|
||||||
info=new AsnGroupInfo();
|
info=new AsnGroupInfo();
|
||||||
info.setAsnId(Long.parseLong(_cfg.getUserRegion1()));
|
info.setAsnId(Long.parseLong(_cfg.getUserRegion1()));
|
||||||
@@ -166,7 +166,7 @@ public class SaveAsnIpThread implements Callable<Throwable>{
|
|||||||
this.save(cfgs);
|
this.save(cfgs);
|
||||||
// splitAndSend(toAddRegionAsnIpCfgs,Constants.VALID_YES);
|
// splitAndSend(toAddRegionAsnIpCfgs,Constants.VALID_YES);
|
||||||
if(toAddRegionAsnIpCfgs.size()>0) {
|
if(toAddRegionAsnIpCfgs.size()>0) {
|
||||||
new AsnIpCfgService().asnIPRegionSendToMaat(toAddRegionAsnIpCfgs,Constants.VALID_YES,1);
|
new AsnIpCfgService().asnIPRegionSendToMaat(toAddRegionAsnIpCfgs,Constants.VALID_YES);
|
||||||
}
|
}
|
||||||
cfgs.clear();
|
cfgs.clear();
|
||||||
toAddRegionAsnIpCfgs.clear();
|
toAddRegionAsnIpCfgs.clear();
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
package com.nis.web.controller.basics;
|
package com.nis.web.controller.basics;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -102,8 +97,6 @@ public class AsnGroupController extends BaseController {
|
|||||||
public String delete(RedirectAttributes redirectAttributes,String ids,String asnIds) {
|
public String delete(RedirectAttributes redirectAttributes,String ids,String asnIds) {
|
||||||
try {
|
try {
|
||||||
asnGroupInfoService.delete(ids,asnIds);
|
asnGroupInfoService.delete(ids,asnIds);
|
||||||
//TODO 查询本次删除的所有asnOrg组中是否存在asn 没有is_used=0的asn,如果存在则需要将整个组删除
|
|
||||||
|
|
||||||
addMessage(redirectAttributes,"success","delete_success");
|
addMessage(redirectAttributes,"success","delete_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("删除失败",e);
|
logger.error("删除失败",e);
|
||||||
@@ -185,38 +178,5 @@ public class AsnGroupController extends BaseController {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 异步获取ASN组织信息
|
|
||||||
* @param model
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequestMapping(value="ajaxGetAsnOrg")
|
|
||||||
@ResponseBody
|
|
||||||
public List ajaxGetAsnOrg( ConfigGroupInfo orgGroup,Model model){
|
|
||||||
List<ConfigGroupInfo> orgaList=new ArrayList<>();
|
|
||||||
try {
|
|
||||||
orgaList=configGroupInfoService.findAllList(orgGroup);
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("异步获取ASN组织信息失败",e);
|
|
||||||
return orgaList;
|
|
||||||
}
|
|
||||||
return orgaList;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 异步获取ASN组织信息
|
|
||||||
* @param model
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequestMapping(value="ajaxGetAsnNo")
|
|
||||||
@ResponseBody
|
|
||||||
public List ajaxGetAsnNo(AsnGroupInfo asnGroup,Model model){
|
|
||||||
List<AsnGroupInfo> orgaList=new ArrayList<>();
|
|
||||||
try {
|
|
||||||
orgaList=asnGroupInfoService.findAsnGroupList(asnGroup);
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("异步获取ASN NO信息失败",e);
|
|
||||||
return orgaList;
|
|
||||||
}
|
|
||||||
return orgaList;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,20 +134,7 @@ public class AsnIpController extends BaseController{
|
|||||||
asnIpMap.put(Long.parseLong(asnIpCfg.getUserRegion1()), _asnIps);
|
asnIpMap.put(Long.parseLong(asnIpCfg.getUserRegion1()), _asnIps);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/********************每次下发一个组的region,保证事物********************/
|
asnIpCfgService.auditIpBatch(asnIpMap,isValid);
|
||||||
for (Long asnId : asnIpMap.keySet()) {
|
|
||||||
try {
|
|
||||||
asnIpCfgService.auditIpBatch(asnIpMap.get(asnId),asnId,isValid);
|
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("配置下发失败:",e);
|
|
||||||
if(e instanceof MaatConvertException) {
|
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
|
||||||
}else {
|
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}/*else {
|
}/*else {
|
||||||
//条件下所有配置审核
|
//条件下所有配置审核
|
||||||
Page<AsnIpCfg> searchPage=new Page<AsnIpCfg>(request,response,"a");
|
Page<AsnIpCfg> searchPage=new Page<AsnIpCfg>(request,response,"a");
|
||||||
|
|||||||
@@ -29,7 +29,4 @@ public interface AsnGroupInfoDao extends CrudDao<AsnGroupInfo> {
|
|||||||
List<AsnGroupInfo> findAsnGroupInfos();
|
List<AsnGroupInfo> findAsnGroupInfos();
|
||||||
Long getCount();
|
Long getCount();
|
||||||
void modifyIssuedIp(AsnGroupInfo info);
|
void modifyIssuedIp(AsnGroupInfo info);
|
||||||
List<AsnGroupInfo> findAsnGroupInfoByAsnGroup(AsnGroupInfo asnGroupInfo);
|
|
||||||
void updateIsUsedAndIsValid(@Param("asnNos")List asnNos,@Param("isUsed")Integer isUsed,@Param("isValid")Integer isValid);
|
|
||||||
List<AsnGroupInfo> findAsnGroupInfoByAsnNos(@Param("asnNos")List asnNos,@Param("isUsed")Integer isUsed);
|
|
||||||
}
|
}
|
||||||
@@ -15,12 +15,10 @@
|
|||||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||||
<result column="asn_id" property="asnId" jdbcType="BIGINT" />
|
<result column="asn_id" property="asnId" jdbcType="BIGINT" />
|
||||||
<result column="issued_ips" property="issuedIPs" jdbcType="INTEGER" />
|
<result column="issued_ips" property="issuedIPs" jdbcType="INTEGER" />
|
||||||
<result column="is_used" property="isUsed" jdbcType="INTEGER" />
|
|
||||||
<result column="region_id" property="regionId" jdbcType="INTEGER" />
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="AsnGroupInfoColumns">
|
<sql id="AsnGroupInfoColumns">
|
||||||
r.id,r.group_id,r.compile_id,r.organization,r.country,r.detail,r.is_valid,r.create_time,r.edit_time,
|
r.id,r.group_id,r.compile_id,r.organization,r.country,r.detail,r.is_valid,r.create_time,r.edit_time,
|
||||||
r.creator_id,r.editor_id,r.asn_id,r.issued_ips,r.is_used,r.region_id
|
r.creator_id,r.editor_id,r.asn_id,r.issued_ips
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 查出所有 有效数据-->
|
<!-- 查出所有 有效数据-->
|
||||||
@@ -81,7 +79,7 @@
|
|||||||
<select id="findAsnGroupInfos" resultMap="AsnGroupInfoMap">
|
<select id="findAsnGroupInfos" resultMap="AsnGroupInfoMap">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="AsnGroupInfoColumns"/>
|
<include refid="AsnGroupInfoColumns"/>
|
||||||
FROM asn_group_info r where r.is_valid !=-1
|
FROM asn_group_info r where is_valid !=-1
|
||||||
</select>
|
</select>
|
||||||
<select id="getCount" resultType="java.lang.Long">
|
<select id="getCount" resultType="java.lang.Long">
|
||||||
SELECT count(1)
|
SELECT count(1)
|
||||||
@@ -89,20 +87,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insert" parameterType="com.nis.domain.basics.AsnGroupInfo" >
|
<insert id="insert" parameterType="com.nis.domain.basics.AsnGroupInfo" >
|
||||||
insert into asn_group_info(
|
insert into asn_group_info(group_id,compile_id,organization,country,detail,is_valid,creator_id,create_time,editor_id,edit_time,asn_id
|
||||||
group_id,
|
|
||||||
compile_id,
|
|
||||||
organization,
|
|
||||||
country,
|
|
||||||
detail,
|
|
||||||
is_valid,
|
|
||||||
creator_id,
|
|
||||||
create_time,
|
|
||||||
editor_id,
|
|
||||||
edit_time,
|
|
||||||
asn_id,
|
|
||||||
is_used,
|
|
||||||
region_id
|
|
||||||
)values (
|
)values (
|
||||||
#{groupId,jdbcType=INTEGER},
|
#{groupId,jdbcType=INTEGER},
|
||||||
#{compileId,jdbcType=INTEGER},
|
#{compileId,jdbcType=INTEGER},
|
||||||
@@ -114,9 +99,7 @@
|
|||||||
#{createTime,jdbcType=TIMESTAMP},
|
#{createTime,jdbcType=TIMESTAMP},
|
||||||
#{editorId,jdbcType=INTEGER},
|
#{editorId,jdbcType=INTEGER},
|
||||||
#{editTime,jdbcType=TIMESTAMP},
|
#{editTime,jdbcType=TIMESTAMP},
|
||||||
#{asnId,jdbcType=INTEGER},
|
#{asnId,jdbcType=INTEGER}
|
||||||
#{isUsed,jdbcType=INTEGER},
|
|
||||||
#{regionId,jdbcType=INTEGER}
|
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -154,12 +137,6 @@
|
|||||||
<if test="editTime != null and editTime != ''" >
|
<if test="editTime != null and editTime != ''" >
|
||||||
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
</if>
|
||||||
<if test="isUsed != null" >
|
|
||||||
is_used = #{isUsed,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="regionId != null" >
|
|
||||||
region_id = #{regionId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
</set>
|
</set>
|
||||||
<where>
|
<where>
|
||||||
@@ -170,28 +147,6 @@
|
|||||||
</trim>
|
</trim>
|
||||||
</where>
|
</where>
|
||||||
</update>
|
</update>
|
||||||
<update id="updateIsUsedAndIsValid" >
|
|
||||||
update asn_group_info
|
|
||||||
<set >
|
|
||||||
<if test="isUsed != null" >
|
|
||||||
is_used = #{isUsed,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null" >
|
|
||||||
is_valid = #{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
<where>
|
|
||||||
<if test="asnNos != null" >
|
|
||||||
and asn_id in
|
|
||||||
<foreach collection ="asnNos" item="asnId" separator ="," open="(" close=")">
|
|
||||||
#{asnId}
|
|
||||||
</foreach >
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null" >
|
|
||||||
and is_valid != #{isValid,jdbcType=INTEGER}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</update>
|
|
||||||
<update id="updateValid" parameterType="com.nis.domain.basics.AsnGroupInfo" >
|
<update id="updateValid" parameterType="com.nis.domain.basics.AsnGroupInfo" >
|
||||||
update asn_group_info
|
update asn_group_info
|
||||||
<set >
|
<set >
|
||||||
@@ -250,7 +205,7 @@
|
|||||||
<select id="getByGroupId" resultType="com.nis.domain.basics.AsnGroupInfo">
|
<select id="getByGroupId" resultType="com.nis.domain.basics.AsnGroupInfo">
|
||||||
select <include refid="AsnGroupInfoColumns"/>
|
select <include refid="AsnGroupInfoColumns"/>
|
||||||
from asn_group_info r
|
from asn_group_info r
|
||||||
where r.group_id =#{groupId} and r.is_valid !=-1
|
where r.group_id =#{groupId} and is_valid !=-1
|
||||||
</select>
|
</select>
|
||||||
<select id="getGroupInfoByName" resultType="com.nis.domain.basics.AsnGroupInfo">
|
<select id="getGroupInfoByName" resultType="com.nis.domain.basics.AsnGroupInfo">
|
||||||
select <include refid="AsnGroupInfoColumns"/>
|
select <include refid="AsnGroupInfoColumns"/>
|
||||||
@@ -288,13 +243,13 @@
|
|||||||
SELECT
|
SELECT
|
||||||
<include refid="AsnGroupInfoColumns"/>
|
<include refid="AsnGroupInfoColumns"/>
|
||||||
FROM
|
FROM
|
||||||
asn_group_info r WHERE r.group_id = #{groupId,jdbcType=INTEGER} AND r.is_valid !=-1
|
asn_group_info r WHERE group_id = #{groupId,jdbcType=INTEGER} AND is_valid !=-1
|
||||||
</select>
|
</select>
|
||||||
<select id="getConfigGroupInfoByName" resultType="com.nis.domain.basics.AsnGroupInfo">
|
<select id="getConfigGroupInfoByName" resultType="com.nis.domain.basics.AsnGroupInfo">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="AsnGroupInfoColumns"/>
|
<include refid="AsnGroupInfoColumns"/>
|
||||||
FROM
|
FROM
|
||||||
asn_group_info r WHERE r.organization = #{organization,jdbcType=VARCHAR} AND r.is_valid !=-1
|
asn_group_info r WHERE organization = #{organization,jdbcType=VARCHAR} AND is_valid !=-1
|
||||||
</select>
|
</select>
|
||||||
<select id="getValidConfigGroupInfoByName" resultType="com.nis.domain.basics.AsnGroupInfo">
|
<select id="getValidConfigGroupInfoByName" resultType="com.nis.domain.basics.AsnGroupInfo">
|
||||||
SELECT
|
SELECT
|
||||||
@@ -323,49 +278,11 @@
|
|||||||
asn_group_info r
|
asn_group_info r
|
||||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||||
<if test="organization != null and organization != ''" >
|
<if test="organization != null and organization != ''" >
|
||||||
AND r.organization = #{organization,jdbcType=VARCHAR}
|
AND organization = #{organization,jdbcType=VARCHAR}
|
||||||
</if>
|
</if>
|
||||||
<if test="asnId != null" >
|
<if test="asnId != null" >
|
||||||
AND r.asn_id = #{asnId,jdbcType=INTEGER}
|
AND asn_id = #{asnId,jdbcType=INTEGER}
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="findAsnGroupInfoByAsnGroup" resultMap="AsnGroupInfoMap">
|
|
||||||
SELECT
|
|
||||||
<include refid="AsnGroupInfoColumns"/>
|
|
||||||
FROM
|
|
||||||
asn_group_info r
|
|
||||||
<where>
|
|
||||||
<if test="asnId != null" >
|
|
||||||
AND r.asn_id = #{asnId,jdbcType=INTEGER}
|
|
||||||
</if>
|
|
||||||
<if test="isUsed != null" >
|
|
||||||
AND r.is_used = #{isUsed,jdbcType=INTEGER}
|
|
||||||
</if>
|
|
||||||
<if test="organization != null and organization != ''" >
|
|
||||||
AND r.organization = #{organization,jdbcType=VARCHAR}
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null" >
|
|
||||||
AND r.is_valid = #{isValid,jdbcType=VARCHAR}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
<select id="findAsnGroupInfoByAsnNos" resultMap="AsnGroupInfoMap">
|
|
||||||
SELECT
|
|
||||||
<include refid="AsnGroupInfoColumns"/>
|
|
||||||
FROM
|
|
||||||
asn_group_info r
|
|
||||||
<where>
|
|
||||||
<if test="isUsed != null" >
|
|
||||||
AND r.is_used = #{isUsed,jdbcType=INTEGER}
|
|
||||||
</if>
|
|
||||||
<if test="asnNos != null" >
|
|
||||||
and r.asn_id in
|
|
||||||
<foreach collection ="asnNos" item="asnId" separator ="," open="(" close=")">
|
|
||||||
#{asnId}
|
|
||||||
</foreach >
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -4,7 +4,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import com.nis.domain.basics.AsnGroupInfo;
|
|
||||||
import com.nis.domain.basics.AsnIpCfg;
|
import com.nis.domain.basics.AsnIpCfg;
|
||||||
import com.nis.domain.basics.Varibles;
|
import com.nis.domain.basics.Varibles;
|
||||||
import com.nis.web.dao.CrudDao;
|
import com.nis.web.dao.CrudDao;
|
||||||
@@ -21,7 +20,6 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
|||||||
public List<Integer> hasASNIds(@Param("ids")String ids);
|
public List<Integer> hasASNIds(@Param("ids")String ids);
|
||||||
public List<Integer> hasASNIpAddrs(@Param("ids")String ids);
|
public List<Integer> hasASNIpAddrs(@Param("ids")String ids);
|
||||||
public List<AsnIpCfg> findAllList(AsnIpCfg cfg);
|
public List<AsnIpCfg> findAllList(AsnIpCfg cfg);
|
||||||
public List<AsnIpCfg> findAllListByAsnGroup(@Param("entity")AsnIpCfg entity,@Param("asnGroups")List<AsnGroupInfo> asnGroups,@Param("asnIds")String asnIds);
|
|
||||||
// public List<ConfigGroupInfo> findPolicyGroupInfosByType(@Param("groupId")Integer groupId);
|
// public List<ConfigGroupInfo> findPolicyGroupInfosByType(@Param("groupId")Integer groupId);
|
||||||
public List<Integer> findOtherIps(@Param("groupId")Integer groupId,@Param("cfgId")Integer cfgId);
|
public List<Integer> findOtherIps(@Param("groupId")Integer groupId,@Param("cfgId")Integer cfgId);
|
||||||
public List<Integer> countValidIPs(@Param("groups")String groups,@Param("ids")String ids);
|
public List<Integer> countValidIPs(@Param("groups")String groups,@Param("ids")String ids);
|
||||||
@@ -34,5 +32,4 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
|||||||
public int hasValidAsnIp(@Param("asnId")Long asnNo);
|
public int hasValidAsnIp(@Param("asnId")Long asnNo);
|
||||||
public AsnIpCfg getOne(AsnIpCfg cfg);
|
public AsnIpCfg getOne(AsnIpCfg cfg);
|
||||||
public void updateAsn(@Param("asnId")String asnNo,@Param("organization")String organization,@Param("country")String country,@Param("detail")String detail);
|
public void updateAsn(@Param("asnId")String asnNo,@Param("organization")String organization,@Param("country")String country,@Param("detail")String detail);
|
||||||
public void updateAsnIpByAsnGroups(@Param("entity")AsnIpCfg entity,@Param("asnGroups")List<AsnGroupInfo> asnGroups,@Param("asnIds")String asnIds);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -308,26 +308,6 @@
|
|||||||
AND r.asn_ip_group =#{asnIpGroup}
|
AND r.asn_ip_group =#{asnIpGroup}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="findAllListByAsnGroup" resultMap="asnIpCfgMap">
|
|
||||||
select
|
|
||||||
<include refid="columns"></include>
|
|
||||||
from asn_ip_cfg r
|
|
||||||
<where>
|
|
||||||
and is_valid=#{entity.isValid,jdbcType=INTEGER}
|
|
||||||
and is_audit=#{entity.isAudit,jdbcType=INTEGER}
|
|
||||||
<if test=" asnGroups != null">
|
|
||||||
and r.user_region1 in
|
|
||||||
<foreach collection ="asnGroups" item="asnGroup" separator ="," open="(" close=")">
|
|
||||||
#{asnGroup.asnId,jdbcType=INTEGER}
|
|
||||||
</foreach >
|
|
||||||
</if>
|
|
||||||
<if test=" asnIds != null and asnIds !=''">
|
|
||||||
and r.user_region1 in (select asn_id from asn_group_info where asn_id in(${asnIds}) and is_used=0)
|
|
||||||
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
|
|
||||||
</select>
|
|
||||||
<select id="getByIds" resultMap="asnIpCfgMap">
|
<select id="getByIds" resultMap="asnIpCfgMap">
|
||||||
select
|
select
|
||||||
<include refid="columns"></include>
|
<include refid="columns"></include>
|
||||||
@@ -647,26 +627,6 @@
|
|||||||
<!-- left join policy_group_info d on r.asn_ip_group = d.service_group_id -->
|
<!-- left join policy_group_info d on r.asn_ip_group = d.service_group_id -->
|
||||||
where r.CFG_ID in (${ids})
|
where r.CFG_ID in (${ids})
|
||||||
</select>
|
</select>
|
||||||
<update id="updateAsnIpByAsnGroups" >
|
|
||||||
update asn_ip_cfg set
|
|
||||||
<if test=" asnIds != null and asnIds !=''">
|
|
||||||
is_valid=#{entity.isValid} ,
|
|
||||||
is_audit=#{entity.isAudit},
|
|
||||||
</if>
|
|
||||||
AUDITOR_ID = #{entity.auditorId,jdbcType=INTEGER}
|
|
||||||
,AUDIT_TIME = #{entity.auditTime,jdbcType=TIMESTAMP}
|
|
||||||
<where>
|
|
||||||
<if test=" asnGroups != null">
|
|
||||||
and user_region1 in
|
|
||||||
<foreach collection ="asnGroups" item="asnGroup" separator ="," open="(" close=")">
|
|
||||||
#{asnGroup.asnId,jdbcType=INTEGER}
|
|
||||||
</foreach >
|
|
||||||
</if>
|
|
||||||
<if test=" asnIds != null and asnIds !=''">
|
|
||||||
and user_region1 in (select asn_id from asn_group_info where asn_id in(${asnIds}) and is_used=0)
|
|
||||||
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</update>
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -80,7 +80,6 @@
|
|||||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||||
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
||||||
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
||||||
<result column="common_group_ids" property="commonGroupIds" jdbcType="VARCHAR" />
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<resultMap id="ipPortMap" type="com.nis.domain.configuration.IpPortCfg" >
|
<resultMap id="ipPortMap" type="com.nis.domain.configuration.IpPortCfg" >
|
||||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||||
@@ -199,7 +198,7 @@
|
|||||||
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
|
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
|
||||||
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
|
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
|
||||||
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.dns_strategy_id,a.user_region1,
|
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.dns_strategy_id,a.user_region1,
|
||||||
a.user_region2,a.user_region3,a.user_region4,a.user_region5,a.do_log,a.do_blacklist,a.common_group_ids
|
a.user_region2,a.user_region3,a.user_region4,a.user_region5,a.do_log,a.do_blacklist
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="IpCfg_Column" >
|
<sql id="IpCfg_Column" >
|
||||||
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
|
||||||
@@ -813,7 +812,6 @@
|
|||||||
user_region5,
|
user_region5,
|
||||||
do_log,
|
do_log,
|
||||||
do_blacklist
|
do_blacklist
|
||||||
,common_group_ids
|
|
||||||
)values (
|
)values (
|
||||||
#{cfgDesc,jdbcType=VARCHAR},
|
#{cfgDesc,jdbcType=VARCHAR},
|
||||||
#{action,jdbcType=INTEGER},
|
#{action,jdbcType=INTEGER},
|
||||||
@@ -841,8 +839,7 @@
|
|||||||
#{userRegion4,jdbcType=VARCHAR},
|
#{userRegion4,jdbcType=VARCHAR},
|
||||||
#{userRegion5,jdbcType=VARCHAR},
|
#{userRegion5,jdbcType=VARCHAR},
|
||||||
#{doLog,jdbcType=INTEGER},
|
#{doLog,jdbcType=INTEGER},
|
||||||
#{doBlackList,jdbcType=INTEGER},
|
#{doBlackList,jdbcType=INTEGER}
|
||||||
#{commonGroupIds,jdbcType=VARCHAR}
|
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="saveCfgIndexForBatch" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
<insert id="saveCfgIndexForBatch" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
||||||
@@ -873,8 +870,7 @@
|
|||||||
user_region4,
|
user_region4,
|
||||||
user_region5,
|
user_region5,
|
||||||
do_log,
|
do_log,
|
||||||
do_blacklist,
|
do_blacklist
|
||||||
common_group_ids
|
|
||||||
)values (
|
)values (
|
||||||
#{cfgDesc,jdbcType=VARCHAR},
|
#{cfgDesc,jdbcType=VARCHAR},
|
||||||
#{action,jdbcType=INTEGER},
|
#{action,jdbcType=INTEGER},
|
||||||
@@ -902,8 +898,7 @@
|
|||||||
#{userRegion4,jdbcType=VARCHAR},
|
#{userRegion4,jdbcType=VARCHAR},
|
||||||
#{userRegion5,jdbcType=VARCHAR},
|
#{userRegion5,jdbcType=VARCHAR},
|
||||||
#{doLog,jdbcType=INTEGER},
|
#{doLog,jdbcType=INTEGER},
|
||||||
#{doBlackList,jdbcType=INTEGER},
|
#{doBlackList,jdbcType=INTEGER}
|
||||||
#{commonGroupIds,jdbcType=VARCHAR}
|
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<!-- insert ip_port_cfg表信息 -->
|
<!-- insert ip_port_cfg表信息 -->
|
||||||
@@ -995,7 +990,6 @@
|
|||||||
action = #{action,jdbcType=INTEGER},
|
action = #{action,jdbcType=INTEGER},
|
||||||
do_log = #{doLog,jdbcType=INTEGER},
|
do_log = #{doLog,jdbcType=INTEGER},
|
||||||
do_blacklist = #{doBlackList,jdbcType=INTEGER},
|
do_blacklist = #{doBlackList,jdbcType=INTEGER},
|
||||||
common_group_ids = #{commonGroupIds,jdbcType=VARCHAR},
|
|
||||||
is_valid = #{isValid,jdbcType=INTEGER},
|
is_valid = #{isValid,jdbcType=INTEGER},
|
||||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||||
<if test="creatorId != null" >
|
<if test="creatorId != null" >
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import java.util.List;
|
|||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import com.nis.domain.configuration.AsnKeywordCfg;
|
import com.nis.domain.configuration.AsnKeywordCfg;
|
||||||
import com.nis.domain.configuration.BaseCfg;
|
|
||||||
import com.nis.domain.configuration.BaseStringCfg;
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
import com.nis.domain.configuration.CfgIndexInfo;
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||||
@@ -25,7 +24,6 @@ public interface StringCfgDao extends CrudDao<BaseStringCfg>{
|
|||||||
public List<BaseStringCfg> findList(BaseStringCfg entity) ;
|
public List<BaseStringCfg> findList(BaseStringCfg entity) ;
|
||||||
public int insert(BaseStringCfg entity) ;
|
public int insert(BaseStringCfg entity) ;
|
||||||
public int update(BaseStringCfg entity) ;
|
public int update(BaseStringCfg entity) ;
|
||||||
public int updateAsnKeyword(BaseStringCfg entity) ;
|
|
||||||
public int updateValid(BaseStringCfg entity) ;
|
public int updateValid(BaseStringCfg entity) ;
|
||||||
public int audit(BaseStringCfg entity) ;
|
public int audit(BaseStringCfg entity) ;
|
||||||
public int getIsValid(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
public int getIsValid(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
||||||
@@ -48,7 +46,7 @@ public interface StringCfgDao extends CrudDao<BaseStringCfg>{
|
|||||||
public void deleteByCompileIds(@Param("user")long user,@Param("tableName")String tableName,@Param("compileIds")String compileIds);
|
public void deleteByCompileIds(@Param("user")long user,@Param("tableName")String tableName,@Param("compileIds")String compileIds);
|
||||||
public List<NtcSubscribeIdCfg> findSubscribeIdCfgListByCfgIndexInfo(CfgIndexInfo entity);
|
public List<NtcSubscribeIdCfg> findSubscribeIdCfgListByCfgIndexInfo(CfgIndexInfo entity);
|
||||||
public void deleteSubscribeIdCfgByCfgIndexInfo(CfgIndexInfo entity);
|
public void deleteSubscribeIdCfgByCfgIndexInfo(CfgIndexInfo entity);
|
||||||
public void deleteAsnKeyword(BaseCfg entity);
|
public void deleteAsnKeyword(CfgIndexInfo entity);
|
||||||
public List<NtcSubscribeIdCfg> findSubscribeIdCfgList(NtcSubscribeIdCfg ntcSubscribeIdCfg);
|
public List<NtcSubscribeIdCfg> findSubscribeIdCfgList(NtcSubscribeIdCfg ntcSubscribeIdCfg);
|
||||||
public List<AsnKeywordCfg> findAsnKeywordCfgList(CfgIndexInfo entity);
|
public List<AsnKeywordCfg> findAsnKeywordCfgList(CfgIndexInfo entity);
|
||||||
public void saveSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg);
|
public void saveSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg);
|
||||||
|
|||||||
@@ -483,95 +483,6 @@
|
|||||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updateAsnKeyword" parameterType="com.nis.domain.configuration.BaseStringCfg" >
|
|
||||||
update ${tableName}
|
|
||||||
<set >
|
|
||||||
<trim suffixOverrides=",">
|
|
||||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
|
||||||
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="cfgKeywords != null and cfgKeywords != ''">
|
|
||||||
cfg_keywords = #{cfgKeywords,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="cfgType != null and cfgType != ''">
|
|
||||||
CFG_TYPE=#{cfgType,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="action != null" >
|
|
||||||
action = #{action,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="isValid != null" >
|
|
||||||
is_valid = #{isValid,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="isAudit != null" >
|
|
||||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="creatorId != null" >
|
|
||||||
creator_id = #{creatorId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null" >
|
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="editorId != null" >
|
|
||||||
editor_id = #{editorId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="editTime != null and editTime != ''" >
|
|
||||||
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="auditorId != null" >
|
|
||||||
auditor_id = #{auditorId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="auditTime != null and auditTime != ''" >
|
|
||||||
audit_time = #{auditTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="serviceId != null" >
|
|
||||||
service_id = #{serviceId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="requestId != null" >
|
|
||||||
request_id = #{requestId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="compileId != null" >
|
|
||||||
compile_id = #{compileId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="isAreaEffective != null" >
|
|
||||||
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="classify != null and classify != ''" >
|
|
||||||
classify = #{classify,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="attribute != null and attribute != ''" >
|
|
||||||
attribute = #{attribute,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="lable != null and lable != ''" >
|
|
||||||
lable = #{lable,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="exprType != null">
|
|
||||||
expr_type=#{exprType,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="matchMethod != null">
|
|
||||||
match_method=#{matchMethod,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="isHexbin != null">
|
|
||||||
is_hexbin=#{isHexbin,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="areaEffectiveIds != null" >
|
|
||||||
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="functionId != null" >
|
|
||||||
function_id = #{functionId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="cfgRegionCode != null" >
|
|
||||||
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
USER_REGION1=#{userRegion1,jdbcType=VARCHAR},
|
|
||||||
USER_REGION2=#{userRegion2,jdbcType=VARCHAR},
|
|
||||||
USER_REGION3=#{userRegion3,jdbcType=VARCHAR},
|
|
||||||
USER_REGION4=#{userRegion4,jdbcType=VARCHAR},
|
|
||||||
USER_REGION5=#{userRegion5,jdbcType=VARCHAR},
|
|
||||||
</trim>
|
|
||||||
</set>
|
|
||||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<update id="updateValid" parameterType="com.nis.domain.configuration.BaseStringCfg" >
|
<update id="updateValid" parameterType="com.nis.domain.configuration.BaseStringCfg" >
|
||||||
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where cfg_id = #{cfgId,jdbcType=BIGINT}
|
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
@@ -841,7 +752,7 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</delete>
|
</delete>
|
||||||
<delete id="deleteAsnKeyword" parameterType="com.nis.domain.configuration.BaseCfg" >
|
<delete id="deleteAsnKeyword" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
||||||
delete from asn_keyword_cfg
|
delete from asn_keyword_cfg
|
||||||
<where>
|
<where>
|
||||||
<if test="compileId != null" >
|
<if test="compileId != null" >
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ public interface ConfigGroupInfoDao extends CrudDao<ConfigGroupInfo>{
|
|||||||
void insertConfigGroupInfo(ConfigGroupInfo entity);
|
void insertConfigGroupInfo(ConfigGroupInfo entity);
|
||||||
int insertBatch(List<ConfigGroupInfo> list);
|
int insertBatch(List<ConfigGroupInfo> list);
|
||||||
void updateConfigGroupInfobyGroupId(ConfigGroupInfo entity);
|
void updateConfigGroupInfobyGroupId(ConfigGroupInfo entity);
|
||||||
void updateAsnOrgGroupByGroupInfo(ConfigGroupInfo entity);
|
|
||||||
ConfigGroupInfo getConfigGroupInfoByGroupId(Integer groupId);
|
ConfigGroupInfo getConfigGroupInfoByGroupId(Integer groupId);
|
||||||
@Cacheable(value="asnNoCache",key="#asnNo")
|
@Cacheable(value="asnNoCache",key="#asnNo")
|
||||||
ConfigGroupInfo getInfoByAsnNo(@Param("asnId")Long asnNo);
|
ConfigGroupInfo getInfoByAsnNo(@Param("asnId")Long asnNo);
|
||||||
@@ -24,6 +23,4 @@ public interface ConfigGroupInfoDao extends CrudDao<ConfigGroupInfo>{
|
|||||||
//获取asn组织的groupId
|
//获取asn组织的groupId
|
||||||
ConfigGroupInfo getAsnGroupByName(@Param("groupName")String groupName);
|
ConfigGroupInfo getAsnGroupByName(@Param("groupName")String groupName);
|
||||||
int delAsnGroup(@Param("groupName")String groupName);
|
int delAsnGroup(@Param("groupName")String groupName);
|
||||||
void updateIsAuditAll(@Param("groupType")Integer groupType,@Param("isAuditAll")Integer isAuditAll,@Param("groupIds")List groupIds);
|
|
||||||
void updateIsUsed(@Param("groupType")Integer groupType,@Param("isUsed")Integer isUsed,@Param("groupIds")List groupIds);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,12 +10,11 @@
|
|||||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
||||||
<result column="group_type" property="groupType" jdbcType="INTEGER" />
|
<result column="group_type" property="groupType" jdbcType="INTEGER" />
|
||||||
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
||||||
<result column="is_audit_all" property="isAuditAll" jdbcType="INTEGER" />
|
<result column="asn_id" property="asnId" jdbcType="BIGINT" />
|
||||||
<result column="is_used" property="isUsed" jdbcType="INTEGER" />
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="columns">
|
<sql id="columns">
|
||||||
id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id,is_audit_all
|
id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id
|
||||||
</sql>
|
</sql>
|
||||||
<select id="findAllList" resultMap="configGroupInfoMap">
|
<select id="findAllList" resultMap="configGroupInfoMap">
|
||||||
select
|
select
|
||||||
@@ -44,14 +43,14 @@
|
|||||||
</select>
|
</select>
|
||||||
<!-- 新增配置分组信息 -->
|
<!-- 新增配置分组信息 -->
|
||||||
<insert id="insertConfigGroupInfo" parameterType="com.nis.domain.specific.ConfigGroupInfo" useGeneratedKeys="true">
|
<insert id="insertConfigGroupInfo" parameterType="com.nis.domain.specific.ConfigGroupInfo" useGeneratedKeys="true">
|
||||||
insert into config_group_info (id,group_id,group_name,is_issued,insert_time,group_type,compile_id,asn_id,is_audit_all,is_used)
|
insert into config_group_info (id,group_id,group_name,is_issued,insert_time,group_type,compile_id,asn_id)
|
||||||
values(#{id},#{groupId},#{groupName},#{isIssued},now(),#{groupType},#{compileId},#{asnId},#{isAuditAll},#{isUsed})
|
values(#{id},#{groupId},#{groupName},#{isIssued},now(),#{groupType},#{compileId},#{asnId})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertBatch">
|
<insert id="insertBatch">
|
||||||
insert into config_group_info (id,group_id,group_name,is_issued,insert_time,group_type,compile_id,asn_id,is_audit_all,is_used)
|
insert into config_group_info (id,group_id,group_name,is_issued,insert_time,group_type,compile_id,asn_id)
|
||||||
values
|
values
|
||||||
<foreach collection ="list" item="info" separator =",">
|
<foreach collection ="list" item="info" separator =",">
|
||||||
(#{info.id},#{info.groupId},#{info.groupName},#{info.isIssued},now(),#{info.groupType},#{info.compileId},#{info.asnId},#{info.isAuditAll},#{info.isUsed})
|
(#{info.id},#{info.groupId},#{info.groupName},#{info.isIssued},now(),#{info.groupType},#{info.compileId},#{info.asnId})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
<!-- 修改配置分组状态信息 -->
|
<!-- 修改配置分组状态信息 -->
|
||||||
@@ -63,16 +62,16 @@
|
|||||||
where group_id = #{groupId}
|
where group_id = #{groupId}
|
||||||
</update>
|
</update>
|
||||||
<select id="getInfoByAsnNo" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Long">
|
<select id="getInfoByAsnNo" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Long">
|
||||||
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id,is_audit_all,is_used
|
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id
|
||||||
from config_group_info c where c.asn_id= #{asnId} and c.group_type=4
|
from config_group_info c where c.asn_id= #{asnId} and c.group_type=4
|
||||||
</select>
|
</select>
|
||||||
<!-- 根据groupId查出配置分组信息 -->
|
<!-- 根据groupId查出配置分组信息 -->
|
||||||
<select id="getConfigGroupInfoByGroupId" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
|
<select id="getConfigGroupInfoByGroupId" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
|
||||||
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id,is_audit_all,is_used
|
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id
|
||||||
from config_group_info where group_id= #{groupId}
|
from config_group_info where group_id= #{groupId}
|
||||||
</select>
|
</select>
|
||||||
<select id="getAsnGroupByName" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.String">
|
<select id="getAsnGroupByName" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.String">
|
||||||
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id,is_audit_all,is_used
|
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id
|
||||||
from config_group_info where group_type=4 and group_name= #{groupName}
|
from config_group_info where group_type=4 and group_name= #{groupName}
|
||||||
</select>
|
</select>
|
||||||
<!-- <select id="findPolicyGroupInfosByType" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
|
<!-- <select id="findPolicyGroupInfosByType" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
|
||||||
@@ -88,46 +87,4 @@
|
|||||||
<delete id="delAsnGroup" parameterType="java.lang.String">
|
<delete id="delAsnGroup" parameterType="java.lang.String">
|
||||||
delete from config_group_info where group_name=#{groupName} and group_type=4
|
delete from config_group_info where group_name=#{groupName} and group_type=4
|
||||||
</delete>
|
</delete>
|
||||||
<update id="updateAsnOrgGroupByGroupInfo" parameterType="com.nis.domain.specific.ConfigGroupInfo">
|
|
||||||
UPDATE config_group_info set is_issued = #{isIssued},update_time=now()
|
|
||||||
<where>
|
|
||||||
<if test="groupType != null">
|
|
||||||
and group_type =#{groupType}
|
|
||||||
</if>
|
|
||||||
<if test="groupId != null ">
|
|
||||||
and group_id =#{groupId}
|
|
||||||
</if>
|
|
||||||
<if test="groupName != null and groupName != ''">
|
|
||||||
and group_name =#{groupName}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</update>
|
|
||||||
<update id="updateIsUsed" >
|
|
||||||
UPDATE config_group_info set is_used = #{isUsed},update_time=now()
|
|
||||||
<where>
|
|
||||||
<if test="groupType != null">
|
|
||||||
and group_type =#{groupType}
|
|
||||||
</if>
|
|
||||||
<if test="groupIds != null ">
|
|
||||||
and group_id in
|
|
||||||
<foreach collection ="groupIds" item="groupId" separator ="," open="(" close=")">
|
|
||||||
#{groupId}
|
|
||||||
</foreach >
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</update>
|
|
||||||
<update id="updateIsAuditAll" >
|
|
||||||
UPDATE config_group_info set is_audit_all = #{isAuditAll},update_time=now()
|
|
||||||
<where>
|
|
||||||
<if test="groupType != null">
|
|
||||||
and group_type =#{groupType}
|
|
||||||
</if>
|
|
||||||
<if test="groupIds != null ">
|
|
||||||
and group_id in
|
|
||||||
<foreach collection ="groupIds" item="groupId" separator ="," open="(" close=")">
|
|
||||||
#{groupId}
|
|
||||||
</foreach >
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</update>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -7,7 +7,6 @@ import java.math.BigDecimal;
|
|||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -58,7 +57,6 @@ import com.nis.domain.configuration.AppPolicyCfg;
|
|||||||
import com.nis.domain.configuration.AppTopicDomainCfg;
|
import com.nis.domain.configuration.AppTopicDomainCfg;
|
||||||
import com.nis.domain.configuration.AreaBean;
|
import com.nis.domain.configuration.AreaBean;
|
||||||
import com.nis.domain.configuration.AreaIpCfg;
|
import com.nis.domain.configuration.AreaIpCfg;
|
||||||
import com.nis.domain.configuration.AsnKeywordCfg;
|
|
||||||
import com.nis.domain.configuration.BaseCfg;
|
import com.nis.domain.configuration.BaseCfg;
|
||||||
import com.nis.domain.configuration.BaseIpCfg;
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
import com.nis.domain.configuration.BaseStringCfg;
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
@@ -546,48 +544,6 @@ public abstract class BaseService {
|
|||||||
cfg.setIsValid(baseCfg.getIsValid());
|
cfg.setIsValid(baseCfg.getIsValid());
|
||||||
dstList.add(cfg);
|
dstList.add(cfg);
|
||||||
}
|
}
|
||||||
} else if (cfgType == 7) { //ASN关键字配置
|
|
||||||
/*//TODO 下发之前是否需要增加asn号的有效性校验,创建配置和下发配置不是在同一时间
|
|
||||||
//TODO 考虑增加配置id、表名和ASN组织,以及ASN NO的关系。
|
|
||||||
//TODO 如果ASNO 和组织关系没有了,数据需要清理,asn组织和配置id关系没有了,也需要清理
|
|
||||||
int regionNum=0;
|
|
||||||
//多个ASNNO存在一个ASN关键字配置中,
|
|
||||||
for (int i = 0; i < srcList.size(); i++) {
|
|
||||||
AsnKeywordCfg asnKeywordCfg=(AsnKeywordCfg)srcList.get(i);
|
|
||||||
regionNum+=asnKeywordCfg.getCfgKeywords().split(",").length;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//List<Integer> groupIdList = ConfigServiceUtil.getId(2, srcList.size());
|
|
||||||
List<Integer> regionIdList = ConfigServiceUtil.getId(3, regionNum);
|
|
||||||
Integer regionIndex=0;*/
|
|
||||||
List<Integer> listGroupId=new ArrayList<>();
|
|
||||||
for (int i = 0; i < srcList.size(); i++) {
|
|
||||||
AsnKeywordCfg asnKeywordCfg = (AsnKeywordCfg)srcList.get(i);
|
|
||||||
GroupCfg group = new GroupCfg();
|
|
||||||
group.setGroupId(Integer.parseInt(asnKeywordCfg.getUserRegion1()));
|
|
||||||
group.setCompileId(baseCfg.getCompileId());
|
|
||||||
group.setAuditTime(baseCfg.getAuditTime());
|
|
||||||
group.setIsValid(baseCfg.getIsValid());
|
|
||||||
group.setIsCommonGroup(1);//标识为公共组 //TODO 已下发过的组是否还需标记为公共组
|
|
||||||
if(!listGroupId.contains(group.getGroupId())){
|
|
||||||
groupRelationList.add(group);
|
|
||||||
listGroupId.add(group.getGroupId());
|
|
||||||
}
|
|
||||||
|
|
||||||
//****************是否下发域信息*******
|
|
||||||
if("1".equals(asnKeywordCfg.getUserRegion3())){
|
|
||||||
StringCfg cfg = new StringCfg();
|
|
||||||
BeanUtils.copyProperties(asnKeywordCfg, cfg);
|
|
||||||
cfg.setGroupId(group.getGroupId());
|
|
||||||
cfg.setRegionId(Integer.parseInt(asnKeywordCfg.getUserRegion2()));
|
|
||||||
cfg.setAuditTime(baseCfg.getAuditTime());
|
|
||||||
cfg.setIsValid(baseCfg.getIsValid());
|
|
||||||
// 处理配置关键字转译
|
|
||||||
cfg.setCfgKeywords(Constants.ASN_KEY+keywordsEscape(asnKeywordCfg.getCfgKeywords()));
|
|
||||||
dstList.add(cfg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
dstList.addAll(srcList);
|
dstList.addAll(srcList);
|
||||||
}
|
}
|
||||||
@@ -1905,7 +1861,7 @@ public abstract class BaseService {
|
|||||||
group.setIssuedIPs(asnGroupAddRegion.getValue()+0l);
|
group.setIssuedIPs(asnGroupAddRegion.getValue()+0l);
|
||||||
((AsnGroupInfoDao) batchSqlSession.getMapper(AsnGroupInfoDao.class)).modifyIssuedIp(group);;
|
((AsnGroupInfoDao) batchSqlSession.getMapper(AsnGroupInfoDao.class)).modifyIssuedIp(group);;
|
||||||
}
|
}
|
||||||
asnIPRegionSendToMaat(toAddRegionAsnIpCfgs,Constants.VALID_YES,Constants.OPACTION_POST);
|
asnIPRegionSendToMaat(toAddRegionAsnIpCfgs,Constants.VALID_YES);
|
||||||
}
|
}
|
||||||
if(toSendFirstAsnIpCfgs.size()>0) {
|
if(toSendFirstAsnIpCfgs.size()>0) {
|
||||||
List<MaatCfg> configCompileList = new ArrayList();
|
List<MaatCfg> configCompileList = new ArrayList();
|
||||||
@@ -2239,7 +2195,7 @@ public abstract class BaseService {
|
|||||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||||
/*groupReuseCfg.setUserRegion(userRegion);*/
|
/*groupReuseCfg.setUserRegion(userRegion);*/
|
||||||
/*groupReuseCfg.setServiceId(tempList.get(0).getServiceId());*/
|
groupReuseCfg.setServiceId(tempList.get(0).getServiceId());
|
||||||
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(tempList,Constants.VALID_YES,configGroupInfo.getGroupId()));
|
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(tempList,Constants.VALID_YES,configGroupInfo.getGroupId()));
|
||||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||||
groupReuseCfg.setStrRegionList(strRegionList);
|
groupReuseCfg.setStrRegionList(strRegionList);
|
||||||
@@ -2254,7 +2210,7 @@ public abstract class BaseService {
|
|||||||
String json=gsonToJson(maatBean);
|
String json=gsonToJson(maatBean);
|
||||||
logger.info("app协议IP域新增配置下发配置参数:"+json);
|
logger.info("app协议IP域新增配置下发配置参数:"+json);
|
||||||
//调用服务接口下发配置
|
//调用服务接口下发配置
|
||||||
ToMaatResult result = ConfigServiceUtil.auditCommonGroupRegionSources(json,1);
|
ToMaatResult result = ConfigServiceUtil.postGroupReuseSources(json);
|
||||||
logger.info("app协议IP域新增配置响应信息:"+result.getMsg());
|
logger.info("app协议IP域新增配置响应信息:"+result.getMsg());
|
||||||
}else {
|
}else {
|
||||||
throw new RuntimeException("Unknown configGroupInfo isIssued value");
|
throw new RuntimeException("Unknown configGroupInfo isIssued value");
|
||||||
@@ -2324,7 +2280,7 @@ public abstract class BaseService {
|
|||||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||||
/*groupReuseCfg.setUserRegion(userRegion);*/
|
/*groupReuseCfg.setUserRegion(userRegion);*/
|
||||||
/*groupReuseCfg.setServiceId(tempList.get(0).getServiceId());*/
|
groupReuseCfg.setServiceId(tempList.get(0).getServiceId());
|
||||||
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(tempList,Constants.VALID_YES,configGroupInfo.getGroupId()));
|
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(tempList,Constants.VALID_YES,configGroupInfo.getGroupId()));
|
||||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||||
groupReuseCfg.setStrRegionList(strRegionList);
|
groupReuseCfg.setStrRegionList(strRegionList);
|
||||||
@@ -2339,7 +2295,7 @@ public abstract class BaseService {
|
|||||||
String json=gsonToJson(maatBean);
|
String json=gsonToJson(maatBean);
|
||||||
logger.info("app协议IP域新增配置下发配置参数:"+json);
|
logger.info("app协议IP域新增配置下发配置参数:"+json);
|
||||||
//调用服务接口下发配置
|
//调用服务接口下发配置
|
||||||
ToMaatResult result = ConfigServiceUtil.auditCommonGroupRegionSources(json,1);
|
ToMaatResult result = ConfigServiceUtil.postGroupReuseSources(json);
|
||||||
logger.info("app协议IP域新增配置响应信息:"+result.getMsg());
|
logger.info("app协议IP域新增配置响应信息:"+result.getMsg());
|
||||||
}else {
|
}else {
|
||||||
throw new RuntimeException("Unknown configGroupInfo isIssued value");
|
throw new RuntimeException("Unknown configGroupInfo isIssued value");
|
||||||
@@ -2914,11 +2870,10 @@ public abstract class BaseService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* asn ip分组复用新增[POST],修改[PUT],删除[PUT]
|
* asn ip分组复用新增
|
||||||
* 首次下发直接走maat,公共组第二次下发直接走addCommonRegion,updateCommonRegion,delCommonRegion
|
|
||||||
* @param asnIpCfgs
|
* @param asnIpCfgs
|
||||||
*/
|
*/
|
||||||
public void asnIPRegionSendToMaat(List<AsnIpCfg> asnIpCfgs,Integer valid,Integer action) {
|
public void asnIPRegionSendToMaat(List<AsnIpCfg> asnIpCfgs,Integer valid) {
|
||||||
logger.warn("asnIPRegionSendToMaat start");
|
logger.warn("asnIPRegionSendToMaat start");
|
||||||
long start=System.currentTimeMillis();
|
long start=System.currentTimeMillis();
|
||||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||||
@@ -2936,19 +2891,19 @@ public abstract class BaseService {
|
|||||||
maatBean.setCreatorName(UserUtils.getUser().getName());
|
maatBean.setCreatorName(UserUtils.getUser().getName());
|
||||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||||
if(valid==Constants.VALID_YES) {
|
if(valid==Constants.VALID_YES) {
|
||||||
maatBean.setOpAction(action);
|
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||||
//调用服务接口下发配置数据
|
//调用服务接口下发配置数据
|
||||||
String json=gsonToJson(maatBean);
|
String json=gsonToJson(maatBean);
|
||||||
if(asnIpCfgs.size()<=100) {
|
if(asnIpCfgs.size()<=100) {
|
||||||
logger.info("asn ip复用域 "+action+"下发配置参数:"+json);
|
logger.info("asn ip复用域新增配置下发配置参数:"+json);
|
||||||
}else {
|
}else {
|
||||||
logger.info("asn ip复用域 "+action+" 配置下发region条数:"+asnIpCfgs.size());
|
logger.info("asn ip复用域新增配置下发region条数:"+asnIpCfgs.size());
|
||||||
}
|
}
|
||||||
//调用服务接口下发配置
|
//调用服务接口下发配置
|
||||||
ToMaatResult result =ConfigServiceUtil.auditCommonGroupRegionSources(json,action);
|
ToMaatResult result =ConfigServiceUtil.postGroupReuseSources(json);
|
||||||
logger.info("asn ip复用域 "+action+" 配置响应信息:"+result.getMsg());
|
logger.info("asn ip复用域新增配置响应信息:"+result.getMsg());
|
||||||
}else {
|
}else {
|
||||||
maatBean.setOpAction(action);
|
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||||
//调用服务接口下发配置数据
|
//调用服务接口下发配置数据
|
||||||
String json=gsonToJson(maatBean);
|
String json=gsonToJson(maatBean);
|
||||||
if(asnIpCfgs.size()<=100) {
|
if(asnIpCfgs.size()<=100) {
|
||||||
@@ -2958,301 +2913,13 @@ public abstract class BaseService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
//调用服务接口下发配置
|
//调用服务接口下发配置
|
||||||
ToMaatResult result = ConfigServiceUtil.auditCommonGroupRegionSources(json,3);
|
ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||||
logger.info("asn ip复用域删除配置响应信息:"+result.getMsg());
|
logger.info("asn ip复用域删除配置响应信息:"+result.getMsg());
|
||||||
}
|
}
|
||||||
long end=System.currentTimeMillis();
|
long end=System.currentTimeMillis();
|
||||||
logger.warn("asnIPRegionSendToMaat finish,cost:"+(end-start));
|
logger.warn("asnIPRegionSendToMaat finish,cost:"+(end-start));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ASN关键字配置处理
|
|
||||||
* @param asnList
|
|
||||||
* @param entity
|
|
||||||
*/
|
|
||||||
public void handleAsn(List<AsnKeywordCfg> asnList,BaseCfg entity) {
|
|
||||||
//无效子配置后,再新增子配置
|
|
||||||
StringCfgDao stringCfgDao=SpringContextHolder.getBean(StringCfgDao.class);
|
|
||||||
stringCfgDao.deleteAsnKeyword(entity);
|
|
||||||
String commonGroupIds="";//公共表存储组织GroupIds
|
|
||||||
if(asnList != null && asnList.size()>0){
|
|
||||||
for (AsnKeywordCfg asnKeywordCfg : asnList) {
|
|
||||||
BeanUtils.copyProperties(entity, asnKeywordCfg,new String[]{"cfgId","cfgRegionCode","cfgType","userRegion1","userRegion2","userRegion3","userRegion4","userRegion5"});
|
|
||||||
asnKeywordCfg.setTableName(AsnKeywordCfg.getTablename());
|
|
||||||
asnKeywordCfg.setIsAudit(entity.getIsAudit());
|
|
||||||
asnKeywordCfg.setIsValid(entity.getIsValid());
|
|
||||||
asnKeywordCfg.setEditTime(entity.getEditTime());
|
|
||||||
asnKeywordCfg.setEditorId(entity.getEditorId());
|
|
||||||
asnKeywordCfg.setExprType(0);
|
|
||||||
asnKeywordCfg.setMatchMethod(3);
|
|
||||||
asnKeywordCfg.setExType("0");
|
|
||||||
asnKeywordCfg.setIsHexbin(0);
|
|
||||||
asnKeywordCfg.setCreateTime(new Date());
|
|
||||||
asnKeywordCfg.setCreatorId(UserUtils.getUser().getId());
|
|
||||||
stringCfgDao.saveStringCfgBatch(asnKeywordCfg);
|
|
||||||
|
|
||||||
commonGroupIds+=asnKeywordCfg.getUserRegion1()+",";//组织GroupId
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!StringUtil.isEmpty(commonGroupIds)){
|
|
||||||
commonGroupIds=commonGroupIds.substring(0, commonGroupIds.length()-1);
|
|
||||||
}
|
|
||||||
entity.setCommonGroupIds(commonGroupIds);
|
|
||||||
//return entity;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* ASN关键字配置处理
|
|
||||||
* @param asnList
|
|
||||||
* @param entity
|
|
||||||
*/
|
|
||||||
public void auditAsnCfg(List<GroupCfg> groupRelationList,List<StringCfg> strRegionList,BaseCfg entity,List<AsnKeywordCfg> asnList){
|
|
||||||
//注意:一条配置是一个分组,keywords=asnNos|userRegion1=groupId|userRegion2=isAuditAll 0 1
|
|
||||||
if(!StringUtil.isEmpty(asnList)){
|
|
||||||
AsnGroupInfoDao asnGroupInfoDao=SpringContextHolder.getBean(AsnGroupInfoDao.class);
|
|
||||||
ConfigGroupInfoDao configGroupInfoDao=SpringContextHolder.getBean(ConfigGroupInfoDao.class);
|
|
||||||
|
|
||||||
//1、修改域配置为下发状态
|
|
||||||
AsnKeywordCfg asnCfg=new AsnKeywordCfg();
|
|
||||||
BeanUtils.copyProperties(entity, asnCfg);
|
|
||||||
asnCfg.setTableName(AsnKeywordCfg.getTablename());
|
|
||||||
IpCfgDao ipCfgDao=SpringContextHolder.getBean(IpCfgDao.class);
|
|
||||||
ipCfgDao.auditCfg(asnCfg);
|
|
||||||
|
|
||||||
//需要标记为下发全部域的groupId集合
|
|
||||||
List signAuditAllGroupList=new ArrayList<>();
|
|
||||||
//需要标记下发的groupId
|
|
||||||
List isUsedGroupIdList=new ArrayList<>();
|
|
||||||
//所有已被策略引用过的域
|
|
||||||
List<AsnGroupInfo> auditRegionList=new ArrayList<>();
|
|
||||||
//所有未被策略过的域
|
|
||||||
List<AsnGroupInfo> notAuditRegionList=new ArrayList<>();
|
|
||||||
//域和分组的关系
|
|
||||||
Map<String,String> groupWithRegion=new HashMap<>();
|
|
||||||
//所有策略所选asn No
|
|
||||||
List<String> asnNoList=new ArrayList<>();
|
|
||||||
//所有未下发过的asnNo
|
|
||||||
List<String> notAuditAsnNoList=new ArrayList<>();
|
|
||||||
//最新的asn域集合
|
|
||||||
List<AsnKeywordCfg> newAsnList=new ArrayList<>();
|
|
||||||
|
|
||||||
//2、记录标记为下发all的groupId|存储组和asnno的关系|记录需要标记为已下发的group
|
|
||||||
for (AsnKeywordCfg asnKeywordCfg : asnList) {
|
|
||||||
asnKeywordCfg.setUserRegion2(StringUtil.isEmpty(asnKeywordCfg.getUserRegion2()) ? "1":"0");
|
|
||||||
if("1".equals(asnKeywordCfg.getUserRegion2())){ //是否标记为下发ALL
|
|
||||||
signAuditAllGroupList.add(Integer.parseInt(asnKeywordCfg.getUserRegion1()));
|
|
||||||
}
|
|
||||||
for (String asnstr: asnKeywordCfg.getCfgKeywords().split(",")) {
|
|
||||||
groupWithRegion.put(asnstr, asnKeywordCfg.getUserRegion1());
|
|
||||||
}
|
|
||||||
if(!isUsedGroupIdList.contains(Integer.parseInt(asnKeywordCfg.getUserRegion1()))){
|
|
||||||
isUsedGroupIdList.add(Integer.parseInt(asnKeywordCfg.getUserRegion1()));
|
|
||||||
}
|
|
||||||
List<String> list=Arrays.asList(asnKeywordCfg.getCfgKeywords().split(","));
|
|
||||||
asnNoList.addAll(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
//3、//根据asnNoList查询所有下发过的ASN NO
|
|
||||||
if(!StringUtil.isEmpty(asnNoList)){
|
|
||||||
auditRegionList=asnGroupInfoDao.findAsnGroupInfoByAsnNos(asnNoList, 1);
|
|
||||||
}
|
|
||||||
//已下发过的ASN NO只需要下发组
|
|
||||||
if(!StringUtil.isEmpty(auditRegionList)){
|
|
||||||
for (AsnGroupInfo asnGroupInfo : auditRegionList) {
|
|
||||||
AsnKeywordCfg cfg = new AsnKeywordCfg();
|
|
||||||
cfg.initDefaultValue();
|
|
||||||
cfg.setTableName(AsnKeywordCfg.getTablename());
|
|
||||||
cfg.setCfgType(asnList.get(0).getCfgType());
|
|
||||||
cfg.setCompileId(entity.getCompileId());
|
|
||||||
cfg.setCfgKeywords(asnGroupInfo.getGroupId().toString());//关键字
|
|
||||||
cfg.setUserRegion1(groupWithRegion.get(asnGroupInfo.getAsnId().toString())); //组号
|
|
||||||
cfg.setUserRegion2(asnGroupInfo.getRegionId().toString());//regionid
|
|
||||||
cfg.setUserRegion3("0"); //是否下发域
|
|
||||||
cfg.setIsAudit(entity.getIsAudit());
|
|
||||||
cfg.setIsValid(entity.getIsValid());
|
|
||||||
cfg.setAuditorId(entity.getAuditorId());
|
|
||||||
cfg.setAuditTime(entity.getAuditTime());
|
|
||||||
cfg.setFunctionId(entity.getFunctionId());
|
|
||||||
newAsnList.add(cfg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//4、查询所有未下发过的 ASN NO
|
|
||||||
if(!StringUtil.isEmpty(asnNoList)){
|
|
||||||
notAuditRegionList=asnGroupInfoDao.findAsnGroupInfoByAsnNos(asnNoList, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!StringUtil.isEmpty(notAuditRegionList)){
|
|
||||||
for (AsnGroupInfo asnGroupInfo : notAuditRegionList) {
|
|
||||||
AsnKeywordCfg cfg = new AsnKeywordCfg();
|
|
||||||
cfg.initDefaultValue();
|
|
||||||
cfg.setTableName(AsnKeywordCfg.getTablename());
|
|
||||||
cfg.setCompileId(entity.getCompileId());
|
|
||||||
cfg.setCfgType(asnList.get(0).getCfgType());
|
|
||||||
cfg.setCfgKeywords(asnGroupInfo.getAsnId().toString());//关键字
|
|
||||||
cfg.setUserRegion1(groupWithRegion.get(asnGroupInfo.getAsnId().toString())); //groupId
|
|
||||||
cfg.setUserRegion2(asnGroupInfo.getRegionId().toString());//regionid
|
|
||||||
cfg.setUserRegion3("1"); //是否下发域
|
|
||||||
cfg.setIsAudit(entity.getIsAudit());
|
|
||||||
cfg.setIsValid(entity.getIsValid());
|
|
||||||
cfg.setAuditorId(entity.getAuditorId());
|
|
||||||
cfg.setAuditTime(entity.getAuditTime());
|
|
||||||
cfg.setFunctionId(entity.getFunctionId());
|
|
||||||
newAsnList.add(cfg);
|
|
||||||
notAuditAsnNoList.add(asnGroupInfo.getAsnId().toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//5、修改所有下发的asn no为已下发
|
|
||||||
if(!StringUtil.isEmpty(notAuditAsnNoList)){
|
|
||||||
asnGroupInfoDao.updateIsUsedAndIsValid(notAuditAsnNoList,1,null);
|
|
||||||
}
|
|
||||||
//6、标记组已被策略标记为全部下发
|
|
||||||
configGroupInfoDao.updateIsAuditAll(4, 1,signAuditAllGroupList );
|
|
||||||
//7、标记组已被策略引用
|
|
||||||
configGroupInfoDao.updateIsUsed(4, 1, isUsedGroupIdList);
|
|
||||||
//8、maat配置转换
|
|
||||||
if(!StringUtil.isEmpty(newAsnList)){
|
|
||||||
Map<String,List> map = cfgConvert(strRegionList,newAsnList,7,entity,groupRelationList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*if(asnList!=null && asnList.size()>0){
|
|
||||||
|
|
||||||
for (AsnKeywordCfg asnKeywordCfg : asnList) {
|
|
||||||
asnNoStr+=asnKeywordCfg.getCfgKeywords()+",";
|
|
||||||
}
|
|
||||||
|
|
||||||
AsnKeywordCfg cfg = new AsnKeywordCfg();
|
|
||||||
cfg.setTableName(AsnKeywordCfg.getTablename());
|
|
||||||
cfg.setCompileId(entity.getCompileId());
|
|
||||||
cfg.setIsAudit(entity.getIsAudit());
|
|
||||||
cfg.setIsValid(entity.getIsValid());
|
|
||||||
cfg.setAuditorId(entity.getAuditorId());
|
|
||||||
cfg.setAuditTime(entity.getAuditTime());
|
|
||||||
cfg.setFunctionId(entity.getFunctionId());
|
|
||||||
ipCfgDao.auditCfg(cfg);
|
|
||||||
Map<String,List> map = cfgConvert(strRegionList,asnList,7,entity,groupRelationList);
|
|
||||||
groupRelationList=map.get("groupList");
|
|
||||||
strRegionList=map.get("dstList");
|
|
||||||
}
|
|
||||||
//修改配置选中的ASN NO 和 asn orga是否被策略引用过
|
|
||||||
if(!StringUtil.isEmpty(asnNoStr)){
|
|
||||||
asnNoStr=asnNoStr.substring(0, asnNoStr.length()-1);
|
|
||||||
if(!StringUtil.isEmpty(asnNoStr)){
|
|
||||||
//如果asnGroup由is_use=0,修改为is_use=1;查询asn no下所有未下发的asn ip,并进行下发,走POST接口【暂时不考虑】
|
|
||||||
AsnIpCfgDao asnIpCfgDao=SpringContextHolder.getBean(AsnIpCfgDao.class);
|
|
||||||
AsnIpCfg asnIp=new AsnIpCfg();
|
|
||||||
asnIp.setIsAudit(0);
|
|
||||||
asnIp.setIsValid(0);
|
|
||||||
List<AsnIpCfg> asnIpList=asnIpCfgDao.findAllListByAsnGroup(asnIp, null, asnNoStr);
|
|
||||||
|
|
||||||
//下发asn IP和修改asn ip的状态必须在一个事物中
|
|
||||||
//重新修改下发时间,下发人员信息
|
|
||||||
AsnIpCfg auditAsnIpCfg=new AsnIpCfg();
|
|
||||||
auditAsnIpCfg.setIsAudit(1);
|
|
||||||
auditAsnIpCfg.setAuditTime(new Date());
|
|
||||||
auditAsnIpCfg.setAuditorId(UserUtils.getUser().getId());
|
|
||||||
auditAsnIpCfg.setIsValid(1);
|
|
||||||
auditAllAsnRegionCfg(auditAsnIpCfg, null, asnNoStr);
|
|
||||||
|
|
||||||
AsnGroupInfoDao asnGroupInfoDao=SpringContextHolder.getBean(AsnGroupInfoDao.class);
|
|
||||||
asnGroupInfoDao.updateIsUsed(asnNoStr, 1);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 配置取消时,需要将公共组id发送至服务端
|
|
||||||
* @param maatCfg
|
|
||||||
* @param entity
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public MaatCfg addKeepGroupList(MaatCfg maatCfg,BaseCfg entity){
|
|
||||||
if(!StringUtil.isEmpty(entity.getCommonGroupIds())){
|
|
||||||
List<GroupCfg> keepGroupList = new ArrayList();
|
|
||||||
String[] orgGroupIds=entity.getCommonGroupIds().split(",");
|
|
||||||
for (int i = 0; i < orgGroupIds.length; i++) {
|
|
||||||
if(!StringUtil.isEmpty(orgGroupIds[i])){
|
|
||||||
GroupCfg groupCfg=new GroupCfg();
|
|
||||||
groupCfg.setGroupId(Integer.parseInt(orgGroupIds[i]));
|
|
||||||
keepGroupList.add(groupCfg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!StringUtil.isEmpty(keepGroupList)){
|
|
||||||
maatCfg.setKeepGroupList(keepGroupList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return maatCfg;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公共组新增域
|
|
||||||
* @param srcMap
|
|
||||||
* @param isValid
|
|
||||||
* @param cfgType
|
|
||||||
* @param commonType 公共组类型 4 ASN
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static <T> List<GroupReuseCfg> convertCommonRegion(Map<Integer,List<T>> srcMap,List<GroupReuseCfg> commonGroupList,Integer isValid,Integer cfgType,Integer commonType) {
|
|
||||||
for (Integer groupId : srcMap.keySet()) {
|
|
||||||
GroupReuseCfg groupCfg=new GroupReuseCfg();
|
|
||||||
List<StringCfg> strRegionList=new ArrayList<>();
|
|
||||||
List<IpCfg> ipRegionList=new ArrayList<>();
|
|
||||||
List<NumBoundaryCfg> numRegionList=new ArrayList<>();
|
|
||||||
|
|
||||||
for (int i = 0; i < srcMap.get(groupId).size(); i++) {
|
|
||||||
if (cfgType == 1) {
|
|
||||||
IpCfg cfg = new IpCfg();
|
|
||||||
BaseIpCfg baseIpCfg = (BaseIpCfg)srcMap.get(groupId).get(i);
|
|
||||||
// 区域IP配置,多条IP配置属于同一个分组,其他业务配置IP,一条配置一个分组
|
|
||||||
cfg.setGroupId(groupId);
|
|
||||||
List<IpCfg> cfgs = ipConvert(cfg, baseIpCfg);
|
|
||||||
ipRegionList.addAll(cfgs);
|
|
||||||
|
|
||||||
}
|
|
||||||
if(cfgType==4){
|
|
||||||
// 一条业务配置创建一个分组
|
|
||||||
NumBoundaryCfg cfg = new NumBoundaryCfg();
|
|
||||||
BeanUtils.copyProperties(srcMap.get(groupId).get(i), cfg);
|
|
||||||
cfg.setGroupId(groupId);
|
|
||||||
numRegionList.add(cfg);
|
|
||||||
}
|
|
||||||
if(cfgType==2 || cfgType==3){
|
|
||||||
// 一条业务配置创建一个分组
|
|
||||||
StringCfg cfg = new StringCfg();
|
|
||||||
BaseStringCfg strCfg=(BaseStringCfg)srcMap.get(groupId).get(i);
|
|
||||||
BeanUtils.copyProperties(srcMap.get(groupId).get(i), cfg);
|
|
||||||
cfg.setGroupId(groupId);
|
|
||||||
cfg.setCfgType(strCfg.getCfgType());
|
|
||||||
cfg.setRegionId(cfg.getRegionId());
|
|
||||||
cfg.setAuditTime(strCfg.getAuditTime());
|
|
||||||
cfg.setMatchMethod(strCfg.getMatchMethod());
|
|
||||||
cfg.setIsValid(isValid);
|
|
||||||
cfg.setIsHexbin(strCfg.getIsHexbin());
|
|
||||||
cfg.setExprType(strCfg.getExprType());
|
|
||||||
// 处理配置关键字转译
|
|
||||||
if(commonType == 4){
|
|
||||||
cfg.setCfgKeywords(Constants.ASN_KEY+keywordsEscape(cfg.getCfgKeywords()));
|
|
||||||
}else{
|
|
||||||
cfg.setCfgKeywords(keywordsEscape(cfg.getCfgKeywords()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 增强字符串转换
|
|
||||||
cfg.setDistrict(keywordsEscape(cfg.getDistrict()));
|
|
||||||
strRegionList.add(cfg);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
groupCfg.setStrRegionList(strRegionList);
|
|
||||||
groupCfg.setIpRegionList(ipRegionList);
|
|
||||||
groupCfg.setNumRegionList(numRegionList);
|
|
||||||
commonGroupList.add(groupCfg);
|
|
||||||
}
|
|
||||||
return commonGroupList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理IpSpoofing配置导入
|
* 处理IpSpoofing配置导入
|
||||||
* @param list
|
* @param list
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.nis.web.service.basics;
|
package com.nis.web.service.basics;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -14,9 +13,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import com.nis.domain.FunctionServiceDict;
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.AsnGroupInfo;
|
import com.nis.domain.basics.AsnGroupInfo;
|
||||||
import com.nis.domain.configuration.AsnKeywordCfg;
|
|
||||||
import com.nis.domain.maat.GroupReuseAddBean;
|
|
||||||
import com.nis.domain.maat.GroupReuseCfg;
|
|
||||||
import com.nis.domain.maat.MaatCfg;
|
import com.nis.domain.maat.MaatCfg;
|
||||||
import com.nis.domain.maat.ToMaatBean;
|
import com.nis.domain.maat.ToMaatBean;
|
||||||
import com.nis.domain.maat.ToMaatResult;
|
import com.nis.domain.maat.ToMaatResult;
|
||||||
@@ -89,8 +85,6 @@ public class AsnGroupInfoService extends BaseService{
|
|||||||
configGroupInfo.setGroupName(org.toUpperCase());
|
configGroupInfo.setGroupName(org.toUpperCase());
|
||||||
configGroupInfo.setIsIssued(0);
|
configGroupInfo.setIsIssued(0);
|
||||||
configGroupInfo.setGroupType(4);
|
configGroupInfo.setGroupType(4);
|
||||||
configGroupInfo.setIsAuditAll(0);
|
|
||||||
configGroupInfo.setIsUsed(0);
|
|
||||||
configGroupInfo.setGroupId(groupIds.get(1));
|
configGroupInfo.setGroupId(groupIds.get(1));
|
||||||
configGroupInfo.setInsertTime(new Date());
|
configGroupInfo.setInsertTime(new Date());
|
||||||
configGroupInfoDao.insertConfigGroupInfo(configGroupInfo);
|
configGroupInfoDao.insertConfigGroupInfo(configGroupInfo);
|
||||||
@@ -110,33 +104,13 @@ public class AsnGroupInfoService extends BaseService{
|
|||||||
entity.setCreateTime(createTime);
|
entity.setCreateTime(createTime);
|
||||||
entity.setGroupId(groupId);
|
entity.setGroupId(groupId);
|
||||||
entity.setIsValid(0);
|
entity.setIsValid(0);
|
||||||
//分组已被策略设定为下发全部域,则需要自动下发新增的asno
|
|
||||||
if(configGroupInfo.getIsAuditAll() != null && configGroupInfo.getIsAuditAll().equals(1)){
|
|
||||||
entity.setIsUsed(1);
|
|
||||||
}else{
|
|
||||||
entity.setIsUsed(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Integer> compileIds= ConfigServiceUtil.getId(1,1);
|
List<Integer> compileIds= ConfigServiceUtil.getId(1,1);
|
||||||
if(compileIds.size()>0) {
|
if(compileIds.size()>0) {
|
||||||
entity.setCompileId(compileIds.get(0));
|
entity.setCompileId(compileIds.get(0));
|
||||||
}else {
|
}else {
|
||||||
throw new MaatConvertException("Get asn reigon id failed");
|
throw new MaatConvertException("Get asn group id failed");
|
||||||
}
|
|
||||||
List<Integer> regionIds= ConfigServiceUtil.getId(3,1);
|
|
||||||
if(regionIds.size()>0) {
|
|
||||||
entity.setRegionId(regionIds.get(0));
|
|
||||||
}else {
|
|
||||||
throw new MaatConvertException("Get asn reigon id failed");
|
|
||||||
}
|
}
|
||||||
asnGroupInfoDao.insert(entity);
|
asnGroupInfoDao.insert(entity);
|
||||||
//新增,需要判断组是否被标记为全量下发,如果标记则下发新增的,没有不下发
|
|
||||||
if(configGroupInfo.getIsAuditAll() != null
|
|
||||||
&& configGroupInfo.getIsAuditAll().equals(1)
|
|
||||||
&& configGroupInfo.getIsUsed()!= null
|
|
||||||
&& configGroupInfo.getIsUsed().equals(1)){
|
|
||||||
auditAsn(entity,configGroupInfo,Constants.OPACTION_POST);
|
|
||||||
}
|
|
||||||
//修改
|
//修改
|
||||||
}else{
|
}else{
|
||||||
long id=entity.getId();
|
long id=entity.getId();
|
||||||
@@ -157,8 +131,6 @@ public class AsnGroupInfoService extends BaseService{
|
|||||||
configGroupInfo1.setGroupName(entity.getOrganization().toUpperCase());
|
configGroupInfo1.setGroupName(entity.getOrganization().toUpperCase());
|
||||||
configGroupInfo1.setIsIssued(0);
|
configGroupInfo1.setIsIssued(0);
|
||||||
configGroupInfo1.setGroupType(4);
|
configGroupInfo1.setGroupType(4);
|
||||||
configGroupInfo1.setIsUsed(0);
|
|
||||||
configGroupInfo1.setIsAuditAll(0);
|
|
||||||
configGroupInfo1.setGroupId(groupIds.get(1));
|
configGroupInfo1.setGroupId(groupIds.get(1));
|
||||||
configGroupInfo1.setInsertTime(new Date());
|
configGroupInfo1.setInsertTime(new Date());
|
||||||
configGroupInfoDao.insertConfigGroupInfo(configGroupInfo1);
|
configGroupInfoDao.insertConfigGroupInfo(configGroupInfo1);
|
||||||
@@ -169,111 +141,13 @@ public class AsnGroupInfoService extends BaseService{
|
|||||||
entity.setGroupId(groupId);
|
entity.setGroupId(groupId);
|
||||||
asnGroupInfoDao.update(entity);
|
asnGroupInfoDao.update(entity);
|
||||||
asnIpCfgDao.updateAsn(String.valueOf(entity.getAsnId()),entity.getOrganization(),entity.getCountry(),entity.getDetail());
|
asnIpCfgDao.updateAsn(String.valueOf(entity.getAsnId()),entity.getOrganization(),entity.getCountry(),entity.getDetail());
|
||||||
if(configGroupInfo1.getIsUsed()!= null
|
|
||||||
&& configGroupInfo1.getIsUsed().equals(1)){
|
|
||||||
group.setGroupId(groupId);
|
|
||||||
group.setAsnId(entity.getAsnId());
|
|
||||||
auditAsn(group,configGroupInfo1,Constants.OPACTION_PUT);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public void auditAsn(AsnGroupInfo entity,ConfigGroupInfo group,Integer action){
|
|
||||||
Map<Integer, List<AsnKeywordCfg>> srcMap=new HashMap<>();
|
|
||||||
List srcList=new ArrayList<>();
|
|
||||||
AsnKeywordCfg cfg=new AsnKeywordCfg();
|
|
||||||
cfg.initDefaultValue();
|
|
||||||
cfg.setGroupId(group.getGroupId());
|
|
||||||
cfg.setCfgKeywords(entity.getAsnId().toString());
|
|
||||||
cfg.setRegionId(entity.getRegionId());
|
|
||||||
cfg.setCfgType(Constants.NTC_ASN_NUMBER);
|
|
||||||
cfg.setAuditTime(new Date());
|
|
||||||
srcList.add(cfg);
|
|
||||||
srcMap.put(group.getGroupId(), srcList);
|
|
||||||
GroupReuseAddBean commonGroupBean=new GroupReuseAddBean();
|
|
||||||
List<GroupReuseCfg> commonGroupList=new ArrayList<>();
|
|
||||||
commonGroupList=convertCommonRegion(srcMap,commonGroupList,1,2,4);
|
|
||||||
commonGroupBean.setGroupReuseCfgList(commonGroupList);
|
|
||||||
//如果已经被引用,则修改
|
|
||||||
commonGroupBean.setAuditTime(new Date());
|
|
||||||
commonGroupBean.setCreatorName(UserUtils.getUser().getName());
|
|
||||||
commonGroupBean.setVersion(Constants.MAAT_VERSION);
|
|
||||||
if(entity.getIsUsed() != null && entity.getIsUsed().equals(1)){ //已经被引用过的asn可调用修改region
|
|
||||||
commonGroupBean.setOpAction(action);
|
|
||||||
String json = gsonToJson(commonGroupBean);
|
|
||||||
logger.info("ASN配置下发配置参数:" + json);
|
|
||||||
// 调用服务接口下发配置
|
|
||||||
ToMaatResult result = ConfigServiceUtil.auditCommonGroupRegionSources(json, action);
|
|
||||||
}else{//已经被引用过的asn可调用新增region
|
|
||||||
commonGroupBean.setOpAction(action);
|
|
||||||
String json = gsonToJson(commonGroupBean);
|
|
||||||
logger.info("ASN配置下发配置参数:" + json);
|
|
||||||
// 调用服务接口下发配
|
|
||||||
ToMaatResult result = ConfigServiceUtil.auditCommonGroupRegionSources(json, action);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void delete(String ids,String asnIds){
|
public void delete(String ids,String asnIds){
|
||||||
|
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if(!StringUtil.isEmpty(ids)){
|
||||||
List<GroupReuseCfg> commonGroupList=new ArrayList<>();
|
List<FunctionServiceDict> dicts=DictUtils.getFunctionServiceDictList(600);
|
||||||
//查询已经被策略引用的asn
|
|
||||||
List<AsnGroupInfo> asnList=asnGroupInfoDao.findAsnGroupInfoByAsnNos(Arrays.asList(asnIds.split(",")), 1);
|
|
||||||
//修改asn为无效,且解除引用
|
|
||||||
asnGroupInfoDao.updateIsUsedAndIsValid(Arrays.asList(asnIds.split(",")), 0, -1);
|
|
||||||
//删除asn下的所有asn IP
|
|
||||||
asnIpCfgDao.deleteByAsnId(asnIds);
|
|
||||||
|
|
||||||
//查询已经被策略引用的asn,需要走取消接口
|
|
||||||
if(!StringUtil.isEmpty(asnList)){
|
|
||||||
Map<Integer, List<AsnKeywordCfg>> srcMap=new HashMap<>();
|
|
||||||
Map<String, Integer> groupIdMap=new HashMap<>();
|
|
||||||
for (AsnGroupInfo asnGroupInfo : asnList) {
|
|
||||||
//查询groupId
|
|
||||||
if(StringUtil.isEmpty(groupIdMap.get(asnGroupInfo.getOrganization()))){
|
|
||||||
ConfigGroupInfo group=configGroupInfoDao.getAsnGroupByName(asnGroupInfo.getOrganization());
|
|
||||||
groupIdMap.put(asnGroupInfo.getOrganization(), group.getGroupId());
|
|
||||||
List<AsnKeywordCfg> list1=new ArrayList<>();
|
|
||||||
AsnKeywordCfg asnCfg=new AsnKeywordCfg();
|
|
||||||
asnCfg.initDefaultValue();
|
|
||||||
asnCfg.setCfgType(Constants.NTC_ASN_NUMBER);
|
|
||||||
asnCfg.setRegionId(asnGroupInfo.getRegionId());
|
|
||||||
asnCfg.setGroupId(group.getGroupId());
|
|
||||||
asnCfg.setIsValid(0);
|
|
||||||
list1.add(asnCfg);
|
|
||||||
srcMap.put(group.getGroupId(), list1);
|
|
||||||
}else{
|
|
||||||
Integer groupId=groupIdMap.get(asnGroupInfo.getOrganization());
|
|
||||||
List list2=srcMap.get(groupId);
|
|
||||||
AsnKeywordCfg asnCfg=new AsnKeywordCfg();
|
|
||||||
asnCfg.initDefaultValue();
|
|
||||||
asnCfg.setCfgType(Constants.NTC_ASN_NUMBER);
|
|
||||||
asnCfg.setRegionId(asnGroupInfo.getRegionId());
|
|
||||||
asnCfg.setGroupId(groupId);
|
|
||||||
asnCfg.setIsValid(0);
|
|
||||||
list2.add(asnCfg);
|
|
||||||
srcMap.put(groupId, list2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
commonGroupList=convertCommonRegion(srcMap, commonGroupList, 0, 2,4);
|
|
||||||
GroupReuseAddBean commonGroupBean=new GroupReuseAddBean();
|
|
||||||
commonGroupBean.setGroupReuseCfgList(commonGroupList);
|
|
||||||
commonGroupBean.setAuditTime(new Date());
|
|
||||||
commonGroupBean.setCreatorName(UserUtils.getUser().getName());
|
|
||||||
commonGroupBean.setVersion(Constants.MAAT_VERSION);
|
|
||||||
commonGroupBean.setOpAction(2);
|
|
||||||
String json = gsonToJson(commonGroupBean);
|
|
||||||
logger.info("ASN配置下发配置参数:" + json);
|
|
||||||
// 调用服务接口下发配置
|
|
||||||
ToMaatResult result = ConfigServiceUtil.auditCommonGroupRegionSources(json, 3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*List<FunctionServiceDict> dicts=DictUtils.getFunctionServiceDictList(600);
|
|
||||||
int result=0;
|
int result=0;
|
||||||
do {
|
do {
|
||||||
result=asnIpCfgDao.deleteByAsnId(asnIds);
|
result=asnIpCfgDao.deleteByAsnId(asnIds);
|
||||||
@@ -312,7 +186,7 @@ public class AsnGroupInfoService extends BaseService{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}*/
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public boolean checkIps(String groupIds) {
|
public boolean checkIps(String groupIds) {
|
||||||
@@ -360,13 +234,4 @@ public class AsnGroupInfoService extends BaseService{
|
|||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
public List<AsnGroupInfo> findAsnGroupList(AsnGroupInfo asnGroupInfo){
|
|
||||||
List<AsnGroupInfo> list=asnGroupInfoDao.findAsnGroupInfoByAsnGroup(asnGroupInfo);
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
public List<AsnGroupInfo> findAsnGroupList(List<String> asnNos,Integer isUsed){
|
|
||||||
List<AsnGroupInfo> list=asnGroupInfoDao.findAsnGroupInfoByAsnNos(asnNos,null );
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ import com.nis.domain.basics.AsnGroupInfo;
|
|||||||
import com.nis.domain.basics.AsnIpCfg;
|
import com.nis.domain.basics.AsnIpCfg;
|
||||||
import com.nis.domain.configuration.BaseIpCfg;
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
import com.nis.domain.configuration.CfgIndexInfo;
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
import com.nis.domain.maat.GroupReuseAddBean;
|
|
||||||
import com.nis.domain.maat.GroupReuseCfg;
|
|
||||||
import com.nis.domain.maat.MaatCfg;
|
import com.nis.domain.maat.MaatCfg;
|
||||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||||
@@ -36,7 +34,6 @@ import com.nis.domain.maat.ToMaatResult;
|
|||||||
import com.nis.domain.specific.ConfigGroupInfo;
|
import com.nis.domain.specific.ConfigGroupInfo;
|
||||||
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.web.dao.CrudDao;
|
import com.nis.web.dao.CrudDao;
|
||||||
import com.nis.web.dao.basics.AsnGroupInfoDao;
|
import com.nis.web.dao.basics.AsnGroupInfoDao;
|
||||||
import com.nis.web.dao.basics.AsnIpCfgDao;
|
import com.nis.web.dao.basics.AsnIpCfgDao;
|
||||||
@@ -103,8 +100,6 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
|||||||
}
|
}
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void update(AsnIpCfg entity){
|
public void update(AsnIpCfg entity){
|
||||||
List<AsnIpCfg> auditAsnIpList=new ArrayList<>();
|
|
||||||
List<AsnGroupInfo> auditAsnGroupList=new ArrayList<>();
|
|
||||||
Date editTime=new Date();
|
Date editTime=new Date();
|
||||||
entity.setEditTime(editTime);
|
entity.setEditTime(editTime);
|
||||||
entity.setEditorId(entity.getCurrentUser().getId());
|
entity.setEditorId(entity.getCurrentUser().getId());
|
||||||
@@ -119,53 +114,7 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
|||||||
entity.setCountry(country);
|
entity.setCountry(country);
|
||||||
entity.setDetail(detail);
|
entity.setDetail(detail);
|
||||||
entity.setCompileId(groupInfo.getCompileId());
|
entity.setCompileId(groupInfo.getCompileId());
|
||||||
/**
|
|
||||||
* isvalid=0 and asnNo=false 直接修改
|
|
||||||
* isvalid=0 and asnNo=true 需要下发
|
|
||||||
* isvalid=1 需要下发asnNo下所有的域配置
|
|
||||||
*/
|
|
||||||
/*if(groupInfo.getIsUsed().equals(1) && entity.getIsValid().equals(Constants.VALID_NO)){
|
|
||||||
entity.setAuditTime(editTime);
|
|
||||||
entity.setAuditorId(entity.getCurrentUser().getId());
|
|
||||||
entity.setIsValid(Constants.VALID_YES);
|
|
||||||
entity.setIsAudit(Constants.AUDIT_YES);
|
|
||||||
auditAsnIpList.add(entity);
|
|
||||||
}
|
|
||||||
if(groupInfo.getIsUsed().equals(1) && entity.getIsValid().equals(Constants.VALID_YES)){
|
|
||||||
entity.setAuditTime(editTime);
|
|
||||||
entity.setAuditorId(entity.getCurrentUser().getId());
|
|
||||||
entity.setIsValid(Constants.VALID_YES);
|
|
||||||
entity.setIsAudit(Constants.AUDIT_YES);
|
|
||||||
auditAsnGroupList.add(groupInfo);
|
|
||||||
}*/
|
|
||||||
if(entity.getIsValid() ==1){
|
|
||||||
entity.setAuditTime(editTime);
|
|
||||||
entity.setAuditorId(entity.getCurrentUser().getId());
|
|
||||||
entity.setEditTime(editTime);
|
|
||||||
entity.setEditorId(entity.getCurrentUser().getId());
|
|
||||||
entity.setIsValid(Constants.VALID_YES);
|
|
||||||
entity.setIsAudit(Constants.AUDIT_YES);
|
|
||||||
}else{
|
|
||||||
entity.setEditTime(editTime);
|
|
||||||
entity.setEditorId(entity.getCurrentUser().getId());
|
|
||||||
entity.setIsValid(Constants.VALID_NO);
|
|
||||||
entity.setIsAudit(Constants.VALID_NO);
|
|
||||||
}
|
|
||||||
asnIpCfgDao.update(entity);
|
asnIpCfgDao.update(entity);
|
||||||
//ASN下发状态时可以更改,更改之后直接下发
|
|
||||||
if(entity.getIsValid() ==1){
|
|
||||||
auditAsnIpList.add(entity);
|
|
||||||
asnIPRegionSendToMaat(auditAsnIpList,Constants.VALID_YES,Constants.OPACTION_PUT);
|
|
||||||
}
|
|
||||||
//common group 新增下发 ASN IP配置
|
|
||||||
/*if(!StringUtil.isEmpty(auditAsnIpList)){
|
|
||||||
asnIPRegionSendToMaat(auditAsnIpList,Constants.VALID_YES,Constants.OPACTION_POST);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
//common group 修改已下发过的配置,全量下发 ASN NO下的所有有效配置
|
|
||||||
/*if(entity.getIsAudit().equals(Constants.VALID_YES)){
|
|
||||||
auditAllAsnRegionCfg(entity,auditAsnGroupList,null);
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void processGroup(Map<Long,AsnGroupInfo> asnNoMap){
|
public void processGroup(Map<Long,AsnGroupInfo> asnNoMap){
|
||||||
@@ -307,12 +256,11 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
|||||||
}
|
}
|
||||||
sb.deleteCharAt(sb.toString().lastIndexOf(","));
|
sb.deleteCharAt(sb.toString().lastIndexOf(","));
|
||||||
asnIpCfgDao.delete(sb.toString());
|
asnIpCfgDao.delete(sb.toString());
|
||||||
asnIPRegionSendToMaat(entities,Constants.VALID_NO,Constants.OPACTION_PUT);
|
asnIPRegionSendToMaat(entities,Constants.VALID_NO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void saveAsnIpCfg(CfgIndexInfo entity) {
|
public void saveAsnIpCfg(CfgIndexInfo entity) {
|
||||||
List<AsnIpCfg> auditAsnIpList=new ArrayList<>();
|
|
||||||
Date createTime=new Date();
|
Date createTime=new Date();
|
||||||
//asn号
|
//asn号
|
||||||
String userRegion1=entity.getUserRegion1();
|
String userRegion1=entity.getUserRegion1();
|
||||||
@@ -353,27 +301,13 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
|||||||
cfg.setCreateTime(createTime);
|
cfg.setCreateTime(createTime);
|
||||||
cfg.setCreatorId(entity.getCurrentUser().getId());
|
cfg.setCreatorId(entity.getCurrentUser().getId());
|
||||||
cfg.setAsnIpGroup(entity.getAsnIpGroup().intValue());
|
cfg.setAsnIpGroup(entity.getAsnIpGroup().intValue());
|
||||||
cfg.setRegionId(idList.get(index));
|
|
||||||
//TODO 注意:被策略引用并下发过的ASN NO,配置新增后直接下发【此功能暂时不做自动,asnip拥有审核功能】
|
|
||||||
/*if(asnGroupInfo.getIsUsed().equals(1)){
|
|
||||||
cfg.setIsValid(Constants.VALID_YES);
|
|
||||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
|
||||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
|
||||||
cfg.setAuditTime(createTime);
|
|
||||||
auditAsnIpList.add(cfg);
|
|
||||||
}else{*/
|
|
||||||
cfg.setIsValid(Constants.VALID_NO);
|
cfg.setIsValid(Constants.VALID_NO);
|
||||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
/*}*/
|
cfg.setRegionId(idList.get(index));
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
this.save(entity.getAsnIpCfgs());
|
this.save(entity.getAsnIpCfgs());
|
||||||
//TODO 注意:被策略引用并下发过的ASN NO,配置新增后直接下发【此功能暂时不做自动,asnip拥有审核功能】
|
|
||||||
/*if(!StringUtil.isEmpty(auditAsnIpList)){
|
|
||||||
asnIPRegionSendToMaat(auditAsnIpList,Constants.VALID_YES,Constants.OPACTION_POST);
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void delete(String ids) {
|
public void delete(String ids) {
|
||||||
@@ -398,7 +332,7 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
|||||||
//已经下发过的,调用分组复用配置删除接口
|
//已经下发过的,调用分组复用配置删除接口
|
||||||
// splitAndSend(issuedList,Constants.VALID_NO);
|
// splitAndSend(issuedList,Constants.VALID_NO);
|
||||||
if(issuedList.size() > 0){
|
if(issuedList.size() > 0){
|
||||||
asnIPRegionSendToMaat(issuedList,Constants.VALID_NO,Constants.OPACTION_PUT);
|
asnIPRegionSendToMaat(issuedList,Constants.VALID_NO);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -506,11 +440,14 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void auditIpBatch(List<AsnIpCfg> asnIpCfgs,Long asn,Integer isValid) {
|
public void auditIpBatch(Map<Long,List<AsnIpCfg>> data,Integer isValid) {
|
||||||
List<AsnGroupInfo> auditAsnGroupList=new ArrayList<>();
|
|
||||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||||
final SqlSession batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
final SqlSession batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||||
try{
|
try{
|
||||||
|
for(Entry<Long,List<AsnIpCfg>> enrty:data.entrySet()) {
|
||||||
|
//data.entrySet().stream().forEach( enrty->{
|
||||||
|
Long asn=enrty.getKey();//ans group 的group id
|
||||||
|
List<AsnIpCfg> asnIpCfgs=enrty.getValue();
|
||||||
int issuedNum=asnIpCfgs.size();
|
int issuedNum=asnIpCfgs.size();
|
||||||
for(int index = 0; index < asnIpCfgs.size();index++){
|
for(int index = 0; index < asnIpCfgs.size();index++){
|
||||||
AsnIpCfg t = asnIpCfgs.get(index);
|
AsnIpCfg t = asnIpCfgs.get(index);
|
||||||
@@ -524,7 +461,6 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
|||||||
asnGroupInfo.setAsnId(asn);
|
asnGroupInfo.setAsnId(asn);
|
||||||
asnGroupInfo=asnGroupInfoDao.getInfoByAsnNo(asnGroupInfo);
|
asnGroupInfo=asnGroupInfoDao.getInfoByAsnNo(asnGroupInfo);
|
||||||
Integer groupId=asnGroupInfo.getGroupId();
|
Integer groupId=asnGroupInfo.getGroupId();
|
||||||
|
|
||||||
MaatCfg maatCfg = new MaatCfg();
|
MaatCfg maatCfg = new MaatCfg();
|
||||||
List<MaatCfg> configCompileList = new ArrayList();
|
List<MaatCfg> configCompileList = new ArrayList();
|
||||||
List<GroupCfg> groupRelationList = new ArrayList();
|
List<GroupCfg> groupRelationList = new ArrayList();
|
||||||
@@ -548,8 +484,6 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
|||||||
groupCfg.setCompileId(asnGroupInfo.getCompileId());
|
groupCfg.setCompileId(asnGroupInfo.getCompileId());
|
||||||
groupCfg.setGroupId(groupId);
|
groupCfg.setGroupId(groupId);
|
||||||
groupCfg.setIsValid(Constants.VALID_YES);
|
groupCfg.setIsValid(Constants.VALID_YES);
|
||||||
//asnGroupId标记为公共组
|
|
||||||
groupCfg.setIsCommonGroup(1);
|
|
||||||
groupCfg.setAuditTime(asnIpCfgs.get(0).getAuditTime());
|
groupCfg.setAuditTime(asnIpCfgs.get(0).getAuditTime());
|
||||||
groupRelationList.add(groupCfg);
|
groupRelationList.add(groupCfg);
|
||||||
BeanUtils.copyProperties(asnIpCfgs.get(0), maatCfg);
|
BeanUtils.copyProperties(asnIpCfgs.get(0), maatCfg);
|
||||||
@@ -583,7 +517,7 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
|||||||
}else if(asnGroupInfo.getIsValid()==1){//已经下发过,走分组复用
|
}else if(asnGroupInfo.getIsValid()==1){//已经下发过,走分组复用
|
||||||
asnGroupInfo.setIssuedIPs(issuedNum+0l);
|
asnGroupInfo.setIssuedIPs(issuedNum+0l);
|
||||||
asnGroupInfoDao.update(asnGroupInfo);
|
asnGroupInfoDao.update(asnGroupInfo);
|
||||||
asnIPRegionSendToMaat(asnIpCfgs,isValid,Constants.OPACTION_POST);
|
asnIPRegionSendToMaat(asnIpCfgs,isValid);
|
||||||
}else {
|
}else {
|
||||||
throw new RuntimeException("asnGroupInfo isValid value is "+asnGroupInfo.getIsValid());
|
throw new RuntimeException("asnGroupInfo isValid value is "+asnGroupInfo.getIsValid());
|
||||||
}
|
}
|
||||||
@@ -591,33 +525,38 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
|||||||
asnGroupInfo.setIssuedIPs(0L-issuedNum);
|
asnGroupInfo.setIssuedIPs(0L-issuedNum);
|
||||||
asnGroupInfoDao.update(asnGroupInfo);
|
asnGroupInfoDao.update(asnGroupInfo);
|
||||||
//已经下发过的,调用分组复用配置删除接口
|
//已经下发过的,调用分组复用配置删除接口
|
||||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
// GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
// List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
// GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||||
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(asnIpCfgs,Constants.VALID_NO,groupId));
|
// ipRegionList.addAll(groupReuseCfgAddRemoveConvert(asnIpCfgs,Constants.VALID_NO,groupId));
|
||||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
// groupReuseCfg.setIpRegionList(ipRegionList);
|
||||||
groupReuseCfg.setStrRegionList(strRegionList);
|
// groupReuseCfg.setStrRegionList(strRegionList);
|
||||||
groupReuseCfg.setNumRegionList(numRegionList);
|
// groupReuseCfg.setNumRegionList(numRegionList);
|
||||||
groupReuseList.add(groupReuseCfg);
|
// groupReuseList.add(groupReuseCfg);
|
||||||
maatBean.setGroupReuseCfgList(groupReuseList);
|
// maatBean.setGroupReuseCfgList(groupReuseList);
|
||||||
maatBean.setAuditTime(asnIpCfgs.get(0).getAuditTime());
|
// maatBean.setAuditTime(asnIpCfgs.get(0).getAuditTime());
|
||||||
maatBean.setCreatorName(asnIpCfgs.get(0).getCurrentUser().getName());
|
// maatBean.setCreatorName(asnIpCfgs.get(0).getCurrentUser().getName());
|
||||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
// maatBean.setVersion(Constants.MAAT_VERSION);
|
||||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
// maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||||
//调用服务接口下发配置数据
|
// //调用服务接口下发配置数据
|
||||||
String json=gsonToJson(maatBean);
|
// String json=gsonToJson(maatBean);
|
||||||
logger.info("ASN IP域删除配置下发配置参数:"+json);
|
// logger.info("ASN IP域删除配置下发配置参数:"+json);
|
||||||
//调用服务接口下发配置
|
// //调用服务接口下发配置
|
||||||
ToMaatResult result = ConfigServiceUtil.auditCommonGroupRegionSources(json,3);
|
// ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||||
logger.info("ASN IP域删除配置响应信息:"+result.getMsg());
|
// logger.info("ASN IP域删除配置响应信息:"+result.getMsg());
|
||||||
|
asnIPRegionSendToMaat(asnIpCfgs,isValid);
|
||||||
//如果一个asn组下没有IP了,修改有效状态
|
//如果一个asn组下没有IP了,修改有效状态
|
||||||
if(hasValidAsnIp(asn)) {
|
//if(hasValidAsnIp(asn)) {
|
||||||
asnGroupInfo.setIsValid(0);
|
// asnGroupInfo.setIsValid(0);
|
||||||
asnGroupInfo.setEditorId(UserUtils.getUser().getId());
|
// asnGroupInfo.setEditorId(UserUtils.getUser().getId());
|
||||||
asnGroupInfo.setEditTime(new Date());
|
// asnGroupInfo.setEditTime(new Date());
|
||||||
asnGroupInfoDao.updateValid(asnGroupInfo);
|
// asnGroupInfoDao.updateValid(asnGroupInfo);
|
||||||
}
|
//}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
throw new RuntimeException("isValid value is "+isValid);
|
||||||
|
}
|
||||||
|
//});
|
||||||
}
|
}
|
||||||
}finally {
|
}finally {
|
||||||
if(batchSqlSession != null){
|
if(batchSqlSession != null){
|
||||||
|
|||||||
@@ -1212,7 +1212,6 @@ public class AppCfgService extends BaseService {
|
|||||||
GroupCfg groupCfg=new GroupCfg();
|
GroupCfg groupCfg=new GroupCfg();
|
||||||
groupCfg.setCompileId(entitys.get(0).getCompileId());
|
groupCfg.setCompileId(entitys.get(0).getCompileId());
|
||||||
groupCfg.setGroupId(groupId);
|
groupCfg.setGroupId(groupId);
|
||||||
groupCfg.setIsCommonGroup(1);
|
|
||||||
groupCfg.setIsValid(Constants.VALID_YES);
|
groupCfg.setIsValid(Constants.VALID_YES);
|
||||||
groupCfg.setAuditTime(entitys.get(0).getAuditTime());
|
groupCfg.setAuditTime(entitys.get(0).getAuditTime());
|
||||||
groupRelationList.add(groupCfg);
|
groupRelationList.add(groupCfg);
|
||||||
@@ -1251,7 +1250,7 @@ public class AppCfgService extends BaseService {
|
|||||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||||
/*groupReuseCfg.setUserRegion(userRegion);*/
|
/*groupReuseCfg.setUserRegion(userRegion);*/
|
||||||
/*groupReuseCfg.setServiceId(entitys.get(0).getServiceId());*/
|
groupReuseCfg.setServiceId(entitys.get(0).getServiceId());
|
||||||
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(entitys,Constants.VALID_YES,groupId));
|
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(entitys,Constants.VALID_YES,groupId));
|
||||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||||
groupReuseCfg.setStrRegionList(strRegionList);
|
groupReuseCfg.setStrRegionList(strRegionList);
|
||||||
@@ -1266,7 +1265,7 @@ public class AppCfgService extends BaseService {
|
|||||||
String json=gsonToJson(maatBean);
|
String json=gsonToJson(maatBean);
|
||||||
logger.info("app协议IP域新增配置下发配置参数:"+json);
|
logger.info("app协议IP域新增配置下发配置参数:"+json);
|
||||||
//调用服务接口下发配置
|
//调用服务接口下发配置
|
||||||
ToMaatResult result = ConfigServiceUtil.auditCommonGroupRegionSources(json,1);
|
ToMaatResult result = ConfigServiceUtil.postGroupReuseSources(json);
|
||||||
logger.info("app协议IP域新增配置响应信息:"+result.getMsg());
|
logger.info("app协议IP域新增配置响应信息:"+result.getMsg());
|
||||||
}else {
|
}else {
|
||||||
throw new RuntimeException("Unknown configGroupInfo isIssued value");
|
throw new RuntimeException("Unknown configGroupInfo isIssued value");
|
||||||
@@ -1290,7 +1289,7 @@ public class AppCfgService extends BaseService {
|
|||||||
String json=gsonToJson(maatBean);
|
String json=gsonToJson(maatBean);
|
||||||
logger.info("app协议IP域删除配置下发配置参数:"+json);
|
logger.info("app协议IP域删除配置下发配置参数:"+json);
|
||||||
//调用服务接口下发配置
|
//调用服务接口下发配置
|
||||||
ToMaatResult result = ConfigServiceUtil.auditCommonGroupRegionSources(json,3);
|
ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||||
logger.info("app协议IP域删除配置响应信息:"+result.getMsg());
|
logger.info("app协议IP域删除配置响应信息:"+result.getMsg());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1513,7 +1513,7 @@ public class ConfigSynchronizationService extends BaseService{
|
|||||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||||
/*groupReuseCfg.setUserRegion(userRegion);*/
|
/*groupReuseCfg.setUserRegion(userRegion);*/
|
||||||
/*groupReuseCfg.setServiceId(entitys.get(0).getServiceId());*/
|
groupReuseCfg.setServiceId(entitys.get(0).getServiceId());
|
||||||
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(entitys,entity.getIsValid(),entitys.get(0).getGroupId()));
|
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(entitys,entity.getIsValid(),entitys.get(0).getGroupId()));
|
||||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||||
groupReuseCfg.setStrRegionList(strRegionList);
|
groupReuseCfg.setStrRegionList(strRegionList);
|
||||||
@@ -1592,7 +1592,7 @@ public class ConfigSynchronizationService extends BaseService{
|
|||||||
}else {
|
}else {
|
||||||
logger.info("app ip批量生效:"+json);
|
logger.info("app ip批量生效:"+json);
|
||||||
//调用服务接口同步回调类配置
|
//调用服务接口同步回调类配置
|
||||||
ToMaatResult result = ConfigServiceUtil.auditCommonGroupRegionSources(json,1);
|
ToMaatResult result = ConfigServiceUtil.postGroupReuseSources(json);
|
||||||
if(result!=null){
|
if(result!=null){
|
||||||
logger.info("app ip批量生效响应信息:"+result.getMsg());
|
logger.info("app ip批量生效响应信息:"+result.getMsg());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,8 +132,6 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
entity.setCompileId(compileId);
|
entity.setCompileId(compileId);
|
||||||
entity.setCreateTime(new Date());
|
entity.setCreateTime(new Date());
|
||||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||||
//保存asn组织信息 字符串域信息
|
|
||||||
handleAsn(entity.getAsnKeywords(), entity);
|
|
||||||
ipCfgDao.saveCfgIndex(entity);
|
ipCfgDao.saveCfgIndex(entity);
|
||||||
if(entity.getIpPortList()!=null){
|
if(entity.getIpPortList()!=null){
|
||||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||||
@@ -157,15 +155,42 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
areaIpCfgDao.saveAreaIpCfg(cfg);
|
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//保存asn组织信息 字符串域信息
|
||||||
|
if(StringUtils.isNotBlank(entity.getUserRegion4())){
|
||||||
|
List<FunctionRegionDict> functionRegionDicts=DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||||
|
FunctionRegionDict regionDict=null;
|
||||||
|
for(FunctionRegionDict dict:functionRegionDicts) {
|
||||||
|
if("asn".equals(dict.getConfigServiceType())) {
|
||||||
|
regionDict=dict;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(regionDict!=null) {
|
||||||
|
String org=entity.getUserRegion4();
|
||||||
|
List<AsnGroupInfo> asnGroupInfos=asnGroupInfoDao.getValidConfigGroupInfoByName(org);
|
||||||
|
for(AsnGroupInfo info:asnGroupInfos) {
|
||||||
|
BaseStringCfg<AsnKeywordCfg> asnKeywordCfg=new AsnKeywordCfg();
|
||||||
|
BeanUtils.copyProperties(entity, asnKeywordCfg,new String[]{"cfgId","cfgDesc","cfgRegionCode","cfgType","userRegion1","userRegion2","userRegion3"});
|
||||||
|
asnKeywordCfg.setTableName(AsnKeywordCfg.getTablename());
|
||||||
|
asnKeywordCfg.setCfgKeywords("AS"+info.getAsnId());
|
||||||
|
asnKeywordCfg.setExprType(0);
|
||||||
|
asnKeywordCfg.setMatchMethod(3);
|
||||||
|
asnKeywordCfg.setExType("0");
|
||||||
|
asnKeywordCfg.setIsHexbin(0);
|
||||||
|
asnKeywordCfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||||
|
asnKeywordCfg.setCfgType(regionDict.getConfigRegionValue());
|
||||||
|
asnKeywordCfg.setCreateTime(entity.getCreateTime());
|
||||||
|
asnKeywordCfg.setCreatorId(UserUtils.getUser().getId());
|
||||||
|
asnKeywordCfg.setFunctionId(regionDict.getFunctionId());
|
||||||
|
asnKeywordCfg.setCompileId(compileId);
|
||||||
|
stringCfgDao.saveStringCfgBatch(asnKeywordCfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
entity.setEditTime(new Date());
|
entity.setEditTime(new Date());
|
||||||
entity.setEditorId(entity.getCurrentUser().getId());
|
entity.setEditorId(entity.getCurrentUser().getId());
|
||||||
//保存asn组织信息 字符串域信息
|
|
||||||
handleAsn(entity.getAsnKeywords(), entity);
|
|
||||||
ipCfgDao.updateCfgIndex(entity);
|
ipCfgDao.updateCfgIndex(entity);
|
||||||
entity.setCreateTime(new Date());
|
|
||||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
|
||||||
//无效子配置后,再新增子配置
|
//无效子配置后,再新增子配置
|
||||||
ipCfgDao.deleteIpCfg(entity);
|
ipCfgDao.deleteIpCfg(entity);
|
||||||
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
|
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
|
||||||
@@ -173,6 +198,8 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
area.setCompileId(entity.getCompileId());
|
area.setCompileId(entity.getCompileId());
|
||||||
area.setFunctionId(entity.getFunctionId());
|
area.setFunctionId(entity.getFunctionId());
|
||||||
areaIpCfgDao.deleteAreaIpCfg(area);
|
areaIpCfgDao.deleteAreaIpCfg(area);
|
||||||
|
entity.setCreateTime(new Date());
|
||||||
|
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||||
if(entity.getIpPortList()!=null){
|
if(entity.getIpPortList()!=null){
|
||||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
@@ -195,9 +222,8 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
areaIpCfgDao.saveAreaIpCfg(cfg);
|
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
handleAsn(entity.getAsnKeywords(), entity);
|
|
||||||
//保存asn组织信息 字符串域信息
|
//保存asn组织信息 字符串域信息
|
||||||
/*if(StringUtils.isNotBlank(entity.getUserRegion4())){
|
if(StringUtils.isNotBlank(entity.getUserRegion4())){
|
||||||
List<FunctionRegionDict> functionRegionDicts=DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
List<FunctionRegionDict> functionRegionDicts=DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||||
FunctionRegionDict regionDict=null;
|
FunctionRegionDict regionDict=null;
|
||||||
for(FunctionRegionDict dict:functionRegionDicts) {
|
for(FunctionRegionDict dict:functionRegionDicts) {
|
||||||
@@ -231,7 +257,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void updateIpCfgValid(Integer isValid,String ids,Integer functionId){
|
public void updateIpCfgValid(Integer isValid,String ids,Integer functionId){
|
||||||
@@ -545,8 +571,6 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
numRegionList.addAll(map.get("numRegionList"));
|
numRegionList.addAll(map.get("numRegionList"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
maatType=1;
|
|
||||||
}
|
}
|
||||||
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
|
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
|
||||||
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
|
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
|
||||||
@@ -559,8 +583,26 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
strRegionList=map.get("dstList");
|
strRegionList=map.get("dstList");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//asn配置下发
|
if(entity.getAsnKeywords()!=null && entity.getAsnKeywords().size()>0){
|
||||||
auditAsnCfg(groupRelationList,strRegionList,entity,entity.getAsnKeywords());
|
String regionValue=entity.getAsnKeywords().get(0).getCfgType();
|
||||||
|
if(regionValue!=null) {
|
||||||
|
for(FunctionRegionDict region:dictList) {
|
||||||
|
if(regionValue.equals(region.getConfigRegionValue())) {
|
||||||
|
maatType=region.getIsMaat();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AsnKeywordCfg cfg = new AsnKeywordCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(AsnKeywordCfg.getTablename());
|
||||||
|
ipCfgDao.auditCfg(cfg);
|
||||||
|
if(isAudit==1&&maatType==Constants.MAAT_TYPE){
|
||||||
|
Map<String,List> map = cfgConvert(strRegionList,entity.getAsnKeywords(),2,entity,groupRelationList);
|
||||||
|
groupRelationList=map.get("groupList");
|
||||||
|
strRegionList=map.get("dstList");
|
||||||
|
}
|
||||||
|
}
|
||||||
//保存区域IP信息
|
//保存区域IP信息
|
||||||
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||||
if(!StringUtil.isEmpty(areaIpCfgList)){
|
if(!StringUtil.isEmpty(areaIpCfgList)){
|
||||||
@@ -668,7 +710,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
maatCfg.setCompileId(entity.getCompileId());
|
maatCfg.setCompileId(entity.getCompileId());
|
||||||
maatCfg.setServiceId(entity.getServiceId());
|
maatCfg.setServiceId(entity.getServiceId());
|
||||||
maatCfg.setIsValid(0);//无效
|
maatCfg.setIsValid(0);//无效
|
||||||
configCompileList.add(addKeepGroupList(maatCfg,entity));
|
configCompileList.add(maatCfg);
|
||||||
maatBean.setConfigCompileList(configCompileList);
|
maatBean.setConfigCompileList(configCompileList);
|
||||||
maatBean.setAuditTime(entity.getAuditTime());
|
maatBean.setAuditTime(entity.getAuditTime());
|
||||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||||
@@ -863,7 +905,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
List<NtcSubscribeIdCfg> subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
|
List<NtcSubscribeIdCfg> subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
|
||||||
entity.setIpPortList(ipPortList);
|
entity.setIpPortList(ipPortList);
|
||||||
entity.setNtcSubscribeIdCfgList(subscribeIdList);
|
entity.setNtcSubscribeIdCfgList(subscribeIdList);
|
||||||
if(StringUtils.isNotBlank(entity.getCommonGroupIds())) {
|
if(StringUtils.isNotBlank(entity.getUserRegion4())) {
|
||||||
List<AsnKeywordCfg> asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity);
|
List<AsnKeywordCfg> asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity);
|
||||||
entity.setAsnKeywords(asnKeywordCfgs);
|
entity.setAsnKeywords(asnKeywordCfgs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -616,10 +616,5 @@ trafficAppTrend=v1/trafficAppTrend
|
|||||||
appConnRecordTop100=v1/appConnRecordTop100
|
appConnRecordTop100=v1/appConnRecordTop100
|
||||||
#SSL\u6cdb\u6536
|
#SSL\u6cdb\u6536
|
||||||
ntcSslRecordLog=v1/ntcSslRecordLogs
|
ntcSslRecordLog=v1/ntcSslRecordLogs
|
||||||
ntc_asn_number=NTC_ASN_NUMBER
|
|
||||||
addRegionToCommonGroup=v1/addRegionToCommonGroup
|
|
||||||
updateRegionToCommonGroup=v1/updateCommonGroupRegion
|
|
||||||
deleteRegionToCommonGroup=v1/delCommonGroupRegion
|
|
||||||
asn_key=AS
|
|
||||||
#Http\u6cdb\u6536
|
#Http\u6cdb\u6536
|
||||||
ntcHttpRecordLog=v1/ntcHttpRecordLogs
|
ntcHttpRecordLog=v1/ntcHttpRecordLogs
|
||||||
|
|||||||
@@ -111,15 +111,12 @@ function update(url){
|
|||||||
var cked = $("tbody tr td input.i-checks:checkbox:checked");
|
var cked = $("tbody tr td input.i-checks:checkbox:checked");
|
||||||
if($(checkboxes).filter(":checked").length==1){
|
if($(checkboxes).filter(":checked").length==1){
|
||||||
if(cked.val()==1){
|
if(cked.val()==1){
|
||||||
//增加asn ip域配置判断,如果是asn ip业务,审核通过的也可以修改 functionId=600
|
|
||||||
if($("input[name='functionId']").val() != 600){
|
|
||||||
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
|
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
|
||||||
return;
|
return;
|
||||||
|
}else if(cked.val()==3){
|
||||||
|
/* top.$.jBox.tip("<spring:message code='cancel_approved'/>", "<spring:message code='info'/>");
|
||||||
|
return; */
|
||||||
}
|
}
|
||||||
}/* else if(cked.val()==3){
|
|
||||||
top.$.jBox.tip("<spring:message code='cancel_approved'/>", "<spring:message code='info'/>");
|
|
||||||
return;
|
|
||||||
} */
|
|
||||||
//处理asnIp,asn组下发过的ip配置不允许修改
|
//处理asnIp,asn组下发过的ip配置不允许修改
|
||||||
if(cked.attr("asnGroup")&&cked.attr("isValid")){
|
if(cked.attr("asnGroup")&&cked.attr("isValid")){
|
||||||
var asnGroup=cked.attr("asnGroup");
|
var asnGroup=cked.attr("asnGroup");
|
||||||
@@ -393,18 +390,6 @@ function cancelPassOpt(url){
|
|||||||
});
|
});
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
//验证是否可删除
|
|
||||||
function validateIsDelete(checkboxes){
|
|
||||||
var flag = false;
|
|
||||||
$(checkboxes).filter(":checked").each(function(){
|
|
||||||
//alert($(this).val());
|
|
||||||
if($(this).val()!=0 && $(this).val()!=3){//状态为3的配置为取消审核的配置,可删除
|
|
||||||
flag = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return flag;
|
|
||||||
}
|
|
||||||
//验证选择的配置,是否有审核通过的
|
//验证选择的配置,是否有审核通过的
|
||||||
function validatePass(checkboxes){
|
function validatePass(checkboxes){
|
||||||
var flag = false;
|
var flag = false;
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
|
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
|
|
||||||
<%-- <div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
|
|
||||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||||
@@ -157,36 +157,6 @@
|
|||||||
|
|
||||||
<input id="intype" class="form-control input-medium" type="text" value="">
|
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||||
|
|
||||||
</div> --%>
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-btn">
|
|
||||||
<span class="form-control" ><spring:message code="organization"/></span>
|
|
||||||
</div>
|
|
||||||
<input name="organization" id="organization" type="text" class="form-control input-medium" value="${cfg.organization}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="pull-left">
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-btn">
|
|
||||||
<span class="form-control" ><spring:message code="asn_no"/></span>
|
|
||||||
</div>
|
|
||||||
<input name="asnId" id="asnId" type="text" class="form-control input-medium" value="${cfg.asnId}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="pull-left">
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-btn">
|
|
||||||
<span class="form-control" ><spring:message code="country"/></span>
|
|
||||||
</div>
|
|
||||||
<input name="country" id="country" type="text" class="form-control input-medium" value="${cfg.country}" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="pull-left">
|
|
||||||
<div class="input-group">
|
|
||||||
<div class="input-group-btn">
|
|
||||||
<span class="form-control" ><spring:message code="detail"/></span>
|
|
||||||
</div>
|
|
||||||
<input name="detail" id="detail" type="text" class="form-control input-medium" value="${cfg.detail}" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
@@ -260,11 +230,10 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||||
<th class="sort-column r.organization"><spring:message code="organization"/></th>
|
<th class="sort-column r.organization"><spring:message code="organization"/></th>
|
||||||
<th class="sort-column r.asn_id"><spring:message code="asn_no"/></th>
|
|
||||||
<th class="sort-column r.country"><spring:message code="country"/></th>
|
<th class="sort-column r.country"><spring:message code="country"/></th>
|
||||||
<th class="sort-column r.detail"><spring:message code="detail"/></th>
|
<th class="sort-column r.detail"><spring:message code="detail"/></th>
|
||||||
<th class="sort-column r.is_used"><spring:message code="is_issued"/></th>
|
<th class="sort-column r.asn_id"><spring:message code="asn_no"/></th>
|
||||||
<th class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
<th class="sort-column r.is_valid"><spring:message code="is_issued"/></th>
|
||||||
<th><spring:message code="creator"/></th>
|
<th><spring:message code="creator"/></th>
|
||||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||||
<th><spring:message code="editor"/></th>
|
<th><spring:message code="editor"/></th>
|
||||||
@@ -278,26 +247,22 @@
|
|||||||
<td>
|
<td>
|
||||||
<a href="javascript:;" data-original-title="${cfg.organization}"
|
<a href="javascript:;" data-original-title="${cfg.organization}"
|
||||||
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||||
${fns:abbr(cfg.organization,50)}
|
${fns:abbr(cfg.organization,20)}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>${cfg.asnId}</td>
|
|
||||||
<td>
|
<td>
|
||||||
<a href="javascript:;" data-original-title="${cfg.country}"
|
<a href="javascript:;" data-original-title="${cfg.country}"
|
||||||
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||||
${fns:abbr(cfg.country,50)}
|
${fns:abbr(cfg.country,20)}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="javascript:;" data-original-title="${cfg.detail}"
|
<a href="javascript:;" data-original-title="${cfg.detail}"
|
||||||
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||||
${fns:abbr(cfg.detail,50)}
|
${fns:abbr(cfg.detail,20)}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>${cfg.asnId}</td>
|
||||||
<c:if test="${cfg.isUsed==0}"><spring:message code="no"/></c:if>
|
|
||||||
<c:if test="${cfg.isUsed==1}"><spring:message code="yes"/></c:if>
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
<c:if test="${cfg.isValid==0}"><spring:message code="no"/></c:if>
|
<c:if test="${cfg.isValid==0}"><spring:message code="no"/></c:if>
|
||||||
<c:if test="${cfg.isValid==1}"><spring:message code="yes"/></c:if>
|
<c:if test="${cfg.isValid==1}"><spring:message code="yes"/></c:if>
|
||||||
|
|||||||
@@ -95,11 +95,8 @@ $(function(){
|
|||||||
<!-- BEGIN FORM-->
|
<!-- BEGIN FORM-->
|
||||||
<form id="cfgFrom" action="${ctx}/basics/asn/update" method="post" class="form-horizontal">
|
<form id="cfgFrom" action="${ctx}/basics/asn/update" method="post" class="form-horizontal">
|
||||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||||
<input type="hidden" name="regionId" value="${_cfg.regionId}">
|
|
||||||
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||||
<input type="hidden" name="isValid" value="${_cfg.isValid}">
|
|
||||||
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
|
|
||||||
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||||
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
||||||
<input type="hidden" id="requestId" name="requestId" value="${_cfg.requestId}">
|
<input type="hidden" id="requestId" name="requestId" value="${_cfg.requestId}">
|
||||||
@@ -138,7 +135,7 @@ $(function(){
|
|||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ASN"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ASN"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<!-- <select name="userRegion1" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search"></select> -->
|
<!-- <select name="userRegion1" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search"></select> -->
|
||||||
<input class="form-control required digits asnMustExists" type="text" name="userRegion1" value="${_cfg.userRegion1}" ctx="${ctx}" <c:if test="${_cfg.isAudit eq 1}">readonly="readonly"</c:if>/>
|
<input class="form-control required digits asnMustExists" type="text" name="userRegion1" value="${_cfg.userRegion1}" ctx="${ctx}">
|
||||||
</div>
|
</div>
|
||||||
<div for="userRegion1"></div>
|
<div for="userRegion1"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
34
src/main/webapp/WEB-INF/views/cfg/ipaddr/asnForm.jsp
Normal file
34
src/main/webapp/WEB-INF/views/cfg/ipaddr/asnForm.jsp
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<div class="row">
|
||||||
|
<div class="pull-right">
|
||||||
|
<span class="glyphicon glyphicon-remove pull-right" title="remove"
|
||||||
|
onClick="delContent('${tabName}${status.index}','${tabName}Add');" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<%-- <input type="hidden" name="userRegion5" value="${_cfg.userRegion5}"> --%>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="organization"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<%-- <select name="userRegion4" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<c:forEach items="${policyGroups }" var="policyGroup">
|
||||||
|
<option asnId="${policyGroup.asnId}" value="${policyGroup.groupName}" <c:if test="${asn==policyGroup.groupName }">selected</c:if>><spring:message code="${policyGroup.groupName}"/></option>
|
||||||
|
</c:forEach>
|
||||||
|
</select> --%>
|
||||||
|
<input class="form-control required invisibleChar orgMustExists" type="text" name="userRegion4" value="${asn}" ctx="${ctx}">
|
||||||
|
</div>
|
||||||
|
<div for="userRegion4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
</html>
|
||||||
@@ -27,18 +27,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//hide actions
|
//hide actions
|
||||||
/* if(isAsn==1){
|
if(isAsn==1){
|
||||||
hideAction(0,asnRegionCode);
|
hideAction(0,asnRegionCode);
|
||||||
}else{
|
}else{
|
||||||
hideAction(1,asnRegionCode);
|
hideAction(1,asnRegionCode);
|
||||||
} */
|
}
|
||||||
/* $("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click();*/
|
if(isAsn==0){
|
||||||
if($(".action:checked").val()==32){
|
$("[class~='glyphicon-plus'][class~='ipPortList']").click();
|
||||||
|
$("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click();
|
||||||
|
/*if(action==32){
|
||||||
$(".subscribeId").find(".glyphicon-remove").click();
|
$(".subscribeId").find(".glyphicon-remove").click();
|
||||||
$(".subscribeId").prev("h4").addClass("hidden");
|
$(".subscribeId").prev("h4").addClass("hidden");
|
||||||
$(".asnRegionV").find(".glyphicon-remove").click();
|
}*/
|
||||||
$(".asnRegionV").prev("h4").addClass("hidden");
|
|
||||||
}
|
|
||||||
var regionCodes=$(".action:checked").attr("regionCode").split(",");
|
var regionCodes=$(".action:checked").attr("regionCode").split(",");
|
||||||
$("h4[class*='ipPortListTitle']").each(function(){
|
$("h4[class*='ipPortListTitle']").each(function(){
|
||||||
var has=false;
|
var has=false;
|
||||||
@@ -52,6 +52,36 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
processAction(isAsn,$(".ipPortList"));
|
processAction(isAsn,$(".ipPortList"));
|
||||||
|
}else{
|
||||||
|
$("[class~='glyphicon-plus'][class~='asn']").click();
|
||||||
|
$("[class~='boxSolid'][class~='ipPortList']").find(".glyphicon-remove").click();
|
||||||
|
processAction(isAsn,$(".asn"));
|
||||||
|
}
|
||||||
|
//隐藏显示asn
|
||||||
|
if($("[name='action']:checked").val()==32||$("[name='action']:checked").val()==64){
|
||||||
|
console.log(111);
|
||||||
|
$("h4.form-section.asn").addClass("hidden");
|
||||||
|
}else{
|
||||||
|
$("h4.form-section.asn").removeClass("hidden");
|
||||||
|
}
|
||||||
|
$(".glyphicon-plus").on("click",function(){
|
||||||
|
if($(this).hasClass("ipPortList")){
|
||||||
|
isAsn=0;
|
||||||
|
hideAction(1,asnRegionCode);
|
||||||
|
$("[class~='boxSolid'][class~='asn']").find(".glyphicon-remove").click();
|
||||||
|
}
|
||||||
|
if($(this).hasClass("asn")){
|
||||||
|
isAsn=1;
|
||||||
|
hideAction(0,asnRegionCode);
|
||||||
|
$("[class~='boxSolid'][class~='ipPortList']").find(".glyphicon-remove").click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//处理asn id
|
||||||
|
$(".asn").find("input[name='userRegion5']").val($(".asn").find("select[name='userRegion4'] option:selected").attr("asnId"));
|
||||||
|
$(".asn").find("select[name='userRegion4']").on("change",function(){
|
||||||
|
var asnId=$(this).find("option[value='"+$(this).val()+"']").attr("asnId");
|
||||||
|
$(this).parents(".row").find("input[name='userRegion5']").val(asnId);
|
||||||
|
});
|
||||||
$(".action").on("change", function() {
|
$(".action").on("change", function() {
|
||||||
$("#serviceId").val($(this).attr("serviceId"));
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
$("#protocolId").val($(this).attr("protocolId"));
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
@@ -86,10 +116,9 @@
|
|||||||
tabInfo.find("[name$='cfgType']").val(cfgType);
|
tabInfo.find("[name$='cfgType']").val(cfgType);
|
||||||
tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode);
|
tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode);
|
||||||
}
|
}
|
||||||
|
if(isAsn==0){
|
||||||
/*if(isAsn==0){
|
|
||||||
changeIPVal(tabInfo);
|
changeIPVal(tabInfo);
|
||||||
} */
|
}
|
||||||
processAction(isAsn,tabInfo);
|
processAction(isAsn,tabInfo);
|
||||||
/* if(tabInfo){
|
/* if(tabInfo){
|
||||||
tabInfo.find("[name$='cfgType']").val(cfgType);
|
tabInfo.find("[name$='cfgType']").val(cfgType);
|
||||||
@@ -98,11 +127,8 @@
|
|||||||
if($(this).val()==32||$(this).val()==96){
|
if($(this).val()==32||$(this).val()==96){
|
||||||
$(".subscribeId").find(".glyphicon-remove").click();
|
$(".subscribeId").find(".glyphicon-remove").click();
|
||||||
$(".subscribeId").prev("h4").addClass("hidden");
|
$(".subscribeId").prev("h4").addClass("hidden");
|
||||||
$(".asnRegionV").find(".glyphicon-remove").click();
|
|
||||||
$(".asnRegionV").prev("h4").addClass("hidden");
|
|
||||||
}else{
|
}else{
|
||||||
$(".subscribeId").prev("h4").removeClass("hidden");
|
$(".subscribeId").prev("h4").removeClass("hidden");
|
||||||
$(".asnRegionV").prev("h4").removeClass("hidden");
|
|
||||||
}
|
}
|
||||||
//处理ICMP
|
//处理ICMP
|
||||||
if($(this).val()==32){
|
if($(this).val()==32){
|
||||||
@@ -119,20 +145,17 @@
|
|||||||
|
|
||||||
} */
|
} */
|
||||||
//隐藏显示asn
|
//隐藏显示asn
|
||||||
/* if($(this).val()==32||$(this).val()==64){
|
if($(this).val()==32||$(this).val()==64){
|
||||||
$("h4.form-section.asn").addClass("hidden");
|
$("h4.form-section.asn").addClass("hidden");
|
||||||
}else{
|
}else{
|
||||||
$("h4.form-section.asn").removeClass("hidden");
|
$("h4.form-section.asn").removeClass("hidden");
|
||||||
} */
|
}
|
||||||
});
|
});
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
$(".ratelimitAction").find("input[name='userRegion1']").on("change",function(){
|
$(".ratelimitAction").find("input[name='userRegion1']").on("change",function(){
|
||||||
switchRateLimitType();
|
switchRateLimitType();
|
||||||
})
|
})
|
||||||
if($("input[name='cfgId']").val() == null || $("input[name='cfgId']").val() == ''){
|
|
||||||
$(".glyphicon-plus").first().click();
|
|
||||||
}
|
|
||||||
$("#cfgFrom").validate(
|
$("#cfgFrom").validate(
|
||||||
{
|
{
|
||||||
errorPlacement : function(error, element) {
|
errorPlacement : function(error, element) {
|
||||||
@@ -150,14 +173,14 @@
|
|||||||
subscribeId=1;
|
subscribeId=1;
|
||||||
}
|
}
|
||||||
//代表所有业务都隐藏了,提示必须增加一种业务数据
|
//代表所有业务都隐藏了,提示必须增加一种业务数据
|
||||||
var boxSolidLenth=$(".boxSolid").length;
|
/* var boxSolidLenth=$(".boxSolid").length;
|
||||||
if($(".boxSolid").hasClass("subscribeId")){
|
if($(".boxSolid").hasClass("subscribeId")){
|
||||||
boxSolidLenth=boxSolidLenth-1;
|
boxSolidLenth=boxSolidLenth-1;
|
||||||
}
|
}
|
||||||
if(boxSolidLenth ==($(".boxSolid.hidden").length-subscribeId)){
|
if(boxSolidLenth ==($(".boxSolid.hidden").length-subscribeId)){
|
||||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||||
return;
|
return;
|
||||||
}
|
} */
|
||||||
//代表所有区域都隐藏了,提示必须增加个区域信息
|
//代表所有区域都隐藏了,提示必须增加个区域信息
|
||||||
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
|
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
|
||||||
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
|
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
|
||||||
@@ -196,10 +219,10 @@
|
|||||||
flag=flag1;
|
flag=flag1;
|
||||||
}
|
}
|
||||||
if(flag){
|
if(flag){
|
||||||
/* if(isAsn==0){
|
if(isAsn==0){
|
||||||
$("input[name='userRegion4']").attr("disabled",true);
|
$("input[name='userRegion4']").attr("disabled",true);
|
||||||
$("input[name='userRegion5']").attr("disabled",true);
|
$("input[name='userRegion5']").attr("disabled",true);
|
||||||
} */
|
}
|
||||||
$("input[name$='userRegion1']").attr("disabled",false);
|
$("input[name$='userRegion1']").attr("disabled",false);
|
||||||
$("input[name$='exprType']").attr("disabled",false);
|
$("input[name$='exprType']").attr("disabled",false);
|
||||||
//将disable属性的元素删除
|
//将disable属性的元素删除
|
||||||
@@ -304,12 +327,12 @@ var processAction=function(configType,obj){
|
|||||||
var selectedProtocol=o.find("select[name$='protocol'] option:selected").attr("value");
|
var selectedProtocol=o.find("select[name$='protocol'] option:selected").attr("value");
|
||||||
if(action==32){
|
if(action==32){
|
||||||
//先清空,再添加
|
//先清空,再添加
|
||||||
o.find("select[name$='protocol']").empty();
|
/* o.find("select[name$='protocol']").empty();
|
||||||
$.ipcommon.protocol.each(function(){
|
$.ipcommon.protocol.each(function(){
|
||||||
if($(this).attr("value")==6||$(this).attr("value")==17||$(this).attr("value")==1||$(this).attr("value")==50||$(this).attr("value")==15||$(this).attr("value")==51){
|
if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17||$(this).attr("value")==1||$(this).attr("value")==8||$(this).attr("value")==15){
|
||||||
o.find("select[name$='protocol']").append($(this));
|
o.find("select[name$='protocol']").append($(this));
|
||||||
}
|
}
|
||||||
})
|
}) */
|
||||||
$(".ratelimitAction").addClass("hidden");
|
$(".ratelimitAction").addClass("hidden");
|
||||||
$(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
|
$(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
|
||||||
}else if(action==16){
|
}else if(action==16){
|
||||||
@@ -324,12 +347,12 @@ var processAction=function(configType,obj){
|
|||||||
$(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
|
$(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
|
||||||
}else if(action==64){
|
}else if(action==64){
|
||||||
//先清空,再添加
|
//先清空,再添加
|
||||||
o.find("select[name$='protocol']").empty();
|
/* o.find("select[name$='protocol']").empty();
|
||||||
$.ipcommon.protocol.each(function(){
|
$.ipcommon.protocol.each(function(){
|
||||||
if($(this).attr("value")==6||$(this).attr("value")==17){
|
if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17){
|
||||||
o.find("select[name$='protocol']").append($(this));
|
o.find("select[name$='protocol']").append($(this));
|
||||||
}
|
}
|
||||||
})
|
}) */
|
||||||
$(".ratelimitAction").removeClass("hidden");
|
$(".ratelimitAction").removeClass("hidden");
|
||||||
var rateLimitType=$("input[name='userRegion1']:checked").val();
|
var rateLimitType=$("input[name='userRegion1']:checked").val();
|
||||||
if(rateLimitType == 0){//丢包率
|
if(rateLimitType == 0){//丢包率
|
||||||
@@ -367,8 +390,6 @@ var processAction=function(configType,obj){
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//drop动作不展示asn信息
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -676,21 +697,20 @@ var showHideIPSECProtocol=function(obj){
|
|||||||
</c:if>
|
</c:if>
|
||||||
<c:if test="${region.regionType eq 7 }">
|
<c:if test="${region.regionType eq 7 }">
|
||||||
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
||||||
<h4 class="form-section asnRegionH">
|
<h4 class="form-section asn">
|
||||||
<spring:message code="${region.configRegionValue}" />
|
<spring:message code="${region.configRegionValue}" />
|
||||||
<small> <span
|
<small> <span
|
||||||
class="glyphicon glyphicon-plus ${tabName}Add"
|
class="glyphicon glyphicon-plus asn ${tabName}Add"
|
||||||
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
||||||
</h4>
|
</h4>
|
||||||
<c:set var="cfgName" value="asnKeywords[${asnIndex}]"></c:set>
|
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="${fn:length(_cfg.asnKeywords)>0}">
|
<c:when test="${fn:length(fn:split(_cfg.userRegion4,','))>0}">
|
||||||
<c:set var="isBreak" value="false" ></c:set>
|
<c:set var="isBreak" value="false" ></c:set>
|
||||||
<c:forEach items="${_cfg.asnKeywords}" var="cfg">
|
<c:forEach items="${fn:split(_cfg.userRegion4,',')}" var="asn">
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="${!isBreak}">
|
<c:when test="${!isBreak}">
|
||||||
<div class="row boxSolid ${tabName}${status.index} asnRegionV">
|
<div class="row boxSolid asn ${tabName}${status.index}">
|
||||||
<%@include file="/WEB-INF/views/cfg/asnForm.jsp"%>
|
<%@include file="/WEB-INF/views/cfg/ipaddr/asnForm.jsp"%>
|
||||||
</div>
|
</div>
|
||||||
<c:set var="isBreak" value="true" ></c:set>
|
<c:set var="isBreak" value="true" ></c:set>
|
||||||
<c:set var="asnIndex" value="${asnIndex+1 }"></c:set>
|
<c:set var="asnIndex" value="${asnIndex+1 }"></c:set>
|
||||||
@@ -698,15 +718,15 @@ var showHideIPSECProtocol=function(obj){
|
|||||||
</c:choose>
|
</c:choose>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
<c:if test="${!isBreak}">
|
<c:if test="${!isBreak}">
|
||||||
<div class="row boxSolid ${tabName}${status.index} hidden disabled asnRegionV">
|
<div class="row boxSolid asn ${tabName}${status.index} hidden disabled">
|
||||||
<%@include file="/WEB-INF/views/cfg/asnForm.jsp"%>
|
<%@include file="/WEB-INF/views/cfg/ipaddr/asnForm.jsp"%>
|
||||||
</div>
|
</div>
|
||||||
<c:set var="asnIndex" value="${asnIndex+1 }"></c:set>
|
<c:set var="asnIndex" value="${asnIndex+1 }"></c:set>
|
||||||
</c:if>
|
</c:if>
|
||||||
</c:when>
|
</c:when>
|
||||||
<c:otherwise>
|
<c:otherwise>
|
||||||
<div class="row boxSolid ${tabName}${status.index} hidden disabled asnRegionV">
|
<div class="row boxSolid asn ${tabName}${status.index} hidden disabled">
|
||||||
<%@include file="/WEB-INF/views/cfg/asnForm.jsp"%>
|
<%@include file="/WEB-INF/views/cfg/ipaddr/asnForm.jsp"%>
|
||||||
</div>
|
</div>
|
||||||
<c:set var="asnIndex" value="${asnIndex+1 }"></c:set>
|
<c:set var="asnIndex" value="${asnIndex+1 }"></c:set>
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
|
|||||||
Reference in New Issue
Block a user