(1)asn导入加入组织国家,asn号验证,组织国家不能为空,asn号不能为两个组织所有
(2)新增asn_keyword_cfg表,用于保存并下发有效且含审核通过asn ip的 asn号 (3)asn 导入去除条数限制 (4)页面asn select选项还是会影响加载页面速度,现在改为input (5)asn_group_info 修改org_group_id为issued_ips,用于保存审核通过的asn ip (6)分组复用url配置文件补全v1
This commit is contained in:
@@ -17,25 +17,27 @@ public class AsnGroupInfo extends BaseCfg<AsnGroupInfo> implements Serializable{
|
||||
*/
|
||||
private static final long serialVersionUID = 7931466570918016654L;
|
||||
private Integer groupId;
|
||||
private Integer orgGroupId;
|
||||
private Long issuedIPs;
|
||||
@ExcelField(title="cfg_id",sort=301)
|
||||
private Integer compileId;
|
||||
@ExcelField(title="organization",sort=302)
|
||||
@ExcelField(title="asn_name",sort=302)
|
||||
private String organization;
|
||||
@ExcelField(title="organization",sort=303)
|
||||
@ExcelField(title="country_code",sort=303)
|
||||
private String country;
|
||||
@ExcelField(title="organization",sort=304)
|
||||
@ExcelField(title="details",sort=304)
|
||||
private String detail;
|
||||
private Integer isValid;
|
||||
@ExcelField(title="ASN",sort=305)
|
||||
private Long asnId;
|
||||
|
||||
public Integer getOrgGroupId() {
|
||||
return orgGroupId;
|
||||
|
||||
|
||||
public Long getIssuedIPs() {
|
||||
return issuedIPs;
|
||||
}
|
||||
|
||||
public void setOrgGroupId(Integer orgGroupId) {
|
||||
this.orgGroupId = orgGroupId;
|
||||
public void setIssuedIPs(Long issuedIPs) {
|
||||
this.issuedIPs = issuedIPs;
|
||||
}
|
||||
|
||||
public Integer getCompileId() {
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
*@Title: SslCertConfig.java
|
||||
*@Package com.nis.domain.restful
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年2月6日 上午8:59:51
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* @ClassName: SslCertConfig.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年2月6日 上午8:59:51
|
||||
* @version V1.0
|
||||
*/
|
||||
public class AsnKeywordCfg extends BaseStringCfg<AsnKeywordCfg>{
|
||||
private static final String tableName="asn_keyword_cfg";
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = -6121146112218278084L;
|
||||
@ExcelField(title="ASN",sort=201)
|
||||
private String cfgKeywords;
|
||||
/* (non-Javadoc)
|
||||
* @see com.nis.domain.configuration.ComplexkeywordCfg#initDefaultValue()
|
||||
*/
|
||||
@Override
|
||||
public void initDefaultValue() {
|
||||
// TODO Auto-generated method stub
|
||||
super.initDefaultValue();
|
||||
this.exprType=0;
|
||||
this.matchMethod=3;
|
||||
this.isHexbin=0;
|
||||
}
|
||||
@ExcelField(title="organization",sort=3)
|
||||
protected String userRegion4;
|
||||
|
||||
public static String getTablename() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
private String organization;
|
||||
private String country;
|
||||
private String detail;
|
||||
private List<AsnGroupInfo> asnGroups;
|
||||
private List<AsnKeywordCfg> asnKeywords;
|
||||
|
||||
/*private CachePolicyUserRegion cachePolicyUserRegion;//缓存策略用户自定义域参数
|
||||
|
||||
@@ -95,15 +95,16 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
}*/
|
||||
|
||||
|
||||
public List<AsnGroupInfo> getAsnGroups() {
|
||||
return asnGroups;
|
||||
}
|
||||
public void setAsnGroups(List<AsnGroupInfo> asnGroups) {
|
||||
this.asnGroups = asnGroups;
|
||||
}
|
||||
|
||||
public String getOrganization() {
|
||||
return organization;
|
||||
}
|
||||
public List<AsnKeywordCfg> getAsnKeywords() {
|
||||
return asnKeywords;
|
||||
}
|
||||
public void setAsnKeywords(List<AsnKeywordCfg> asnKeywords) {
|
||||
this.asnKeywords = asnKeywords;
|
||||
}
|
||||
public void setOrganization(String organization) {
|
||||
this.organization = organization;
|
||||
}
|
||||
|
||||
@@ -42,21 +42,21 @@ public class AsnIpTemplate extends BasicTemplate{
|
||||
public void setDestIpAddress(String destIpAddress) {
|
||||
this.destIpAddress = destIpAddress;
|
||||
}
|
||||
@ExcelField(title="organization",align=2,sort=1)
|
||||
@ExcelField(title="asn_name",align=2,sort=1)
|
||||
public String getOrganization() {
|
||||
return organization;
|
||||
}
|
||||
public void setOrganization(String organization) {
|
||||
this.organization = organization;
|
||||
}
|
||||
@ExcelField(title="country",align=2,sort=14)
|
||||
@ExcelField(title="country_code",align=2,sort=14)
|
||||
public String getCountry() {
|
||||
return country;
|
||||
}
|
||||
public void setCountry(String country) {
|
||||
this.country = country;
|
||||
}
|
||||
@ExcelField(title="detail",align=2,sort=13)
|
||||
@ExcelField(title="details",align=2,sort=13)
|
||||
public String getDetail() {
|
||||
return detail;
|
||||
}
|
||||
|
||||
@@ -69,6 +69,15 @@ public class ImportBigExcel extends XLSXCovertCSVReader{
|
||||
private boolean districtShow=false;
|
||||
private List<Object[]> annotationList;
|
||||
private List<List<Object>> dataList=Lists.newArrayList();
|
||||
private boolean hasImportLimit=true;
|
||||
|
||||
|
||||
public boolean isHasImportLimit() {
|
||||
return hasImportLimit;
|
||||
}
|
||||
public void setHasImportLimit(boolean hasImportLimit) {
|
||||
this.hasImportLimit = hasImportLimit;
|
||||
}
|
||||
/**
|
||||
* 构造函数
|
||||
* @param file 导入文件对象
|
||||
@@ -412,7 +421,7 @@ public class ImportBigExcel extends XLSXCovertCSVReader{
|
||||
}
|
||||
if(dataList.size()==0) {
|
||||
throw new ServiceException(props.getProperty("noneData", "noneData"));
|
||||
}else if(dataList.size()>(Constants.IMPORT_LIMIT+1)) {
|
||||
}else if(this.hasImportLimit&&dataList.size()>(Constants.IMPORT_LIMIT+1)) {
|
||||
throw new ServiceException(props.getProperty("import_limit_is", "The maximum import size is")+" "+Constants.IMPORT_LIMIT);
|
||||
}
|
||||
// Get excel data
|
||||
|
||||
@@ -226,24 +226,52 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
}
|
||||
}
|
||||
if (regionDict.getFunctionId().equals(600)) {//asn
|
||||
String organization=baseIpCfg.getOrganization();
|
||||
if(StringUtils.isBlank(organization)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("organization","Organization"))
|
||||
+ ";");
|
||||
}else {
|
||||
if(organization.length() > 1024){
|
||||
errInfo.append(prop.getProperty("asn_name")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":1024") + ";");
|
||||
}else {
|
||||
if(organization.trim().length()<128) {
|
||||
baseIpCfg.setCfgDesc(organization.trim());
|
||||
}
|
||||
baseIpCfg.setOrganization(organization.trim().toUpperCase());
|
||||
}
|
||||
|
||||
}
|
||||
String country=baseIpCfg.getCountry();
|
||||
if(StringUtils.isBlank(country)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("country"))
|
||||
+ ";");
|
||||
}else {
|
||||
if(country.length() > 512){
|
||||
errInfo.append(prop.getProperty("country_code")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":512") + ";");
|
||||
}else {
|
||||
baseIpCfg.setCountry(country.trim().toUpperCase());
|
||||
}
|
||||
}
|
||||
String detail=baseIpCfg.getDetail();
|
||||
if(StringUtils.isBlank(detail)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("detail"))
|
||||
+ ";");
|
||||
}else {
|
||||
if(detail.length() > 1024||detail.length()<4){
|
||||
errInfo.append(prop.getProperty("details")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("min_length")+":4,"+prop.getProperty("max_length")+":1024") + ";");
|
||||
}else {
|
||||
baseIpCfg.setDetail(detail.trim());
|
||||
}
|
||||
}
|
||||
//asn id
|
||||
String userRegion1 = baseIpCfg.getUserRegion1();
|
||||
if(StringUtils.isBlank(userRegion1)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("asn_no"))
|
||||
+ ";");
|
||||
}else if(StringUtils.isBlank(baseIpCfg.getOrganization())){
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("organization","Organization"))
|
||||
+ ";");
|
||||
}else if(StringUtils.isBlank(baseIpCfg.getCountry())){
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("country","Country"))
|
||||
+ ";");
|
||||
}else if(StringUtils.isBlank(baseIpCfg.getDetail())){
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("detail","Detail"))
|
||||
+ ";");
|
||||
}else {
|
||||
try {
|
||||
Long asnNo=Long.parseLong(userRegion1);
|
||||
@@ -258,22 +286,45 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
//缓存中没有
|
||||
if(configGroupInfo==null) {
|
||||
synchronized (Constants.IMPORT_LOCK) {
|
||||
AsnGroupInfo groupInfo=new AsnGroupInfo();
|
||||
groupInfo.setOrganization(baseIpCfg.getOrganization().trim());
|
||||
groupInfo.setCountry(baseIpCfg.getCountry().trim());
|
||||
groupInfo.setDetail(baseIpCfg.getDetail().trim());
|
||||
groupInfo.setIsValid(0);
|
||||
groupInfo.setAsnId(asnNo);
|
||||
asnNos.get(0).put(asnNo,groupInfo);
|
||||
if(StringUtils.isNotBlank(baseIpCfg.getOrganization())&&StringUtils.isNotBlank(baseIpCfg.getCountry())) {
|
||||
AsnGroupInfo groupInfo=new AsnGroupInfo();
|
||||
groupInfo.setOrganization(baseIpCfg.getOrganization().trim().toUpperCase());
|
||||
groupInfo.setCountry(baseIpCfg.getCountry().trim().toUpperCase());
|
||||
groupInfo.setDetail(baseIpCfg.getDetail().trim());
|
||||
groupInfo.setIsValid(0);
|
||||
groupInfo.setAsnId(asnNo);
|
||||
if(asnNos.get(0).containsKey(asnNo)) {
|
||||
if(!asnNos.get(0).get(asnNo).getOrganization().equals(baseIpCfg.getOrganization().trim().toUpperCase())) {
|
||||
//一个asn号不能被两个组织拥有
|
||||
logger.error("ASN "+asnNo+" Found two Organization "+asnNos.get(0).get(asnNo).getOrganization()+" "+baseIpCfg.getOrganization().trim().toUpperCase());
|
||||
errInfo.append(asnNos.get(0).get(asnNo).getOrganization()+" "+baseIpCfg.getOrganization().trim().toUpperCase()+" "+prop.getProperty("asn_no")+" "+asnNo+" "+prop.getProperty("repeat")
|
||||
+";");
|
||||
}else {
|
||||
asnNos.get(0).put(asnNo,groupInfo);
|
||||
}
|
||||
}else {
|
||||
asnNos.get(0).put(asnNo,groupInfo);
|
||||
}
|
||||
|
||||
}else {
|
||||
if(StringUtils.isNotBlank(baseIpCfg.getOrganization())) {
|
||||
logger.error("ASN "+asnNo+" Organization is Null");
|
||||
}
|
||||
if(StringUtils.isNotBlank(baseIpCfg.getCountry())) {
|
||||
logger.error("ASN "+asnNo+" Country is Null");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}else {
|
||||
if(!configGroupInfo.getOrganization().equals(baseIpCfg.getOrganization().trim())) {
|
||||
if(!configGroupInfo.getOrganization().equalsIgnoreCase(baseIpCfg.getOrganization().trim())) {
|
||||
errInfo.append(prop.getProperty("organization","Organization")+" "+prop.getProperty("mismatch","Mismatch"));
|
||||
}
|
||||
if(!configGroupInfo.getCountry().equals(baseIpCfg.getCountry().trim())) {
|
||||
if(!configGroupInfo.getCountry().equalsIgnoreCase(baseIpCfg.getCountry().trim())) {
|
||||
errInfo.append(prop.getProperty("country","Country")+" "+prop.getProperty("mismatch","Mismatch"));
|
||||
}
|
||||
if(!configGroupInfo.getDetail().equals(baseIpCfg.getDetail().trim())) {
|
||||
if(!configGroupInfo.getDetail().equalsIgnoreCase(baseIpCfg.getDetail().trim())) {
|
||||
errInfo.append(prop.getProperty("detail","Detail")+" "+prop.getProperty("mismatch","Mismatch"));
|
||||
}
|
||||
if(StringUtils.isBlank(errInfo.toString())) {
|
||||
@@ -291,27 +342,6 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
+ ";");
|
||||
}
|
||||
}
|
||||
String organization=baseIpCfg.getOrganization();
|
||||
if(StringUtils.isBlank(organization)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("organization","Organization"))
|
||||
+ ";");
|
||||
}else {
|
||||
baseIpCfg.setCfgDesc(organization);
|
||||
|
||||
}
|
||||
String country=baseIpCfg.getCountry();
|
||||
if(StringUtils.isBlank(country)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("country"))
|
||||
+ ";");
|
||||
}
|
||||
String detail=baseIpCfg.getDetail();
|
||||
if(StringUtils.isBlank(detail)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("detail"))
|
||||
+ ";");
|
||||
}
|
||||
|
||||
}
|
||||
if (regionDict.getFunctionId().equals(301)) {
|
||||
|
||||
@@ -1344,6 +1344,7 @@ public class BaseController {
|
||||
BlockingQueue<P2pIpTemplate> list = ei.getDataList(P2pIpTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
||||
} else if (regionDict.getFunctionId().equals(600)) {// ASN IP
|
||||
ei.setHasImportLimit(false);
|
||||
//加载asn缓存
|
||||
//AsnCacheUtils.init(true);
|
||||
//从数据库中读取
|
||||
|
||||
@@ -16,6 +16,8 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
/**
|
||||
@@ -110,6 +112,14 @@ public class AsnGroupController extends BaseController {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@RequestMapping(value="ajaxGetAuditedIPAddress",method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public boolean ajaxGetAuditedIPAddress(Model model,@RequestParam(required=true,value="asnIds")String asnIds){
|
||||
if(StringUtils.isNotBlank(asnIds)) {
|
||||
return asnGroupInfoService.checkIpAddrs(asnIds);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@RequestMapping(value="asnGroupName",method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Integer asnGroupName(Model model,@RequestParam(required=true,value="id")Long id,@RequestParam(required=true,value="organization")String organization,@RequestParam(required=true,value="country")String country,
|
||||
@@ -154,4 +164,19 @@ public class AsnGroupController extends BaseController {
|
||||
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* 校验asn号是否已存在
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/orgMustExists"})
|
||||
public boolean orgMustExists(AsnIpCfg cfg, HttpServletRequest request, HttpServletResponse response){
|
||||
cfg.setIsValid(1);
|
||||
AsnIpCfg asnIpCfg=asnIpCfgService.getOne(cfg);
|
||||
if(asnIpCfg == null){
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,8 +61,8 @@ public class AsnIpController extends BaseController{
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
initFormCondition(model,cfg);
|
||||
List<ConfigGroupInfo> groupInfos=configGroupInfoService.findAllList(4);
|
||||
model.addAttribute("policyGroups", groupInfos);
|
||||
//List<ConfigGroupInfo> groupInfos=configGroupInfoService.findAllList(4);
|
||||
//model.addAttribute("policyGroups", groupInfos);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/asnIpCfgFormAdd";
|
||||
}
|
||||
@@ -72,8 +72,8 @@ public class AsnIpController extends BaseController{
|
||||
,RedirectAttributes redirectAttributes){
|
||||
cfg = asnIpCfgService.get(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model, cfg);
|
||||
List<ConfigGroupInfo> groupInfos=configGroupInfoService.findAllList(4);
|
||||
model.addAttribute("policyGroups", groupInfos);
|
||||
//List<ConfigGroupInfo> groupInfos=configGroupInfoService.findAllList(4);
|
||||
//model.addAttribute("policyGroups", groupInfos);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/asnIpCfgFormUpdate";
|
||||
}
|
||||
@@ -181,14 +181,14 @@ public class AsnIpController extends BaseController{
|
||||
return "redirect:" + adminPath +"/basics/asn/list?functionId="+functionId;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/ajaxDeleteAsnIp"})
|
||||
/*@RequestMapping(value = {"/ajaxDeleteAsnIp"})
|
||||
public void ajaxDeleteAsnIp(String ids, HttpServletRequest request, HttpServletResponse response){
|
||||
try{
|
||||
asnIpCfgService.ajaxDeleteAsnIp(ids);
|
||||
}catch(Exception e){
|
||||
logger.error("Delete failed",e);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
@RequestMapping(value="ajaxGetGroups",method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public List<AsnGroupInfo> ajaxGetGroups(Model model,@RequestParam(required=true,value="org")String org){
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.configuration.AsnKeywordCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
@@ -93,8 +94,8 @@ public class IpController extends BaseController{
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
}
|
||||
List<ConfigGroupInfo> policyGroups=asnPolicyCfgService.getConfigGroupInfoList(4);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
//List<ConfigGroupInfo> policyGroups=asnPolicyCfgService.getConfigGroupInfoList(4);
|
||||
//model.addAttribute("policyGroups", policyGroups);
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/ipaddr/ipForm";
|
||||
}
|
||||
@@ -127,8 +128,14 @@ public class IpController extends BaseController{
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(cfg.getUserRegion4())) {
|
||||
tabList.add(new String[]{"3","ASN"});
|
||||
if(cfg.getAsnKeywords()!=null){
|
||||
String cfgType = null;
|
||||
for(AsnKeywordCfg keyword:cfg.getAsnKeywords()){
|
||||
if(!keyword.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"3",keyword.getCfgType()});
|
||||
cfgType = keyword.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
@@ -177,11 +184,11 @@ public class IpController extends BaseController{
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
if(StringUtils.isNoneBlank(entity.getUserRegion4())) {
|
||||
/*if(StringUtils.isNoneBlank(entity.getUserRegion4())) {
|
||||
ipCfgService.auditAsnCfg(entity, isAudit);
|
||||
}else {
|
||||
}else {*/
|
||||
ipCfgService.auditIpCfg(entity,isAudit);
|
||||
}
|
||||
/*}*/
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.info("ip配置下发失败:"+e.getMessage());
|
||||
@@ -524,13 +531,13 @@ public class IpController extends BaseController{
|
||||
titleList.add("asn_policy");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("asn_policy", AsnGroupInfo.class);
|
||||
classMap.put("asn_policy", AsnKeywordCfg.class);
|
||||
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion3,userregion4,userregion5,&userregion2:ratelimit-";
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String asnGroupInfoNoExport=ipPortInfoNoExport+"block_type,";
|
||||
String asnGroupInfoNoExport=ipPortInfoNoExport+"block_type,block_type,expression_type,match_method,is_hex,is_case_insenstive,";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
@@ -548,13 +555,11 @@ public class IpController extends BaseController{
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("asn_policy", asnGroupInfoNoExport);
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
List<AsnGroupInfo> groupInfoList=new ArrayList<AsnGroupInfo>();
|
||||
List<AsnKeywordCfg> groupInfoList=new ArrayList<AsnKeywordCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
CfgIndexInfo cfgIndexInfo=ipCfgService.exportIpInfo(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
if(!StringUtil.isEmpty(cfgIndexInfo.getUserRegion4())){
|
||||
groupInfoList.addAll(cfgIndexInfo.getAsnGroups());
|
||||
}
|
||||
groupInfoList.addAll(cfgIndexInfo.getAsnKeywords());
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
|
||||
@@ -12,7 +12,7 @@ import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface AsnGroupInfoDao extends CrudDao<AsnGroupInfo> {
|
||||
List<AsnGroupInfo> findAsnGroupInfoList(AsnGroupInfo policyGroupInfo);
|
||||
AsnGroupInfo getById(int id);
|
||||
AsnGroupInfo getById(long id);
|
||||
AsnGroupInfo getByGroupId(int groupId);
|
||||
AsnGroupInfo getInfoByAsnNo(AsnGroupInfo policyGroupInfo);
|
||||
Integer getGroupIdByOrganization(String organization);
|
||||
@@ -28,5 +28,5 @@ public interface AsnGroupInfoDao extends CrudDao<AsnGroupInfo> {
|
||||
void insertBatch(List<AsnGroupInfo> policyGroupInfos);
|
||||
List<AsnGroupInfo> findAsnGroupInfos();
|
||||
Long getCount();
|
||||
void audit(AsnIpCfg t);
|
||||
void modifyIssuedIp(AsnGroupInfo info);
|
||||
}
|
||||
@@ -14,11 +14,11 @@
|
||||
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="asn_id" property="asnId" jdbcType="BIGINT" />
|
||||
<result column="org_group_id" property="orgGroupId" jdbcType="INTEGER" />
|
||||
<result column="issued_ips" property="issuedIPs" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
<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.creator_id,r.editor_id,r.asn_id,r.org_group_id
|
||||
r.creator_id,r.editor_id,r.asn_id,r.issued_ips
|
||||
</sql>
|
||||
|
||||
<!-- 查出所有 有效数据-->
|
||||
@@ -55,8 +55,8 @@
|
||||
<if test="editorName != null and editorName != ''">
|
||||
AND r.EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="orgGroupId != null and orgGroupId != ''">
|
||||
AND r.org_group_id =#{orgGroupId }
|
||||
<if test="issuedIPs != null and issuedIPs != ''">
|
||||
AND r.issued_ips =#{issuedIPs }
|
||||
</if>
|
||||
<if test="isValid != null and isValid != ''">
|
||||
AND r.is_valid =#{isValid }
|
||||
@@ -87,7 +87,7 @@
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.nis.domain.basics.AsnGroupInfo" >
|
||||
insert into asn_group_info(group_id,compile_id,organization,country,detail,is_valid,creator_id,create_time,editor_id,edit_time,asn_id,org_group_id
|
||||
insert into asn_group_info(group_id,compile_id,organization,country,detail,is_valid,creator_id,create_time,editor_id,edit_time,asn_id
|
||||
)values (
|
||||
#{groupId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
@@ -99,8 +99,7 @@
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
#{editTime,jdbcType=TIMESTAMP},
|
||||
#{asnId,jdbcType=INTEGER},
|
||||
#{orgGroupId,jdbcType=INTEGER}
|
||||
#{asnId,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -126,8 +125,8 @@
|
||||
<if test="groupId != null and groupId !=''" >
|
||||
group_id = #{groupId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="orgGroupId != null and orgGroupId !=''" >
|
||||
org_group_id = #{orgGroupId,jdbcType=INTEGER},
|
||||
<if test="issuedIPs != null" >
|
||||
issued_ips = issued_ips+#{issuedIPs,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="compileId != null and compileId !=''" >
|
||||
compile_id = #{compileId,jdbcType=INTEGER},
|
||||
@@ -153,6 +152,9 @@
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
<if test="issuedIPs != null" >
|
||||
issued_ips = issued_ips+#{issuedIPs,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
@@ -160,9 +162,37 @@
|
||||
<if test="groupId != null" >
|
||||
and group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="asnId != null" >
|
||||
and asn_id = #{asnId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="id != null and id != ''" >
|
||||
and id = #{id,jdbcType=INTEGER}
|
||||
</if>
|
||||
and is_valid != -1
|
||||
</trim>
|
||||
</where>
|
||||
</update>
|
||||
<update id="modifyIssuedIp" parameterType="com.nis.domain.basics.AsnGroupInfo" >
|
||||
update asn_group_info
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="issuedIPs != null" >
|
||||
issued_ips = issued_ips+#{issuedIPs,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
<trim prefixOverrides="and">
|
||||
<if test="groupId != null" >
|
||||
and group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="asnId != null and asnId != ''" >
|
||||
and asn_id = #{asnId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="id != null and id != ''" >
|
||||
and id = #{id,jdbcType=INTEGER}
|
||||
</if>
|
||||
and is_valid != -1
|
||||
</trim>
|
||||
</where>
|
||||
</update>
|
||||
@@ -225,7 +255,7 @@
|
||||
SELECT
|
||||
<include refid="AsnGroupInfoColumns"/>
|
||||
FROM
|
||||
asn_group_info r WHERE organization = #{organization,jdbcType=VARCHAR} AND is_valid =1
|
||||
asn_group_info r WHERE organization = #{organization,jdbcType=VARCHAR} AND is_valid =1 AND issued_ips>0
|
||||
</select>
|
||||
<select id="getCountGroupInfoByName" resultType="java.lang.Integer">
|
||||
SELECT count(1) FROM asn_group_info r WHERE organization = #{organization,jdbcType=VARCHAR} AND is_valid !=-1
|
||||
|
||||
@@ -18,6 +18,7 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
||||
public List<AsnIpCfg> getByIds(@Param("ids")String ids);
|
||||
public List<Integer> hasGroupIds(@Param("ids")String ids);
|
||||
public List<Integer> hasASNIds(@Param("ids")String ids);
|
||||
public List<Integer> hasASNIpAddrs(@Param("ids")String ids);
|
||||
public List<AsnIpCfg> findAllList(AsnIpCfg cfg);
|
||||
// public List<ConfigGroupInfo> findPolicyGroupInfosByType(@Param("groupId")Integer groupId);
|
||||
public List<Integer> findOtherIps(@Param("groupId")Integer groupId,@Param("cfgId")Integer cfgId);
|
||||
@@ -29,4 +30,6 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
||||
public Varibles getVaribles(@Param("name")String name);
|
||||
public void ajaxDeleteAsnIp(@Param("ids")String ids);
|
||||
public int hasValidAsnIp(@Param("asnId")Long asnNo);
|
||||
public AsnIpCfg getOne(AsnIpCfg cfg);
|
||||
public void updateAsn(@Param("asnId")String asnNo,@Param("organization")String organization,@Param("country")String country,@Param("detail")String detail);
|
||||
}
|
||||
|
||||
@@ -204,6 +204,101 @@
|
||||
from asn_ip_cfg r
|
||||
where r.cfg_id=#{cfgId}
|
||||
</select>
|
||||
<select id="getOne" resultMap="asnIpCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from asn_ip_cfg r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="asnIpGroup != null and asnIpGroup != ''">
|
||||
AND r.asn_Ip_Group =#{asnIpGroup,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE =#{cfgType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="ipPattern != null">
|
||||
AND r.IP_PATTERN=#{ipPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="portPattern != null">
|
||||
AND r.PORT_PATTERN=#{portPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destPort != null and destPort !=''">
|
||||
AND r.DEST_PORT=#{destPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="direction != null">
|
||||
AND r.DIRECTION=#{direction,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocol != null">
|
||||
AND r.PROTOCOL=#{protocol,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocolId != null">
|
||||
AND r.PROTOCOL_ID=#{protocolId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null">
|
||||
AND r.IS_VALID != -1
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime !=''">
|
||||
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="regionId != null">
|
||||
AND r.region_id=#{regionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="organization != null">
|
||||
AND r.organization =#{organization,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="country != null">
|
||||
AND r.country =#{country,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="detail != null">
|
||||
AND r.detail =#{detail,jdbcType=VARCHAR}
|
||||
</if>
|
||||
</trim>
|
||||
limit 1
|
||||
</select>
|
||||
<select id="findAllList" resultMap="asnIpCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
@@ -417,6 +512,9 @@
|
||||
<if test="asnIpGroup != null " >
|
||||
asn_ip_group = #{asnIpGroup,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userRegion1 != null and userRegion1 != ''" >
|
||||
user_region1 = #{userRegion1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
@@ -437,6 +535,9 @@
|
||||
</delete>
|
||||
<update id="ajaxDeleteAsnIp" parameterType="java.lang.String" >
|
||||
delete from asn_ip_cfg where asn_ip_group in (${ids})
|
||||
</update>
|
||||
<update id="updateAsn" parameterType="java.lang.String" >
|
||||
update asn_ip_cfg set organization=#{organization}, country=#{country}, detail=#{detail} where user_region1 =#{asnId} and is_valid=0
|
||||
</update>
|
||||
<select id="findOtherIps" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
select 1 from asn_ip_cfg where is_valid=1 and asn_ip_group=#{groupId} and cfg_id !=#{cfgId} limit 1
|
||||
@@ -447,6 +548,9 @@
|
||||
<select id="hasASNIds" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
select 1 from asn_ip_cfg where is_valid !=-1 and is_audit=1 and user_region1 in(${ids}) limit 1
|
||||
</select>
|
||||
<select id="hasASNIpAddrs" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
select 1 from asn_keyword_cfg where is_valid !=-1 and is_audit=1 and cfg_keywords in(${ids}) limit 1
|
||||
</select>
|
||||
<select id="countValidIPs" resultType="java.lang.Integer" parameterType="java.lang.String">
|
||||
select count(1) from asn_ip_cfg where is_valid !=-1 and asn_ip_group in(${groups}) and cfg_id not in(${ids}) GROUP BY asn_ip_group;
|
||||
</select>
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.configuration.AsnKeywordCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
@@ -45,7 +46,9 @@ public interface StringCfgDao extends CrudDao<BaseStringCfg>{
|
||||
public void deleteByCompileIds(@Param("user")long user,@Param("tableName")String tableName,@Param("compileIds")String compileIds);
|
||||
public List<NtcSubscribeIdCfg> findSubscribeIdCfgListByCfgIndexInfo(CfgIndexInfo entity);
|
||||
public void deleteSubscribeIdCfgByCfgIndexInfo(CfgIndexInfo entity);
|
||||
public void deleteAsnKeyword(CfgIndexInfo entity);
|
||||
public List<NtcSubscribeIdCfg> findSubscribeIdCfgList(NtcSubscribeIdCfg ntcSubscribeIdCfg);
|
||||
public List<AsnKeywordCfg> findAsnKeywordCfgList(CfgIndexInfo entity);
|
||||
public void saveSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg);
|
||||
public void updateSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg);
|
||||
public void deleteSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg);
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
<result column="creator_name" property="creatorName" jdbcType="VARCHAR" />
|
||||
<result column="auditor_name" property="auditorName" jdbcType="VARCHAR" />
|
||||
<result column="editor_name" property="editorName" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<resultMap id="AsnKeywordMap" type="com.nis.domain.configuration.AsnKeywordCfg" extends="BaseStringMap">
|
||||
</resultMap>
|
||||
<resultMap id="SubscribeIdCfgMap" type="com.nis.domain.configuration.NtcSubscribeIdCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
@@ -77,6 +79,12 @@
|
||||
r.action,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id,r.edit_time, r.auditor_id,
|
||||
r.audit_time,r.service_id,r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,r.cfg_region_code
|
||||
</sql>
|
||||
<sql id="AsnKeywordCfg_Column">
|
||||
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.cfg_type,
|
||||
r.action,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id,r.edit_time, r.auditor_id,
|
||||
r.audit_time,r.service_id,r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,r.cfg_region_code,r.user_region1,r.user_region2,r.user_region3,r.user_region4,r.user_region5
|
||||
</sql>
|
||||
<!-- <sql id="BaseStringCfg_Column_List_with_id_alias" >
|
||||
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc, r.CFG_KEYWORDS as cfgKeywords, r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
|
||||
@@ -716,6 +724,19 @@
|
||||
</where>
|
||||
|
||||
</select>
|
||||
<select id="findAsnKeywordCfgList" resultMap="AsnKeywordMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
||||
select
|
||||
<include refid="AsnKeywordCfg_Column" />
|
||||
from asn_keyword_cfg r
|
||||
<where>
|
||||
<if test="functionId != null">
|
||||
and r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
and r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<!-- 删除voip subscribe信息 -->
|
||||
<delete id="deleteSubscribeIdCfgByCfgIndexInfo" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
||||
delete from ntc_subscribe_id_cfg
|
||||
@@ -731,6 +752,17 @@
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
<delete id="deleteAsnKeyword" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
||||
delete from asn_keyword_cfg
|
||||
<where>
|
||||
<if test="compileId != null" >
|
||||
and compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="functionId != null" >
|
||||
and function_id = #{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
<!-- =====================NtcSubscribeIdCfg end======================== -->
|
||||
|
||||
<insert id="saveStringCfgBatch" parameterType="com.nis.domain.configuration.BaseStringCfg" >
|
||||
|
||||
@@ -102,6 +102,7 @@ import com.nis.web.dao.configuration.StringCfgDao;
|
||||
import com.nis.web.dao.specific.ConfigGroupInfoDao;
|
||||
import com.nis.web.dao.specific.SpecificServiceCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.basics.AsnGroupInfoService;
|
||||
import com.nis.web.service.basics.SysDictInfoService;
|
||||
|
||||
/**
|
||||
@@ -1780,7 +1781,7 @@ public abstract class BaseService {
|
||||
//需要通过新增域接口新增的ip集合
|
||||
List<AsnIpCfg> toAddRegionAsnIpCfgs=Lists.newArrayList();
|
||||
Map<Long,List<AsnIpCfg>> toSendFirstAsnIpCfgs=Maps.newHashMap();
|
||||
|
||||
Map<Long,Integer> asnGroupAddRegions=Maps.newHashMap();
|
||||
// AsnCacheUtils.init(true);
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
@@ -1793,6 +1794,12 @@ public abstract class BaseService {
|
||||
}
|
||||
//AsnGroupInfo group=AsnCacheUtils.get(Long.parseLong(cfg.getUserRegion1()));
|
||||
if(group!=null&&group.getIsValid().intValue()==1) {
|
||||
if(asnGroupAddRegions.containsKey(group.getAsnId())) {
|
||||
int count=asnGroupAddRegions.get(group.getAsnId());
|
||||
asnGroupAddRegions.put(group.getAsnId(), count+1);
|
||||
}else {
|
||||
asnGroupAddRegions.put(group.getAsnId(), 1);
|
||||
}
|
||||
toAddRegionAsnIpCfgs.add(cfg);
|
||||
}else if(group!=null) {
|
||||
if(toSendFirstAsnIpCfgs.containsKey(group.getAsnId())) {
|
||||
@@ -1809,12 +1816,17 @@ public abstract class BaseService {
|
||||
}
|
||||
if(send) {
|
||||
if(toAddRegionAsnIpCfgs.size()>0) {
|
||||
for(Entry<Long,Integer> asnGroupAddRegion:asnGroupAddRegions.entrySet()) {
|
||||
AsnGroupInfo group=new AsnGroupInfo();
|
||||
group.setAsnId(asnGroupAddRegion.getKey());
|
||||
group.setIssuedIPs(asnGroupAddRegion.getValue()+0l);
|
||||
((AsnGroupInfoDao) batchSqlSession.getMapper(AsnGroupInfoDao.class)).modifyIssuedIp(group);;
|
||||
}
|
||||
asnIPRegionSendToMaat(toAddRegionAsnIpCfgs,Constants.VALID_YES);
|
||||
}
|
||||
if(toSendFirstAsnIpCfgs.size()>0) {
|
||||
List<MaatCfg> configCompileList = new ArrayList();
|
||||
ToMaatBean maatBean = new ToMaatBean();
|
||||
|
||||
for(Entry<Long, List<AsnIpCfg>> info:toSendFirstAsnIpCfgs.entrySet()) {
|
||||
AsnGroupInfo group=asnNoMaps.get(0).get(info.getKey());
|
||||
if(group==null) {
|
||||
@@ -1855,6 +1867,7 @@ public abstract class BaseService {
|
||||
configCompileList.add(maatCfg);
|
||||
|
||||
group.setIsValid(1);
|
||||
group.setIssuedIPs(info.getValue().size()+0L);
|
||||
((AsnGroupInfoDao) batchSqlSession.getMapper(AsnGroupInfoDao.class)).updateValid(group);
|
||||
}
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -9,14 +10,21 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.basics.AsnGroupInfoDao;
|
||||
import com.nis.web.dao.basics.AsnIpCfgDao;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
import com.nis.web.dao.specific.ConfigGroupInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
@@ -58,8 +66,10 @@ public class AsnGroupInfoService extends BaseService{
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveOrUpdate(AsnGroupInfo entity) throws MaatConvertException{
|
||||
//asn类型从综合服务获取groupId
|
||||
String org=entity.getOrganization().trim();
|
||||
String country=entity.getCountry().trim();
|
||||
String org=entity.getOrganization().trim().toUpperCase();
|
||||
String country=entity.getCountry().trim().toUpperCase();
|
||||
entity.setOrganization(org);
|
||||
entity.setCountry(country);
|
||||
int groupId=0;
|
||||
//获取组织
|
||||
ConfigGroupInfo configGroupInfo=configGroupInfoDao.getAsnGroupByName(org);
|
||||
@@ -72,7 +82,7 @@ public class AsnGroupInfoService extends BaseService{
|
||||
throw new MaatConvertException("Get asn group id failed");
|
||||
}
|
||||
configGroupInfo=new ConfigGroupInfo();
|
||||
configGroupInfo.setGroupName(org);
|
||||
configGroupInfo.setGroupName(org.toUpperCase());
|
||||
configGroupInfo.setIsIssued(0);
|
||||
configGroupInfo.setGroupType(4);
|
||||
configGroupInfo.setGroupId(groupIds.get(1));
|
||||
@@ -103,33 +113,79 @@ public class AsnGroupInfoService extends BaseService{
|
||||
asnGroupInfoDao.insert(entity);
|
||||
//修改
|
||||
}else{
|
||||
long id=entity.getId();
|
||||
AsnGroupInfo group=asnGroupInfoDao.getById(id);
|
||||
int count=asnGroupInfoDao.getCountGroupInfoByName(group.getOrganization());
|
||||
if(count==1&&!group.getOrganization().equalsIgnoreCase(entity.getOrganization())) {
|
||||
configGroupInfoDao.delAsnGroup(group.getOrganization());
|
||||
}
|
||||
ConfigGroupInfo configGroupInfo1=configGroupInfoDao.getAsnGroupByName(entity.getOrganization());
|
||||
if(configGroupInfo1==null) {
|
||||
List<Integer> groupIds= ConfigServiceUtil.getId(2,2);
|
||||
if(groupIds.size()>0) {
|
||||
groupId=groupIds.get(0).intValue();
|
||||
}else {
|
||||
throw new MaatConvertException("Get asn group id failed");
|
||||
}
|
||||
configGroupInfo1=new ConfigGroupInfo();
|
||||
configGroupInfo1.setGroupName(entity.getOrganization().toUpperCase());
|
||||
configGroupInfo1.setIsIssued(0);
|
||||
configGroupInfo1.setGroupType(4);
|
||||
configGroupInfo1.setGroupId(groupIds.get(1));
|
||||
configGroupInfo1.setInsertTime(new Date());
|
||||
configGroupInfoDao.insertConfigGroupInfo(configGroupInfo1);
|
||||
}
|
||||
Date editTime=new Date();
|
||||
entity.setEditorId(UserUtils.getUser().getId());
|
||||
entity.setEditTime(editTime);
|
||||
entity.setGroupId(groupId);
|
||||
asnGroupInfoDao.update(entity);
|
||||
asnIpCfgDao.updateAsn(String.valueOf(entity.getAsnId()),entity.getOrganization(),entity.getCountry(),entity.getDetail());
|
||||
}
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void delete(String ids,String asnIds){
|
||||
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
List<FunctionServiceDict> dicts=DictUtils.getFunctionServiceDictList(600);
|
||||
int result=0;
|
||||
do {
|
||||
result=asnIpCfgDao.deleteByAsnId(asnIds);
|
||||
}while(result>0);
|
||||
for (String id : ids.split(",")) {
|
||||
if(!StringUtil.isEmpty(id)){
|
||||
AsnGroupInfo entity=asnGroupInfoDao.getById(Integer.parseInt(id));
|
||||
int valid=entity.getIsValid();
|
||||
entity.setIsValid(-1);
|
||||
entity.setId(Long.parseLong(id));
|
||||
asnGroupInfoDao.updateValid(entity);
|
||||
if(asnGroupInfoDao.getCountGroupInfoByName(entity.getOrganization())==0) {
|
||||
configGroupInfoDao.delAsnGroup(entity.getOrganization());
|
||||
}
|
||||
//取消下发过的编译
|
||||
if(valid==1) {
|
||||
ToMaatBean maatBean = new ToMaatBean();
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
List<MaatCfg> configCompileList = new ArrayList();
|
||||
maatCfg.setCompileId(entity.getCompileId());
|
||||
maatCfg.setServiceId(dicts.get(0).getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("asn ip配置取消配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult _result = ConfigServiceUtil.put(json,1);
|
||||
logger.info("asn ip配置取消配置响应信息:"+_result.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int result=0;
|
||||
do {
|
||||
result=asnIpCfgDao.deleteByAsnId(asnIds);
|
||||
}while(result>0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -143,6 +199,18 @@ public class AsnGroupInfoService extends BaseService{
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public boolean checkIpAddrs(String groupIds) {
|
||||
StringBuffer buffer=new StringBuffer();
|
||||
for(String groupId:groupIds.split(",")) {
|
||||
Integer.parseInt(groupId);
|
||||
buffer.append("'AS"+groupId+"',");
|
||||
}
|
||||
List<Integer> hasIpList=asnIpCfgDao.hasASNIpAddrs(buffer.substring(0, buffer.toString().length()-1));
|
||||
if(hasIpList!=null&&hasIpList.size()>0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public AsnGroupInfo getInfoByAsnNo(AsnGroupInfo AsnGroupInfo){
|
||||
return asnGroupInfoDao.getInfoByAsnNo(AsnGroupInfo);
|
||||
|
||||
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
@@ -102,9 +103,13 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
Date editTime=new Date();
|
||||
entity.setEditTime(editTime);
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
String org=entity.getOrganization().trim();
|
||||
String country=entity.getCountry().trim();
|
||||
String detail=entity.getDetail().trim();
|
||||
String userRegion1=entity.getUserRegion1();
|
||||
AsnGroupInfo groupInfo=new AsnGroupInfo();
|
||||
groupInfo.setAsnId(Long.parseLong(userRegion1));
|
||||
groupInfo=asnGroupInfoDao.getInfoByAsnNo(groupInfo);
|
||||
String org=groupInfo.getOrganization().trim();
|
||||
String country=groupInfo.getCountry().trim();
|
||||
String detail=groupInfo.getDetail().trim();
|
||||
entity.setOrganization(org);
|
||||
entity.setCountry(country);
|
||||
entity.setDetail(detail);
|
||||
@@ -230,9 +235,23 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void delAndSend(List<AsnIpCfg> entities) {
|
||||
StringBuilder sb=new StringBuilder();
|
||||
Map<Long,Integer> asnDelCounts=Maps.newHashMap();
|
||||
for(AsnIpCfg ip:entities) {
|
||||
sb.append(ip.getCfgId());
|
||||
sb.append(",");
|
||||
if(asnDelCounts.containsKey(Long.parseLong(ip.getUserRegion1()))) {
|
||||
int count=asnDelCounts.get(Long.parseLong(ip.getUserRegion1()))+1;
|
||||
asnDelCounts.put(Long.parseLong(ip.getUserRegion1()), count);
|
||||
}else {
|
||||
asnDelCounts.put(Long.parseLong(ip.getUserRegion1()), 1);
|
||||
}
|
||||
}
|
||||
//跟新asn组的审核通过IP数量
|
||||
for(Entry<Long,Integer> asnDelCount: asnDelCounts.entrySet()) {
|
||||
AsnGroupInfo info=new AsnGroupInfo();
|
||||
info.setAsnId(asnDelCount.getKey());
|
||||
info.setIssuedIPs(0l-asnDelCount.getValue());
|
||||
asnGroupInfoDao.modifyIssuedIp(info);
|
||||
}
|
||||
sb.deleteCharAt(sb.toString().lastIndexOf(","));
|
||||
asnIpCfgDao.delete(sb.toString());
|
||||
@@ -242,12 +261,16 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAsnIpCfg(CfgIndexInfo entity) {
|
||||
Date createTime=new Date();
|
||||
//asn号
|
||||
String userRegion1=entity.getUserRegion1();
|
||||
AsnGroupInfo asnGroupInfo=new AsnGroupInfo();
|
||||
asnGroupInfo.setAsnId(Long.parseLong(userRegion1));
|
||||
asnGroupInfo=asnGroupInfoDao.getInfoByAsnNo(asnGroupInfo);
|
||||
//组织去除首尾空格
|
||||
entity.setOrganization(entity.getOrganization().trim());
|
||||
entity.setCountry(entity.getCountry().trim());
|
||||
entity.setDetail(entity.getDetail().trim());
|
||||
entity.setOrganization(asnGroupInfo.getOrganization().trim());
|
||||
entity.setCountry(asnGroupInfo.getCountry().trim());
|
||||
entity.setDetail(asnGroupInfo.getDetail().trim());
|
||||
ConfigGroupInfo configGroupInfo=configGroupInfoDao.getAsnGroupByName(entity.getOrganization());
|
||||
AsnGroupInfo asnGroupInfo=asnGroupInfoDao.getGroupIdByNameAndASNId(entity.getOrganization(), entity.getCountry(), Long.parseLong(entity.getUserRegion1()));
|
||||
Integer orgGroup=0;
|
||||
Integer compileId=0;
|
||||
Integer asnIdGroup=0;
|
||||
@@ -257,42 +280,12 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
configGroupInfo.setGroupType(4);
|
||||
configGroupInfo.setInsertTime(new Date());
|
||||
configGroupInfo.setIsIssued(0);
|
||||
if(asnGroupInfo==null) {
|
||||
List<Integer> groupIdList=ConfigServiceUtil.getId(2, 2);
|
||||
orgGroup=groupIdList.get(0);
|
||||
|
||||
asnIdGroup=groupIdList.get(1);
|
||||
}else {
|
||||
List<Integer> groupIdList=ConfigServiceUtil.getId(2, 1);
|
||||
orgGroup=groupIdList.get(0);
|
||||
configGroupInfo.setGroupId(orgGroup);
|
||||
asnIdGroup=asnGroupInfo.getGroupId();
|
||||
}
|
||||
List<Integer> groupIdList=ConfigServiceUtil.getId(2, 2);
|
||||
orgGroup=groupIdList.get(0);
|
||||
configGroupInfo.setGroupId(orgGroup);
|
||||
configGroupInfoDao.insertConfigGroupInfo(configGroupInfo);
|
||||
}else {
|
||||
orgGroup=configGroupInfo.getGroupId();
|
||||
if(asnGroupInfo==null) {
|
||||
List<Integer> groupIdList=ConfigServiceUtil.getId(2, 1);
|
||||
asnIdGroup=groupIdList.get(0);
|
||||
}else {
|
||||
asnIdGroup=asnGroupInfo.getGroupId();
|
||||
}
|
||||
}
|
||||
if(asnGroupInfo==null) {
|
||||
asnGroupInfo=new AsnGroupInfo();
|
||||
asnGroupInfo.setOrganization(entity.getOrganization());
|
||||
asnGroupInfo.setCountry(entity.getCountry());
|
||||
asnGroupInfo.setDetail(entity.getDetail());
|
||||
asnGroupInfo.setIsValid(0);
|
||||
asnGroupInfo.setCreateTime(new Date());
|
||||
asnGroupInfo.setCreatorId(entity.getCurrentUser().getId());
|
||||
asnGroupInfo.setAsnId(Long.parseLong(entity.getUserRegion1()));
|
||||
asnGroupInfo.setGroupId(asnIdGroup);
|
||||
List<Integer> compileIds=ConfigServiceUtil.getId(1, 1);
|
||||
asnGroupInfo.setCompileId(compileIds.get(0));
|
||||
asnGroupInfoDao.insert(asnGroupInfo);
|
||||
}
|
||||
asnIdGroup=asnGroupInfo.getGroupId();
|
||||
entity.setAsnIpGroup(asnIdGroup);
|
||||
entity.setCompileId(asnGroupInfo.getCompileId());
|
||||
List<Integer> idList=ConfigServiceUtil.getId(3, entity.getAsnIpCfgs().size());
|
||||
@@ -384,6 +377,12 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void deleteByAsnNo(List<Long> asnNoList) {
|
||||
// for(Long asnNo:asnNoList) {
|
||||
// int result=0;
|
||||
// do {
|
||||
// result=asnIpCfgDao.deleteByAsnId(String.valueOf(asnNo));
|
||||
// }while(result>0);
|
||||
// }
|
||||
int pointsDataLimit = 1000;//限制条数
|
||||
Integer size = asnNoList.size();
|
||||
if(pointsDataLimit<size){
|
||||
@@ -427,9 +426,9 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
asnNoList.clear();
|
||||
}
|
||||
}
|
||||
public void ajaxDeleteAsnIp(String ids) {
|
||||
/*public void ajaxDeleteAsnIp(String ids) {
|
||||
asnIpCfgDao.ajaxDeleteAsnIp(ids);
|
||||
}
|
||||
}*/
|
||||
/**
|
||||
*
|
||||
* auditIpBatch(非IP类配置用,审核区域IP)
|
||||
@@ -448,6 +447,7 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
//data.entrySet().stream().forEach( enrty->{
|
||||
Long asn=enrty.getKey();//ans group 的group id
|
||||
List<AsnIpCfg> asnIpCfgs=enrty.getValue();
|
||||
int issuedNum=asnIpCfgs.size();
|
||||
for(int index = 0; index < asnIpCfgs.size();index++){
|
||||
AsnIpCfg t = asnIpCfgs.get(index);
|
||||
BaseIpCfg ipCfg=new BaseIpCfg();
|
||||
@@ -474,6 +474,7 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
asnGroupInfo.setIsValid(1);
|
||||
asnGroupInfo.setEditorId(UserUtils.getUser().getId());
|
||||
asnGroupInfo.setEditTime(new Date());
|
||||
asnGroupInfo.setIssuedIPs(issuedNum+0L);
|
||||
asnGroupInfoDao.updateValid(asnGroupInfo);
|
||||
maatCfg.initDefaultValue();
|
||||
ToMaatBean maatBean = new ToMaatBean();
|
||||
@@ -513,11 +514,15 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
logger.info("ASN IP配置下发响应信息:" + result.getMsg());
|
||||
}else if(asnGroupInfo.getIsValid()==1){//已经下发过,走分组复用
|
||||
asnGroupInfo.setIssuedIPs(issuedNum+0l);
|
||||
asnGroupInfoDao.update(asnGroupInfo);
|
||||
asnIPRegionSendToMaat(asnIpCfgs,isValid);
|
||||
}else {
|
||||
throw new RuntimeException("asnGroupInfo isValid value is "+asnGroupInfo.getIsValid());
|
||||
}
|
||||
}else if(isValid==Constants.VALID_NO) {//取消审核通过
|
||||
asnGroupInfo.setIssuedIPs(0L-issuedNum);
|
||||
asnGroupInfoDao.update(asnGroupInfo);
|
||||
//已经下发过的,调用分组复用配置删除接口
|
||||
// GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
// List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
@@ -546,6 +551,7 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
// asnGroupInfo.setEditTime(new Date());
|
||||
// asnGroupInfoDao.updateValid(asnGroupInfo);
|
||||
//}
|
||||
|
||||
}else {
|
||||
throw new RuntimeException("isValid value is "+isValid);
|
||||
}
|
||||
@@ -557,4 +563,9 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AsnIpCfg getOne(AsnIpCfg cfg) {
|
||||
// TODO Auto-generated method stub
|
||||
return asnIpCfgDao.getOne(cfg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,9 @@ import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.callback.InlineIp;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.AsnKeywordCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
@@ -153,7 +155,38 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
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{
|
||||
entity.setEditTime(new Date());
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
@@ -189,6 +222,42 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
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) {
|
||||
//先删除asn keyword
|
||||
String org=entity.getUserRegion4();
|
||||
stringCfgDao.deleteAsnKeyword(entity);
|
||||
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.setEditorId(entity.getEditorId());
|
||||
asnKeywordCfg.setEditTime(entity.getEditTime());
|
||||
asnKeywordCfg.setCompileId(entity.getCompileId());
|
||||
stringCfgDao.saveStringCfgBatch(asnKeywordCfg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
public void updateIpCfgValid(Integer isValid,String ids,Integer functionId){
|
||||
@@ -217,6 +286,13 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
|
||||
ipCfgDao.updateCfgValid(cfg);
|
||||
}
|
||||
if(entity.getAsnKeywords()!=null && entity.getAsnKeywords().size()>0)
|
||||
{
|
||||
AsnKeywordCfg cfg = new AsnKeywordCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
cfg.setTableName(AsnKeywordCfg.getTablename());
|
||||
ipCfgDao.updateCfgValid(cfg);
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
|
||||
AreaIpCfg cfg = new AreaIpCfg();
|
||||
@@ -507,6 +583,26 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
strRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
if(entity.getAsnKeywords()!=null && entity.getAsnKeywords().size()>0){
|
||||
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信息
|
||||
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||
if(!StringUtil.isEmpty(areaIpCfgList)){
|
||||
@@ -638,56 +734,73 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
* @param ids cfgId
|
||||
* @param functionId
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void auditAsnCfg(CfgIndexInfo entity,Integer isAudit){
|
||||
entity.setTableName(CfgIndexInfo.getTablename());
|
||||
entity.setIsAudit(isAudit);
|
||||
ipCfgDao.auditCfg(entity);
|
||||
ToMaatBean maatBean = new ToMaatBean();
|
||||
|
||||
List<MaatCfg> configCompileList = new ArrayList<>();
|
||||
|
||||
if(isAudit==Constants.AUDIT_YES) {
|
||||
AsnGroupInfo asnGroupInfo=new AsnGroupInfo();
|
||||
asnGroupInfo.setOrganization(entity.getUserRegion4());
|
||||
asnGroupInfo.setIsValid(1);
|
||||
List<AsnGroupInfo> groups=asnGroupInfoDao.findAsnGroupInfoList(asnGroupInfo);
|
||||
if(groups!=null&&groups.size()>0) {
|
||||
// if(configGroupInfo.getIsIssued()==1) {//复用,只下编译跟分组
|
||||
// for(AsnGroupInfo group:groups) {
|
||||
// MaatCfg maatCfg = new MaatCfg();
|
||||
// List<GroupCfg> groupRelationList = new ArrayList<>();
|
||||
// List<IpCfg> ipRegionList = new ArrayList<>();
|
||||
// List<StringCfg> strRegionList = new ArrayList<>();
|
||||
// List<NumBoundaryCfg> numRegionList = new ArrayList<>();
|
||||
// List<DigestCfg> digestRegionList = new ArrayList<>();
|
||||
// List<IpCfg> areaIpRegionList = new ArrayList<>();
|
||||
// maatCfg.initDefaultValue();
|
||||
// BeanUtils.copyProperties(entity, maatCfg);
|
||||
// maatCfg.setAction(entity.getAction());
|
||||
// maatCfg.setAuditTime(entity.getAuditTime());
|
||||
// maatCfg.setIpRegionList(ipRegionList);
|
||||
// maatCfg.setStrRegionList(strRegionList);
|
||||
// maatCfg.setNumRegionList(numRegionList);
|
||||
// maatCfg.setDigestRegionList(digestRegionList);
|
||||
// maatCfg.setGroupRelationList(groupRelationList);
|
||||
// maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||
// maatCfg.setIsValid(entity.getIsValid());
|
||||
// //group
|
||||
// GroupCfg groupCfg=new GroupCfg();
|
||||
// groupCfg.setCompileId(entity.getCompileId());
|
||||
// groupCfg.setGroupId(Integer.parseInt(entity.getUserRegion4()));
|
||||
// groupCfg.setIsValid(Constants.VALID_YES);
|
||||
// groupCfg.setAuditTime(entity.getAuditTime());
|
||||
// groupRelationList.add(groupCfg);
|
||||
// maatCfg.setGroupNum(groupRelationList.size());
|
||||
// if(group.getAsnId()!=null) {
|
||||
// maatCfg.setUserRegion("ASN_ID="+group.getAsnId());
|
||||
|
||||
// @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
// @Deprecated
|
||||
// public void auditAsnCfg(CfgIndexInfo entity,Integer isAudit){
|
||||
// entity.setTableName(CfgIndexInfo.getTablename());
|
||||
// entity.setIsAudit(isAudit);
|
||||
// ipCfgDao.auditCfg(entity);
|
||||
// ToMaatBean maatBean = new ToMaatBean();
|
||||
//
|
||||
// List<MaatCfg> configCompileList = new ArrayList<>();
|
||||
//
|
||||
// if(isAudit==Constants.AUDIT_YES) {
|
||||
// List<AsnKeywordCfg> asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity);
|
||||
// if(asnKeywordCfgs!=null&&asnKeywordCfgs.size()>0) {
|
||||
// MaatCfg maatCfg = new MaatCfg();
|
||||
// List<GroupCfg> groupRelationList = new ArrayList<>();
|
||||
// List<IpCfg> ipRegionList = new ArrayList<>();
|
||||
// List<StringCfg> strRegionList = new ArrayList<>();
|
||||
// List<NumBoundaryCfg> numRegionList = new ArrayList<>();
|
||||
// List<DigestCfg> digestRegionList = new ArrayList<>();
|
||||
// List<IpCfg> areaIpRegionList = new ArrayList<>();
|
||||
// maatCfg.initDefaultValue();
|
||||
// BeanUtils.copyProperties(entity, maatCfg);
|
||||
// maatCfg.setAction(entity.getAction());
|
||||
// maatCfg.setAuditTime(entity.getAuditTime());
|
||||
//
|
||||
// maatCfg.setNumRegionList(numRegionList);
|
||||
// maatCfg.setDigestRegionList(digestRegionList);
|
||||
// maatCfg.setGroupRelationList(groupRelationList);
|
||||
// maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||
// maatCfg.setIsValid(entity.getIsValid());
|
||||
// //group
|
||||
// List<Integer> groupIds=ConfigServiceUtil.getId(2, 1);
|
||||
// GroupCfg groupCfg=new GroupCfg();
|
||||
// groupCfg.setCompileId(entity.getCompileId());
|
||||
// //groupCfg.setGroupId(Integer.parseInt(entity.getUserRegion4()));
|
||||
// groupCfg.setGroupId(groupIds.get(0));
|
||||
// groupCfg.setIsValid(Constants.VALID_YES);
|
||||
// groupCfg.setAuditTime(entity.getAuditTime());
|
||||
// groupRelationList.add(groupCfg);
|
||||
// maatCfg.setGroupNum(groupRelationList.size());
|
||||
// maatCfg.setIpRegionList(ipRegionList);
|
||||
// List<Integer> regions=ConfigServiceUtil.getId(3, asnKeywordCfgs.size());
|
||||
// int index=0;
|
||||
// List<FunctionRegionDict> functionRegionDicts=DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
// String cfgType=null;
|
||||
// for(FunctionRegionDict dict:functionRegionDicts) {
|
||||
// if("asn".equals(dict.getConfigServiceType())) {
|
||||
// cfgType=dict.getCfgType();
|
||||
// }
|
||||
// configCompileList.add(maatCfg);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// for(AsnKeywordCfg keyword:asnKeywordCfgs) {
|
||||
// StringCfg cfg=new StringCfg();
|
||||
// BeanUtils.copyProperties(keyword, cfg);
|
||||
// cfg.setRegionId(index);
|
||||
// //需要根据文档
|
||||
// //cfg.setCfgType(StringUtils.isBlank(cfgType)?"NTC_ASN_NUMBER":cfgType);
|
||||
// cfg.setGroupId(groupIds.get(0));
|
||||
// cfg.setAuditTime(entity.getAuditTime());
|
||||
// cfg.setIsValid(entity.getIsValid());
|
||||
// cfg.setRegionId(regions.get(index));
|
||||
// //cfg.setGroupId(Integer.parseInt(entity.getUserRegion4()));
|
||||
// strRegionList.add(cfg);
|
||||
// index++;
|
||||
// }
|
||||
// maatCfg.setStrRegionList(strRegionList);
|
||||
// configCompileList.add(maatCfg);
|
||||
// maatBean.setConfigCompileList(configCompileList);
|
||||
// maatBean.setAuditTime(entity.getAuditTime());
|
||||
// maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
@@ -696,104 +809,35 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
//
|
||||
// //调用服务接口下发配置数据
|
||||
// String json=gsonToJson(maatBean);
|
||||
// logger.info("ipaddr asn组复用配置下发配置参数:"+json);
|
||||
// logger.info("ipaddr asn配置下发配置参数:"+json);
|
||||
// //调用服务接口下发配置
|
||||
// ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
// logger.info("ipaddr asn组复用配置下发响应信息:"+result.getMsg());
|
||||
// }else {//首次下发
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
List<GroupCfg> groupRelationList = new ArrayList<>();
|
||||
List<IpCfg> ipRegionList = new ArrayList<>();
|
||||
List<StringCfg> strRegionList = new ArrayList<>();
|
||||
List<NumBoundaryCfg> numRegionList = new ArrayList<>();
|
||||
List<DigestCfg> digestRegionList = new ArrayList<>();
|
||||
List<IpCfg> areaIpRegionList = new ArrayList<>();
|
||||
maatCfg.initDefaultValue();
|
||||
BeanUtils.copyProperties(entity, maatCfg);
|
||||
maatCfg.setAction(entity.getAction());
|
||||
maatCfg.setAuditTime(entity.getAuditTime());
|
||||
|
||||
maatCfg.setNumRegionList(numRegionList);
|
||||
maatCfg.setDigestRegionList(digestRegionList);
|
||||
maatCfg.setGroupRelationList(groupRelationList);
|
||||
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
//group
|
||||
List<Integer> groupIds=ConfigServiceUtil.getId(2, 1);
|
||||
GroupCfg groupCfg=new GroupCfg();
|
||||
groupCfg.setCompileId(entity.getCompileId());
|
||||
//groupCfg.setGroupId(Integer.parseInt(entity.getUserRegion4()));
|
||||
groupCfg.setGroupId(groupIds.get(0));
|
||||
groupCfg.setIsValid(Constants.VALID_YES);
|
||||
groupCfg.setAuditTime(entity.getAuditTime());
|
||||
groupRelationList.add(groupCfg);
|
||||
maatCfg.setGroupNum(groupRelationList.size());
|
||||
maatCfg.setIpRegionList(ipRegionList);
|
||||
List<Integer> regions=ConfigServiceUtil.getId(3, groups.size());
|
||||
int index=0;
|
||||
List<FunctionRegionDict> functionRegionDicts=DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
String cfgType=null;
|
||||
for(FunctionRegionDict dict:functionRegionDicts) {
|
||||
if("asn".equals(dict.getConfigServiceType())) {
|
||||
cfgType=dict.getCfgType();
|
||||
}
|
||||
}
|
||||
for(AsnGroupInfo group:groups) {
|
||||
StringCfg cfg=new StringCfg();
|
||||
cfg.setRegionId(index);
|
||||
cfg.setCfgKeywords("AS"+group.getAsnId());
|
||||
cfg.setExprType(0);
|
||||
cfg.setIsHexbin(0);
|
||||
cfg.setMatchMethod(3);
|
||||
//需要根据文档
|
||||
cfg.setCfgType(StringUtils.isBlank(cfgType)?"NTC_ASN_NUMBER":cfgType);
|
||||
cfg.setGroupId(groupIds.get(0));
|
||||
cfg.setAuditTime(entity.getAuditTime());
|
||||
cfg.setIsValid(entity.getIsValid());
|
||||
cfg.setRegionId(regions.get(index));
|
||||
//cfg.setGroupId(Integer.parseInt(entity.getUserRegion4()));
|
||||
strRegionList.add(cfg);
|
||||
index++;
|
||||
}
|
||||
maatCfg.setStrRegionList(strRegionList);
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("ipaddr asn配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||
logger.info("ipaddr asn配置下发响应信息:"+result.getMsg());
|
||||
// }
|
||||
}
|
||||
|
||||
}else if(isAudit==Constants.AUDIT_NOT_YES) {//取消审核通过
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
maatCfg.setCompileId(entity.getCompileId());
|
||||
maatCfg.setServiceId(entity.getServiceId());
|
||||
maatCfg.setIsValid(0);//无效
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("ipaddr asn取消下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||
logger.info("ipaddr asn取消配置响应信息:"+result.getMsg());
|
||||
}else {
|
||||
throw new RuntimeException("unknown isAudit value "+isAudit);
|
||||
}
|
||||
|
||||
}
|
||||
// logger.info("ipaddr asn配置下发响应信息:"+result.getMsg());
|
||||
//// }
|
||||
// }
|
||||
//
|
||||
// }else if(isAudit==Constants.AUDIT_NOT_YES) {//取消审核通过
|
||||
// MaatCfg maatCfg = new MaatCfg();
|
||||
// maatCfg.setCompileId(entity.getCompileId());
|
||||
// maatCfg.setServiceId(entity.getServiceId());
|
||||
// maatCfg.setIsValid(0);//无效
|
||||
// configCompileList.add(maatCfg);
|
||||
// maatBean.setConfigCompileList(configCompileList);
|
||||
// maatBean.setAuditTime(entity.getAuditTime());
|
||||
// maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
// maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
// maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
// //调用服务接口取消配置
|
||||
// String json=gsonToJson(maatBean);
|
||||
// logger.info("ipaddr asn取消下发配置参数:"+json);
|
||||
// //调用服务接口下发配置
|
||||
// ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||
// logger.info("ipaddr asn取消配置响应信息:"+result.getMsg());
|
||||
// }else {
|
||||
// throw new RuntimeException("unknown isAudit value "+isAudit);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void deleteIp(String ids,String compileIds,int functionId){
|
||||
if(StringUtils.isNotBlank(compileIds)){
|
||||
@@ -862,8 +906,8 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
entity.setIpPortList(ipPortList);
|
||||
entity.setNtcSubscribeIdCfgList(subscribeIdList);
|
||||
if(StringUtils.isNotBlank(entity.getUserRegion4())) {
|
||||
List<AsnGroupInfo> infos=asnGroupInfoDao.getValidConfigGroupInfoByName((entity.getUserRegion4().trim()));
|
||||
entity.setAsnGroups(infos);
|
||||
List<AsnKeywordCfg> asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity);
|
||||
entity.setAsnKeywords(asnKeywordCfgs);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
@@ -871,8 +915,8 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
List<IpPortCfg> ipPortList = ipCfgDao.getIpPortList(entity);
|
||||
entity.setIpPortList(ipPortList);
|
||||
if(StringUtils.isNotBlank(entity.getUserRegion4())) {
|
||||
List<AsnGroupInfo> infos=asnGroupInfoDao.getValidConfigGroupInfoByName(entity.getUserRegion4().trim());
|
||||
entity.setAsnGroups(infos);
|
||||
List<AsnKeywordCfg> asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity);
|
||||
entity.setAsnKeywords(asnKeywordCfgs);
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
@@ -27,13 +27,16 @@ public class ConfigGroupInfoService extends BaseService{
|
||||
public ConfigGroupInfo getConfigGroupInfoByGroupId(Integer groupId) {
|
||||
return configGroupInfoDao.getConfigGroupInfoByGroupId(groupId);
|
||||
}
|
||||
public ConfigGroupInfo getInfoByAsnNo(Long asnNo) {
|
||||
/*public ConfigGroupInfo getInfoByAsnNo(Long asnNo) {
|
||||
return configGroupInfoDao.getInfoByAsnNo(asnNo);
|
||||
}
|
||||
}*/
|
||||
public Integer getIssuedConfigGroupInfoByGroupIds(String groupIds) {
|
||||
return configGroupInfoDao.getIssuedConfigGroupInfoByGroupIds(groupIds);
|
||||
}
|
||||
public List<ConfigGroupInfo> findAllList(ConfigGroupInfo entity){
|
||||
return configGroupInfoDao.findAllListByGroupInfo(entity);
|
||||
}
|
||||
public ConfigGroupInfo getAsnOrganization(String groupName){
|
||||
return configGroupInfoDao.getAsnGroupByName(groupName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1213,7 +1213,7 @@ single_keyword_tip=Only single key input is allowed.
|
||||
ipv4_mask_range_tip=IP mask must between 16 and 32
|
||||
ipv6_mask_range_tip=IP Mask must between 2 and 128
|
||||
letter_cancel_info=Cancel Letter Info
|
||||
import_tip_excel=Please choose a valid Excel file with which it's subfix is .xlsx to import.
|
||||
import_tip_excel=Excel 2007 or later versions are supported
|
||||
http_keyword=Website Keyword
|
||||
http_keyword_monit=Website Keyword Monitor
|
||||
http_keyword_reject=Website Keyword Block
|
||||
@@ -1451,4 +1451,9 @@ asn_group=ASN Group
|
||||
can_not_edit_issued_ans_group=Can not edit valid ASN group
|
||||
can_not_delete_asn_group_with_audited_ip=Can not delete ASN group with approved IP
|
||||
organization=Organization
|
||||
mismatch=Mismatch
|
||||
mismatch=Mismatch
|
||||
can_not_delete_asn_group_with_audited_ip_address=Can not delete ASN group with approved packet IP address
|
||||
country_code=Country Code
|
||||
asn_name=ASN Name
|
||||
details=Details
|
||||
NTC_ASN_NUMBER=ASN
|
||||
@@ -1213,7 +1213,7 @@ single_keyword_tip=\u0414\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\
|
||||
ipv4_mask_range_tip=\u041c\u0430\u0441\u043a\u0430 IP \u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043c\u0435\u0436\u0434\u0443 16 \u0438 32
|
||||
ipv6_mask_range_tip=IP-\u043c\u0430\u0441\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043c\u0435\u0436\u0434\u0443 2 \u0438 128
|
||||
letter_cancel_info=\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u0438\u0441\u044c\u043c\u0430
|
||||
import_tip_excel=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Excel, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u0438\u043c\u043f\u043e\u0440\u0442\u0430 .xlsx.
|
||||
import_tip_excel=Excel 2007 or later versions are supported
|
||||
http_keyword=\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430
|
||||
http_keyword_monit=\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u0430
|
||||
http_keyword_reject=\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 \u0432\u0435\u0431-c\u0430\u0439\u0442\u0430
|
||||
@@ -1455,4 +1455,9 @@ asn_group=ASN Group
|
||||
can_not_edit_issued_ans_group=Can not edit valid ASN group
|
||||
can_not_delete_asn_group_with_audited_ip=Can not delete ASN group with approved IP
|
||||
organization=Organization
|
||||
mismatch=Mismatch
|
||||
mismatch=Mismatch
|
||||
can_not_delete_asn_group_with_audited_ip_address=Can not delete ASN group with approved packet IP address
|
||||
country_code=Country Code
|
||||
asn_name=ASN Name
|
||||
details=Details
|
||||
NTC_ASN_NUMBER=ASN
|
||||
@@ -1208,7 +1208,7 @@ single_keyword_tip=Only single key input is allowed.
|
||||
ipv4_mask_range_tip=IP\u63a9\u7801\u5fc5\u987b\u4ecb\u4e8e16\u548c32\u4e4b\u95f4
|
||||
ipv6_mask_range_tip=IP\u63a9\u7801\u5fc5\u987b\u4ecb\u4e8e2\u548c128\u4e4b\u95f4
|
||||
letter_cancel_info=\u53d6\u6d88\u5ba1\u6838\u6765\u51fd
|
||||
import_tip_excel=\u8bf7\u9009\u62e9\u6587\u4ef6\u7ed3\u5c3e\u4e3a.xlsx\u7684\u6709\u6548Excel\u6587\u4ef6\u5bfc\u5165
|
||||
import_tip_excel=\u4ec5\u652f\u6301Excel 2007\u4ee5\u53ca\u4e4b\u540e\u7248\u672c
|
||||
http_keyword=\u7f51\u9875\u5173\u952e\u5b57
|
||||
http_keyword_monit=\u7f51\u9875\u5173\u952e\u5b57\u76d1\u6d4b
|
||||
http_keyword_reject=\u7f51\u9875\u5173\u952e\u5b57\u963b\u65ad
|
||||
@@ -1451,4 +1451,9 @@ asn_group=ASN\u7ec4
|
||||
can_not_edit_issued_ans_group=\u4e0d\u80fd\u4fee\u6539\u6709\u6548\u7684ASN\u7ec4
|
||||
can_not_delete_asn_group_with_audited_ip=\u4e0d\u80fd\u5220\u9664\u5305\u542b\u5ba1\u6838\u901a\u8fc7ip\u7684ASN\u7ec4
|
||||
organization=\u7ec4\u7ec7
|
||||
mismatch=\u4e0d\u5339\u914d
|
||||
mismatch=\u4e0d\u5339\u914d
|
||||
can_not_delete_asn_group_with_audited_ip_address=\u4e0d\u80fd\u5220\u9664\u5305\u542b\u5728\u5df2\u5ba1\u6838ip\u5730\u5740\u914d\u7f6e\u4e2d\u7684asn\u7ec4
|
||||
country_code=\u56fd\u5bb6\u4ee3\u7801
|
||||
asn_name=ASN\u7ec4\u7ec7\u540d
|
||||
details=\u8BE6\u60C5
|
||||
NTC_ASN_NUMBER=ASN
|
||||
@@ -521,7 +521,7 @@ app_id_region=APP_ID
|
||||
#application spec service code scope
|
||||
app_spec_service_code_max_val=310000
|
||||
app_spec_service_code_min_val=300001
|
||||
groupReuseSources=groupReuseSources
|
||||
groupReuseSources=v1/groupReuseSources
|
||||
log_time_range=300000
|
||||
log_time_start=2018-08-01 00:00:00
|
||||
log_time_end=2018-10-01 00:00:00
|
||||
@@ -550,7 +550,7 @@ mulity_thread_size=5
|
||||
ntcRadiusReport=v2/ntcRadiusReport
|
||||
ntcCollectVoipLog=v1/ntcCollectVoipLogs
|
||||
ntcKeywordsUrlLog=v1/ntcKeywordsUrlLogs
|
||||
save_and_del_thread_size=5
|
||||
save_and_del_thread_size=20
|
||||
#mysql \u5355\u4e2asql\u5927\u5c0f\u9650\u5236,\u6839\u636emariadb\u76f8\u5173\u53c2\u6570\u914d\u7f6e
|
||||
max_allowed_packet=1048576
|
||||
#http client\u8fde\u63a5\u6c60\u76f8\u5173\u53c2\u6570\uff0chttp_max_connection:\u6700\u5927\u8fde\u63a5\u6570\uff0cdefault_max_perroute:\u6bcf\u4e2a\u4e3b\u673a\u5730\u5740\u7684\u5e76\u53d1\u6570\uff0cpoolcm_socket_timeout:socket\u8d85\u65f6\u65f6\u95f4
|
||||
|
||||
42
src/main/resources/sql/20190106/asn_group_info.sql
Normal file
42
src/main/resources/sql/20190106/asn_group_info.sql
Normal file
@@ -0,0 +1,42 @@
|
||||
#修改 org_group_id为issued_ips
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : 204
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 100214
|
||||
Source Host : 192.168.10.204:3306
|
||||
Source Schema : gwall_dev
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 100214
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 06/01/2019 10:11:01
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for asn_group_info
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `asn_group_info`;
|
||||
CREATE TABLE `asn_group_info` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`group_id` int(11) NOT NULL,
|
||||
`organization` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
`country` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
`detail` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
`create_time` datetime(0) NOT NULL,
|
||||
`creator_id` int(11) NOT NULL,
|
||||
`edit_time` datetime(0) NULL DEFAULT NULL,
|
||||
`editor_id` int(11) NULL DEFAULT NULL,
|
||||
`is_valid` int(2) NOT NULL COMMENT '-1删除 1有效0无效',
|
||||
`asn_id` bigint(20) NOT NULL COMMENT 'asn号',
|
||||
`issued_ips` int(11) NOT NULL DEFAULT 0,
|
||||
`compile_id` int(11) NOT NULL COMMENT 'asn 号的编译ID',
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 507295 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
59
src/main/resources/sql/20190106/asn_keyword_cfg.sql
Normal file
59
src/main/resources/sql/20190106/asn_keyword_cfg.sql
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
|
||||
Source Server : 204
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 100214
|
||||
Source Host : 192.168.10.204:3306
|
||||
Source Schema : gwall_dev
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 100214
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 06/01/2019 10:10:12
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for asn_keyword_cfg
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `asn_keyword_cfg`;
|
||||
CREATE TABLE `asn_keyword_cfg` (
|
||||
`cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增',
|
||||
`cfg_desc` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`cfg_keywords` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '对应maat规范的字符串表keywords字段',
|
||||
`action` int(11) NOT NULL COMMENT '1:阻断,2:监测, 5: FD 白名单,6:监测白名单,7: FD 监测都白名单,应与业务ID所代表的逻辑相匹配,8-灰名单',
|
||||
`is_valid` int(11) NOT NULL COMMENT '0无效,1有效,-1删除;1) 未审核时配置可删除;2) 审核通过,此字段置1;3) 取消审核通过,此字段置0',
|
||||
`is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过;1) 审核未通过,配置可修改;2) 审核通过,配置不可删除,只能取消审核通过',
|
||||
`creator_id` int(11) NOT NULL COMMENT '取自sys_user.id',
|
||||
`create_time` datetime(0) NOT NULL,
|
||||
`editor_id` int(11) NULL DEFAULT NULL COMMENT '取自sys_user.id',
|
||||
`edit_time` datetime(0) NULL DEFAULT NULL,
|
||||
`auditor_id` int(11) NULL DEFAULT NULL COMMENT '取自sys_user.id',
|
||||
`audit_time` datetime(0) NULL DEFAULT NULL,
|
||||
`service_id` int(11) NOT NULL COMMENT '参考系统业务类型管理表',
|
||||
`request_id` int(11) NOT NULL COMMENT '取自request_info.id',
|
||||
`compile_id` int(11) NOT NULL COMMENT '取自服务接口返回的maat配置的编译id,配置初始入库时获取。',
|
||||
`is_area_effective` int(11) NOT NULL COMMENT '0否,1是',
|
||||
`classify` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '分类id,多个用英文逗号分隔',
|
||||
`attribute` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '性质id,多个用英文逗号分隔',
|
||||
`lable` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签id,多个用英文逗号分隔',
|
||||
`expr_type` int(11) NOT NULL COMMENT '0:无表达式,1:与表达式',
|
||||
`match_method` int(11) NOT NULL COMMENT 'expr_type:0时有意义,其它情况必须置0。0:子串匹配;1:右匹配;2:左匹配;3:完全匹配',
|
||||
`is_hexbin` int(11) NOT NULL COMMENT '默认为0:大小写不敏感,且非HEX;1:HEX格式二进制;2:大小写敏感,且非HEX',
|
||||
`area_effective_ids` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '多个英文逗号分隔',
|
||||
`function_id` int(11) NULL DEFAULT NULL,
|
||||
`cfg_region_code` int(11) NULL DEFAULT NULL,
|
||||
`cfg_type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
|
||||
`user_region1` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预留自定义域1',
|
||||
`user_region2` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预留自定义域2',
|
||||
`user_region3` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预留自定义域3',
|
||||
`user_region4` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预留自定义域4',
|
||||
`user_region5` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '预留自定义域5',
|
||||
PRIMARY KEY (`cfg_id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -10,6 +10,10 @@
|
||||
$("#intype").val("${cfg.organization}");
|
||||
}else if(''!="${cfg.asnId}"){
|
||||
$("#intype").val("${cfg.asnId}");
|
||||
}else if(''!="${cfg.country}"){
|
||||
$("#intype").val("${cfg.country}");
|
||||
}else if(''!="${cfg.detail}"){
|
||||
$("#intype").val("${cfg.detail}");
|
||||
}else{
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
}
|
||||
@@ -60,6 +64,20 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
if(canDel){
|
||||
tip='<spring:message code="can_not_delete_asn_group_with_audited_ip_address"/>'
|
||||
$.ajax({
|
||||
type:'post',
|
||||
url:'${ctx}/basics/asnGroup/ajaxGetAuditedIPAddress',
|
||||
data:{"asnIds":asnIds.join(',')},
|
||||
async:false,
|
||||
success:function(data,textStatus){//处理返回结果
|
||||
if(data){
|
||||
canDel=false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
if(canDel){
|
||||
var added = "";
|
||||
@@ -131,6 +149,8 @@
|
||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||
<form:option value="organization"><spring:message code="organization"></spring:message></form:option>
|
||||
<form:option value="asnId"><spring:message code="asn_no"></spring:message></form:option>
|
||||
<form:option value="country"><spring:message code="country"></spring:message></form:option>
|
||||
<form:option value="detail"><spring:message code="detail"></spring:message></form:option>
|
||||
</form:select>
|
||||
|
||||
</div>
|
||||
@@ -213,7 +233,7 @@
|
||||
<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.asn_id"><spring:message code="asn_no"/></th>
|
||||
<th><spring:message code="is_issued"/></th>
|
||||
<th class="sort-column r.is_valid"><spring:message code="is_issued"/></th>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
|
||||
@@ -17,9 +17,9 @@ $(function(){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
},
|
||||
submitHandler: function(form){
|
||||
$("[name='country']").val($("[name='userRegion1'] option:selected").attr("country"));
|
||||
/* $("[name='country']").val($("[name='userRegion1'] option:selected").attr("country"));
|
||||
$("[name='detail']").val($("[name='userRegion1'] option:selected").attr("detail"));
|
||||
$("[name='asnIpGroup']").val($("[name='userRegion1'] option:selected").attr("asnIpGroup"));
|
||||
$("[name='asnIpGroup']").val($("[name='userRegion1'] option:selected").attr("asnIpGroup")); */
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
@@ -30,7 +30,7 @@ $(function(){
|
||||
var asnId=$(this).find("option[value='"+$(this).val()+"']").attr("asnId");
|
||||
$("#asnId").val(asnId);
|
||||
}); */
|
||||
var organization=$("[name='organization']").val();
|
||||
/* var organization=$("[name='organization']").val();
|
||||
if(organization){
|
||||
$.ajax({
|
||||
type:'post',
|
||||
@@ -69,7 +69,7 @@ $(function(){
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}); */
|
||||
});
|
||||
//业务窗口打开
|
||||
var addContent = function(obj, contentClassName) {
|
||||
@@ -199,7 +199,7 @@ var reSort=function(obj,index){
|
||||
<div for="asnIpGroup"></div>
|
||||
</div>
|
||||
</div> --%>
|
||||
<div class="col-md-6">
|
||||
<%-- <div class="col-md-6">
|
||||
<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">
|
||||
@@ -208,24 +208,25 @@ var reSort=function(obj,index){
|
||||
<option value="${policyGroup.groupName}" <c:if test="${_cfg.organization eq policyGroup.groupName }">selected</c:if>>${policyGroup.groupName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<%-- <input class="form-control required" type="text" name="organization" value="${_cfg.organization}"> --%>
|
||||
<input class="form-control required" type="text" name="organization" value="${_cfg.organization}">
|
||||
</div>
|
||||
<div for="organization"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
--%>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ASN"/></label>
|
||||
<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>
|
||||
<%-- <input class="form-control required digits" type="text" name="userRegion1" value="${_cfg.userRegion1}"> --%>
|
||||
<%-- <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}">
|
||||
</div>
|
||||
<div for="userRegion1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="row">
|
||||
<div class="col-md-6 hidden">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="country"/></label>
|
||||
@@ -246,7 +247,7 @@ var reSort=function(obj,index){
|
||||
<div for="detail"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --%>
|
||||
<!-- desc and action -->
|
||||
<h4 class="form-section">
|
||||
<spring:message code="asn_ip_configuration" />
|
||||
|
||||
@@ -14,9 +14,9 @@ $(function(){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
},
|
||||
submitHandler: function(form){
|
||||
$("[name='country']").val($("[name='userRegion1'] option:selected").attr("country"));
|
||||
/* $("[name='country']").val($("[name='userRegion1'] option:selected").attr("country"));
|
||||
$("[name='detail']").val($("[name='userRegion1'] option:selected").attr("detail"));
|
||||
$("[name='asnIpGroup']").val($("[name='userRegion1'] option:selected").attr("asnIpGroup"));
|
||||
$("[name='asnIpGroup']").val($("[name='userRegion1'] option:selected").attr("asnIpGroup")); */
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
@@ -27,7 +27,7 @@ $(function(){
|
||||
var asnId=$(this).find("option[value='"+$(this).val()+"']").attr("asnId");
|
||||
$("#asnId").val(asnId);
|
||||
}); */
|
||||
var organization=$("[name='organization']").val();
|
||||
/* var organization=$("[name='organization']").val();
|
||||
if(organization){
|
||||
$.ajax({
|
||||
type:'post',
|
||||
@@ -70,7 +70,7 @@ $(function(){
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}); */
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
@@ -131,19 +131,30 @@ $(function(){
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<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="organization" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search">
|
||||
<c:forEach items="${policyGroups }" var="policyGroup">
|
||||
<option value="${policyGroup.groupName}" <c:if test="${_cfg.organization eq policyGroup.groupName }">selected</c:if>>${policyGroup.groupName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<%-- <input class="form-control required" type="text" name="organization" value="${_cfg.organization}"> --%>
|
||||
</div>
|
||||
<div for="organization"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ASN"/></label>
|
||||
<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> -->
|
||||
<input class="form-control required digits asnMustExists" type="text" name="userRegion1" value="${_cfg.userRegion1}" ctx="${ctx}">
|
||||
</div>
|
||||
<div for="userRegion1"></div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="col-md-6">
|
||||
<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="organization" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search">
|
||||
<c:forEach items="${policyGroups }" var="policyGroup">
|
||||
<option value="${policyGroup.groupName}" <c:if test="${_cfg.organization eq policyGroup.groupName }">selected</c:if>>${policyGroup.groupName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<input class="form-control required" type="text" name="organization" value="${_cfg.organization}">
|
||||
</div>
|
||||
<div for="organization"></div>
|
||||
</div>
|
||||
|
||||
</div> --%>
|
||||
<div class="col-md-6 hidden">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="action"/></label>
|
||||
@@ -170,17 +181,8 @@ $(function(){
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ASN"/></label>
|
||||
<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>
|
||||
<%-- <input class="form-control" type="text" name="userRegion1" value="${_cfg.userRegion1}"> --%>
|
||||
</div>
|
||||
<div for="userRegion1"></div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group hidden">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="country"/></label>
|
||||
@@ -201,7 +203,7 @@ $(function(){
|
||||
<div for="detail"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> --%>
|
||||
<!-- desc and action -->
|
||||
<%-- <%@include file="/WEB-INF/include/form/complexIpInfo.jsp" %> --%>
|
||||
<div class="row ipInfo">
|
||||
|
||||
@@ -17,13 +17,14 @@
|
||||
<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="group"/></label>
|
||||
<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">
|
||||
<%-- <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>
|
||||
</select> --%>
|
||||
<input class="form-control required invisibleChar orgMustExists" type="text" name="userRegion4" value="${asn}" ctx="${ctx}">
|
||||
</div>
|
||||
<div for="userRegion4"></div>
|
||||
</div>
|
||||
|
||||
@@ -705,7 +705,7 @@ var showHideIPSECProtocol=function(obj){
|
||||
<c:choose>
|
||||
<c:when test="${fn:length(fn:split(_cfg.userRegion4,','))>0}">
|
||||
<c:set var="isBreak" value="false" ></c:set>
|
||||
<c:forEach items="${fn:split(_cfg.userRegion4,',')}" var="asn">${_cfg.cfgType}
|
||||
<c:forEach items="${fn:split(_cfg.userRegion4,',')}" var="asn">
|
||||
<c:choose>
|
||||
<c:when test="${!isBreak}">
|
||||
<div class="row boxSolid asn ${tabName}${status.index}">
|
||||
|
||||
@@ -218,25 +218,15 @@
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
<c:if test="${(region[0] eq 3) && (not empty _cfg.userRegion4)}">
|
||||
<c:forEach items="${_cfg.asnGroups}" var="asn">
|
||||
<c:if test="${(region[0] eq 3) && (not empty _cfg.asnKeywords)}">
|
||||
<c:forEach items="${_cfg.asnKeywords}" var="asn">
|
||||
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><spring:message code='organization'/>:</label>
|
||||
<label>
|
||||
${asn.organization}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><spring:message code='country'/>:</label>
|
||||
<label>
|
||||
${asn.country}
|
||||
${asn.userRegion4}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -246,17 +236,7 @@
|
||||
<div class="form-group">
|
||||
<label><spring:message code='asn_no'/>:</label>
|
||||
<label>
|
||||
${asn.asnId}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><spring:message code='detail'/>:</label>
|
||||
<label>
|
||||
${asn.detail}
|
||||
${asn.cfgKeywords}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -959,6 +959,41 @@ jQuery.validator.addMethod("asnNoUnique",function(value, element) {
|
||||
});
|
||||
return result;
|
||||
});
|
||||
jQuery.validator.addMethod("asnMustExists",function(value, element) {
|
||||
var ctx=$(element).attr("ctx");
|
||||
//var id= $("[name='id']").val();
|
||||
var url = ctx+"/basics/asnGroup/checkAsnNo";
|
||||
var result = true;
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url: url,
|
||||
data:{"asnId":value},
|
||||
success:function(data){
|
||||
if(data==true){
|
||||
result=false;
|
||||
}else{
|
||||
result=true;
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
});
|
||||
jQuery.validator.addMethod("orgMustExists",function(value, element) {
|
||||
var ctx=$(element).attr("ctx");
|
||||
var url = ctx+"/basics/asnGroup/orgMustExists";
|
||||
var result = true;
|
||||
$.ajax({
|
||||
type:'post',
|
||||
async:false,
|
||||
url: url,
|
||||
data:{"organization":value},
|
||||
success:function(data){
|
||||
result = data;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
});
|
||||
|
||||
jQuery.validator.addMethod("areaUnique",function(value,element) {
|
||||
var flag = true;
|
||||
|
||||
@@ -78,6 +78,8 @@
|
||||
netAddress:"The class C type of IP addresses must has the same network number bit field",
|
||||
addrPoolUnique:"Address Pool already exists.",
|
||||
asnNoUnique:"ASN already exists.",
|
||||
asnMustExists:"ASN Must exists in ASN Group.",
|
||||
orgMustExists:"ASN organization Must exists in ASN Group and have an approved ASN IP",
|
||||
areaUnique:"Area already exists.",
|
||||
config_sync_tip:"The system is being maintained and temporarily inaccessible.",
|
||||
ipMaskSole:"IP already exists.",
|
||||
|
||||
@@ -78,6 +78,8 @@
|
||||
netAddress:"Тип IP-адресов класса C должен иметь один и тот же номер сети бит поля.",
|
||||
addrPoolUnique:"Address Pool уже существует.",
|
||||
asnNoUnique:"ASN уже существует.",
|
||||
asnMustExists:"ASN Must exists in ASN Group.",
|
||||
orgMustExists:"ASN organization Must exists in ASN Group and have an approved ASN IP",
|
||||
areaUnique:"Регион уже существует.",
|
||||
config_sync_tip:"Система находится под техническим обслуживанием и временно недоступна.",
|
||||
ipMaskSole:"IP уже существует.",
|
||||
|
||||
@@ -78,6 +78,8 @@
|
||||
netAddress:"C类IP地址网络位必须相同",
|
||||
addrPoolUnique:"地址池已存在",
|
||||
asnNoUnique:"ASN号已存在",
|
||||
asnMustExists:"ASN号必须存在于ASN组中",
|
||||
orgMustExists:"ASN组织 必须存在于ASN组中并且包含已审核ASN IP",
|
||||
areaUnique:"该区域已存在",
|
||||
config_sync_tip:"系统正在维护中,暂时不可访问!",
|
||||
ipMaskSole:"IP已存在",
|
||||
|
||||
Reference in New Issue
Block a user