Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into
develop Conflicts: src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java 证书增加CN和SAN列,修改时间类型 common.js去掉无用字符 国际化增加cert_not_match_domain
This commit is contained in:
@@ -22,7 +22,7 @@ public class PolicyGroupInfo extends BaseCfg<PolicyGroupInfo> implements Seriali
|
||||
private Integer groupType;
|
||||
private Integer serviceGroupId;
|
||||
private String description;
|
||||
private Integer asnNo;
|
||||
private Long asnNo;
|
||||
|
||||
public Integer getServiceGroupId() {
|
||||
return serviceGroupId;
|
||||
@@ -66,10 +66,10 @@ public class PolicyGroupInfo extends BaseCfg<PolicyGroupInfo> implements Seriali
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
public Integer getAsnNo() {
|
||||
public Long getAsnNo() {
|
||||
return asnNo;
|
||||
}
|
||||
public void setAsnNo(Integer asnNo) {
|
||||
public void setAsnNo(Long asnNo) {
|
||||
this.asnNo = asnNo;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,14 @@ public class BaseStringCfg<T> extends BaseCfg<T> {
|
||||
protected Integer appCode;//仅用于copy属性使用
|
||||
protected Integer behavCode;//仅用于copy属性使用
|
||||
protected Integer specServiceId;//仅用于copy属性使用
|
||||
protected String domain;//仅用于copy属性使用
|
||||
|
||||
public String getDomain() {
|
||||
return domain;
|
||||
}
|
||||
public void setDomain(String domain) {
|
||||
this.domain = domain;
|
||||
}
|
||||
public Integer getAppCode() {
|
||||
return appCode;
|
||||
}
|
||||
|
||||
@@ -29,13 +29,28 @@ public class PxyObjKeyring extends BaseCfg<PxyObjKeyring> {
|
||||
@ExcelField(title="issuer",sort=6)
|
||||
private String issuer;
|
||||
@ExcelField(title="not_before_time",sort=8)
|
||||
private Date notBeforeTime;
|
||||
private String notBeforeTime;
|
||||
@ExcelField(title="not_after_time",sort=9)
|
||||
private Date notAfterTime;
|
||||
private String notAfterTime;
|
||||
@ExcelField(title="certificate_subject",sort=7)
|
||||
private String subject;
|
||||
@ExcelField(title="keyring_name",sort=1)
|
||||
private String keyringName;
|
||||
private String cn;
|
||||
private String altName;
|
||||
|
||||
public String getCn() {
|
||||
return cn;
|
||||
}
|
||||
public String getAltName() {
|
||||
return altName;
|
||||
}
|
||||
public void setCn(String cn) {
|
||||
this.cn = cn;
|
||||
}
|
||||
public void setAltName(String altName) {
|
||||
this.altName = altName;
|
||||
}
|
||||
|
||||
|
||||
public String getKeyringName() {
|
||||
@@ -86,16 +101,16 @@ public class PxyObjKeyring extends BaseCfg<PxyObjKeyring> {
|
||||
public void setIssuer(String issuer) {
|
||||
this.issuer = issuer;
|
||||
}
|
||||
public Date getNotAfterTime() {
|
||||
public String getNotAfterTime() {
|
||||
return notAfterTime;
|
||||
}
|
||||
public Date getNotBeforeTime() {
|
||||
public String getNotBeforeTime() {
|
||||
return notBeforeTime;
|
||||
}
|
||||
public void setNotAfterTime(Date notAfterTime) {
|
||||
public void setNotAfterTime(String notAfterTime) {
|
||||
this.notAfterTime = notAfterTime;
|
||||
}
|
||||
public void setNotBeforeTime(Date notBeforeTime) {
|
||||
public void setNotBeforeTime(String notBeforeTime) {
|
||||
this.notBeforeTime = notBeforeTime;
|
||||
}
|
||||
public String getSubject() {
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
*@Title: BaseStringConfig.java
|
||||
*@Package com.nis.domain.restful
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年2月5日 下午5:26:02
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* @Description: excel导入字符串类配置
|
||||
*/
|
||||
public class AppDomainTemplate {
|
||||
private String cfgDesc;
|
||||
private String cfgKeywords;
|
||||
private Integer matchMethod ;
|
||||
private Integer isHex;
|
||||
private Integer isCaseInsenstive;
|
||||
|
||||
@ExcelField(title="config_describe",align=2,sort=1)
|
||||
public String getCfgDesc() {
|
||||
return cfgDesc;
|
||||
}
|
||||
public void setCfgDesc(String cfgDesc) {
|
||||
this.cfgDesc = cfgDesc;
|
||||
}
|
||||
@ExcelField(title="domain_name",sort=2)
|
||||
public String getCfgKeywords() {
|
||||
return cfgKeywords;
|
||||
}
|
||||
public void setCfgKeywords(String cfgKeywords) {
|
||||
this.cfgKeywords = cfgKeywords;
|
||||
}
|
||||
@ExcelField(title="match_method",dictType="MATCH_METHOD",sort=13)
|
||||
public Integer getMatchMethod() {
|
||||
return matchMethod;
|
||||
}
|
||||
public void setMatchMethod(Integer matchMethod) {
|
||||
this.matchMethod = matchMethod;
|
||||
}
|
||||
@ExcelField(title="is_hex",dictType="IS_HEX",sort=14)
|
||||
public Integer getIsHex() {
|
||||
return isHex;
|
||||
}
|
||||
public void setIsHex(Integer isHex) {
|
||||
this.isHex = isHex;
|
||||
}
|
||||
@ExcelField(title="is_case_insenstive",dictType="CASE_INSENSTIVE",sort=15)
|
||||
public Integer getIsCaseInsenstive() {
|
||||
return isCaseInsenstive;
|
||||
}
|
||||
public void setIsCaseInsenstive(Integer isCaseInsenstive) {
|
||||
this.isCaseInsenstive = isCaseInsenstive;
|
||||
}
|
||||
}
|
||||
140
src/main/java/com/nis/domain/dashboard/NtcRadiusReport.java
Normal file
140
src/main/java/com/nis/domain/dashboard/NtcRadiusReport.java
Normal file
@@ -0,0 +1,140 @@
|
||||
package com.nis.domain.dashboard;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||
|
||||
public class NtcRadiusReport implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = 7635016645942704971L;
|
||||
@JsonInclude(value = Include.NON_NULL)
|
||||
@ApiModelProperty(value = "接入IP", required = true)
|
||||
protected String nasIp;
|
||||
@JsonInclude(value = Include.NON_NULL)
|
||||
@ApiModelProperty(value = "用户名", required = true)
|
||||
protected String account;
|
||||
@JsonInclude(value = Include.NON_NULL)
|
||||
@ApiModelProperty(value = "次数", required = true)
|
||||
protected Long num;
|
||||
@JsonInclude(value = Include.NON_NULL)
|
||||
@ApiModelProperty(value = "统计时间", required = true)
|
||||
protected String reportTime;
|
||||
|
||||
/**
|
||||
* 业务类型:1:用户名和接口IP列表 2:根据用户,统计IP变化趋势 3:IP根据,统计用户变化趋势
|
||||
*/
|
||||
protected String searchBusinessType = "1";
|
||||
@SerializedName("searchReportStartTime")
|
||||
protected String searchFoundStartTime;
|
||||
@SerializedName("searchReportEndTime")
|
||||
protected String searchFoundEndTime;
|
||||
protected Long searchReportStartTimeCluster;
|
||||
protected Long searchReportEndTimeCluster;
|
||||
|
||||
protected String searchNasIp;
|
||||
protected String searchAccount;
|
||||
protected String groupType;
|
||||
|
||||
public String getNasIp() {
|
||||
return nasIp;
|
||||
}
|
||||
|
||||
public void setNasIp(String nasIp) {
|
||||
this.nasIp = nasIp;
|
||||
}
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public Long getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Long num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public String getReportTime() {
|
||||
return reportTime;
|
||||
}
|
||||
|
||||
public void setReportTime(String reportTime) {
|
||||
this.reportTime = reportTime;
|
||||
}
|
||||
|
||||
public String getSearchBusinessType() {
|
||||
return searchBusinessType;
|
||||
}
|
||||
@JsonIgnore
|
||||
public void setSearchBusinessType(String searchBusinessType) {
|
||||
this.searchBusinessType = searchBusinessType;
|
||||
}
|
||||
@JsonIgnore
|
||||
public String getSearchFoundStartTime() {
|
||||
return searchFoundStartTime;
|
||||
}
|
||||
|
||||
public void setSearchFoundStartTime(String searchFoundStartTime) {
|
||||
this.searchFoundStartTime = searchFoundStartTime;
|
||||
}
|
||||
@JsonIgnore
|
||||
public String getSearchFoundEndTime() {
|
||||
return searchFoundEndTime;
|
||||
}
|
||||
|
||||
public void setSearchFoundEndTime(String searchFoundEndTime) {
|
||||
this.searchFoundEndTime = searchFoundEndTime;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Long getSearchReportStartTimeCluster() {
|
||||
return searchReportStartTimeCluster;
|
||||
}
|
||||
|
||||
public void setSearchReportStartTimeCluster(
|
||||
Long searchReportStartTimeCluster) {
|
||||
this.searchReportStartTimeCluster = searchReportStartTimeCluster;
|
||||
}
|
||||
@JsonIgnore
|
||||
public Long getSearchReportEndTimeCluster() {
|
||||
return searchReportEndTimeCluster;
|
||||
}
|
||||
|
||||
public void setSearchReportEndTimeCluster(Long searchReportEndTimeCluster) {
|
||||
this.searchReportEndTimeCluster = searchReportEndTimeCluster;
|
||||
}
|
||||
@JsonIgnore
|
||||
public String getSearchNasIp() {
|
||||
return searchNasIp;
|
||||
}
|
||||
|
||||
public void setSearchNasIp(String searchNasIp) {
|
||||
this.searchNasIp = searchNasIp;
|
||||
}
|
||||
@JsonIgnore
|
||||
public String getSearchAccount() {
|
||||
return searchAccount;
|
||||
}
|
||||
|
||||
public void setSearchAccount(String searchAccount) {
|
||||
this.searchAccount = searchAccount;
|
||||
}
|
||||
@JsonIgnore
|
||||
public String getGroupType() {
|
||||
return groupType;
|
||||
}
|
||||
|
||||
public void setGroupType(String groupType) {
|
||||
this.groupType = groupType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,12 +16,12 @@ public class ConfigGroupInfo {
|
||||
private Integer groupType;
|
||||
@ExcelField(title="cfg_id",sort=301)
|
||||
private Integer compileId;
|
||||
private Integer asnId;
|
||||
private Long asnId;
|
||||
|
||||
public Integer getAsnId() {
|
||||
public Long getAsnId() {
|
||||
return asnId;
|
||||
}
|
||||
public void setAsnId(Integer asnId) {
|
||||
public void setAsnId(Long asnId) {
|
||||
this.asnId = asnId;
|
||||
}
|
||||
public Integer getCompileId() {
|
||||
|
||||
@@ -91,7 +91,11 @@ public class MultipartFileIntercepter extends CommonsMultipartResolver{
|
||||
return multipartParsingResult;
|
||||
|
||||
} catch (FileUploadBase.SizeLimitExceededException ex) {
|
||||
throw new MultiPartNewException("",fileUploadTotalSize,fileUpload.getSizeMax(),languageProp,ex);
|
||||
if(fileUploadTotalSize==0l){
|
||||
throw new MultiPartNewException(languageProp, ex);
|
||||
}else{
|
||||
throw new MultiPartNewException("",fileUploadTotalSize,fileUpload.getSizeMax(),languageProp,ex);
|
||||
}
|
||||
} catch (FileUploadException ex) {
|
||||
throw new MultiPartNewException(languageProp, ex);
|
||||
}catch (IOException ex) {
|
||||
|
||||
@@ -56,6 +56,10 @@ public final class Constants {
|
||||
* 配置审核下发的类型 回调类型
|
||||
*/
|
||||
public static final int CALLBACK_TYPE=2;
|
||||
/**
|
||||
* 域名验证正则
|
||||
*/
|
||||
public static final String DOMAIN_REGEXP=Configurations.getStringProperty("domain_regexp", "*");
|
||||
/**
|
||||
* IP验证正则
|
||||
*/
|
||||
@@ -680,6 +684,7 @@ public final class Constants {
|
||||
public static final String NTC_TOTAL_REPORT=Configurations.getStringProperty("ntcTotalReport","ntcTotalReport");
|
||||
public static final String TRAFFIC_IPACTIVE_FIVEMINUTE=Configurations.getStringProperty("trafficIpActiveFiveMinute","trafficIpActiveFiveMinute");
|
||||
public static final String TRAFFIC_IPACTIVE_ONEHOUR=Configurations.getStringProperty("trafficIpActiveOneHour","trafficIpActiveOneHour");
|
||||
public static final String NTC_RADIUS_REPORT=Configurations.getStringProperty("ntcRadiusReport","ntcRadiusReport");
|
||||
|
||||
/**
|
||||
* httpclient 工具超时时间设置
|
||||
|
||||
@@ -485,21 +485,21 @@ public class ExportExcel {
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_VALUE+"(IPv4)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_VALUE+"(IPv4)";
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv4_range_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv4_range_tip");
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_RANGE_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.IPV4_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv4_subnet_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv4_subnet_tip")+")";
|
||||
defaultValue=Constants.IPV4_DEFAULT_IP_SUBNET_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
@@ -508,21 +508,21 @@ public class ExportExcel {
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",3,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_VALUE+"(IPv6)"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_VALUE+"(IPv6)";
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",2,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv6_range_tip")+")"+"\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_RANGE_VALUE+"("+msgProp.getProperty("ipv6_range_tip")+")";
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_RANGE_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if((","+region.getConfigIpPattern()+",").indexOf(",1,") > -1){
|
||||
commentStr=commentStr+Constants.IPV6_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv6_subnet_tip")+")"+"\n\n";
|
||||
if(StringUtil.isEmpty(defaultValue)){
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_SUBNET_VALUE+"("+msgProp.getProperty("ipv6_subnet_tip")+")";
|
||||
defaultValue=Constants.IPV6_DEFAULT_IP_SUBNET_VALUE;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
@@ -17,11 +17,14 @@ import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.hadoop.hbase.protobuf.generated.CellProtos.CellType;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDataFormatter;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.DateUtil;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Row.MissingCellPolicy;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
@@ -219,6 +222,35 @@ public class ImportExcel {
|
||||
}
|
||||
return val;
|
||||
}
|
||||
/**
|
||||
* 获取单元格值
|
||||
* @param row 获取的行
|
||||
* @param column 获取单元格列号
|
||||
* @return 单元格值
|
||||
*/
|
||||
public Object getStringCellValue(Row row, int column){
|
||||
Object val = "";
|
||||
try{
|
||||
Cell cell = row.getCell(column);
|
||||
if (cell != null){
|
||||
if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC){
|
||||
HSSFDataFormatter dataFormatter = new HSSFDataFormatter();
|
||||
val = dataFormatter.formatCellValue(cell);
|
||||
}else if (cell.getCellType() == Cell.CELL_TYPE_STRING){
|
||||
val = cell.getStringCellValue();
|
||||
}else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA){
|
||||
val = cell.getCellFormula();
|
||||
}else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN){
|
||||
val = cell.getBooleanCellValue();
|
||||
}else if (cell.getCellType() == Cell.CELL_TYPE_ERROR){
|
||||
val = cell.getErrorCellValue();
|
||||
}
|
||||
}
|
||||
}catch (Exception e) {
|
||||
return val;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
/**
|
||||
* //递归获取cls实体对象及父级对象的属性
|
||||
* wx:修改,子类覆盖父类的同名方法
|
||||
@@ -786,7 +818,8 @@ public class ImportExcel {
|
||||
Row row = this.getRow(i);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Object[] os : annotationList){
|
||||
Object val = this.getCellValue(row, column++);
|
||||
// Object val = this.getCellValue(row, column++);
|
||||
Object val = this.getStringCellValue(row, column++);
|
||||
if (val != null){
|
||||
ExcelField ef = (ExcelField)os[0];
|
||||
// If is dict type, get dict value
|
||||
|
||||
@@ -51,6 +51,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.Encodes;
|
||||
import com.nis.util.StringUtil;
|
||||
|
||||
/**
|
||||
* @ClassName: HttpClientBean.java
|
||||
@@ -193,8 +194,12 @@ public class HttpClientUtil {
|
||||
String url = "";
|
||||
try {
|
||||
URIBuilder uriBuilder = new URIBuilder(destUrl);
|
||||
for (String param : params.keySet()) {
|
||||
uriBuilder.addParameter(param, params.get(param).toString());
|
||||
if(params!=null) {
|
||||
for (String param : params.keySet()) {
|
||||
if(!StringUtil.isBlank(param)&¶ms.get(param)!=null) {
|
||||
uriBuilder.addParameter(param, params.get(param).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
System.err.println(uriBuilder);
|
||||
url=uriBuilder.toString();
|
||||
|
||||
@@ -55,6 +55,7 @@ import com.nis.domain.configuration.DnsResStrategy;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.configuration.StringCfgTemplate;
|
||||
import com.nis.domain.configuration.template.AppDomainTemplate;
|
||||
import com.nis.domain.configuration.template.AsnIpTemplate;
|
||||
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
||||
import com.nis.domain.configuration.template.DdosIpTemplate;
|
||||
@@ -857,6 +858,7 @@ public class BaseController {
|
||||
}
|
||||
StringBuffer errTip = new StringBuffer();
|
||||
Pattern pattern = Pattern.compile("\t|\r|\n|\b|\f");
|
||||
Pattern domainPattern = Pattern.compile(Constants.DOMAIN_REGEXP);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
StringBuffer errInfo = new StringBuffer();
|
||||
BaseStringCfg baseStringCfg = new BaseStringCfg();
|
||||
@@ -880,47 +882,71 @@ public class BaseController {
|
||||
}
|
||||
}
|
||||
String keyword = baseStringCfg.getCfgKeywords();
|
||||
if (StringUtils.isBlank(keyword)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word") + " ") + ";");
|
||||
}
|
||||
if (mulityKeywordsP.equals("0")) {
|
||||
if (keyword.indexOf("\n") > -1) {
|
||||
if (!regionDict.getFunctionId().equals(403)) {
|
||||
if (StringUtils.isBlank(keyword)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("not_multiple"), prop.getProperty("key_word")) + ";");
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word") + " ") + ";");
|
||||
}
|
||||
Matcher m = pattern.matcher(keyword);
|
||||
if (m.find()) {
|
||||
errInfo.append(String.format(prop.getProperty("has_invisible_char"),
|
||||
prop.getProperty("key_word") + " '" + keyword + "'") + ";");
|
||||
}
|
||||
} else {
|
||||
boolean has = false;
|
||||
Set<String> keywordSet=Sets.newHashSet();
|
||||
for (String key : keyword.split("\n")) {
|
||||
Matcher m = pattern.matcher(key);
|
||||
if (mulityKeywordsP.equals("0")) {
|
||||
if (keyword.indexOf("\n") > -1) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("not_multiple"), prop.getProperty("key_word")) + ";");
|
||||
}
|
||||
Matcher m = pattern.matcher(keyword);
|
||||
if (m.find()) {
|
||||
has = true;
|
||||
errInfo.append(String.format(prop.getProperty("has_invisible_char"),
|
||||
prop.getProperty("key_word") + " '" + key + "'") + ";");
|
||||
break;
|
||||
prop.getProperty("key_word") + " '" + keyword + "'") + ";");
|
||||
}
|
||||
if(!keywordSet.contains(key)) {
|
||||
keywordSet.add(key);
|
||||
}else {
|
||||
errInfo.append(prop.getProperty("key_word") + " '" + key + "'"+" "+prop.getProperty("repeat") + ";");
|
||||
} else {
|
||||
boolean has = false;
|
||||
Set<String> keywordSet=Sets.newHashSet();
|
||||
for (String key : keyword.split("\n")) {
|
||||
Matcher m = pattern.matcher(key);
|
||||
if (m.find()) {
|
||||
has = true;
|
||||
errInfo.append(String.format(prop.getProperty("has_invisible_char"),
|
||||
prop.getProperty("key_word") + " '" + key + "'") + ";");
|
||||
break;
|
||||
}
|
||||
if(!keywordSet.contains(key)) {
|
||||
keywordSet.add(key);
|
||||
}else {
|
||||
errInfo.append(prop.getProperty("key_word") + " '" + key + "'"+" "+prop.getProperty("repeat") + ";");
|
||||
}
|
||||
}
|
||||
if (!has) {
|
||||
if(keyword.replaceAll("\n","").length()>1024) {
|
||||
errInfo.append(String.format(prop.getProperty("most_keywords"),
|
||||
prop.getProperty("key_word")) + ";");
|
||||
}else {
|
||||
String reWord = keyword.replaceAll("\n", Constants.KEYWORD_EXPR);
|
||||
baseStringCfg.setCfgKeywords(reWord);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!has) {
|
||||
if(keyword.replaceAll("\n","").length()>1024) {
|
||||
errInfo.append(String.format(prop.getProperty("most_keywords"),
|
||||
prop.getProperty("key_word")) + ";");
|
||||
}else {
|
||||
if (StringUtils.isBlank(keyword)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("domain_name") + " ") + ";");
|
||||
}else {
|
||||
Matcher m = pattern.matcher(keyword);
|
||||
if (m.find()) {
|
||||
errInfo.append(String.format(prop.getProperty("has_invisible_char"),
|
||||
prop.getProperty("domain_name") + " '" + keyword + "'") + ";");
|
||||
}else {
|
||||
String reWord = keyword.replaceAll("\n", Constants.KEYWORD_EXPR);
|
||||
baseStringCfg.setCfgKeywords(reWord);
|
||||
m = domainPattern.matcher(keyword);
|
||||
if(!m.matches()) {
|
||||
errInfo.append(String.format(prop.getProperty("not_valid_domain"),
|
||||
prop.getProperty("domain_name") + " '" + keyword + "'") + ";");
|
||||
}else {
|
||||
baseStringCfg.setDomain(keyword);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Integer exprType = baseStringCfg.getExprType();
|
||||
boolean has = false;
|
||||
if (exprType == null) {
|
||||
@@ -1474,7 +1500,7 @@ public class BaseController {
|
||||
+ ";");
|
||||
}else {
|
||||
try {
|
||||
Integer.parseInt(userRegion1);
|
||||
Long asnNo=Long.parseLong(userRegion1);
|
||||
/*ConfigGroupInfo configGroupInfo=asnIpCfgService.getConfigGroupInfoByAsnNo(asnNo);
|
||||
if(configGroupInfo==null) {//不存在则新增
|
||||
PolicyGroupInfo info=new PolicyGroupInfo();
|
||||
@@ -1486,6 +1512,11 @@ public class BaseController {
|
||||
configGroupInfo=asnIpCfgService.getConfigGroupInfoByAsnNo(asnNo);
|
||||
}
|
||||
baseIpCfg.setAsnIpGroup(configGroupInfo.getGroupId());*/
|
||||
if(asnNo.longValue()>4294967295l||asnNo.longValue()<1) {
|
||||
errInfo.append(prop.getProperty("asn_no")+" "+
|
||||
String.format(prop.getProperty("must_between"),"1","4294967295" )
|
||||
+ ";");
|
||||
}
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(
|
||||
@@ -3272,6 +3303,10 @@ public class BaseController {
|
||||
List<P2pHashStringTemplate> list = ei.getDataList(P2pHashStringTemplate.class,
|
||||
this.getMsgProp(),regionDict,serviceDict);
|
||||
stringCfgs = this.checkStringCfg(serviceDict, regionDict, list);
|
||||
}else if (regionDict.getFunctionId().equals(403)) {
|
||||
List<AppDomainTemplate> list = ei.getDataList(AppDomainTemplate.class,
|
||||
this.getMsgProp(),regionDict,serviceDict);
|
||||
stringCfgs = this.checkStringCfg(serviceDict, regionDict, list);
|
||||
} else {
|
||||
List<StringAllTemplate> list = ei.getDataList(StringAllTemplate.class, this.getMsgProp(),regionDict,serviceDict);
|
||||
stringCfgs = this.checkStringCfg(serviceDict, regionDict, list);
|
||||
@@ -3307,6 +3342,7 @@ public class BaseController {
|
||||
|| serviceDict.getServiceId().intValue() == 148
|
||||
|| serviceDict.getServiceId().intValue() == 1028// app ip
|
||||
|| serviceDict.getServiceId().intValue() == 1024//app http
|
||||
|| serviceDict.getServiceId().intValue() == 1026//app domain
|
||||
)) {
|
||||
if (StringUtils.isNotBlank(specServiceId)) {
|
||||
specificServiceCfg = specificServiceCfgService
|
||||
@@ -3316,6 +3352,7 @@ public class BaseController {
|
||||
if (regionDict.getRegionType().equals(1)) {// IP
|
||||
if(regionDict.getFunctionId().intValue()==600) {//ans ip
|
||||
Map<String,List<AsnIpCfg>> asnIpCfgs=new HashMap<>();
|
||||
int total=ipPortCfgs.size();
|
||||
for (BaseIpCfg cfg : ipPortCfgs) {
|
||||
AsnIpCfg _cfg=new AsnIpCfg();
|
||||
BeanUtils.copyProperties(cfg, _cfg);
|
||||
@@ -3345,7 +3382,7 @@ public class BaseController {
|
||||
}
|
||||
}
|
||||
ipPortCfgs.clear();
|
||||
asnIpCfgService.saveAsnIpBatch(asnIpCfgs);
|
||||
asnIpCfgService.saveAsnIpBatch(asnIpCfgs,total);
|
||||
}else {
|
||||
List<Integer> compileIds=Lists.newArrayList();
|
||||
List<Integer> regionIds=Lists.newArrayList();
|
||||
@@ -3507,9 +3544,12 @@ public class BaseController {
|
||||
appPolicyCfgs.add(appPolicyCfg);
|
||||
}
|
||||
} else {
|
||||
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
||||
BeanUtils.copyProperties(cfg, cfgIndexInfo, new String[] {"cfgId"});
|
||||
cfgIndexInfos.add(cfgIndexInfo);
|
||||
if(!regionDict.getFunctionId().equals(403)) {
|
||||
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
||||
BeanUtils.copyProperties(cfg, cfgIndexInfo, new String[] {"cfgId"});
|
||||
cfgIndexInfos.add(cfgIndexInfo);
|
||||
}
|
||||
|
||||
}
|
||||
ind++;
|
||||
}
|
||||
@@ -3547,6 +3587,9 @@ public class BaseController {
|
||||
if(regionDict.getDictId().intValue()==16){
|
||||
avContentCfgService.saveVoIpAccountCfg(stringCfgs);
|
||||
}
|
||||
if(regionDict.getDictId().intValue()==64){
|
||||
appCfgService.saveAppDomainCfg(stringCfgs);
|
||||
}
|
||||
} else if (regionDict.getRegionType().equals(3)) {
|
||||
List<Integer> compileIds=Lists.newArrayList();
|
||||
try {
|
||||
|
||||
@@ -199,14 +199,14 @@ public class AppCfgController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("saveAppPolicyCfg failed",e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ public class AppCfgController extends BaseController {
|
||||
e.printStackTrace();
|
||||
logger.error("app策略配置下发失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","");
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
@@ -320,14 +320,14 @@ public class AppCfgController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppIpCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("saveAppIpCfg failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,7 +372,7 @@ public class AppCfgController extends BaseController {
|
||||
e.printStackTrace();
|
||||
logger.error("app协议IP配置下发失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
@@ -453,14 +453,14 @@ public class AppCfgController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppHttpCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("saveAppHttpCfg failed", e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ public class AppCfgController extends BaseController {
|
||||
e.printStackTrace();
|
||||
logger.error("app http配置下发失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
@@ -572,13 +572,13 @@ public class AppCfgController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppDomainCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ public class AppCfgController extends BaseController {
|
||||
e.printStackTrace();
|
||||
logger.error("app协议domain配置下发失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
@@ -690,14 +690,14 @@ public class AppCfgController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppByteCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("saveAppByteCfg failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -730,7 +730,7 @@ public class AppCfgController extends BaseController {
|
||||
e.printStackTrace();
|
||||
logger.error("app协议byte配置下发失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
@@ -810,14 +810,14 @@ public class AppCfgController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppSslCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("saveAppSslCfg failed", e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -932,12 +932,12 @@ public class AppCfgController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppTcpeCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("saveAppTcpCfg failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
@@ -1057,12 +1057,12 @@ public class AppCfgController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppHeaderCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("saveAppHeaderCfg failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
@@ -1097,7 +1097,7 @@ public class AppCfgController extends BaseController {
|
||||
e.printStackTrace();
|
||||
logger.error("app Header配置下发失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
@@ -1217,16 +1217,16 @@ public class AppCfgController extends BaseController {
|
||||
entity.setDomain(entity.getDomain());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppTopicDomainCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("app主题网站配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("app主题网站配置下发失败",e);
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1353,12 +1353,12 @@ public class AppCfgController extends BaseController {
|
||||
}
|
||||
appBuiltInFeatureService.saveOrUpdate(cfg);
|
||||
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
logger.error("appBuiltinFeatureFileSaveOrUpdate failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
@@ -1404,7 +1404,7 @@ public class AppCfgController extends BaseController {
|
||||
e.printStackTrace();
|
||||
logger.error("appBuiltinFeature audit failed", e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
|
||||
@@ -129,7 +129,11 @@ public class AppFeatureCfgController extends BaseController {
|
||||
appMultiFeatureCfgService.saveOrUpdateAppFeatureCfg(entity);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/app/feature/multiFeatureCfgList?functionId="+entity.getFunctionId();
|
||||
@@ -158,11 +162,11 @@ public class AppFeatureCfgController extends BaseController {
|
||||
appMultiFeatureCfgService.auditAppFeatureCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("app 特征配置下发失败:"+e.getMessage());
|
||||
logger.error("app 特征配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("app 特征配置下发失败:"+e.getMessage());
|
||||
logger.error("app 特征配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,15 +135,15 @@ public class BasicProtocolController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("基础协议信息保存失败",e);
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
// addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,10 +206,10 @@ public class BasicProtocolController extends BaseController {
|
||||
logger.error("基础协议信息保存失败",e);
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"delete_failed");
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId;
|
||||
|
||||
@@ -129,7 +129,11 @@ public class CommonController extends BaseController {
|
||||
addMessage(model,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("保存失败",e);
|
||||
addMessage(model,"error","save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(model,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(model,"error","save_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
public void _saveOrUpdateDomain(String cfgName,RedirectAttributes model, HttpUrlCfg cfg) {
|
||||
@@ -152,7 +156,11 @@ public class CommonController extends BaseController {
|
||||
addMessage(model,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("保存失败",e);
|
||||
addMessage(model,"error","save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(model,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(model,"error", "save_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
public void _deleteIp(String cfgName,String ids,String compileIds,Integer functionId,RedirectAttributes model) {
|
||||
@@ -220,7 +228,7 @@ public class CommonController extends BaseController {
|
||||
addMessage(redirectAttributes,"success","audit_success");
|
||||
}catch(MaatConvertException e){
|
||||
logger.error("审核失败", e);
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}catch(Exception e){
|
||||
logger.error("审核失败", e);
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
@@ -328,7 +336,7 @@ public class CommonController extends BaseController {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error", "导出失败!失败信息:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "export_failed" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,14 +157,14 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("加密隧道信息保存失败",e);
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,11 +224,9 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
} catch (Exception e) {
|
||||
logger.error("加密隧道协议保存失败",e);
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
e.printStackTrace();
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"delete_failed");
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId;
|
||||
|
||||
@@ -14,6 +14,8 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.GroupAreaInfo;
|
||||
import com.nis.exceptions.CallExternalProceduresException;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.configuration.GroupAreaService;
|
||||
@@ -66,10 +68,14 @@ public class GroupAreaController extends BaseController {
|
||||
public String saveOrUpdate(GroupAreaInfo cfg,Model model,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
groupAreaService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes, "save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("新增失败",e);
|
||||
addMessage(redirectAttributes, "save_failed");
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/groupArea/groupAreaList";
|
||||
}
|
||||
|
||||
@@ -76,11 +76,15 @@ public class DnsIpCfgController extends BaseController {
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
dnsIpCfgService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+cfg.getFunctionId();
|
||||
@@ -167,7 +171,11 @@ public class DnsIpCfgController extends BaseController {
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("DnsIp export failed",e);
|
||||
addMessage(redirectAttributes, "export_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "export_failed");
|
||||
}
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
@@ -82,10 +82,11 @@ public class DnsResStrategyController extends BaseController {
|
||||
|
||||
dnsResStrategyService.saveOrUpdate(cfg);
|
||||
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch (MaatConvertException e) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+cfg.getFunctionId();
|
||||
@@ -188,7 +189,11 @@ public class DnsResStrategyController extends BaseController {
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("Dns export failed",e);
|
||||
addMessage(redirectAttributes, "export_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "export_failed");
|
||||
}
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
@@ -70,10 +70,14 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
||||
|
||||
ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
||||
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+cfg.getFunctionId();
|
||||
@@ -98,7 +102,8 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
||||
}
|
||||
addMessage(redirectAttributes,"delete_success");
|
||||
}catch(Exception e){
|
||||
addMessage(redirectAttributes,"delete_failed");
|
||||
logger.error(e);
|
||||
addMessage(redirectAttributes,"error", "delete_failed");
|
||||
}
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+functionId;
|
||||
}
|
||||
@@ -181,10 +186,14 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
||||
}
|
||||
ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
||||
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId();
|
||||
@@ -201,8 +210,12 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
||||
ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("SNAT地址池管理配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
logger.error("SNAT地址池管理配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,6 +232,7 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
||||
}
|
||||
addMessage(redirectAttributes,"delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error(e);
|
||||
addMessage(redirectAttributes,"delete_failed");
|
||||
}
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
|
||||
|
||||
@@ -62,11 +62,15 @@ public class DdosCfgController extends BaseController {
|
||||
@ModelAttribute("cfg")DdosIpCfg cfg, RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
ddosCfgService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/manipulation/ddos/list?functionId="+cfg.getFunctionId();
|
||||
|
||||
@@ -55,14 +55,14 @@ public class AsnPolicyCfgController extends BaseController {
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
asnPolicyCfgService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,11 +88,11 @@ public class AsnPolicyCfgController extends BaseController {
|
||||
asnPolicyCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
||||
logger.error("dns fake ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
||||
logger.error("dns fake ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
|
||||
|
||||
@@ -373,7 +373,11 @@ public class AvContentController extends BaseController {
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/ntc/av/contIpList?functionId="+cfg.getFunctionId();
|
||||
@@ -481,7 +485,11 @@ public class AvContentController extends BaseController {
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/ntc/av/picIpList?functionId="+cfg.getFunctionId();
|
||||
@@ -511,11 +519,11 @@ public class AvContentController extends BaseController {
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Pic Ip配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","");
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("Pic Ip配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -603,7 +611,7 @@ public class AvContentController extends BaseController {
|
||||
CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
avContentCfgService.saveOrUpdateContUrl(cfg);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
@@ -639,10 +647,14 @@ public class AvContentController extends BaseController {
|
||||
for(String id :idArray){
|
||||
try {
|
||||
avContentCfgService.auditContUrl(isAudit,isValid,functionId,id,auditTime);
|
||||
} catch (MaatConvertException e) {
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("Cont Url配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -736,7 +748,11 @@ public class AvContentController extends BaseController {
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/ntc/av/picUrlList?functionId="+cfg.getFunctionId();
|
||||
@@ -763,10 +779,14 @@ public class AvContentController extends BaseController {
|
||||
for(String id :idArray){
|
||||
try {
|
||||
avContentCfgService.auditPicUrl(isAudit,isValid,functionId,id,auditTime);
|
||||
} catch (MaatConvertException e) {
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("Pic Url配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -874,7 +894,7 @@ public class AvContentController extends BaseController {
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error", "导出失败!失败信息:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "export_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/ntc/av/picUrlList?functionId="+entity.getFunctionId();
|
||||
|
||||
@@ -238,16 +238,17 @@ public class AvController extends BaseController {
|
||||
|
||||
|
||||
avCfgService.saveOrUpdateAvFileSample(entity, srcFile);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
|
||||
|
||||
}catch(Exception e){
|
||||
logger.error("文件上传失败",e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,14 +259,14 @@ public class AvController extends BaseController {
|
||||
public String saveAudioSignSample(Model model,HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes,String ids,AvSignSampleCfg entity){
|
||||
try{
|
||||
avCfgService.saveOrUpdateAvSignSample(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("saveAudioSignSample failed",e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/av/sample/audioSignSampleList?functionId="+entity.getFunctionId();
|
||||
@@ -396,11 +397,11 @@ public class AvController extends BaseController {
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
logger.info("音视频标识样例配置下发失败:"+e.getMessage());
|
||||
logger.error("音视频标识样例配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
logger.error("auditAvAudioSignSample failed",e);
|
||||
addMessage(redirectAttributes,"success","audit_failed");
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.domain.configuration.P2pHashCfg;
|
||||
import com.nis.domain.configuration.P2pKeywordCfg;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.CallExternalProceduresException;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
@@ -79,7 +80,7 @@ public class FileTransferCfgController extends BaseController{
|
||||
CfgIndexInfo entity,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
fileTransferCfgService.saveFtpCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
@@ -174,7 +175,7 @@ public class FileTransferCfgController extends BaseController{
|
||||
} catch (MaatConvertException e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("ftp配置下发失败:"+e.getMessage());;
|
||||
logger.error("ftp配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"request_service_failed");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
@@ -254,11 +255,16 @@ public class FileTransferCfgController extends BaseController{
|
||||
logger.info("获取文件摘要响应信息:"+result);
|
||||
}
|
||||
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result,areaCfgIds);
|
||||
addMessage(redirectAttributes, "save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (MaatConvertException e) {
|
||||
addMessage(redirectAttributes, "request_service_failed");
|
||||
} catch (IOException e) {
|
||||
addMessage(redirectAttributes, "save_failed");
|
||||
} catch ( Exception e) {
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/fileTransfer/fileDigestList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
@@ -280,9 +286,15 @@ public class FileTransferCfgController extends BaseController{
|
||||
for(String id :idArray){
|
||||
try {
|
||||
fileTransferCfgService.auditFileDigestCfg(isAudit,isValid,functionId,id,auditTime);
|
||||
} catch (MaatConvertException e) {
|
||||
} catch ( Exception e) {
|
||||
logger.error("File Digest配置下发失败",e);
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,10 +462,15 @@ public class FileTransferCfgController extends BaseController{
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
fileTransferCfgService.auditP2pCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("p2p配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/fileTransfer/p2pList?functionId="+functionId;
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.domain.configuration.template.AppDomainTemplate;
|
||||
import com.nis.domain.configuration.template.AsnIpTemplate;
|
||||
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
||||
import com.nis.domain.configuration.template.DdosIpTemplate;
|
||||
@@ -309,6 +310,11 @@ public class IpController extends BaseController{
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, P2pHashStringTemplate.class, 2);
|
||||
excel.setDataList(this.getMsgProp(),classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else if(regionDict.getFunctionId().equals(403)) {//app domain
|
||||
List<AppDomainTemplate> classList=new ArrayList<AppDomainTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, AppDomainTemplate.class, 2);
|
||||
excel.setDataList(this.getMsgProp(),classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else{
|
||||
List<StringAllTemplate> classList=new ArrayList<StringAllTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, StringAllTemplate.class, 2);
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.nis.domain.configuration.FileDigestCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.CallExternalProceduresException;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
@@ -70,7 +71,7 @@ public class MailCfgController extends BaseController{
|
||||
}
|
||||
@RequestMapping(value = {"saveMailCfg"})
|
||||
@RequiresPermissions(value={"mail:config"})
|
||||
public String saveMailCfg(Model model,HttpServletRequest request,HttpServletResponse response,String ids,
|
||||
public String saveMailCfg( RedirectAttributes redirectAttributes, Model model,HttpServletRequest request,HttpServletResponse response,String ids,
|
||||
CfgIndexInfo entity,MultipartFile file) {
|
||||
|
||||
try {
|
||||
@@ -97,8 +98,13 @@ public class MailCfgController extends BaseController{
|
||||
logger.info("获取文件摘要响应信息:"+result);
|
||||
}
|
||||
mailCfgService.saveMailCfg(entity,result);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch ( Exception e) {
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+entity.getFunctionId();
|
||||
@@ -168,10 +174,15 @@ public class MailCfgController extends BaseController{
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
mailCfgService.auditMailCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("mail配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
logger.error("mail配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+functionId;
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.nis.domain.configuration.HttpResHeadCfg;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.exceptions.CallExternalProceduresException;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
@@ -314,10 +315,15 @@ public class WebsiteController extends BaseController{
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
websiteCfgService.auditSslCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("ssl配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
logger.error("ssl配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/website/sslList?functionId="+functionId;
|
||||
@@ -407,7 +413,7 @@ public class WebsiteController extends BaseController{
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/website/dnsList?functionId="+functionId;
|
||||
|
||||
@@ -246,11 +246,11 @@ public class WhiteListController extends CommonController{
|
||||
domainService.auditDomainCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("domain配置下发失败:"+e.getMessage());
|
||||
logger.error("domain配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("domain配置下发失败:"+e.getMessage());
|
||||
logger.error("domain配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,10 +84,14 @@ public class XmppController extends BaseController {
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
xmppCfgService.auditXmppCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("http配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/other/xmppList?functionId="+functionId;
|
||||
|
||||
@@ -69,10 +69,14 @@ public class ControlPolicyController extends BaseController{
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
controlPolicyService.saveOrUpdate(cfg,areaCfgIds);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/proxy/control/httpReqReplace/list?functionId="+cfg.getFunctionId();
|
||||
@@ -95,9 +99,13 @@ public class ControlPolicyController extends BaseController{
|
||||
for(String id :idArray){
|
||||
try {
|
||||
controlPolicyService.audit(isAudit,isValid,functionId,id,auditTime,Constants.REPLACE_REQ_KEY_VALUE);
|
||||
} catch (MaatConvertException e) {
|
||||
} catch ( Exception e) {
|
||||
logger.error("配置下发失败",e);
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,10 +145,14 @@ public class ControlPolicyController extends BaseController{
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
controlPolicyService.saveOrUpdate(cfg,areaCfgIds);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/proxy/control/httpResReplace/list?functionId="+cfg.getFunctionId();
|
||||
@@ -163,10 +175,14 @@ public class ControlPolicyController extends BaseController{
|
||||
for(String id :idArray){
|
||||
try {
|
||||
controlPolicyService.audit(isAudit,isValid,functionId,id,auditTime,Constants.REPLACE_RES_KEY_VALUE);
|
||||
} catch (MaatConvertException e) {
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("配置下发失败",e);
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.nis.domain.Page;
|
||||
import com.nis.domain.callback.ProxyFileStrategyCfg;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.maat.ToMaatResult.ResponseData;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.FileUtils;
|
||||
import com.nis.util.JsonMapper;
|
||||
@@ -116,10 +117,14 @@ public class FileStrategyController extends CommonController {
|
||||
cfg.setContentLength(file.length());//文件长度
|
||||
}
|
||||
proxyFileStrategyService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}finally {
|
||||
if(file != null) {
|
||||
file.delete();//删除临时文件
|
||||
|
||||
@@ -185,11 +185,15 @@ public class HttpRedirectPolicyController extends BaseController{
|
||||
@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
httpRedirectCfgService.saveHttpCfg(cfg);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+cfg.getFunctionId();
|
||||
@@ -231,10 +235,14 @@ public class HttpRedirectPolicyController extends BaseController{
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
httpRedirectCfgService.auditHttpCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("http重定向配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+functionId;
|
||||
|
||||
@@ -85,10 +85,14 @@ public class InterceptController extends CommonController{
|
||||
public String saveInterceptIpCfg(RedirectAttributes redirectAttributes,Model model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
||||
try {
|
||||
interceptCfgService.saveInterceptCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("save_failed", e);
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
@@ -144,9 +148,13 @@ public class InterceptController extends CommonController{
|
||||
try {
|
||||
interceptCfgService.auditInterceptIpCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
} catch ( Exception e) {
|
||||
logger.error("intercept ip audit failed",e);
|
||||
addMessage(redirectAttributes,"audit_failed");
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+functionId;
|
||||
|
||||
@@ -6,31 +6,17 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.PageLog;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.log.NtcIpLog;
|
||||
import com.nis.domain.log.SearchReport;
|
||||
import com.nis.domain.maat.LogRecvData;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.controller.report.TestBean;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/dashboard/traffic")
|
||||
@@ -111,17 +97,5 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
}
|
||||
return m;
|
||||
}
|
||||
@RequestMapping("userBehavior")
|
||||
public String list(@ModelAttribute("bean") SearchReport bean,Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
List<RequestInfo> requestInfos = requestInfoService.getAllRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
Page<TestBean> page=new Page<TestBean>(request, response);
|
||||
List<TestBean> list=new ArrayList<>();
|
||||
list.add(new TestBean());
|
||||
page.setList(list);
|
||||
model.addAttribute("page", page);
|
||||
model.addAttribute("bean", bean);
|
||||
return "/dashboard/trafficUserBehavior";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.nis.web.controller.dashboard;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.dashboard.NtcRadiusReport;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/traffic")
|
||||
public class TrafficStatisticsReportController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 用户行为查询
|
||||
* @param bean
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("userBehavior")
|
||||
public String list(@ModelAttribute("log") NtcRadiusReport bean,Model model, HttpServletRequest request, HttpServletResponse response) {
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
Map<String, Object> userJsonList = new HashMap<String, Object>();
|
||||
Map<String, Object> ipJsonList = new HashMap<String, Object>();
|
||||
String searchBusinessType = bean.getSearchBusinessType();
|
||||
if("2".endsWith(searchBusinessType)) {
|
||||
model.addAttribute("searchBusinessType", 2);// 用户查询
|
||||
}
|
||||
if("3".endsWith(searchBusinessType)) {
|
||||
model.addAttribute("searchBusinessType", 3);// IP查询
|
||||
}
|
||||
String url = Constants.DASHBOARD_URL+Constants.NTC_RADIUS_REPORT;
|
||||
String statTime = bean.getSearchFoundStartTime();
|
||||
String endTime = bean.getSearchFoundEndTime();
|
||||
String account = bean.getAccount();
|
||||
String nasIp = bean.getNasIp();
|
||||
String destUrl = url+ "?searchBusinessType=1";
|
||||
String userUrl = url+ "?searchBusinessType=2";
|
||||
String ipUrl =url + "?searchBusinessType=3";
|
||||
List list = new ArrayList();
|
||||
List userList = new ArrayList();
|
||||
List ipList = new ArrayList();
|
||||
try {
|
||||
if(StringUtil.isBlank(statTime)&&StringUtil.isBlank(endTime)) {
|
||||
statTime=DateUtils.getDate()+" 00:00:00"; // 默认今天
|
||||
endTime=DateUtils.getDateTime();
|
||||
bean.setSearchFoundStartTime(statTime);
|
||||
bean.setSearchFoundEndTime(endTime);
|
||||
}else {
|
||||
statTime=URLEncoder.encode(statTime, "UTF-8");
|
||||
endTime=URLEncoder.encode(endTime, "UTF-8");
|
||||
String paramUrl="&searchReportStartTime="+statTime+"&searchReportEndTime="+endTime;
|
||||
destUrl=destUrl+paramUrl;
|
||||
userUrl=userUrl+paramUrl;
|
||||
ipUrl=ipUrl+paramUrl;
|
||||
}
|
||||
// 用户及IP数据
|
||||
String string = HttpClientUtil.get(destUrl);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
list = (ArrayList) fromJsonList.get("data");
|
||||
Map map = (Map) list.get(0);
|
||||
List nasIpList=(List) map.get("nasIpList");
|
||||
List accountList=(List) map.get("accountList");
|
||||
model.addAttribute("nasIpList", nasIpList);
|
||||
model.addAttribute("accountList", accountList);
|
||||
if("2".endsWith(searchBusinessType)&&!StringUtil.isBlank(account)) {
|
||||
|
||||
String userString = HttpClientUtil.get(userUrl+"&searchAccount="+account);
|
||||
// 指定用户 查询
|
||||
Gson usergson = new GsonBuilder().create();
|
||||
userJsonList = usergson.fromJson(userString, new TypeToken<Map>(){}.getType());
|
||||
userList = (ArrayList) userJsonList.get("data");
|
||||
model.addAttribute("userList", userList);
|
||||
}
|
||||
if ("3".endsWith(searchBusinessType)&&!StringUtil.isBlank(nasIp)) {
|
||||
String ipString = HttpClientUtil.get(ipUrl+"&searchNasIp="+nasIp);
|
||||
// 指定IP查询
|
||||
Gson ipgson = new GsonBuilder().create();
|
||||
ipJsonList = ipgson.fromJson(ipString, new TypeToken<Map>(){}.getType());
|
||||
ipList = (ArrayList) ipJsonList.get("data");
|
||||
model.addAttribute("ipList", ipList);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "/dashboard/trafficUserBehavior";
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
HashMap<String, Object> m = new HashMap<String, Object>();
|
||||
List list = new ArrayList();
|
||||
String string;
|
||||
try {
|
||||
string = HttpClientUtil.get("http://localhost:8082/galaxy-service/service/log/v1/ntcRadiusReport?"
|
||||
+ "searchBusinessType=1&searchReportStartTime=2018-06-01+15%3A41%3A21&searchReportEndTime=2018-10-30+15%3A46%3A21");
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||
list = (ArrayList) fromJsonList.get("data");
|
||||
Map map = (Map) list.get(0);
|
||||
List nasIpList=(List) map.get("nasIpList");
|
||||
List accountList=(List) map.get("accountList");
|
||||
System.err.println(map.get("nasIpList"));
|
||||
System.err.println(map.get("accountList"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -66,13 +66,9 @@ public class DkBehaviorLogController extends BaseController{
|
||||
|
||||
//获取字典信息
|
||||
List<CodeResult> protocolList=CodeDicUtils.getCodeList("protocolCode");
|
||||
List<CodeResult> osList=CodeDicUtils.getCodeList("osCode");
|
||||
List<CodeResult> browserList=CodeDicUtils.getCodeList("browserCode");
|
||||
List<CodeResult> behaviorList=CodeDicUtils.getCodeList("behaviorCode");
|
||||
List<CodeResult> appList=CodeDicUtils.getCodeList("appCode");
|
||||
model.addAttribute("protocolList", protocolList);
|
||||
model.addAttribute("osList", osList);
|
||||
model.addAttribute("browserList", browserList);
|
||||
model.addAttribute("behaviorList", behaviorList);
|
||||
model.addAttribute("appList", appList);
|
||||
String url = "";
|
||||
|
||||
@@ -59,8 +59,6 @@ public class AppLogController extends BaseController{
|
||||
|
||||
//获取字典信息
|
||||
List<CodeResult> protocolList=CodeDicUtils.getCodeList("protocolCode");
|
||||
List<CodeResult> osList=CodeDicUtils.getCodeList("osCode");
|
||||
List<CodeResult> browserList=CodeDicUtils.getCodeList("browserCode");
|
||||
List<CodeResult> behaviorList=CodeDicUtils.getCodeList("behaviorCode");
|
||||
List<CodeResult> appList=CodeDicUtils.getCodeList("appCode");
|
||||
model.addAttribute("protocolList", protocolList);
|
||||
|
||||
@@ -19,7 +19,7 @@ public interface AsnIpCfgDao extends CrudDao<AsnIpCfg>{
|
||||
// public List<ConfigGroupInfo> findPolicyGroupInfosByType(@Param("groupId")Integer groupId);
|
||||
public List<Integer> findOtherIps(@Param("groupId")Integer groupId,@Param("cfgId")Integer cfgId);
|
||||
public List<Integer> countValidIPs(@Param("groups")String groups,@Param("ids")String ids);
|
||||
public ConfigGroupInfo getInfoByAsnNo(@Param("asnId")Integer asnNo);
|
||||
public List<AsnIpCfg> getByAsnGroup(@Param("groupId")Integer groupId,@Param("asnId")Integer asnNo);
|
||||
public void deleteByAsnGroup(@Param("groupId")Integer groupId,@Param("asnId")Integer asnNo);
|
||||
public ConfigGroupInfo getInfoByAsnNo(@Param("asnId")Long asnNo);
|
||||
public List<AsnIpCfg> getByAsnGroup(@Param("groupId")long groupId,@Param("asnId")long asnNo);
|
||||
public void deleteByAsnGroup(@Param("groupId")long groupId,@Param("asnId")long asnNo);
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
from asn_ip_cfg r
|
||||
where r.cfg_id in (${ids}) and is_valid !=-1
|
||||
</select>
|
||||
<select id="getByAsnGroup" resultMap="asnIpCfgMap" parameterType="java.lang.Integer" >
|
||||
<select id="getByAsnGroup" resultMap="asnIpCfgMap" parameterType="java.lang.Long" >
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from asn_ip_cfg r where r.is_valid!=-1 and r.asn_ip_group=#{groupId} and r.user_region1=#{asnId}
|
||||
@@ -399,7 +399,7 @@
|
||||
<!-- <update id="deleteByAsnGroup" parameterType="java.lang.Integer" >
|
||||
update asn_ip_cfg set is_valid=-1 where asn_ip_group=#{groupId} and user_region1=#{asnId}
|
||||
</update> -->
|
||||
<delete id="deleteByAsnGroup" parameterType="java.lang.Integer" >
|
||||
<delete id="deleteByAsnGroup" parameterType="java.lang.Long" >
|
||||
delete from asn_ip_cfg where asn_ip_group=#{groupId} and user_region1=#{asnId}
|
||||
</delete>
|
||||
<select id="findOtherIps" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
@@ -411,7 +411,7 @@
|
||||
<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>
|
||||
<select id="getInfoByAsnNo" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Integer">
|
||||
<select id="getInfoByAsnNo" resultType="com.nis.domain.specific.ConfigGroupInfo" parameterType="java.lang.Long">
|
||||
select id,group_id,group_name,is_issued,insert_time,update_time,group_type,compile_id,asn_id
|
||||
from config_group_info c where c.asn_id= #{asnId} and c.group_type=4
|
||||
</select>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="service_group_id" property="serviceGroupId" jdbcType="INTEGER" />
|
||||
<result column="asn_no" property="asnNo" jdbcType="INTEGER" />
|
||||
<result column="asn_no" property="asnNo" jdbcType="BIGINT" />
|
||||
<result column="description" property="description" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<sql id="PolicyGroupInfoColumns">
|
||||
|
||||
@@ -13,8 +13,10 @@
|
||||
<result column="crl" property="crl" jdbcType="VARCHAR" />
|
||||
<result column="issuer" property="issuer" jdbcType="VARCHAR" />
|
||||
<result column="subject" property="subject" jdbcType="VARCHAR" />
|
||||
<result column="not_before_time" property="notBeforeTime" jdbcType="TIMESTAMP" />
|
||||
<result column="not_after_time" property="notAfterTime" jdbcType="TIMESTAMP" />
|
||||
<result column="not_before_time" property="notBeforeTime" jdbcType="VARCHAR" />
|
||||
<result column="not_after_time" property="notAfterTime" jdbcType="VARCHAR" />
|
||||
<result column="cn" property="cn" jdbcType="VARCHAR" />
|
||||
<result column="alt_name" property="altName" jdbcType="VARCHAR" />
|
||||
<result column="action" property="action" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
||||
@@ -48,6 +50,8 @@
|
||||
,r.subject
|
||||
,r.not_before_time
|
||||
,r.not_after_time
|
||||
,r.cn
|
||||
,r.alt_name
|
||||
,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
|
||||
@@ -201,6 +205,8 @@
|
||||
subject,
|
||||
not_before_time,
|
||||
not_after_time,
|
||||
cn,
|
||||
alt_name,
|
||||
cfg_type,
|
||||
compile_Id,
|
||||
cfg_region_code
|
||||
@@ -232,8 +238,10 @@
|
||||
#{crl, jdbcType=VARCHAR},
|
||||
#{issuer, jdbcType=VARCHAR},
|
||||
#{subject, jdbcType=VARCHAR},
|
||||
#{notBeforeTime,jdbcType=TIMESTAMP},
|
||||
#{notAfterTime,jdbcType=TIMESTAMP},
|
||||
#{notBeforeTime,jdbcType=VARCHAR},
|
||||
#{notAfterTime,jdbcType=VARCHAR},
|
||||
#{cn,jdbcType=VARCHAR},
|
||||
#{altName,jdbcType=VARCHAR},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
#{cfgRegionCode,jdbcType=INTEGER}
|
||||
@@ -301,10 +309,10 @@
|
||||
<if test="keyringType != null" >
|
||||
keyring_type = #{keyringType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="privateKeyFile != null" >
|
||||
<if test="privateKeyFile != null and privateKeyFile !=''" >
|
||||
private_key_file = #{privateKeyFile,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="publicKeyFile != null" >
|
||||
<if test="publicKeyFile != null and publicKeyFile !=''" >
|
||||
public_key_file = #{publicKeyFile,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="expireAfter != null" >
|
||||
@@ -313,8 +321,26 @@
|
||||
<if test="publicKeyAlgo != null" >
|
||||
public_key_algo = #{publicKeyAlgo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="crl != null" >
|
||||
<if test="crl != null and crl !=''" >
|
||||
crl = #{crl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="issuer != null and issuer !=''" >
|
||||
issuer = #{issuer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="subject != null and subject !=''" >
|
||||
subject = #{subject,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="notBeforeTime != null and notBeforeTime !=''" >
|
||||
not_before_time = #{notBeforeTime,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="notAfterTime != null and notAfterTime !=''" >
|
||||
not_after_time = #{notAfterTime,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cn != null and cn !=''" >
|
||||
cn = #{cn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="altName != null and altName !=''" >
|
||||
alt_name = #{altName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
|
||||
@@ -282,9 +282,9 @@
|
||||
<if test="httpReqBody!=null">
|
||||
AND a.compile_id in (select f.compile_id from http_body_cfg f
|
||||
<where>
|
||||
and cfg_type='NTC_HTTP_REQ_BODY'
|
||||
AND f.cfg_type = #{httpReqBody.cfgType}
|
||||
<if test="httpReqBody.cfgKeywords != null and httpReqBody.cfgKeywords != ''">
|
||||
and REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpReqBody.cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
AND REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpReqBody.cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
|
||||
</where>
|
||||
@@ -293,9 +293,9 @@
|
||||
<if test="httpResBody!=null">
|
||||
AND a.compile_id in (select f.compile_id from http_body_cfg f
|
||||
<where>
|
||||
and cfg_type='NTC_HTTP_RES_BODY'
|
||||
AND f.cfg_type = #{httpResBody.cfgType}
|
||||
<if test="httpResBody.cfgKeywords != null and httpResBody.cfgKeywords != ''">
|
||||
and REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpResBody.cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
AND REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpResBody.cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
|
||||
</where>
|
||||
@@ -304,8 +304,9 @@
|
||||
<if test="httpReqHdr!=null">
|
||||
AND a.compile_id in (select f.compile_id from http_req_head_cfg f
|
||||
<where>
|
||||
AND f.cfg_type = #{httpReqHdr.cfgType}
|
||||
<if test="httpReqHdr.cfgKeywords != null and httpReqHdr.cfgKeywords != ''">
|
||||
REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpReqHdr.cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
AND REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpReqHdr.cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
</where>
|
||||
)
|
||||
@@ -313,8 +314,9 @@
|
||||
<if test="httpResHdr!=null">
|
||||
AND a.compile_id in (select f.compile_id from http_res_head_cfg f
|
||||
<where>
|
||||
AND f.cfg_type = #{httpResHdr.cfgType}
|
||||
<if test="httpResHdr.cfgKeywords != null and httpResHdr.cfgKeywords != ''">
|
||||
REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpResHdr.cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
AND REPLACE(f.cfg_keywords,'***and***','|') like concat(concat('%',#{httpResHdr.cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
</where>
|
||||
)
|
||||
|
||||
@@ -60,15 +60,6 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void save(List<AsnIpCfg> entitys){
|
||||
Date createTime=new Date();
|
||||
List<Integer> idList=ConfigServiceUtil.getId(3, entitys.size());
|
||||
int index=0;
|
||||
for(AsnIpCfg entity:entitys) {
|
||||
entity.setCreateTime(createTime);
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
entity.setRegionId(idList.get(index));
|
||||
index++;
|
||||
}
|
||||
this.saveBatch(entitys, AsnIpCfgDao.class);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
@@ -88,28 +79,32 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAsnIpBatch(Map<String,List<AsnIpCfg>> cfgs) {
|
||||
public void saveAsnIpBatch(Map<String,List<AsnIpCfg>> cfgs,int total) {
|
||||
List<AsnIpCfg> toDelAsnIpCfgs=Lists.newArrayList();
|
||||
List<AsnIpCfg> toSaveAsnIpCfgs=Lists.newArrayList();
|
||||
List<SysDataDictionaryItem> isImportAll=DictUtils.getDictList("IS_ASN_IP_IMPORT_ALL");
|
||||
List<Integer> idList=ConfigServiceUtil.getId(3, total);
|
||||
int ind=0;
|
||||
for(Entry<String,List<AsnIpCfg>> entry:cfgs.entrySet()) {
|
||||
Integer asnNo=Integer.parseInt(entry.getKey());
|
||||
Long asnNo=Long.parseLong(entry.getKey());
|
||||
ConfigGroupInfo configGroupInfo=this.getConfigGroupInfoByAsnNo(asnNo);
|
||||
if(configGroupInfo==null) {//不存在则新增
|
||||
PolicyGroupInfo info=new PolicyGroupInfo();
|
||||
info.setAsnNo(Integer.parseInt(entry.getKey()));
|
||||
info.setAsnNo(Long.parseLong(entry.getKey()));
|
||||
info.setDescription("Create by import excel");
|
||||
info.setGroupName("Import"+asnNo);
|
||||
info.setGroupType(4);
|
||||
this.saveAsnGroup(info);
|
||||
configGroupInfo=this.getConfigGroupInfoByAsnNo(asnNo);
|
||||
configGroupInfo=this.saveAsnGroup(info);
|
||||
}
|
||||
for(AsnIpCfg cfg:entry.getValue()) {
|
||||
cfg.setAsnIpGroup(configGroupInfo.getGroupId());
|
||||
cfg.setRegionId(idList.get(ind));
|
||||
if(configGroupInfo.getIsIssued()==0)
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
else
|
||||
else {
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
ind++;
|
||||
}
|
||||
if(isImportAll.get(0).getItemCode().equals("1")) {//全量下发,删除已有的
|
||||
if(configGroupInfo.getIsIssued()==1) {//已下发
|
||||
@@ -166,8 +161,9 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
}
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAsnGroup(PolicyGroupInfo entity) throws MaatConvertException{
|
||||
public ConfigGroupInfo saveAsnGroup(PolicyGroupInfo entity) throws MaatConvertException{
|
||||
entity.setIsValid(1);
|
||||
ConfigGroupInfo group=new ConfigGroupInfo();
|
||||
//新增
|
||||
Date createTime=new Date();
|
||||
entity.setCreatorId(UserUtils.getUser().getId());
|
||||
@@ -183,7 +179,6 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
}
|
||||
entity.setServiceGroupId(serviceGroupId);
|
||||
//新增协议分组
|
||||
ConfigGroupInfo group = new ConfigGroupInfo();
|
||||
group.setGroupId(serviceGroupId);
|
||||
group.setGroupName(entity.getGroupName());
|
||||
group.setIsIssued(0);
|
||||
@@ -192,7 +187,7 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
specificServiceCfgDao.insertConfigGroupInfo(group);
|
||||
policyGroupInfoDao.insert(entity);
|
||||
}
|
||||
|
||||
return group;
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAsnIpCfg(CfgIndexInfo entity) {
|
||||
@@ -201,6 +196,8 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
if(groupInfo==null) {
|
||||
throw new RuntimeException("ConfigGroupInfo is null!");
|
||||
}
|
||||
List<Integer> idList=ConfigServiceUtil.getId(3, entity.getAsnIpCfgs().size());
|
||||
int index=0;
|
||||
if(groupInfo.getIsIssued()==1) {//如果已经下发,则需要下到综合服务中
|
||||
if(entity.getAsnIpCfgs()!=null) {
|
||||
for(AsnIpCfg cfg:entity.getAsnIpCfgs()) {
|
||||
@@ -214,6 +211,8 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
cfg.setCreatorId(entity.getCurrentUser().getId());
|
||||
cfg.setAsnIpGroup(entity.getAsnIpGroup());
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
cfg.setRegionId(idList.get(index));
|
||||
index++;
|
||||
}
|
||||
}
|
||||
this.save(entity.getAsnIpCfgs());
|
||||
@@ -226,6 +225,8 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
cfg.setCreatorId(entity.getCurrentUser().getId());
|
||||
cfg.setAsnIpGroup(entity.getAsnIpGroup().intValue());
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setRegionId(idList.get(index));
|
||||
index++;
|
||||
}
|
||||
}
|
||||
this.save(entity.getAsnIpCfgs());
|
||||
@@ -281,19 +282,19 @@ public class AsnIpCfgService extends CrudService<CrudDao<AsnIpCfg>, AsnIpCfg> {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public ConfigGroupInfo getConfigGroupInfoByAsnNo(Integer asnNo) {
|
||||
public ConfigGroupInfo getConfigGroupInfoByAsnNo(Long asnNo) {
|
||||
return asnIpCfgDao.getInfoByAsnNo(asnNo);
|
||||
}
|
||||
public List<AsnIpCfg> getByAsnGroup(Integer groupId,Integer asnNo) {
|
||||
public List<AsnIpCfg> getByAsnGroup(Integer groupId,Long asnNo) {
|
||||
if(groupId==null||asnNo==null) {
|
||||
throw new RuntimeException("groupId or asnNo is null!");
|
||||
}
|
||||
return asnIpCfgDao.getByAsnGroup(groupId,asnNo);
|
||||
return asnIpCfgDao.getByAsnGroup(groupId.longValue(),asnNo.longValue());
|
||||
}
|
||||
public void deleteByAsnGroup(Integer groupId,Integer asnNo) {
|
||||
public void deleteByAsnGroup(Integer groupId,Long asnNo) {
|
||||
if(groupId==null||asnNo==null) {
|
||||
throw new RuntimeException("groupId or asnNo is null!");
|
||||
}
|
||||
asnIpCfgDao.deleteByAsnGroup(groupId,asnNo);
|
||||
asnIpCfgDao.deleteByAsnGroup(groupId.longValue(),asnNo.longValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.nis.domain.configuration.AppTcpCfg;
|
||||
import com.nis.domain.configuration.AppTopicDomainCfg;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
@@ -512,7 +513,15 @@ public class AppCfgService extends BaseService {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Transactional(readOnly = false, rollbackFor = RuntimeException.class)
|
||||
public void saveAppDomainCfg(List<BaseStringCfg<?>> cfgs) throws Exception {
|
||||
for(BaseStringCfg cfg:cfgs) {
|
||||
AppDomainCfg entity=new AppDomainCfg();
|
||||
BeanUtils.copyProperties(cfg, entity);
|
||||
appCfgDao.insertAppDomainCfg(entity);
|
||||
}
|
||||
|
||||
}
|
||||
@Transactional(readOnly = false, rollbackFor = RuntimeException.class)
|
||||
public void saveOrUpdateAppDomainCfg(AppDomainCfg entity) throws Exception {
|
||||
// 设置区域运营商信息
|
||||
|
||||
@@ -100,6 +100,19 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
|
||||
// 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL)
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
|
||||
entity.setPage(page);
|
||||
// 设置cfg_type,用于列表检索时区分
|
||||
if(entity.getHttpReqHdr() != null){
|
||||
entity.getHttpReqHdr().setCfgType(Constants.HTTP_REDIRECT_REQ_HEAD_REGION);
|
||||
}
|
||||
if(entity.getHttpReqBody() != null){
|
||||
entity.getHttpReqBody().setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION);
|
||||
}
|
||||
if(entity.getHttpResHdr() != null){
|
||||
entity.getHttpResHdr().setCfgType(Constants.HTTP_REDIRECT_RES_HEAD_REGION);
|
||||
}
|
||||
if(entity.getHttpResBody() != null){
|
||||
entity.getHttpResBody().setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION);
|
||||
}
|
||||
List<CfgIndexInfo> list = websiteCfgDao.getWebsiteList(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
|
||||
@@ -161,6 +161,19 @@ public class WebsiteCfgService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||
// 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL)
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
|
||||
entity.setPage(page);
|
||||
// 设置cfg_type,用于列表检索时区分
|
||||
if(entity.getHttpReqHdr() != null){
|
||||
entity.getHttpReqHdr().setCfgType(Constants.HTTP_REQ_HEAD_REGION);
|
||||
}
|
||||
if(entity.getHttpReqBody() != null){
|
||||
entity.getHttpReqBody().setCfgType(Constants.HTTP_REQ_BODY_REGION);
|
||||
}
|
||||
if(entity.getHttpResHdr() != null){
|
||||
entity.getHttpResHdr().setCfgType(Constants.HTTP_RES_HEAD_REGION);
|
||||
}
|
||||
if(entity.getHttpResBody() != null){
|
||||
entity.getHttpResBody().setCfgType(Constants.HTTP_RES_BODY_REGION);
|
||||
}
|
||||
List<CfgIndexInfo> list = websiteCfgDao.getWebsiteList(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
|
||||
Reference in New Issue
Block a user