Merge branch 'develop' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git into develop
This commit is contained in:
@@ -167,7 +167,7 @@ public class SysUser extends BaseEntity<SysUser> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAdmin(String loginId){
|
public static boolean isAdmin(String loginId){
|
||||||
return loginId != null && "admin".equals(loginId);
|
return loginId != null && "ceiec".equals(loginId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import java.util.Date;
|
|||||||
|
|
||||||
import com.nis.domain.configuration.BaseCfg;
|
import com.nis.domain.configuration.BaseCfg;
|
||||||
import com.nis.domain.configuration.CfgIndexInfo;
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: PolicyGroupInfo.java
|
* @ClassName: PolicyGroupInfo.java
|
||||||
@@ -18,9 +19,12 @@ public class PolicyGroupInfo extends BaseCfg<PolicyGroupInfo> implements Seriali
|
|||||||
private static final long serialVersionUID = 7931466570918016654L;
|
private static final long serialVersionUID = 7931466570918016654L;
|
||||||
|
|
||||||
private Integer groupId;
|
private Integer groupId;
|
||||||
|
@ExcelField(title="group_name",sort=1)
|
||||||
private String groupName;
|
private String groupName;
|
||||||
|
@ExcelField(title="group_type",dictType="GROUP_TYPE",sort=2)
|
||||||
private Integer groupType;
|
private Integer groupType;
|
||||||
private Integer serviceGroupId;
|
private Integer serviceGroupId;
|
||||||
|
@ExcelField(title="desc",sort=4)
|
||||||
private String description;
|
private String description;
|
||||||
private Long asnNo;
|
private Long asnNo;
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.nis.domain.SysMenu;
|
|||||||
import com.nis.domain.SysUser;
|
import com.nis.domain.SysUser;
|
||||||
import com.nis.util.Configurations;
|
import com.nis.util.Configurations;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
/**
|
/**
|
||||||
* 业务辅助表-业务字典信息表
|
* 业务辅助表-业务字典信息表
|
||||||
* @author zsl
|
* @author zsl
|
||||||
@@ -21,16 +22,24 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
|
|||||||
private static final long serialVersionUID = 4680466118906894338L;
|
private static final long serialVersionUID = 4680466118906894338L;
|
||||||
|
|
||||||
private Integer serviceDictId; //service_dict_id 字典ID int N 主键,自增
|
private Integer serviceDictId; //service_dict_id 字典ID int N 主键,自增
|
||||||
|
@ExcelField(title="item_type",dictType="SERVICE_DICT_ITM_TYPE",sort=3)
|
||||||
private Integer itemType; //item_type 数据类型 int N 1:分类 2:性质 3:标签
|
private Integer itemType; //item_type 数据类型 int N 1:分类 2:性质 3:标签
|
||||||
private String itemCode; //item_code编码 varchar(64) N
|
private String itemCode; //item_code编码 varchar(64) N
|
||||||
|
@ExcelField(title="config_content",sort=1)
|
||||||
private String itemValue; //item_value 编码对应值 varchar2(64) N
|
private String itemValue; //item_value 编码对应值 varchar2(64) N
|
||||||
|
@ExcelField(title="desc",sort=2)
|
||||||
private String itemDesc; //item_desc 描述信息 varcahr2(128) Y
|
private String itemDesc; //item_desc 描述信息 varcahr2(128) Y
|
||||||
private ServiceDictInfo parent; //parent_id 父ID number(9) N 无父属性,默认填0
|
private ServiceDictInfo parent; //parent_id 父ID number(9) N 无父属性,默认填0
|
||||||
|
@ExcelField(title="is_leaf",dictType="INT_YES_NO",sort=4)
|
||||||
private Integer isLeaf; //is_leaf 是否叶子节点 int N 0-否 1-是;只有一级填0;
|
private Integer isLeaf; //is_leaf 是否叶子节点 int N 0-否 1-是;只有一级填0;
|
||||||
private Integer isValid; //is_valid 有效标志 int N 1-有效 0-无效
|
private Integer isValid; //is_valid 有效标志 int N 1-有效 0-无效
|
||||||
|
|
||||||
private SysUser serviceDictCreator; //creator_id 创建人员 int N 取自sys_user.id
|
private SysUser serviceDictCreator; //creator_id 创建人员 int N 取自sys_user.id
|
||||||
|
@ExcelField(title="create_time",sort=6)
|
||||||
private Date createTime; //create_time 配置时间 date N
|
private Date createTime; //create_time 配置时间 date N
|
||||||
|
|
||||||
private SysUser serviceDictEditor; //editor_id 修改人员 int Y 取自sys_user.id
|
private SysUser serviceDictEditor; //editor_id 修改人员 int Y 取自sys_user.id
|
||||||
|
@ExcelField(title="edit_time",sort=8)
|
||||||
private Date editTime; //edit_time 修改时间 date Y
|
private Date editTime; //edit_time 修改时间 date Y
|
||||||
private Integer levelNo; //层级
|
private Integer levelNo; //层级
|
||||||
private List<ServiceDictInfo> childrenList = new ArrayList<ServiceDictInfo>();//子列表
|
private List<ServiceDictInfo> childrenList = new ArrayList<ServiceDictInfo>();//子列表
|
||||||
@@ -41,6 +50,11 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
|
|||||||
private Date editEndDate; // 修改结束日期
|
private Date editEndDate; // 修改结束日期
|
||||||
|
|
||||||
private String showSequence; //显示序号
|
private String showSequence; //显示序号
|
||||||
|
@ExcelField(title="creator",sort=5)
|
||||||
|
private String creatorName;
|
||||||
|
@ExcelField(title="editor",sort=7)
|
||||||
|
private String editorName;
|
||||||
|
|
||||||
|
|
||||||
private String pNames;//父节点名称
|
private String pNames;//父节点名称
|
||||||
/**
|
/**
|
||||||
@@ -49,6 +63,20 @@ public class ServiceDictInfo extends BaseEntity<ServiceDictInfo>{
|
|||||||
*/
|
*/
|
||||||
private List<Integer> conditionType;
|
private List<Integer> conditionType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public String getCreatorName() {
|
||||||
|
return creatorName;
|
||||||
|
}
|
||||||
|
public void setCreatorName(String creatorName) {
|
||||||
|
this.creatorName = creatorName;
|
||||||
|
}
|
||||||
|
public String getEditorName() {
|
||||||
|
return editorName;
|
||||||
|
}
|
||||||
|
public void setEditorName(String editorName) {
|
||||||
|
this.editorName = editorName;
|
||||||
|
}
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public String getpNames() {
|
public String getpNames() {
|
||||||
return pNames;
|
return pNames;
|
||||||
|
|||||||
@@ -43,6 +43,19 @@ public class AppComplexFeatureCfg extends BaseCfg<AppComplexFeatureCfg> {
|
|||||||
private String appName;
|
private String appName;
|
||||||
private List<AppIpCfg> ipPortList = new ArrayList();
|
private List<AppIpCfg> ipPortList = new ArrayList();
|
||||||
private String cfgRegionCode1;
|
private String cfgRegionCode1;
|
||||||
|
//以下参数为APP PAYLOAD L3_HEADER的特殊属性(使用偏移表达式处理)
|
||||||
|
private String ver;
|
||||||
|
private String ihl;
|
||||||
|
private String tos;
|
||||||
|
private String totalLength;
|
||||||
|
private String flags;
|
||||||
|
private String fragmentOffset;
|
||||||
|
private String protocol;
|
||||||
|
private String icmpType;
|
||||||
|
private String icmpCode;
|
||||||
|
private String icmpIdentifier;
|
||||||
|
private String headerType;
|
||||||
|
|
||||||
public String getCfgRegionCode1() {
|
public String getCfgRegionCode1() {
|
||||||
return cfgRegionCode1;
|
return cfgRegionCode1;
|
||||||
}
|
}
|
||||||
@@ -198,4 +211,93 @@ public class AppComplexFeatureCfg extends BaseCfg<AppComplexFeatureCfg> {
|
|||||||
this.ipPortList = ipPortList;
|
this.ipPortList = ipPortList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getVer() {
|
||||||
|
return ver;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVer(String ver) {
|
||||||
|
this.ver = ver;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIhl() {
|
||||||
|
return ihl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIhl(String ihl) {
|
||||||
|
this.ihl = ihl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTos() {
|
||||||
|
return tos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTos(String tos) {
|
||||||
|
this.tos = tos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTotalLength() {
|
||||||
|
return totalLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalLength(String totalLength) {
|
||||||
|
this.totalLength = totalLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlags() {
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlags(String flags) {
|
||||||
|
this.flags = flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFragmentOffset() {
|
||||||
|
return fragmentOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFragmentOffset(String fragmentOffset) {
|
||||||
|
this.fragmentOffset = fragmentOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProtocol() {
|
||||||
|
return protocol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProtocol(String protocol) {
|
||||||
|
this.protocol = protocol;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIcmpType() {
|
||||||
|
return icmpType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIcmpType(String icmpType) {
|
||||||
|
this.icmpType = icmpType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIcmpCode() {
|
||||||
|
return icmpCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIcmpCode(String icmpCode) {
|
||||||
|
this.icmpCode = icmpCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIcmpIdentifier() {
|
||||||
|
return icmpIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIcmpIdentifier(String icmpIdentifier) {
|
||||||
|
this.icmpIdentifier = icmpIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHeaderType() {
|
||||||
|
return headerType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeaderType(String headerType) {
|
||||||
|
this.headerType = headerType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ public class AvFileSampleCfg extends BaseCfg<AvFileSampleCfg> {
|
|||||||
private String indexTable="av_file_sample_cfg";
|
private String indexTable="av_file_sample_cfg";
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("srcFile")
|
@SerializedName("srcFile")
|
||||||
@ExcelField(title="src_file",sort=2)
|
@ExcelField(title="src_file",sort=3)
|
||||||
private String srcUrl;
|
private String srcUrl;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("dstFile")
|
@SerializedName("dstFile")
|
||||||
@ExcelField(title="sample_file",sort=3)
|
@ExcelField(title="sample_file",sort=4)
|
||||||
private String sampleUrl;
|
private String sampleUrl;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("srcFileMd5")
|
@SerializedName("srcFileMd5")
|
||||||
|
|||||||
@@ -261,18 +261,20 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
|||||||
*/
|
*/
|
||||||
@ExcelField(title="do_log",dictType="DO_LOG",sort=30)
|
@ExcelField(title="do_log",dictType="DO_LOG",sort=30)
|
||||||
protected Integer doLog = Constants.MAAT_CFG_DOLOG_DEFAULT;
|
protected Integer doLog = Constants.MAAT_CFG_DOLOG_DEFAULT;
|
||||||
|
@ExcelField(title="do_blacklist",dictType="DO_BLACKLIST",sort=31)
|
||||||
|
protected Integer doBlackList=Constants.MAAT_CFG_DOLOG_DOBLACKLIST_DEFAULT;
|
||||||
|
|
||||||
protected Integer groupId;//仅用于copy属性使用
|
protected Integer groupId;//仅用于copy属性使用
|
||||||
protected Integer regionId;//仅用于copy属性使用
|
protected Integer regionId;//仅用于copy属性使用
|
||||||
// protected Integer numberRegionGroupId;//仅用于copy属性使用
|
protected Integer numberRegionGroupId;//仅用于copy属性使用
|
||||||
protected Integer numberRegionRegionId;//仅用于copy属性使用
|
protected Integer numberRegionRegionId;//仅用于copy属性使用
|
||||||
|
|
||||||
// public Integer getNumberRegionGroupId() {
|
public Integer getNumberRegionGroupId() {
|
||||||
// return numberRegionGroupId;
|
return numberRegionGroupId;
|
||||||
// }
|
}
|
||||||
// public void setNumberRegionGroupId(Integer numberRegionGroupId) {
|
public void setNumberRegionGroupId(Integer numberRegionGroupId) {
|
||||||
// this.numberRegionGroupId = numberRegionGroupId;
|
this.numberRegionGroupId = numberRegionGroupId;
|
||||||
// }
|
}
|
||||||
public Integer getNumberRegionRegionId() {
|
public Integer getNumberRegionRegionId() {
|
||||||
return numberRegionRegionId;
|
return numberRegionRegionId;
|
||||||
}
|
}
|
||||||
@@ -964,5 +966,11 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
|||||||
public void setCancelRequestId(Integer cancelRequestId) {
|
public void setCancelRequestId(Integer cancelRequestId) {
|
||||||
this.cancelRequestId = cancelRequestId;
|
this.cancelRequestId = cancelRequestId;
|
||||||
}
|
}
|
||||||
|
public Integer getDoBlackList() {
|
||||||
|
return doBlackList;
|
||||||
|
}
|
||||||
|
public void setDoBlackList(Integer doBlackList) {
|
||||||
|
this.doBlackList = doBlackList;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,28 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
|||||||
protected Integer appCode;//仅用于copy属性使用
|
protected Integer appCode;//仅用于copy属性使用
|
||||||
protected Integer behavCode;//仅用于copy属性使用
|
protected Integer behavCode;//仅用于copy属性使用
|
||||||
protected Integer specServiceId;//仅用于copy属性使用
|
protected Integer specServiceId;//仅用于copy属性使用
|
||||||
|
protected String antiddosProtocol;//仅用于copy属性使用
|
||||||
|
protected Long bpsThreadshold;//仅用于copy属性使用
|
||||||
|
protected Long ppsThreadshold;//仅用于copy属性使用
|
||||||
|
|
||||||
|
public String getAntiddosProtocol() {
|
||||||
|
return antiddosProtocol;
|
||||||
|
}
|
||||||
|
public void setAntiddosProtocol(String antiddosProtocol) {
|
||||||
|
this.antiddosProtocol = antiddosProtocol;
|
||||||
|
}
|
||||||
|
public Long getBpsThreadshold() {
|
||||||
|
return bpsThreadshold;
|
||||||
|
}
|
||||||
|
public void setBpsThreadshold(Long bpsThreadshold) {
|
||||||
|
this.bpsThreadshold = bpsThreadshold;
|
||||||
|
}
|
||||||
|
public Long getPpsThreadshold() {
|
||||||
|
return ppsThreadshold;
|
||||||
|
}
|
||||||
|
public void setPpsThreadshold(Long ppsThreadshold) {
|
||||||
|
this.ppsThreadshold = ppsThreadshold;
|
||||||
|
}
|
||||||
public Integer getAppCode() {
|
public Integer getAppCode() {
|
||||||
return appCode;
|
return appCode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,14 @@ public class BaseStringCfg<T> extends BaseCfg<T> {
|
|||||||
protected Integer behavCode;//仅用于copy属性使用
|
protected Integer behavCode;//仅用于copy属性使用
|
||||||
protected Integer specServiceId;//仅用于copy属性使用
|
protected Integer specServiceId;//仅用于copy属性使用
|
||||||
protected String domain;//仅用于copy属性使用
|
protected String domain;//仅用于copy属性使用
|
||||||
|
protected Integer dnsStrategyId;//仅用作复制属性使用
|
||||||
|
|
||||||
|
public Integer getDnsStrategyId() {
|
||||||
|
return dnsStrategyId;
|
||||||
|
}
|
||||||
|
public void setDnsStrategyId(Integer dnsStrategyId) {
|
||||||
|
this.dnsStrategyId = dnsStrategyId;
|
||||||
|
}
|
||||||
public String getDomain() {
|
public String getDomain() {
|
||||||
return domain;
|
return domain;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,159 @@
|
|||||||
|
/**
|
||||||
|
*@Title: HttpDomainConfig.java
|
||||||
|
*@Package com.nis.domain.restful
|
||||||
|
*@Description TODO
|
||||||
|
*@author dell
|
||||||
|
*@date 2018年2月5日 下午5:33:05
|
||||||
|
*@version 版本号
|
||||||
|
*/
|
||||||
|
package com.nis.domain.configuration;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName: HttpDomainConfig.java
|
||||||
|
* @Description: TODO
|
||||||
|
* @author (dell)
|
||||||
|
* @date 2018年2月5日 下午5:33:05
|
||||||
|
* @version V1.0
|
||||||
|
*/
|
||||||
|
public class CachePolicyUserRegion extends BaseCfg<CachePolicyUserRegion> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -1741829305216502322L;
|
||||||
|
|
||||||
|
@ExcelField(title="cache_cookied_cont",dictType="CACHE_COOKIED_CONT",sort=7)
|
||||||
|
private String cache_cookied_cont;
|
||||||
|
@ExcelField(title="cache_dyn_url",dictType="CACHE_DYN_URL",sort=6)
|
||||||
|
private String cache_dyn_url;
|
||||||
|
@ExcelField(title="force_caching",dictType="FORCE_CACHING",sort=10)
|
||||||
|
private String force_caching;
|
||||||
|
@ExcelField(title="ignore_req_nocache",dictType="IGNORE_REQ_NOCACHE",sort=8)
|
||||||
|
private String ignore_req_nocache;
|
||||||
|
@ExcelField(title="ignore_res_nocache",dictType="IGNORE_RES_NOCACHE",sort=9)
|
||||||
|
private String ignore_res_nocache;
|
||||||
|
@ExcelField(title="inactive_time",sort=14)
|
||||||
|
private String inactive_time;
|
||||||
|
@ExcelField(title="max_cache_obj_size",sort=15)
|
||||||
|
private String max_cache_obj_size;
|
||||||
|
@ExcelField(title="max_cache_size",sort=13)
|
||||||
|
private String max_cache_size;
|
||||||
|
@ExcelField(title="min_use",sort=11)
|
||||||
|
private String min_use;
|
||||||
|
@ExcelField(title="no_revalidate",dictType="CACHE_NO_REVALIDATE",sort=5)
|
||||||
|
private String no_revalidate;
|
||||||
|
@ExcelField(title="pinning_time",dictType="",sort=12)
|
||||||
|
private String pinning_time;
|
||||||
|
@ExcelField(title="ignore_query_string",sort=3)
|
||||||
|
private String ignore_qs;
|
||||||
|
@ExcelField(title="include_cookie",sort=4)
|
||||||
|
private String cookie;
|
||||||
|
|
||||||
|
private Map<String,String> cache_key;
|
||||||
|
|
||||||
|
private BaseStringCfg strCfg;
|
||||||
|
|
||||||
|
@ExcelField(title="action",sort=2)
|
||||||
|
protected String actionCode;
|
||||||
|
|
||||||
|
|
||||||
|
public String getActionCode() {
|
||||||
|
return actionCode;
|
||||||
|
}
|
||||||
|
public void setActionCode(String actionCode) {
|
||||||
|
this.actionCode = actionCode;
|
||||||
|
}
|
||||||
|
public BaseStringCfg getStrCfg() {
|
||||||
|
return strCfg;
|
||||||
|
}
|
||||||
|
public void setStrCfg(BaseStringCfg strCfg) {
|
||||||
|
this.strCfg = strCfg;
|
||||||
|
}
|
||||||
|
public Map<String, String> getCache_key() {
|
||||||
|
return cache_key;
|
||||||
|
}
|
||||||
|
public void setCache_key(Map<String, String> cache_key) {
|
||||||
|
this.cache_key = cache_key;
|
||||||
|
}
|
||||||
|
public String getIgnore_res_nocache() {
|
||||||
|
return ignore_res_nocache;
|
||||||
|
}
|
||||||
|
public void setIgnore_res_nocache(String ignore_res_nocache) {
|
||||||
|
this.ignore_res_nocache = ignore_res_nocache;
|
||||||
|
}
|
||||||
|
public String getCache_cookied_cont() {
|
||||||
|
return cache_cookied_cont;
|
||||||
|
}
|
||||||
|
public void setCache_cookied_cont(String cache_cookied_cont) {
|
||||||
|
this.cache_cookied_cont = cache_cookied_cont;
|
||||||
|
}
|
||||||
|
public String getCache_dyn_url() {
|
||||||
|
return cache_dyn_url;
|
||||||
|
}
|
||||||
|
public void setCache_dyn_url(String cache_dyn_url) {
|
||||||
|
this.cache_dyn_url = cache_dyn_url;
|
||||||
|
}
|
||||||
|
public String getForce_caching() {
|
||||||
|
return force_caching;
|
||||||
|
}
|
||||||
|
public void setForce_caching(String force_caching) {
|
||||||
|
this.force_caching = force_caching;
|
||||||
|
}
|
||||||
|
public String getIgnore_req_nocache() {
|
||||||
|
return ignore_req_nocache;
|
||||||
|
}
|
||||||
|
public void setIgnore_req_nocache(String ignore_req_nocache) {
|
||||||
|
this.ignore_req_nocache = ignore_req_nocache;
|
||||||
|
}
|
||||||
|
public String getInactive_time() {
|
||||||
|
return inactive_time;
|
||||||
|
}
|
||||||
|
public void setInactive_time(String inactive_time) {
|
||||||
|
this.inactive_time = inactive_time;
|
||||||
|
}
|
||||||
|
public String getMax_cache_obj_size() {
|
||||||
|
return max_cache_obj_size;
|
||||||
|
}
|
||||||
|
public void setMax_cache_obj_size(String max_cache_obj_size) {
|
||||||
|
this.max_cache_obj_size = max_cache_obj_size;
|
||||||
|
}
|
||||||
|
public String getMax_cache_size() {
|
||||||
|
return max_cache_size;
|
||||||
|
}
|
||||||
|
public void setMax_cache_size(String max_cache_size) {
|
||||||
|
this.max_cache_size = max_cache_size;
|
||||||
|
}
|
||||||
|
public String getMin_use() {
|
||||||
|
return min_use;
|
||||||
|
}
|
||||||
|
public void setMin_use(String min_use) {
|
||||||
|
this.min_use = min_use;
|
||||||
|
}
|
||||||
|
public String getNo_revalidate() {
|
||||||
|
return no_revalidate;
|
||||||
|
}
|
||||||
|
public void setNo_revalidate(String no_revalidate) {
|
||||||
|
this.no_revalidate = no_revalidate;
|
||||||
|
}
|
||||||
|
public String getPinning_time() {
|
||||||
|
return pinning_time;
|
||||||
|
}
|
||||||
|
public void setPinning_time(String pinning_time) {
|
||||||
|
this.pinning_time = pinning_time;
|
||||||
|
}
|
||||||
|
public String getIgnore_qs() {
|
||||||
|
return ignore_qs;
|
||||||
|
}
|
||||||
|
public void setIgnore_qs(String ignore_qs) {
|
||||||
|
this.ignore_qs = ignore_qs;
|
||||||
|
}
|
||||||
|
public String getCookie() {
|
||||||
|
return cookie;
|
||||||
|
}
|
||||||
|
public void setCookie(String cookie) {
|
||||||
|
this.cookie = cookie;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ public class DnsResStrategy extends BaseCfg<DnsResStrategy> {
|
|||||||
private static final long serialVersionUID = -2720862431960415564L;
|
private static final long serialVersionUID = -2720862431960415564L;
|
||||||
private String indexTable="dns_res_strategy";
|
private String indexTable="dns_res_strategy";
|
||||||
private Integer resGroup1Id;
|
private Integer resGroup1Id;
|
||||||
@ExcelField(title="res_group_num",sort=3)
|
@ExcelField(title="res_group_num",sort=4)
|
||||||
private Integer resGroup1Num;
|
private Integer resGroup1Num;
|
||||||
private Integer resGroup2Id;
|
private Integer resGroup2Id;
|
||||||
private Integer resGroup2Num;
|
private Integer resGroup2Num;
|
||||||
@@ -28,9 +28,9 @@ public class DnsResStrategy extends BaseCfg<DnsResStrategy> {
|
|||||||
private Integer resGroup5Num;
|
private Integer resGroup5Num;
|
||||||
private Integer minTtl;
|
private Integer minTtl;
|
||||||
private Integer maxTtl;
|
private Integer maxTtl;
|
||||||
@ExcelField(title="group",sort=2)
|
@ExcelField(title="group",sort=3)
|
||||||
private String group1Name;
|
private String group1Name;
|
||||||
@ExcelField(title="min_ttl",sort=4)
|
@ExcelField(title="min_ttl",sort=5)
|
||||||
private String miTtlmax;
|
private String miTtlmax;
|
||||||
//仅作导入使用
|
//仅作导入使用
|
||||||
private String ttl;
|
private String ttl;
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ public class FileDigestCfg extends BaseCfg<FileDigestCfg> {
|
|||||||
private static final long serialVersionUID = 2796500715438264119L;
|
private static final long serialVersionUID = 2796500715438264119L;
|
||||||
private static final String tableName="file_digest_cfg";
|
private static final String tableName="file_digest_cfg";
|
||||||
private String indexTable="file_digest_cfg";
|
private String indexTable="file_digest_cfg";
|
||||||
@ExcelField(title="raw_len",sort=3)
|
@ExcelField(title="raw_len",sort=4)
|
||||||
private Long rawLen;
|
private Long rawLen;
|
||||||
@ExcelField(title="digest",sort=2)
|
@ExcelField(title="digest",sort=3)
|
||||||
private String digest;
|
private String digest;
|
||||||
@ExcelField(title="cfds_level",sort=4)
|
@ExcelField(title="harm_level",sort=5)
|
||||||
private Integer cfdsLevel;
|
private Integer cfdsLevel;
|
||||||
@ExcelField(title="file_url",sort=5)
|
@ExcelField(title="file_url",sort=6)
|
||||||
private String fileUrl;
|
private String fileUrl;
|
||||||
|
|
||||||
private NtcSubscribeIdCfg ntcSubscribeIdCfg;
|
private NtcSubscribeIdCfg ntcSubscribeIdCfg;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.nis.domain.configuration;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IP复用地址池实体
|
* IP复用地址池实体
|
||||||
@@ -13,15 +14,16 @@ public class IpAddrPoolCfg extends BaseCfg<IpAddrPoolCfg>{
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1392197458744667669L;
|
private static final long serialVersionUID = 1392197458744667669L;
|
||||||
private String indexTable="ip_reuse_addr_pool";
|
private String indexTable="ip_reuse_addr_pool";
|
||||||
|
@ExcelField(title="address_pool",sort=2)
|
||||||
private String addrPoolName; // 地址池名称
|
private String addrPoolName; // 地址池名称
|
||||||
|
@ExcelField(title="ip_total",sort=3)
|
||||||
private Integer ipTotal; // IP总数
|
private Integer ipTotal; // IP总数
|
||||||
private Integer availableIpTotal; // 可用IP总数
|
private Integer availableIpTotal; // 可用IP总数
|
||||||
private String description; // 描述信息
|
private String description; // 描述信息
|
||||||
|
|
||||||
private List<BaseIpCfg> ipCfgs; // 地址池IP信息
|
private List<BaseIpCfg> ipCfgs; // 地址池IP信息
|
||||||
|
|
||||||
@SerializedName("cfgId")
|
@ExcelField(title="address_pool_id",sort=0)
|
||||||
private Integer compileId;
|
private Integer compileId;
|
||||||
|
|
||||||
public String getIndexTable() {
|
public String getIndexTable() {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.nis.domain.configuration;
|
|||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IP复用DNAT策略实体
|
* IP复用DNAT策略实体
|
||||||
@@ -16,6 +17,7 @@ public class IpReuseDnatPolicyCfg extends IpPortCfg{
|
|||||||
|
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("configId")
|
@SerializedName("configId")
|
||||||
|
@ExcelField(title="cfg_id",sort=0)
|
||||||
private Integer compileId;
|
private Integer compileId;
|
||||||
|
|
||||||
@Expose
|
@Expose
|
||||||
@@ -24,22 +26,26 @@ public class IpReuseDnatPolicyCfg extends IpPortCfg{
|
|||||||
|
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("originalDestIp")
|
@SerializedName("originalDestIp")
|
||||||
|
@ExcelField(title="original_dest_ip",sort=4)
|
||||||
private String srcIpAddress;
|
private String srcIpAddress;
|
||||||
|
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("originalDestPort")
|
@SerializedName("originalDestPort")
|
||||||
|
@ExcelField(title="original_dest_port",sort=5)
|
||||||
private String srcPort;
|
private String srcPort;
|
||||||
|
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("originalProtocol")
|
@SerializedName("originalProtocol")
|
||||||
|
@ExcelField(title="protocol",dictType="PROTOCOL",sort=8)
|
||||||
private Integer protocol;
|
private Integer protocol;
|
||||||
|
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("translatedDestIp")
|
@SerializedName("translatedDestIp")
|
||||||
|
@ExcelField(title="translated_dest_ip",sort=6)
|
||||||
private String destIpAddress;
|
private String destIpAddress;
|
||||||
|
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("translatedDestPort")
|
@SerializedName("translatedDestPort")
|
||||||
|
@ExcelField(title="translated_dest_port",sort=7)
|
||||||
private String destPort;
|
private String destPort;
|
||||||
|
|
||||||
@Expose
|
@Expose
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.nis.domain.configuration;
|
|||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IP复用策略
|
* IP复用策略
|
||||||
@@ -20,6 +21,7 @@ public class IpReusePolicyCfg extends BaseCfg<IpReusePolicyCfg>{
|
|||||||
|
|
||||||
private Integer userId; // 用户标识
|
private Integer userId; // 用户标识
|
||||||
@Expose
|
@Expose
|
||||||
|
@ExcelField(title="user_type",dictType="USER_TYPE",sort=4)
|
||||||
protected String userType; // 用户类型
|
protected String userType; // 用户类型
|
||||||
@Expose
|
@Expose
|
||||||
protected Integer addrPoolId; // 地址池ID
|
protected Integer addrPoolId; // 地址池ID
|
||||||
@@ -27,11 +29,14 @@ public class IpReusePolicyCfg extends BaseCfg<IpReusePolicyCfg>{
|
|||||||
protected String translateParam; // 地址翻译参数
|
protected String translateParam; // 地址翻译参数
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("userId")
|
@SerializedName("userId")
|
||||||
|
@ExcelField(title="user",sort=5)
|
||||||
private String userName;
|
private String userName;
|
||||||
|
@ExcelField(title="address_pool",sort=3)
|
||||||
private String addrPoolName; // 仅用于列表条件检索
|
private String addrPoolName; // 仅用于列表条件检索
|
||||||
|
|
||||||
private Integer ipType;
|
private Integer ipType;
|
||||||
private Integer ipPattern;
|
private Integer ipPattern;
|
||||||
|
@ExcelField(title="ip",sort=6)
|
||||||
private String srcIpAddress;
|
private String srcIpAddress;
|
||||||
private String destIpAddress;
|
private String destIpAddress;
|
||||||
@Expose
|
@Expose
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package com.nis.domain.configuration;
|
package com.nis.domain.configuration;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import com.nis.util.excel.ExcelField;
|
import com.nis.util.excel.ExcelField;
|
||||||
@@ -23,10 +21,13 @@ public class PxyObjSpoofingIpPool extends BaseIpCfg{
|
|||||||
private String port;
|
private String port;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("addrType")
|
@SerializedName("addrType")
|
||||||
|
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=4)
|
||||||
private Integer ipType;
|
private Integer ipType;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("ip")
|
@SerializedName("ip")
|
||||||
|
@ExcelField(title="IP",sort=5)
|
||||||
private String ipAddress;
|
private String ipAddress;
|
||||||
|
@ExcelField(title="group",sort=3)
|
||||||
private String groupName;//欺骗IP池(IP组)名称
|
private String groupName;//欺骗IP池(IP组)名称
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("policyGroup")
|
@SerializedName("policyGroup")
|
||||||
@@ -36,6 +37,7 @@ public class PxyObjSpoofingIpPool extends BaseIpCfg{
|
|||||||
private Integer location;//位置,无意义,固定为0
|
private Integer location;//位置,无意义,固定为0
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("cfgId")
|
@SerializedName("cfgId")
|
||||||
|
@ExcelField(title="cfg_id",sort=0)
|
||||||
private Integer compileId;
|
private Integer compileId;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("userRegion")
|
@SerializedName("userRegion")
|
||||||
@@ -50,6 +52,9 @@ public class PxyObjSpoofingIpPool extends BaseIpCfg{
|
|||||||
this.ipAddress = ipAddress;
|
this.ipAddress = ipAddress;
|
||||||
}
|
}
|
||||||
public Integer getGroupId() {
|
public Integer getGroupId() {
|
||||||
|
if((groupId==null || groupId==0) && cfgId!=null){
|
||||||
|
groupId=cfgId.intValue();
|
||||||
|
}
|
||||||
return groupId;
|
return groupId;
|
||||||
}
|
}
|
||||||
public void setGroupId(Integer groupId) {
|
public void setGroupId(Integer groupId) {
|
||||||
|
|||||||
@@ -3,25 +3,33 @@ package com.nis.domain.configuration;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.nis.domain.BaseEntity;
|
import com.nis.domain.BaseEntity;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
public class UserManage extends BaseEntity<UserManage>{
|
public class UserManage extends BaseEntity<UserManage>{
|
||||||
|
|
||||||
private static final long serialVersionUID = -2749633756272829982L;
|
private static final long serialVersionUID = -2749633756272829982L;
|
||||||
|
|
||||||
private static final String tableName="user_manage";
|
private static final String tableName="user_manage";
|
||||||
|
@ExcelField(title="user_name",sort=1)
|
||||||
private String userName;
|
private String userName;
|
||||||
private String userPwd;
|
private String userPwd;
|
||||||
|
@ExcelField(title="vpn_ip",sort=2)
|
||||||
private String serverIp;
|
private String serverIp;
|
||||||
private String authMethod;
|
private String authMethod;
|
||||||
private Integer numLogins;
|
private Integer numLogins;
|
||||||
private String lastLogin;
|
private String lastLogin;
|
||||||
private String transferBytes;
|
private String transferBytes;
|
||||||
private String transferPackets;
|
private String transferPackets;
|
||||||
|
|
||||||
private Long creatorId;
|
private Long creatorId;
|
||||||
|
@ExcelField(title="config_time",sort=5)
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
private Long editorId;
|
private Long editorId;
|
||||||
|
@ExcelField(title="edit_time",sort=7)
|
||||||
private Date editTime;
|
private Date editTime;
|
||||||
private Integer isValid;
|
private Integer isValid;
|
||||||
|
@ExcelField(title="desc",sort=3)
|
||||||
private String remarks;
|
private String remarks;
|
||||||
private String userType;
|
private String userType;
|
||||||
|
|
||||||
@@ -39,8 +47,9 @@ public class UserManage extends BaseEntity<UserManage>{
|
|||||||
private String incomingBroadcastPackets;
|
private String incomingBroadcastPackets;
|
||||||
private String incomingBroadcastTotalSize;
|
private String incomingBroadcastTotalSize;
|
||||||
private Integer numberOfLogins;*/
|
private Integer numberOfLogins;*/
|
||||||
|
@ExcelField(title="creator",sort=4)
|
||||||
private String creatorName;
|
private String creatorName;
|
||||||
|
@ExcelField(title="editor",sort=6)
|
||||||
private String editorName;
|
private String editorName;
|
||||||
private Date search_create_time_start;
|
private Date search_create_time_start;
|
||||||
private Date search_create_time_end;
|
private Date search_create_time_end;
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP Payload 导入模板类
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class AppPayloadTemplate extends ComplexStringAllTemplate{
|
||||||
|
|
||||||
|
// APP PAYLOAD L3_HEADER的特殊属性
|
||||||
|
private String ver;
|
||||||
|
private String ihl;
|
||||||
|
private String tos;
|
||||||
|
private String totalLength;
|
||||||
|
private String flags;
|
||||||
|
private String fragmentOffset;
|
||||||
|
private String protocol;
|
||||||
|
private String icmpType;
|
||||||
|
private String icmpCode;
|
||||||
|
private String icmpIdentifier;
|
||||||
|
private String headerType;
|
||||||
|
|
||||||
|
@ExcelField(title="headerType",align=2,sort=17)
|
||||||
|
public String getHeaderType() {
|
||||||
|
return headerType;
|
||||||
|
}
|
||||||
|
public void setHeaderType(String headerType) {
|
||||||
|
this.headerType = headerType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="VER",align=2,sort=18)
|
||||||
|
public String getVer() {
|
||||||
|
return ver;
|
||||||
|
}
|
||||||
|
public void setVer(String ver) {
|
||||||
|
this.ver = ver;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="IHL",align=2,sort=19)
|
||||||
|
public String getIhl() {
|
||||||
|
return ihl;
|
||||||
|
}
|
||||||
|
public void setIhl(String ihl) {
|
||||||
|
this.ihl = ihl;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="TOS",align=2,sort=20)
|
||||||
|
public String getTos() {
|
||||||
|
return tos;
|
||||||
|
}
|
||||||
|
public void setTos(String tos) {
|
||||||
|
this.tos = tos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="Total Length",align=2,sort=21)
|
||||||
|
public String getTotalLength() {
|
||||||
|
return totalLength;
|
||||||
|
}
|
||||||
|
public void setTotalLength(String totalLength) {
|
||||||
|
this.totalLength = totalLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="Flags",align=2,sort=22)
|
||||||
|
public String getFlags() {
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
|
public void setFlags(String flags) {
|
||||||
|
this.flags = flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="fragment offset",align=2,sort=23)
|
||||||
|
public String getFragmentOffset() {
|
||||||
|
return fragmentOffset;
|
||||||
|
}
|
||||||
|
public void setFragmentOffset(String fragmentOffset) {
|
||||||
|
this.fragmentOffset = fragmentOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="Protocol",align=2,sort=24)
|
||||||
|
public String getProtocol() {
|
||||||
|
return protocol;
|
||||||
|
}
|
||||||
|
public void setProtocol(String protocol) {
|
||||||
|
this.protocol = protocol;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="ICMP type",align=2,sort=25)
|
||||||
|
public String getIcmpType() {
|
||||||
|
return icmpType;
|
||||||
|
}
|
||||||
|
public void setIcmpType(String icmpType) {
|
||||||
|
this.icmpType = icmpType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="ICMP code",align=2,sort=26)
|
||||||
|
public String getIcmpCode() {
|
||||||
|
return icmpCode;
|
||||||
|
}
|
||||||
|
public void setIcmpCode(String icmpCode) {
|
||||||
|
this.icmpCode = icmpCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="ICMP identifier",align=2,sort=27)
|
||||||
|
public String getIcmpIdentifier() {
|
||||||
|
return icmpIdentifier;
|
||||||
|
}
|
||||||
|
public void setIcmpIdentifier(String icmpIdentifier) {
|
||||||
|
this.icmpIdentifier = icmpIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EXCEL HTTP(s)重定向 导入模板
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class HttpsRedirectComplexTemplate extends ComplexStringAllTemplate{
|
||||||
|
|
||||||
|
private String userRegion1;// 重定向应答码
|
||||||
|
private String userRegion2;// 重定向URL
|
||||||
|
|
||||||
|
@ExcelField(title="redirect_response_code",dictType="REDIRECT_RESPONSE_CODE",align=2,sort=2)
|
||||||
|
public String getUserRegion1() {
|
||||||
|
return userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion1(String userRegion1) {
|
||||||
|
this.userRegion1 = userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="redirect_url",align=2,sort=3)
|
||||||
|
public String getUserRegion2() {
|
||||||
|
return userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion2(String userRegion2) {
|
||||||
|
this.userRegion2 = userRegion2;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EXCEL HTTP(s)重定向 导入模板
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class HttpsRedirectIpTemplate extends IpAllTemplate{
|
||||||
|
|
||||||
|
private String userRegion1;// 重定向应答码
|
||||||
|
private String userRegion2;// 重定向URL
|
||||||
|
|
||||||
|
@ExcelField(title="redirect_response_code",dictType="REDIRECT_RESPONSE_CODE",align=2,sort=2)
|
||||||
|
public String getUserRegion1() {
|
||||||
|
return userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion1(String userRegion1) {
|
||||||
|
this.userRegion1 = userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="redirect_url",align=2,sort=3)
|
||||||
|
public String getUserRegion2() {
|
||||||
|
return userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion2(String userRegion2) {
|
||||||
|
this.userRegion2 = userRegion2;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EXCEL HTTP(s)重定向 导入模板
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class HttpsRedirectTemplate extends StringAllTemplate{
|
||||||
|
|
||||||
|
private String userRegion1;// 重定向应答码
|
||||||
|
private String userRegion2;// 重定向URL
|
||||||
|
|
||||||
|
@ExcelField(title="redirect_response_code",dictType="REDIRECT_RESPONSE_CODE",align=2,sort=2)
|
||||||
|
public String getUserRegion1() {
|
||||||
|
return userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion1(String userRegion1) {
|
||||||
|
this.userRegion1 = userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="redirect_url",align=2,sort=3)
|
||||||
|
public String getUserRegion2() {
|
||||||
|
return userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion2(String userRegion2) {
|
||||||
|
this.userRegion2 = userRegion2;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EXCEL HTTP(s)阻断 导入模板
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class HttpsRejectComplexTemplate extends ComplexStringAllTemplate{
|
||||||
|
|
||||||
|
private String userRegion1;// 应答码
|
||||||
|
private String userRegion2;// 响应内容
|
||||||
|
|
||||||
|
@ExcelField(title="response_code",dictType="RESPONSE_CODE",align=2,sort=2)
|
||||||
|
public String getUserRegion1() {
|
||||||
|
return userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion1(String userRegion1) {
|
||||||
|
this.userRegion1 = userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="response_content",align=2,sort=3)
|
||||||
|
public String getUserRegion2() {
|
||||||
|
return userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion2(String userRegion2) {
|
||||||
|
this.userRegion2 = userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EXCEL HTTP(s)阻断 导入模板
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class HttpsRejectIpTemplate extends IpAllTemplate{
|
||||||
|
|
||||||
|
private String userRegion1;// 应答码
|
||||||
|
private String userRegion2;// 响应内容
|
||||||
|
|
||||||
|
@ExcelField(title="response_code",dictType="RESPONSE_CODE",align=2,sort=2)
|
||||||
|
public String getUserRegion1() {
|
||||||
|
return userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion1(String userRegion1) {
|
||||||
|
this.userRegion1 = userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="response_content",align=2,sort=3)
|
||||||
|
public String getUserRegion2() {
|
||||||
|
return userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion2(String userRegion2) {
|
||||||
|
this.userRegion2 = userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EXCEL HTTP(s)阻断 导入模板
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class HttpsRejectTemplate extends StringAllTemplate{
|
||||||
|
|
||||||
|
private String userRegion1;// 应答码
|
||||||
|
private String userRegion2;// 响应内容
|
||||||
|
|
||||||
|
@ExcelField(title="response_code",dictType="RESPONSE_CODE",align=2,sort=2)
|
||||||
|
public String getUserRegion1() {
|
||||||
|
return userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion1(String userRegion1) {
|
||||||
|
this.userRegion1 = userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="response_content",align=2,sort=3)
|
||||||
|
public String getUserRegion2() {
|
||||||
|
return userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion2(String userRegion2) {
|
||||||
|
this.userRegion2 = userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EXCEL HTTP(s)替换 导入模板
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class HttpsReplaceComplexTemplate extends ComplexStringAllTemplate{
|
||||||
|
|
||||||
|
private String userRegion1;// 搜索区域
|
||||||
|
private String userRegion2;// 发现内容
|
||||||
|
private String userRegion3;// 替换内容
|
||||||
|
|
||||||
|
@ExcelField(title="replace_zone",dictType="CONTROL_REPLACE_ZONE",align=2,sort=2)
|
||||||
|
public String getUserRegion1() {
|
||||||
|
return userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion1(String userRegion1) {
|
||||||
|
this.userRegion1 = userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="replaced_content",align=2,sort=3)
|
||||||
|
public String getUserRegion2() {
|
||||||
|
return userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion2(String userRegion2) {
|
||||||
|
this.userRegion2 = userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="replace_content",align=2,sort=4)
|
||||||
|
public String getUserRegion3() {
|
||||||
|
return userRegion3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion3(String userRegion3) {
|
||||||
|
this.userRegion3 = userRegion3;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EXCEL HTTP(s)替换 导入模板
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class HttpsReplaceIpTemplate extends IpAllTemplate{
|
||||||
|
|
||||||
|
private String userRegion1;// 搜索区域
|
||||||
|
private String userRegion2;// 发现内容
|
||||||
|
private String userRegion3;// 替换内容
|
||||||
|
|
||||||
|
@ExcelField(title="replace_zone",dictType="CONTROL_REPLACE_ZONE",align=2,sort=2)
|
||||||
|
public String getUserRegion1() {
|
||||||
|
return userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion1(String userRegion1) {
|
||||||
|
this.userRegion1 = userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="replaced_content",align=2,sort=3)
|
||||||
|
public String getUserRegion2() {
|
||||||
|
return userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion2(String userRegion2) {
|
||||||
|
this.userRegion2 = userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="replace_content",align=2,sort=4)
|
||||||
|
public String getUserRegion3() {
|
||||||
|
return userRegion3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion3(String userRegion3) {
|
||||||
|
this.userRegion3 = userRegion3;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EXCEL HTTP(s)替换 导入模板
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class HttpsReplaceTemplate extends StringAllTemplate{
|
||||||
|
|
||||||
|
private String userRegion1;// 搜索区域
|
||||||
|
private String userRegion2;// 发现内容
|
||||||
|
private String userRegion3;// 替换内容
|
||||||
|
|
||||||
|
@ExcelField(title="replace_zone",dictType="CONTROL_REPLACE_ZONE",align=2,sort=2)
|
||||||
|
public String getUserRegion1() {
|
||||||
|
return userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion1(String userRegion1) {
|
||||||
|
this.userRegion1 = userRegion1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="replaced_content",align=2,sort=3)
|
||||||
|
public String getUserRegion2() {
|
||||||
|
return userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion2(String userRegion2) {
|
||||||
|
this.userRegion2 = userRegion2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="replace_content",align=2,sort=4)
|
||||||
|
public String getUserRegion3() {
|
||||||
|
return userRegion3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserRegion3(String userRegion3) {
|
||||||
|
this.userRegion3 = userRegion3;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,6 +28,8 @@ public class IpWhitelistTemplate extends BasicTemplate{
|
|||||||
private String destIpAddress;
|
private String destIpAddress;
|
||||||
private String srcPort;
|
private String srcPort;
|
||||||
private String destPort;
|
private String destPort;
|
||||||
|
private Integer protocol;
|
||||||
|
private Integer direction;
|
||||||
|
|
||||||
@ExcelField(title="config_describe",align=2,sort=1)
|
@ExcelField(title="config_describe",align=2,sort=1)
|
||||||
public String getCfgDesc() {
|
public String getCfgDesc() {
|
||||||
@@ -66,4 +68,20 @@ public class IpWhitelistTemplate extends BasicTemplate{
|
|||||||
this.destPort = destPort;
|
this.destPort = destPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="protocol",align=2,sort=15)
|
||||||
|
public Integer getProtocol() {
|
||||||
|
return protocol;
|
||||||
|
}
|
||||||
|
public void setProtocol(Integer protocol) {
|
||||||
|
this.protocol = protocol;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="direction",align=2,sort=16)
|
||||||
|
public Integer getDirection() {
|
||||||
|
return direction;
|
||||||
|
}
|
||||||
|
public void setDirection(Integer direction) {
|
||||||
|
this.direction = direction;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +1,29 @@
|
|||||||
package com.nis.domain.dashboard;
|
package com.nis.domain.dashboard;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
public class NtcRadiusReport implements Serializable{
|
public class NtcRadiusReport {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7635016645942704971L;
|
// @JsonInclude(value = Include.NON_NULL)
|
||||||
@JsonInclude(value = Include.NON_NULL)
|
// @ApiModelProperty(value = "接入IP", required = true)
|
||||||
@ApiModelProperty(value = "接入IP", required = true)
|
@ExcelField(title = "ip_address_control", sort = 2)
|
||||||
protected String nasIp;
|
protected String nasIp;
|
||||||
@JsonInclude(value = Include.NON_NULL)
|
// @JsonInclude(value = Include.NON_NULL)
|
||||||
@ApiModelProperty(value = "用户名", required = true)
|
// @ApiModelProperty(value = "用户名", required = true)
|
||||||
|
@ExcelField(title = "account", sort = 1)
|
||||||
protected String account;
|
protected String account;
|
||||||
@JsonInclude(value = Include.NON_NULL)
|
// @JsonInclude(value = Include.NON_NULL)
|
||||||
@ApiModelProperty(value = "次数", required = true)
|
// @ApiModelProperty(value = "次数", required = true)
|
||||||
|
@ExcelField(title = "visits", sort = 3)
|
||||||
protected Long num;
|
protected Long num;
|
||||||
@JsonInclude(value = Include.NON_NULL)
|
// @JsonInclude(value = Include.NON_NULL)
|
||||||
@ApiModelProperty(value = "统计时间", required = true)
|
// @ApiModelProperty(value = "统计时间", required = true)
|
||||||
|
@ExcelField(title = "stat_time", sort = 4)
|
||||||
protected String reportTime;
|
protected String reportTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,6 +69,16 @@ public class NtcRadiusReport implements Serializable{
|
|||||||
return reportTime;
|
return reportTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "NtcRadiusReport [nasIp=" + nasIp + ", account=" + account + ", num=" + num + ", reportTime="
|
||||||
|
+ reportTime + ", searchBusinessType=" + searchBusinessType + ", searchFoundStartTime="
|
||||||
|
+ searchFoundStartTime + ", searchFoundEndTime=" + searchFoundEndTime
|
||||||
|
+ ", searchReportStartTimeCluster=" + searchReportStartTimeCluster + ", searchReportEndTimeCluster="
|
||||||
|
+ searchReportEndTimeCluster + ", searchNasIp=" + searchNasIp + ", searchAccount=" + searchAccount
|
||||||
|
+ ", groupType=" + groupType + "]";
|
||||||
|
}
|
||||||
|
|
||||||
public void setReportTime(String reportTime) {
|
public void setReportTime(String reportTime) {
|
||||||
this.reportTime = reportTime;
|
this.reportTime = reportTime;
|
||||||
}
|
}
|
||||||
@@ -74,11 +86,11 @@ public class NtcRadiusReport implements Serializable{
|
|||||||
public String getSearchBusinessType() {
|
public String getSearchBusinessType() {
|
||||||
return searchBusinessType;
|
return searchBusinessType;
|
||||||
}
|
}
|
||||||
@JsonIgnore
|
|
||||||
public void setSearchBusinessType(String searchBusinessType) {
|
public void setSearchBusinessType(String searchBusinessType) {
|
||||||
this.searchBusinessType = searchBusinessType;
|
this.searchBusinessType = searchBusinessType;
|
||||||
}
|
}
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchFoundStartTime() {
|
public String getSearchFoundStartTime() {
|
||||||
return searchFoundStartTime;
|
return searchFoundStartTime;
|
||||||
}
|
}
|
||||||
@@ -86,7 +98,7 @@ public class NtcRadiusReport implements Serializable{
|
|||||||
public void setSearchFoundStartTime(String searchFoundStartTime) {
|
public void setSearchFoundStartTime(String searchFoundStartTime) {
|
||||||
this.searchFoundStartTime = searchFoundStartTime;
|
this.searchFoundStartTime = searchFoundStartTime;
|
||||||
}
|
}
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchFoundEndTime() {
|
public String getSearchFoundEndTime() {
|
||||||
return searchFoundEndTime;
|
return searchFoundEndTime;
|
||||||
}
|
}
|
||||||
@@ -95,16 +107,14 @@ public class NtcRadiusReport implements Serializable{
|
|||||||
this.searchFoundEndTime = searchFoundEndTime;
|
this.searchFoundEndTime = searchFoundEndTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonIgnore
|
|
||||||
public Long getSearchReportStartTimeCluster() {
|
public Long getSearchReportStartTimeCluster() {
|
||||||
return searchReportStartTimeCluster;
|
return searchReportStartTimeCluster;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSearchReportStartTimeCluster(
|
public void setSearchReportStartTimeCluster(Long searchReportStartTimeCluster) {
|
||||||
Long searchReportStartTimeCluster) {
|
|
||||||
this.searchReportStartTimeCluster = searchReportStartTimeCluster;
|
this.searchReportStartTimeCluster = searchReportStartTimeCluster;
|
||||||
}
|
}
|
||||||
@JsonIgnore
|
|
||||||
public Long getSearchReportEndTimeCluster() {
|
public Long getSearchReportEndTimeCluster() {
|
||||||
return searchReportEndTimeCluster;
|
return searchReportEndTimeCluster;
|
||||||
}
|
}
|
||||||
@@ -112,7 +122,7 @@ public class NtcRadiusReport implements Serializable{
|
|||||||
public void setSearchReportEndTimeCluster(Long searchReportEndTimeCluster) {
|
public void setSearchReportEndTimeCluster(Long searchReportEndTimeCluster) {
|
||||||
this.searchReportEndTimeCluster = searchReportEndTimeCluster;
|
this.searchReportEndTimeCluster = searchReportEndTimeCluster;
|
||||||
}
|
}
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchNasIp() {
|
public String getSearchNasIp() {
|
||||||
return searchNasIp;
|
return searchNasIp;
|
||||||
}
|
}
|
||||||
@@ -120,7 +130,7 @@ public class NtcRadiusReport implements Serializable{
|
|||||||
public void setSearchNasIp(String searchNasIp) {
|
public void setSearchNasIp(String searchNasIp) {
|
||||||
this.searchNasIp = searchNasIp;
|
this.searchNasIp = searchNasIp;
|
||||||
}
|
}
|
||||||
@JsonIgnore
|
|
||||||
public String getSearchAccount() {
|
public String getSearchAccount() {
|
||||||
return searchAccount;
|
return searchAccount;
|
||||||
}
|
}
|
||||||
@@ -128,7 +138,7 @@ public class NtcRadiusReport implements Serializable{
|
|||||||
public void setSearchAccount(String searchAccount) {
|
public void setSearchAccount(String searchAccount) {
|
||||||
this.searchAccount = searchAccount;
|
this.searchAccount = searchAccount;
|
||||||
}
|
}
|
||||||
@JsonIgnore
|
|
||||||
public String getGroupType() {
|
public String getGroupType() {
|
||||||
return groupType;
|
return groupType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,27 @@
|
|||||||
package com.nis.domain.log;
|
package com.nis.domain.log;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
public class IrDnatLog extends BaseLogEntity<IrDnatLog> {
|
public class IrDnatLog extends BaseLogEntity<IrDnatLog> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 5860838446015457328L;
|
private static final long serialVersionUID = 5860838446015457328L;
|
||||||
|
|
||||||
|
@ExcelField(title = "user", sort = 8)
|
||||||
protected String userId;// 用户名
|
protected String userId;// 用户名
|
||||||
|
@ExcelField(title = "nat_ip", sort = 9)
|
||||||
protected String natIp;// 复用的ip地址
|
protected String natIp;// 复用的ip地址
|
||||||
|
@ExcelField(title = "creat_time", sort = 10)
|
||||||
protected String creatTime;// 链接建立时间
|
protected String creatTime;// 链接建立时间
|
||||||
|
@ExcelField(title = "close_time", sort = 11)
|
||||||
protected String closeTime;// 链接结束时间
|
protected String closeTime;// 链接结束时间
|
||||||
protected String c2sPktNum;// c2s包数
|
@ExcelField(title = "c2s_pkt_num", sort = 12)
|
||||||
protected String s2cPktNum;// s2c包数
|
protected String c2sPktNum;
|
||||||
protected String c2sByteNum;// c2s字节数
|
@ExcelField(title = "s2c_pkt_num", sort = 13)
|
||||||
protected String s2cByteNum;// s2c字节数
|
protected String s2cPktNum;
|
||||||
|
@ExcelField(title = "c2s_byte_num", sort = 14)
|
||||||
|
protected String c2sByteNum;
|
||||||
|
@ExcelField(title = "s2c_byte_num", sort = 15)
|
||||||
|
protected String s2cByteNum;
|
||||||
|
|
||||||
public String getUserId() {
|
public String getUserId() {
|
||||||
return userId;
|
return userId;
|
||||||
|
|||||||
@@ -1,17 +1,25 @@
|
|||||||
package com.nis.domain.log;
|
package com.nis.domain.log;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
public class IrSnatLog extends BaseLogEntity<IrSnatLog> {
|
public class IrSnatLog extends BaseLogEntity<IrSnatLog> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 5860838446015457328L;
|
private static final long serialVersionUID = 5860838446015457328L;
|
||||||
|
|
||||||
|
@ExcelField(title = "nat_ip", sort = 9)
|
||||||
protected String natIp;// 复用的ip地址
|
protected String natIp;// 复用的ip地址
|
||||||
|
@ExcelField(title = "creat_time", sort = 10)
|
||||||
protected String creatTime;// 链接建立时间
|
protected String creatTime;// 链接建立时间
|
||||||
|
@ExcelField(title = "close_time", sort = 11)
|
||||||
protected String closeTime;// 链接结束时间
|
protected String closeTime;// 链接结束时间
|
||||||
protected String c2sPktNum;// c2s包数
|
@ExcelField(title = "c2s_pkt_num", sort = 12)
|
||||||
protected String s2cPktNum;// s2c包数
|
protected String c2sPktNum;
|
||||||
protected String c2sByteNum;// c2s字节数
|
@ExcelField(title = "s2c_pkt_num", sort = 13)
|
||||||
protected String s2cByteNum;// s2c字节数
|
protected String s2cPktNum;
|
||||||
|
@ExcelField(title = "c2s_byte_num", sort = 14)
|
||||||
|
protected String c2sByteNum;
|
||||||
|
@ExcelField(title = "s2c_byte_num", sort = 15)
|
||||||
|
protected String s2cByteNum;
|
||||||
|
|
||||||
public String getNatIp() {
|
public String getNatIp() {
|
||||||
return natIp;
|
return natIp;
|
||||||
|
|||||||
@@ -561,6 +561,9 @@ public class MaatCfg implements Serializable {
|
|||||||
this.areaEffectiveIds = areaEffectiveIds;
|
this.areaEffectiveIds = areaEffectiveIds;
|
||||||
}
|
}
|
||||||
public Integer getDoBlackList() {
|
public Integer getDoBlackList() {
|
||||||
|
if(doBlackList==null){
|
||||||
|
doBlackList = 1;
|
||||||
|
}
|
||||||
return doBlackList;
|
return doBlackList;
|
||||||
}
|
}
|
||||||
public void setDoBlackList(Integer doBlackList) {
|
public void setDoBlackList(Integer doBlackList) {
|
||||||
@@ -678,7 +681,7 @@ public class MaatCfg implements Serializable {
|
|||||||
}
|
}
|
||||||
public void initDefaultValue() {
|
public void initDefaultValue() {
|
||||||
this.doLog=Constants.MAAT_CFG_DOLOG_DEFAULT;
|
this.doLog=Constants.MAAT_CFG_DOLOG_DEFAULT;
|
||||||
this.doBlackList=Constants.MAAT_CFG_DOLOG_DOBLACKLIST_DEFAULT;
|
// this.doBlackList=Constants.MAAT_CFG_DOLOG_DOBLACKLIST_DEFAULT;
|
||||||
this.configPercent=Constants.MAAT_CFG_DOLOG_CONFIGPERCENT_DEFAULT;
|
this.configPercent=Constants.MAAT_CFG_DOLOG_CONFIGPERCENT_DEFAULT;
|
||||||
this.configOption=Constants.MAAT_CFG_DOLOG_CONFIGOPTION_DEFAULT;
|
this.configOption=Constants.MAAT_CFG_DOLOG_CONFIGOPTION_DEFAULT;
|
||||||
this.startTime=new Date();
|
this.startTime=new Date();
|
||||||
|
|||||||
122
src/main/java/com/nis/domain/maat/ToUpdateMaatBeanStatus.java
Normal file
122
src/main/java/com/nis/domain/maat/ToUpdateMaatBeanStatus.java
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
/**
|
||||||
|
*@Title: ToMaatBean.java
|
||||||
|
*@Package com.nis.domain.configuration
|
||||||
|
*@Description TODO
|
||||||
|
*@author dell
|
||||||
|
*@date 2018年2月28日 下午2:03:08
|
||||||
|
*@version 版本号
|
||||||
|
*/
|
||||||
|
package com.nis.domain.maat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改maat类配置状态
|
||||||
|
* @ClassName: ToUpdateStatusMaatBean.java
|
||||||
|
* @Description: TODO
|
||||||
|
* @author (dell)
|
||||||
|
* @date 2019年1月2日 下午3:08:08
|
||||||
|
* @version V1.0
|
||||||
|
*/
|
||||||
|
public class ToUpdateMaatBeanStatus implements Serializable{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = -3468862666445104490L;
|
||||||
|
/**
|
||||||
|
* @Fields serialVersionUID:TODO(转换为maat格式的java bean)
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Expose
|
||||||
|
private String version;
|
||||||
|
@Expose
|
||||||
|
@SerializedName("operator")
|
||||||
|
private String creatorName;
|
||||||
|
@Expose
|
||||||
|
@SerializedName("opTime")
|
||||||
|
private Date auditTime;
|
||||||
|
@Expose
|
||||||
|
private Integer opAction;
|
||||||
|
@Expose
|
||||||
|
private List<UpdateMaatCfgStatus> configCompileStartStopList;
|
||||||
|
|
||||||
|
public static class UpdateMaatCfgStatus{
|
||||||
|
@Expose
|
||||||
|
private Integer compileId;
|
||||||
|
@Expose
|
||||||
|
private Integer isValid;
|
||||||
|
@Expose
|
||||||
|
@SerializedName("opTime")
|
||||||
|
private Date auditTime;
|
||||||
|
public Integer getCompileId() {
|
||||||
|
return compileId;
|
||||||
|
}
|
||||||
|
public void setCompileId(Integer compileId) {
|
||||||
|
this.compileId = compileId;
|
||||||
|
}
|
||||||
|
public Integer getIsValid() {
|
||||||
|
return isValid;
|
||||||
|
}
|
||||||
|
public void setIsValid(Integer isValid) {
|
||||||
|
this.isValid = isValid;
|
||||||
|
}
|
||||||
|
public Date getAuditTime() {
|
||||||
|
return auditTime;
|
||||||
|
}
|
||||||
|
public void setAuditTime(Date auditTime) {
|
||||||
|
this.auditTime = auditTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public String getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersion(String version) {
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatorName() {
|
||||||
|
return creatorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatorName(String creatorName) {
|
||||||
|
this.creatorName = creatorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getAuditTime() {
|
||||||
|
return auditTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuditTime(Date auditTime) {
|
||||||
|
this.auditTime = auditTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<UpdateMaatCfgStatus> getConfigCompileStartStopList() {
|
||||||
|
return configCompileStartStopList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfigCompileStartStopList(List<UpdateMaatCfgStatus> configCompileStartStopList) {
|
||||||
|
this.configCompileStartStopList = configCompileStartStopList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getOpAction() {
|
||||||
|
return opAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpAction(Integer opAction) {
|
||||||
|
this.opAction = opAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,11 +7,11 @@ public class NtcAsnRecord extends BaseLogEntity<NtcAsnRecord>{
|
|||||||
|
|
||||||
private static final long serialVersionUID = -4947912502754359817L;
|
private static final long serialVersionUID = -4947912502754359817L;
|
||||||
|
|
||||||
@ExcelField(title="bps",sort=8)
|
@ExcelField(title="bps",sort=10)
|
||||||
protected String bps;
|
protected String bps;
|
||||||
@ExcelField(title="pps",sort=9)
|
@ExcelField(title="pps",sort=9)
|
||||||
protected String pps;
|
protected String pps;
|
||||||
@ExcelField(title="asn",sort=10)
|
@ExcelField(title="asn",sort=8)
|
||||||
protected String asn;
|
protected String asn;
|
||||||
public String getAsn() {
|
public String getAsn() {
|
||||||
return asn;
|
return asn;
|
||||||
|
|||||||
@@ -0,0 +1,154 @@
|
|||||||
|
package com.nis.domain.report;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.nis.domain.BaseEntity;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重点保障事件实体对象
|
||||||
|
*
|
||||||
|
* @author A.Chen
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class NtcEventKeyProtectionReport extends BaseEntity<NtcEventKeyProtectionReport> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
@ExcelField(title = "task_id", sort = 1)
|
||||||
|
private String taskIds;
|
||||||
|
|
||||||
|
@ExcelField(title = "task_name", sort = 2)
|
||||||
|
private String taskName;
|
||||||
|
|
||||||
|
@ExcelField(title = "letter_num", sort = 3)
|
||||||
|
private long letterNum;
|
||||||
|
|
||||||
|
@ExcelField(title = "config_num", sort = 4)
|
||||||
|
private long configNum;
|
||||||
|
|
||||||
|
@ExcelField(title = "monitor_num", sort = 5)
|
||||||
|
private long monitorNum;
|
||||||
|
|
||||||
|
@ExcelField(title = "control_num", sort = 6)
|
||||||
|
private long controlNum;
|
||||||
|
|
||||||
|
@ExcelField(title = "task_time", sort = 7)
|
||||||
|
private String taskTime;
|
||||||
|
|
||||||
|
@ExcelField(title = "stat_time", sort = 8)
|
||||||
|
private String reportTime;
|
||||||
|
|
||||||
|
private String searchReportStartTime;
|
||||||
|
private String searchReportEndTime;
|
||||||
|
private String searchTaskStartTime;
|
||||||
|
private String searchTaskEndTime;
|
||||||
|
|
||||||
|
public String getTaskTime() {
|
||||||
|
return taskTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskTime(String taskTime) {
|
||||||
|
this.taskTime = taskTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskName() {
|
||||||
|
return taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskName(String taskName) {
|
||||||
|
this.taskName = taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getLetterNum() {
|
||||||
|
return letterNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLetterNum(long letterNum) {
|
||||||
|
this.letterNum = letterNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getConfigNum() {
|
||||||
|
return configNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfigNum(long configNum) {
|
||||||
|
this.configNum = configNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getMonitorNum() {
|
||||||
|
return monitorNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMonitorNum(long monitorNum) {
|
||||||
|
this.monitorNum = monitorNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getControlNum() {
|
||||||
|
return controlNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setControlNum(long controlNum) {
|
||||||
|
this.controlNum = controlNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSearchReportStartTime() {
|
||||||
|
return searchReportStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchReportStartTime(String searchReportStartTime) {
|
||||||
|
this.searchReportStartTime = searchReportStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSearchReportEndTime() {
|
||||||
|
return searchReportEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchReportEndTime(String searchReportEndTime) {
|
||||||
|
this.searchReportEndTime = searchReportEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSearchTaskStartTime() {
|
||||||
|
return searchTaskStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchTaskStartTime(String searchTaskStartTime) {
|
||||||
|
this.searchTaskStartTime = searchTaskStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSearchTaskEndTime() {
|
||||||
|
return searchTaskEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchTaskEndTime(String searchTaskEndTime) {
|
||||||
|
this.searchTaskEndTime = searchTaskEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskIds() {
|
||||||
|
return taskIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskIds(String taskIds) {
|
||||||
|
this.taskIds = taskIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReportTime() {
|
||||||
|
return reportTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReportTime(String reportTime) {
|
||||||
|
this.reportTime = reportTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "NtcEventKeyProtectionReport [taskIds=" + taskIds + ", taskName=" + taskName + ", letterNum=" + letterNum
|
||||||
|
+ ", configNum=" + configNum + ", monitorNum=" + monitorNum + ", controlNum=" + controlNum
|
||||||
|
+ ", taskTime=" + taskTime + ", reportTime=" + reportTime + ", searchReportStartTime="
|
||||||
|
+ searchReportStartTime + ", searchReportEndTime=" + searchReportEndTime + ", searchTaskStartTime="
|
||||||
|
+ searchTaskStartTime + ", searchTaskEndTime=" + searchTaskEndTime + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
package com.nis.domain.report;
|
||||||
|
|
||||||
|
import com.nis.domain.BaseEntity;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测事件和封堵事件实体对象
|
||||||
|
*
|
||||||
|
* @author A.Chen
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class NtcEventMonitorOrBlockReport extends BaseEntity<NtcEventMonitorOrBlockReport> {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 4523581081780227829L;
|
||||||
|
|
||||||
|
@ExcelField(title = "task_time", sort = 8)
|
||||||
|
private String taskTime;// 审核时间
|
||||||
|
|
||||||
|
@ExcelField(title = "task_name", sort = 2)
|
||||||
|
private String taskName;// 事件名称
|
||||||
|
|
||||||
|
@ExcelField(title = "ip_count", sort = 3)
|
||||||
|
private long ipNum;// ip数量
|
||||||
|
|
||||||
|
@ExcelField(title = "http_num", sort = 4)
|
||||||
|
private long httpNum;// http数量
|
||||||
|
|
||||||
|
@ExcelField(title = "mail_num", sort = 5)
|
||||||
|
private long mailNum;// 邮件数量
|
||||||
|
|
||||||
|
@ExcelField(title = "vedio_count", sort = 6)
|
||||||
|
private long vedioNum;// 视频次数
|
||||||
|
|
||||||
|
@ExcelField(title = "agent_count", sort = 7)
|
||||||
|
private long agentNum;// 代理次数
|
||||||
|
|
||||||
|
@ExcelField(title = "task_id", sort = 1)
|
||||||
|
private String taskIds;// 审核ID
|
||||||
|
|
||||||
|
@ExcelField(title = "stat_time", sort = 9)
|
||||||
|
private String reportTime;// 统计时间
|
||||||
|
|
||||||
|
//
|
||||||
|
private String searchReportStartTime;// 统计开始时间
|
||||||
|
private String searchReportEndTime;// 统计结束时间
|
||||||
|
private String searchTaskStartTime;// 审核开始时间
|
||||||
|
private String searchTaskEndTime;// 审核结束时间
|
||||||
|
private int reportType;// 查询类型 1.封堵 2.监测
|
||||||
|
|
||||||
|
public String getReportTime() {
|
||||||
|
return reportTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReportTime(String reportTime) {
|
||||||
|
this.reportTime = reportTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskTime() {
|
||||||
|
return taskTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskTime(String taskTime) {
|
||||||
|
this.taskTime = taskTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskName() {
|
||||||
|
return taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskName(String taskName) {
|
||||||
|
this.taskName = taskName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getIpNum() {
|
||||||
|
return ipNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIpNum(long ipNum) {
|
||||||
|
this.ipNum = ipNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getHttpNum() {
|
||||||
|
return httpNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHttpNum(long httpNum) {
|
||||||
|
this.httpNum = httpNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getMailNum() {
|
||||||
|
return mailNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMailNum(long mailNum) {
|
||||||
|
this.mailNum = mailNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getVedioNum() {
|
||||||
|
return vedioNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVedioNum(long vedioNum) {
|
||||||
|
this.vedioNum = vedioNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getAgentNum() {
|
||||||
|
return agentNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAgentNum(long agentNum) {
|
||||||
|
this.agentNum = agentNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSearchReportStartTime() {
|
||||||
|
return searchReportStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchReportStartTime(String searchReportStartTime) {
|
||||||
|
this.searchReportStartTime = searchReportStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSearchReportEndTime() {
|
||||||
|
return searchReportEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchReportEndTime(String searchReportEndTime) {
|
||||||
|
this.searchReportEndTime = searchReportEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSearchTaskStartTime() {
|
||||||
|
return searchTaskStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchTaskStartTime(String searchTaskStartTime) {
|
||||||
|
this.searchTaskStartTime = searchTaskStartTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSearchTaskEndTime() {
|
||||||
|
return searchTaskEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearchTaskEndTime(String searchTaskEndTime) {
|
||||||
|
this.searchTaskEndTime = searchTaskEndTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getReportType() {
|
||||||
|
return reportType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReportType(int reportType) {
|
||||||
|
this.reportType = reportType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskIds() {
|
||||||
|
return taskIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskIds(String taskIds) {
|
||||||
|
this.taskIds = taskIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "NtcEventMonitorOrBlockReport [taskTime=" + taskTime + ", taskName=" + taskName + ", ipNum=" + ipNum
|
||||||
|
+ ", httpNum=" + httpNum + ", mailNum=" + mailNum + ", vedioNum=" + vedioNum + ", agentNum=" + agentNum
|
||||||
|
+ ", taskIds=" + taskIds + ", reportTime=" + reportTime + ", searchReportStartTime="
|
||||||
|
+ searchReportStartTime + ", searchReportEndTime=" + searchReportEndTime + ", searchTaskStartTime="
|
||||||
|
+ searchTaskStartTime + ", searchTaskEndTime=" + searchTaskEndTime + ", reportType=" + reportType + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ import java.util.List;
|
|||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.nis.domain.BaseEntity;
|
import com.nis.domain.BaseEntity;
|
||||||
import com.nis.util.Configurations;
|
import com.nis.util.Configurations;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统特定服务信息表-记录特定服务信息(specific_service_cfg)
|
* 系统特定服务信息表-记录特定服务信息(specific_service_cfg)
|
||||||
@@ -17,19 +18,25 @@ public class SpecificServiceCfg extends BaseEntity<SpecificServiceCfg>{
|
|||||||
private static final long serialVersionUID = -1133644323636425766L;
|
private static final long serialVersionUID = -1133644323636425766L;
|
||||||
|
|
||||||
private Integer specServiceId; //spec_service_id 协议ID int N 主键,初始化
|
private Integer specServiceId; //spec_service_id 协议ID int N 主键,初始化
|
||||||
|
@ExcelField(title="app_code",sort=2)
|
||||||
private Integer specServiceCode; //协议编码 int N 暂定,以后可扩展 1000:微信 , 1001:QQ
|
private Integer specServiceCode; //协议编码 int N 暂定,以后可扩展 1000:微信 , 1001:QQ
|
||||||
|
@ExcelField(title="app_name",sort=3)
|
||||||
private String specServiceName; //spec_service_name 协议名称 varchar(64) N
|
private String specServiceName; //spec_service_name 协议名称 varchar(64) N
|
||||||
|
@ExcelField(title="app_desc",sort=4)
|
||||||
private String specServiceDesc; //spec_service_desc 协议描述 varchar2(64) N
|
private String specServiceDesc; //spec_service_desc 协议描述 varchar2(64) N
|
||||||
private Integer isValid; //is_valid 有效标志 int N 1-有效 0-无效
|
private Integer isValid; //is_valid 有效标志 int N 1-有效 0-无效
|
||||||
|
@ExcelField(title="operate_time",sort=6)
|
||||||
private Date opTime; //op_time 操作时间 date N
|
private Date opTime; //op_time 操作时间 date N
|
||||||
private SpecificServiceCfg parent; //parent_id 父节点id int N 0表示一级节点
|
private SpecificServiceCfg parent; //parent_id 父节点id int N 0表示一级节点
|
||||||
private Integer isLeaf; //is_leaf 是否是叶子节点 int N 0否,1是,只有一级填0
|
private Integer isLeaf; //is_leaf 是否是叶子节点 int N 0否,1是,只有一级填0
|
||||||
private Integer groupId; //group_id maat端配置分组id int N 缺省0,表示未与maat分组同步
|
private Integer groupId; //group_id maat端配置分组id int N 缺省0,表示未与maat分组同步
|
||||||
|
@ExcelField(title="cfg_type",dictType="SPECIFIC_SERVICE_CFG_TYPE",sort=5)
|
||||||
private Integer cfgType;//配置类型,1,app;2,加密隧道;3,基础协议
|
private Integer cfgType;//配置类型,1,app;2,加密隧道;3,基础协议
|
||||||
private Integer parentType;//父配置类型
|
private Integer parentType;//父配置类型
|
||||||
private Date beginDate; // 开始日期
|
private Date beginDate; // 开始日期
|
||||||
private Date endDate; // 结束日期
|
private Date endDate; // 结束日期
|
||||||
private String showSequence; //显示序号
|
private String showSequence; //显示序号
|
||||||
|
@ExcelField(title="business_type",sort=1)
|
||||||
private String businessType;
|
private String businessType;
|
||||||
private Integer addFlag;//app界面添加标记
|
private Integer addFlag;//app界面添加标记
|
||||||
|
|
||||||
|
|||||||
@@ -814,6 +814,42 @@ public class ConfigServiceUtil {
|
|||||||
|
|
||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* maat配置停启用
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String configStatusUpdate(String params) throws MaatConvertException{
|
||||||
|
String result = null;
|
||||||
|
ToMaatResult bean = null;
|
||||||
|
Response response=null;
|
||||||
|
try {
|
||||||
|
String url = Constants.SERVICE_URL+Constants.CONFIG_START_STOP_UPDATE;
|
||||||
|
//创建连接
|
||||||
|
WebTarget wt = ClientUtil.getWebTarger(url);
|
||||||
|
logger.info("put url:"+url);
|
||||||
|
//获取响应结果
|
||||||
|
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
|
||||||
|
try {
|
||||||
|
response= header.put(Entity.entity(params, MediaType.APPLICATION_JSON));
|
||||||
|
if(response != null) {
|
||||||
|
result=response.readEntity(String.class);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||||
|
}
|
||||||
|
if(response !=null && response.getStatus() == 200){
|
||||||
|
JSONObject resObject = JSONObject.fromObject(result);
|
||||||
|
bean = (ToMaatResult) JSONObject.toBean(resObject,ToMaatResult.class);
|
||||||
|
}else{
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
// getId(1,1);
|
// getId(1,1);
|
||||||
|
|||||||
@@ -714,6 +714,8 @@ public final class Constants {
|
|||||||
public static final String TRAFFIC_WEBSITELIST_NOTIME=Configurations.getStringProperty("trafficWebsiteListNoTime","trafficWebsiteListNoTime");
|
public static final String TRAFFIC_WEBSITELIST_NOTIME=Configurations.getStringProperty("trafficWebsiteListNoTime","trafficWebsiteListNoTime");
|
||||||
public static final String TRAFFIC_TOPICLIST=Configurations.getStringProperty("trafficTopicList","trafficTopicList");
|
public static final String TRAFFIC_TOPICLIST=Configurations.getStringProperty("trafficTopicList","trafficTopicList");
|
||||||
public static final String TRAFFIC_DOMAIN_TRANS=Configurations.getStringProperty("trafficDomainTrans","trafficDomainTrans");
|
public static final String TRAFFIC_DOMAIN_TRANS=Configurations.getStringProperty("trafficDomainTrans","trafficDomainTrans");
|
||||||
|
public static final String TRAFFIC_PORTACTIVE_FIVEMINUTE=Configurations.getStringProperty("trafficPortActiveFiveMinute","trafficPortActiveFiveMinute");
|
||||||
|
public static final String TREND_TOTAL_REPORT=Configurations.getStringProperty("trendTotalReport","trendTotalReport");
|
||||||
/**
|
/**
|
||||||
* httpclient 工具超时时间设置
|
* httpclient 工具超时时间设置
|
||||||
*/
|
*/
|
||||||
@@ -790,4 +792,14 @@ public final class Constants {
|
|||||||
*/
|
*/
|
||||||
public static final int MAX_LOG_EXPORT_SIZE = Configurations.getIntProperty("maxLogExportSize", 100000);
|
public static final int MAX_LOG_EXPORT_SIZE = Configurations.getIntProperty("maxLogExportSize", 100000);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测事件,封堵事件,重点保障事件查询接口URL
|
||||||
|
*/
|
||||||
|
public static final String NTC_EVENT_MONITOR_OR_BLOCK_Report =Configurations.getStringProperty("ntcEventsMonitorOrBlock","");
|
||||||
|
|
||||||
|
public static final String NTC_EVENT_KEYPROTECTION_Report =Configurations.getStringProperty("ntcEventKeyProtection","");
|
||||||
|
|
||||||
|
//配置启停服务接口方法
|
||||||
|
public static final String CONFIG_START_STOP_UPDATE=Configurations.getStringProperty("configStartStop", "configStartStop");
|
||||||
}
|
}
|
||||||
|
|||||||
345
src/main/java/com/nis/util/SchedulerTaskUtil.java
Normal file
345
src/main/java/com/nis/util/SchedulerTaskUtil.java
Normal file
@@ -0,0 +1,345 @@
|
|||||||
|
package com.nis.util;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.nis.domain.configuration.AppPolicyCfg;
|
||||||
|
import com.nis.domain.configuration.AvFileSampleCfg;
|
||||||
|
import com.nis.domain.configuration.AvSignSampleCfg;
|
||||||
|
import com.nis.domain.configuration.BaseCfg;
|
||||||
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
|
import com.nis.domain.configuration.DnsIpCfg;
|
||||||
|
import com.nis.domain.configuration.DnsResStrategy;
|
||||||
|
import com.nis.domain.configuration.FileDigestCfg;
|
||||||
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
|
import com.nis.domain.configuration.PxyObjKeyring;
|
||||||
|
import com.nis.domain.configuration.PxyObjTrustedCaCert;
|
||||||
|
import com.nis.domain.configuration.PxyObjTrustedCaCrl;
|
||||||
|
import com.nis.domain.maat.MaatCfg;
|
||||||
|
import com.nis.domain.maat.ToMaatBean;
|
||||||
|
import com.nis.domain.maat.ToMaatResult;
|
||||||
|
import com.nis.domain.maat.ToUpdateMaatBeanStatus;
|
||||||
|
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||||
|
import com.nis.domain.maat.ToUpdateMaatBeanStatus.UpdateMaatCfgStatus;
|
||||||
|
import com.nis.web.dao.configuration.ConfigSynchronizationDao;
|
||||||
|
import com.nis.web.service.BaseService;
|
||||||
|
import com.nis.web.service.SpringContextHolder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置任务调度通用类
|
||||||
|
* 定时任务调用,处理界面配置状态修改,以及下发综合服务处理
|
||||||
|
* @author ThinkPad
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class SchedulerTaskUtil {
|
||||||
|
|
||||||
|
//调度任务的配置信息,复用配置同步DAO
|
||||||
|
private static ConfigSynchronizationDao configSynchronizationDao = SpringContextHolder.getBean(ConfigSynchronizationDao.class);
|
||||||
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据业务与编译ID查询配置,修改失效或生效状态,并下发至综合服务
|
||||||
|
* @param serviceId 不可空
|
||||||
|
* @param compileId 不可空
|
||||||
|
* @param oldIsValid 配置当前状态 0无效,1有效,可空
|
||||||
|
* @param newIsValid 配置最新修改状态 0无效,1有效,不可空
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public boolean updateConfigByServiceAndCompile(Integer serviceId,Integer compileId,Integer oldIsValid,Integer newIsValid){
|
||||||
|
//根据业务查询配置文件,获取该业务的配置域表信息
|
||||||
|
ServiceConfigTemplateUtil serviceTemplate = new ServiceConfigTemplateUtil();
|
||||||
|
List<Map<String,Object>> serviceList = serviceTemplate.getServiceListByServiceId(serviceId);
|
||||||
|
//根据编译ID查询配置表中的配置信息
|
||||||
|
for(Map<String,Object> service:serviceList){
|
||||||
|
String tableName = service.get("tableName").toString();
|
||||||
|
String serviceType = service.get("serviceType").toString();
|
||||||
|
String className = service.get("className").toString();
|
||||||
|
BaseCfg entity = new BaseCfg();
|
||||||
|
entity.setServiceId(serviceId);
|
||||||
|
entity.setTableName(tableName);
|
||||||
|
List list = Lists.newArrayList();
|
||||||
|
List callBackCfgList = Lists.newArrayList();
|
||||||
|
boolean isUpdateContent = false;
|
||||||
|
/**
|
||||||
|
* 根据编译ID查询配置,如果配置当前审核状态为未审核(is_audit=0),并且newIsValid=1需要查询详细的域配置信息,下发配置详细内容,
|
||||||
|
* 如果已审核(is_audit=1),则只查询配置主表,更新配置状态即可,
|
||||||
|
* 如果审核取消(is_audit=3)则删除定时任务,表示配置已最终删除,此状态处理原则上在配置修改拦截器中处理
|
||||||
|
*/
|
||||||
|
if("1".equals(serviceType)){//maat类配置
|
||||||
|
Date updateTime = new Date();
|
||||||
|
//下发并修改配置状态的参数类
|
||||||
|
ToUpdateMaatBeanStatus maatStatusBean = new ToUpdateMaatBeanStatus();
|
||||||
|
UpdateMaatCfgStatus updateCfg = new UpdateMaatCfgStatus();
|
||||||
|
List<UpdateMaatCfgStatus> configCompileStartStopList = new ArrayList();
|
||||||
|
maatStatusBean.setVersion(Constants.MAAT_VERSION);
|
||||||
|
maatStatusBean.setOpAction(Constants.INSERT_ACTION);
|
||||||
|
maatStatusBean.setAuditTime(updateTime);
|
||||||
|
maatStatusBean.setCreatorName("TaskScheduler");//任务调度定时修改状态
|
||||||
|
|
||||||
|
//下发带有配置内容的参数对象
|
||||||
|
ToMaatBean maatBean = new ToMaatBean();
|
||||||
|
MaatCfg maatCfg = new MaatCfg();
|
||||||
|
List<MaatCfg> configCompileList = new ArrayList();
|
||||||
|
List<GroupCfg> groupRelationList = new ArrayList();
|
||||||
|
List<IpCfg> ipRegionList = new ArrayList();
|
||||||
|
List<StringCfg> strRegionList = new ArrayList();
|
||||||
|
List<NumBoundaryCfg> numRegionList = new ArrayList();
|
||||||
|
List<DigestCfg> digestRegionList = new ArrayList();
|
||||||
|
List<IpCfg> areaIpRegionList = new ArrayList();
|
||||||
|
|
||||||
|
// for(Integer compileId:compileIds){
|
||||||
|
entity.setCompileId(compileId);
|
||||||
|
//查询配置
|
||||||
|
if("cfg_index_info".equals(tableName)){
|
||||||
|
list = configSynchronizationDao.getCfgIndexList(entity);
|
||||||
|
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
CfgIndexInfo cfg = (CfgIndexInfo) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
|
if(newIsValid==1){
|
||||||
|
//需要查询详细的域配置信息,下发配置内容,并修改数据库is_valid=1,is_audit=1
|
||||||
|
|
||||||
|
}else{
|
||||||
|
logger.debug("配置修改状态与当前配置状态不符合业务逻辑!");
|
||||||
|
}
|
||||||
|
}else{//修改各个配置域的配置状态
|
||||||
|
BaseCfg config = new BaseCfg();
|
||||||
|
config.setIsValid(newIsValid);
|
||||||
|
config.setEditTime(updateTime);
|
||||||
|
config.setCompileId(cfg.getCompileId());
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
if(cfgList!=null){
|
||||||
|
for(Map<String,Object> m:cfgList){
|
||||||
|
String regionTableName = m.get("tableName").toString();
|
||||||
|
config.setTableName(regionTableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if("file_digest_cfg".equals(tableName)){
|
||||||
|
list = configSynchronizationDao.getFileDigestListByService(entity);
|
||||||
|
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
FileDigestCfg cfg = (FileDigestCfg) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
|
if(newIsValid==1){
|
||||||
|
//需要查询详细的域配置信息,下发配置内容,并修改数据库is_valid=1,is_audit=1
|
||||||
|
|
||||||
|
}else{
|
||||||
|
logger.debug("配置修改状态与当前配置状态不符合业务逻辑!");
|
||||||
|
}
|
||||||
|
}else{//修改各个配置域的配置状态
|
||||||
|
BaseCfg config = new BaseCfg();
|
||||||
|
config.setIsValid(newIsValid);
|
||||||
|
config.setEditTime(updateTime);
|
||||||
|
config.setCompileId(cfg.getCompileId());
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
if(cfgList!=null){
|
||||||
|
for(Map<String,Object> m:cfgList){
|
||||||
|
String regionTableName = m.get("tableName").toString();
|
||||||
|
config.setTableName(regionTableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if("app_policy_cfg".equals(tableName)){
|
||||||
|
list = configSynchronizationDao.getAppPolicyList(entity);
|
||||||
|
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
AppPolicyCfg cfg = (AppPolicyCfg) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
|
if(newIsValid==1){
|
||||||
|
//需要查询详细的域配置信息,下发配置内容,并修改数据库is_valid=1,is_audit=1
|
||||||
|
|
||||||
|
}else{
|
||||||
|
logger.debug("配置修改状态与当前配置状态不符合业务逻辑!");
|
||||||
|
}
|
||||||
|
}else{//修改各个配置域的配置状态
|
||||||
|
BaseCfg config = new BaseCfg();
|
||||||
|
config.setIsValid(newIsValid);
|
||||||
|
config.setEditTime(updateTime);
|
||||||
|
config.setCompileId(cfg.getCompileId());
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
if(cfgList!=null){
|
||||||
|
for(Map<String,Object> m:cfgList){
|
||||||
|
String regionTableName = m.get("tableName").toString();
|
||||||
|
config.setTableName(regionTableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(!isUpdateContent){
|
||||||
|
updateCfg.setIsValid(newIsValid);
|
||||||
|
updateCfg.setCompileId(compileId);
|
||||||
|
updateCfg.setAuditTime(updateTime);
|
||||||
|
configCompileStartStopList.add(updateCfg);
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
if(isUpdateContent){//修改配置内容以及状态
|
||||||
|
//下发配置内容
|
||||||
|
|
||||||
|
}else{//只修改配置状态
|
||||||
|
maatStatusBean.setConfigCompileStartStopList(configCompileStartStopList);
|
||||||
|
String json=BaseService.gsonToJson(maatBean);
|
||||||
|
//调用服务启停接口
|
||||||
|
String result = ConfigServiceUtil.configStatusUpdate(json);
|
||||||
|
logger.debug("MAAT类配置启停状态修改结果:"+result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if("2".equals(serviceType)){//回调类配置
|
||||||
|
List ids = Lists.newArrayList();
|
||||||
|
// for(Integer compileId:compileIds){
|
||||||
|
entity.setCompileId(compileId);
|
||||||
|
//查询配置
|
||||||
|
if(entity.getServiceId().equals(3)){//ip drop回调类配置用了主表和子表关系
|
||||||
|
list = configSynchronizationDao.getCfgIndexList(entity);
|
||||||
|
if(!StringUtil.isEmpty(list)){
|
||||||
|
List<Integer> compileIdArray = Lists.newArrayList();
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
CfgIndexInfo cfg = (CfgIndexInfo) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
|
Date updateTime = new Date();
|
||||||
|
cfg.setIsAudit(1);
|
||||||
|
cfg.setAuditTime(updateTime);
|
||||||
|
cfg.setTableName(tableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
}
|
||||||
|
compileIdArray.add(cfg.getCompileId());
|
||||||
|
}
|
||||||
|
List subList = configSynchronizationDao.getIpDropList("ip_port_cfg", compileIdArray);
|
||||||
|
for(int i=0;i<subList.size();i++){
|
||||||
|
IpPortCfg cfg = (IpPortCfg) subList.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
|
cfg.setIsValid(newIsValid);
|
||||||
|
if(newIsValid==1){
|
||||||
|
Date updateTime = new Date();
|
||||||
|
cfg.setIsAudit(1);
|
||||||
|
cfg.setAuditTime(updateTime);
|
||||||
|
cfg.setTableName("ip_port_cfg");
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
callBackCfgList.add(BaseService.convertCallBackIp(cfg,cfg.getGroupId()));
|
||||||
|
}else{
|
||||||
|
logger.debug("配置修改与配置当前状态不符合业务逻辑");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
if(className.equals("AvFileSampleCfg")){
|
||||||
|
list = configSynchronizationDao.getAvFileCfgList(entity);
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
AvFileSampleCfg cfg = (AvFileSampleCfg) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
|
cfg.setIsValid(newIsValid);
|
||||||
|
if(newIsValid==1){
|
||||||
|
Date updateTime = new Date();
|
||||||
|
cfg.setIsAudit(1);
|
||||||
|
cfg.setAuditTime(updateTime);
|
||||||
|
cfg.setTableName(tableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
callBackCfgList.add(cfg);
|
||||||
|
}else{
|
||||||
|
logger.debug("配置修改与配置当前状态不符合业务逻辑");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if(className.equals("AvSignSampleCfg")){//音视频场景配置
|
||||||
|
list = configSynchronizationDao.getAvSignCfgList(entity);
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
AvSignSampleCfg cfg = (AvSignSampleCfg) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
|
cfg.setIsValid(newIsValid);
|
||||||
|
if(newIsValid==1){
|
||||||
|
Date updateTime = new Date();
|
||||||
|
cfg.setIsAudit(1);
|
||||||
|
cfg.setAuditTime(updateTime);
|
||||||
|
cfg.setTableName(tableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
callBackCfgList.add(cfg);
|
||||||
|
}else{
|
||||||
|
logger.debug("配置修改与配置当前状态不符合业务逻辑");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else if(className.equals("IpPortCfg")){
|
||||||
|
list = configSynchronizationDao.getIpPortListByService(entity);
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
IpPortCfg cfg = (IpPortCfg) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
|
cfg.setIsValid(newIsValid);
|
||||||
|
if(newIsValid==1){
|
||||||
|
Date updateTime = new Date();
|
||||||
|
cfg.setIsAudit(1);
|
||||||
|
cfg.setAuditTime(updateTime);
|
||||||
|
cfg.setTableName(tableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
callBackCfgList.add(BaseService.convertCallBackIp(cfg,cfg.getGroupId()));
|
||||||
|
}else{
|
||||||
|
logger.debug("配置修改与配置当前状态不符合业务逻辑");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!isUpdateContent){//如果没有内容修改,则只更新状态
|
||||||
|
Date updateTime = new Date();
|
||||||
|
BaseCfg updateCfg = new BaseCfg();
|
||||||
|
updateCfg.setIsValid(newIsValid);
|
||||||
|
updateCfg.setCompileId(compileId);
|
||||||
|
updateCfg.setServiceId(serviceId);
|
||||||
|
updateCfg.setAuditTime(updateTime);
|
||||||
|
updateCfg.setEditTime(updateTime);
|
||||||
|
updateCfg.setCreatorName("TaskScheduler");
|
||||||
|
configSynchronizationDao.updateCfgStatus(updateCfg);//修改界面数据库配置状态
|
||||||
|
callBackCfgList.add(updateCfg);
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
if(!StringUtil.isEmpty(callBackCfgList)){
|
||||||
|
//调用服务接口下发配置数据
|
||||||
|
String json=BaseService.gsonToJson(callBackCfgList);
|
||||||
|
//调用服务接口修改回调类配置状态
|
||||||
|
ToMaatResult result = ConfigServiceUtil.put(json,2);
|
||||||
|
logger.debug("回调类配置启停状态修改结果:"+result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -66,10 +66,9 @@ public class ServiceConfigTemplateUtil {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param functionId
|
* @param functionId
|
||||||
* @param serviceId
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<Map<String,Object>> getServiceList(Integer functionId){
|
public List<Map<String,Object>> getServiceListByFunctionId(Integer functionId){
|
||||||
List<Map<String,Object>> list =new ArrayList();
|
List<Map<String,Object>> list =new ArrayList();
|
||||||
if(!StringUtil.isEmpty(functionId)) {
|
if(!StringUtil.isEmpty(functionId)) {
|
||||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(functionId);
|
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(functionId);
|
||||||
@@ -97,6 +96,34 @@ public class ServiceConfigTemplateUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param serviceId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Map<String,Object>> getServiceListByServiceId(Integer serviceId){
|
||||||
|
List<Map<String,Object>> list =new ArrayList();
|
||||||
|
if(!StringUtil.isEmpty(serviceId)) {
|
||||||
|
List<Element> elements = root.selectNodes("service");
|
||||||
|
for(Element element:elements){
|
||||||
|
String serviceIdC=element.attributeValue("id");
|
||||||
|
if(!StringUtil.isEmpty(serviceIdC)
|
||||||
|
&& String.valueOf(serviceId).equals(serviceIdC)) {
|
||||||
|
Map<String,Object> map = new HashMap();
|
||||||
|
for(int i=0;i<element.attributes().size();i++){
|
||||||
|
String attributeName = element.attribute(i).getName();
|
||||||
|
map.put(attributeName, element.attributeValue(attributeName));
|
||||||
|
}
|
||||||
|
map.put("cfgList", getServiceCfgList(element));
|
||||||
|
map.put("userRegionList",getUserRegionList(element));
|
||||||
|
list.add(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
@@ -151,7 +178,7 @@ public class ServiceConfigTemplateUtil {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
ServiceConfigTemplateUtil serviceTemplate = new ServiceConfigTemplateUtil();
|
ServiceConfigTemplateUtil serviceTemplate = new ServiceConfigTemplateUtil();
|
||||||
List<Map<String,Object>> list = serviceTemplate.getServiceList(5);
|
List<Map<String,Object>> list = serviceTemplate.getServiceListByServiceId(518);
|
||||||
for(Map<String,Object> map :list){
|
for(Map<String,Object> map :list){
|
||||||
System.out.println("业务配置:"+map.get("id")+","+map.get("functionId")+","+map.get("serviceType")+","+map.get("tableName"));
|
System.out.println("业务配置:"+map.get("id")+","+map.get("functionId")+","+map.get("serviceType")+","+map.get("tableName"));
|
||||||
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) map.get("cfgList");
|
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) map.get("cfgList");
|
||||||
|
|||||||
@@ -269,11 +269,11 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||||||
*/
|
*/
|
||||||
public static String getRemoteAddr(HttpServletRequest request) {
|
public static String getRemoteAddr(HttpServletRequest request) {
|
||||||
String remoteAddr = request.getHeader("X-Real-IP");
|
String remoteAddr = request.getHeader("X-Real-IP");
|
||||||
if (isNotBlank(remoteAddr)) {
|
if (isBlank(remoteAddr)) {
|
||||||
remoteAddr = request.getHeader("X-Forwarded-For");
|
remoteAddr = request.getHeader("X-Forwarded-For");
|
||||||
} else if (isNotBlank(remoteAddr)) {
|
} else if (isBlank(remoteAddr)) {
|
||||||
remoteAddr = request.getHeader("Proxy-Client-IP");
|
remoteAddr = request.getHeader("Proxy-Client-IP");
|
||||||
} else if (isNotBlank(remoteAddr)) {
|
} else if (isBlank(remoteAddr)) {
|
||||||
remoteAddr = request.getHeader("WL-Proxy-Client-IP");
|
remoteAddr = request.getHeader("WL-Proxy-Client-IP");
|
||||||
}
|
}
|
||||||
return remoteAddr != null ? remoteAddr : request.getRemoteAddr();
|
return remoteAddr != null ? remoteAddr : request.getRemoteAddr();
|
||||||
|
|||||||
@@ -130,6 +130,9 @@ public class ExcelCsv {
|
|||||||
Map<String, List<String>> commentMap=new HashMap<String, List<String>>();
|
Map<String, List<String>> commentMap=new HashMap<String, List<String>>();
|
||||||
for (String title : titleList) {
|
for (String title : titleList) {
|
||||||
String noExportField=noExportMap.get(title);
|
String noExportField=noExportMap.get(title);
|
||||||
|
if(noExportField.contains("do_log")){
|
||||||
|
noExportField=",do_blacklist,"+noExportField;
|
||||||
|
}
|
||||||
List<Object[]> annotationList = Lists.newArrayList();
|
List<Object[]> annotationList = Lists.newArrayList();
|
||||||
List<Field> list=new ArrayList<Field>();
|
List<Field> list=new ArrayList<Field>();
|
||||||
// Get annotation field
|
// Get annotation field
|
||||||
@@ -216,7 +219,14 @@ public class ExcelCsv {
|
|||||||
}
|
}
|
||||||
if(!StringUtil.isEmpty(titleStr)){
|
if(!StringUtil.isEmpty(titleStr)){
|
||||||
//去掉不需要展示的header
|
//去掉不需要展示的header
|
||||||
if(!(noExportField.indexOf(","+titleStr+",") > -1)){
|
//去掉不需要展示的header
|
||||||
|
String noExport="";
|
||||||
|
if(noExportField.contains("&")){
|
||||||
|
noExport=noExportField.substring(0,noExportField.indexOf("&"));
|
||||||
|
}else{
|
||||||
|
noExport=noExportField;
|
||||||
|
}
|
||||||
|
if(!(noExport.indexOf(","+titleStr+",") > -1)){
|
||||||
//需要替换的header
|
//需要替换的header
|
||||||
boolean flag=true;
|
boolean flag=true;
|
||||||
if(noExportField.contains("&")){
|
if(noExportField.contains("&")){
|
||||||
@@ -225,14 +235,14 @@ public class ExcelCsv {
|
|||||||
for (int i = 0; i < replaceStr.length; i++) {
|
for (int i = 0; i < replaceStr.length; i++) {
|
||||||
String [] fields=replaceStr[i].split(":");
|
String [] fields=replaceStr[i].split(":");
|
||||||
if(fields[0].equals(titleStr)){
|
if(fields[0].equals(titleStr)){
|
||||||
titleStr=msgProp.getProperty(fields[1]);
|
titleStr=msgProp.getProperty(fields[1],fields[1]);
|
||||||
flag=false;
|
flag=false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(flag){
|
if(flag){
|
||||||
titleStr=msgProp.getProperty(titleStr)==null?titleStr:msgProp.getProperty(titleStr);
|
titleStr=msgProp.getProperty(titleStr)==null?titleStr:msgProp.getProperty(titleStr,titleStr);
|
||||||
}
|
}
|
||||||
headerList.add(titleStr);
|
headerList.add(titleStr);
|
||||||
commentList.add(commentStr);
|
commentList.add(commentStr);
|
||||||
@@ -322,7 +332,7 @@ public class ExcelCsv {
|
|||||||
log.error("Get entity value failed",ex);
|
log.error("Get entity value failed",ex);
|
||||||
val = "";
|
val = "";
|
||||||
}
|
}
|
||||||
sb.append(val + ", ");
|
sb.append(val + "┆~");
|
||||||
}
|
}
|
||||||
listT.add(String.valueOf(sb));
|
listT.add(String.valueOf(sb));
|
||||||
}
|
}
|
||||||
@@ -415,7 +425,7 @@ public class ExcelCsv {
|
|||||||
// 写入文件内容
|
// 写入文件内容
|
||||||
//Html 解码
|
//Html 解码
|
||||||
data = Encodes.unescapeHtml(data.toString());
|
data = Encodes.unescapeHtml(data.toString());
|
||||||
String [] datas=data.split(",");
|
String [] datas=data.split("┆~");
|
||||||
for (String tag : datas) {
|
for (String tag : datas) {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
if("null".equals(tag.trim())){
|
if("null".equals(tag.trim())){
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import org.apache.poi.ss.usermodel.Row;
|
|||||||
import org.apache.poi.ss.usermodel.Sheet;
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.apache.poi.ss.util.CellRangeAddress;
|
import org.apache.poi.ss.util.CellRangeAddress;
|
||||||
|
import org.apache.poi.ss.util.RegionUtil;
|
||||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
|
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
|
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
|
||||||
@@ -227,6 +228,73 @@ public class ExportExcel {
|
|||||||
index++;
|
index++;
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
/*** HTTP(s)重定向 重定向应答码 ***/
|
||||||
|
if("redirect_response_code".equals(headerStr)){
|
||||||
|
commentStr="";
|
||||||
|
List<SysDataDictionaryItem> dict=DictUtils.getDictList("REDIRECT_RESPONSE_CODE");
|
||||||
|
if(dict !=null && dict.size()>0){
|
||||||
|
for (SysDataDictionaryItem sysDataDictionaryItem : dict) {
|
||||||
|
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"("+msgProp.getProperty(sysDataDictionaryItem.getItemValue(),sysDataDictionaryItem.getItemValue())+")\n";
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
defaultValue = "1";
|
||||||
|
}
|
||||||
|
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
if(!StringUtil.isEmpty(defaultValue)){
|
||||||
|
//1、默认值说明
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||||
|
index++;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*** HTTP(s)阻断 应答码 ***/
|
||||||
|
if("response_code".equals(headerStr)){
|
||||||
|
commentStr="";
|
||||||
|
List<SysDataDictionaryItem> dict=DictUtils.getDictList("RESPONSE_CODE");
|
||||||
|
if(dict !=null && dict.size()>0){
|
||||||
|
for (SysDataDictionaryItem sysDataDictionaryItem : dict) {
|
||||||
|
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"("+msgProp.getProperty(sysDataDictionaryItem.getItemValue(),sysDataDictionaryItem.getItemValue())+")\n";
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
defaultValue = "404";
|
||||||
|
}
|
||||||
|
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
if(!StringUtil.isEmpty(defaultValue)){
|
||||||
|
//1、默认值说明
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||||
|
index++;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*** HTTP(s)替换 搜索区域 ***/
|
||||||
|
if(("replace_zone".equals(headerStr)) && (region.getFunctionId().equals(209))){
|
||||||
|
commentStr="";
|
||||||
|
List<SysDataDictionaryItem> dict=DictUtils.getDictList("CONTROL_REPLACE_ZONE");
|
||||||
|
if(dict !=null && dict.size()>0){
|
||||||
|
for (SysDataDictionaryItem sysDataDictionaryItem : dict) {
|
||||||
|
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"("+msgProp.getProperty(sysDataDictionaryItem.getItemValue(),sysDataDictionaryItem.getItemValue())+")\n";
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
defaultValue = "http_resp_body";
|
||||||
|
}
|
||||||
|
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
if(!StringUtil.isEmpty(defaultValue)){
|
||||||
|
//1、默认值说明
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||||
|
index++;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/***发现内容***/
|
/***发现内容***/
|
||||||
if("replaced_content".equals(headerStr)){
|
if("replaced_content".equals(headerStr)){
|
||||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
@@ -244,7 +312,7 @@ public class ExportExcel {
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
//intercept replace replace_zone
|
//intercept replace replace_zone
|
||||||
if("replace_zone".equals(headerStr)){
|
if("replace_zone".equals(headerStr) && (region.getFunctionId().equals(212))){
|
||||||
commentStr="";
|
commentStr="";
|
||||||
List<SysDataDictionaryItem> interceptReplaceZone=DictUtils.getDictList("INTERCEPT_REPLACE_ZONE");
|
List<SysDataDictionaryItem> interceptReplaceZone=DictUtils.getDictList("INTERCEPT_REPLACE_ZONE");
|
||||||
if(interceptReplaceZone !=null && interceptReplaceZone.size()>0){
|
if(interceptReplaceZone !=null && interceptReplaceZone.size()>0){
|
||||||
@@ -968,13 +1036,18 @@ public class ExportExcel {
|
|||||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
// APP Payload
|
||||||
|
if(region.getFunctionId().equals(563)) {
|
||||||
|
commentStr=commentStr+"▶"+"L3_header:"+msgProp.getProperty("need_input")+"'headerType'"+"\n";
|
||||||
|
index++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//expr type
|
//expr type
|
||||||
if("key_word".equals(headerStr)){
|
if("key_word".equals(headerStr)){
|
||||||
if(!StringUtil.isEmpty(region.getConfigMultiKeywords())){
|
if(!StringUtil.isEmpty(region.getConfigMultiKeywords())){
|
||||||
if(region.getConfigMultiKeywords().equals(1)){//多关键字输入TODO
|
if(region.getConfigMultiKeywords().equals("1")){//多关键字输入TODO
|
||||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
index++;
|
index++;
|
||||||
//允许输入多关键字,多个关键字用换行表示
|
//允许输入多关键字,多个关键字用换行表示
|
||||||
@@ -1189,6 +1262,95 @@ public class ExportExcel {
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// APP Payload
|
||||||
|
if("headerType".equals(headerStr)){
|
||||||
|
commentStr=commentStr+"IP_header"+"\n"+"ICMP_header"+"\n";
|
||||||
|
index++;
|
||||||
|
index++;
|
||||||
|
defaultValue=region.getConfigDistrict().split(",")[0];
|
||||||
|
|
||||||
|
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||||
|
index++;
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
|
||||||
|
//1、非空说明
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("required")+"\n";
|
||||||
|
index++;
|
||||||
|
//2、默认值说明
|
||||||
|
/*if(!StringUtil.isEmpty(defaultValue)){
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+"IP_header"+"\n";
|
||||||
|
index++;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
commentStr=commentStr+"▶"+"IP_header:"+msgProp.getProperty("need_input")+"('VER'、'IHL'、'TOS'、'Total Length'、'Flags'、'fragment offset'、'Protocol'),"+msgProp.getProperty("max_input")+"\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+"ICMP_header:"+msgProp.getProperty("need_input")+"('ICMP type'、'ICMP code'、'ICMP identifier')"+"\n";
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("VER".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_4");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("IHL".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_4");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("TOS".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("Total Length".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_16");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("Flags".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_3");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("fragment offset".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("Protocol".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("ICMP type".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("ICMP code".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("ICMP identifier".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_16");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
}else if(region.getRegionType().equals(6)) {
|
}else if(region.getRegionType().equals(6)) {
|
||||||
if(region.getFunctionId().equals(400)) {
|
if(region.getFunctionId().equals(400)) {
|
||||||
if("group".equals(headerStr)){
|
if("group".equals(headerStr)){
|
||||||
@@ -2132,6 +2294,9 @@ public class ExportExcel {
|
|||||||
Map<String, List<String>> commentMap=new HashMap<String, List<String>>();
|
Map<String, List<String>> commentMap=new HashMap<String, List<String>>();
|
||||||
for (String title : titleList) {
|
for (String title : titleList) {
|
||||||
String noExportField=noExportMap.get(title);
|
String noExportField=noExportMap.get(title);
|
||||||
|
if(noExportField.contains("do_log")){
|
||||||
|
noExportField=",do_blacklist,"+noExportField;
|
||||||
|
}
|
||||||
List<Object[]> annotationList = Lists.newArrayList();
|
List<Object[]> annotationList = Lists.newArrayList();
|
||||||
List<Field> list=new ArrayList<Field>();
|
List<Field> list=new ArrayList<Field>();
|
||||||
// Get annotation field
|
// Get annotation field
|
||||||
@@ -2218,7 +2383,13 @@ public class ExportExcel {
|
|||||||
}
|
}
|
||||||
if(!StringUtil.isEmpty(titleStr)){
|
if(!StringUtil.isEmpty(titleStr)){
|
||||||
//去掉不需要展示的header
|
//去掉不需要展示的header
|
||||||
if(!(noExportField.indexOf(","+titleStr+",") > -1)){
|
String noExport="";
|
||||||
|
if(noExportField.contains("&")){
|
||||||
|
noExport=noExportField.substring(0,noExportField.indexOf("&"));
|
||||||
|
}else{
|
||||||
|
noExport=noExportField;
|
||||||
|
}
|
||||||
|
if(!(noExport.indexOf(","+titleStr+",") > -1)){
|
||||||
//需要替换的header
|
//需要替换的header
|
||||||
boolean flag=true;
|
boolean flag=true;
|
||||||
if(noExportField.contains("&")){
|
if(noExportField.contains("&")){
|
||||||
@@ -2227,14 +2398,14 @@ public class ExportExcel {
|
|||||||
for (int i = 0; i < replaceStr.length; i++) {
|
for (int i = 0; i < replaceStr.length; i++) {
|
||||||
String [] fields=replaceStr[i].split(":");
|
String [] fields=replaceStr[i].split(":");
|
||||||
if(fields[0].equals(titleStr)){
|
if(fields[0].equals(titleStr)){
|
||||||
titleStr=msgProp.getProperty(fields[1]);
|
titleStr=msgProp.getProperty(fields[1],fields[1]);
|
||||||
flag=false;
|
flag=false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(flag){
|
if(flag){
|
||||||
titleStr=msgProp.getProperty(titleStr)==null?titleStr:msgProp.getProperty(titleStr);
|
titleStr=msgProp.getProperty(titleStr)==null?titleStr:msgProp.getProperty(titleStr,titleStr);
|
||||||
}
|
}
|
||||||
headerList.add(titleStr);
|
headerList.add(titleStr);
|
||||||
commentList.add(commentStr);
|
commentList.add(commentStr);
|
||||||
@@ -2287,11 +2458,10 @@ public class ExportExcel {
|
|||||||
Row timeRow = sheet.createRow(0);
|
Row timeRow = sheet.createRow(0);
|
||||||
timeRow.setHeightInPoints(16);
|
timeRow.setHeightInPoints(16);
|
||||||
Cell cellt = timeRow.createCell(0);
|
Cell cellt = timeRow.createCell(0);
|
||||||
cellt.setCellStyle(style);
|
|
||||||
cellt.setCellValue(titleTime);
|
cellt.setCellValue(titleTime);
|
||||||
sheet.addMergedRegion(callRangeAddress);
|
sheet.addMergedRegion(callRangeAddress);
|
||||||
sheet.autoSizeColumn(0);
|
sheet.autoSizeColumn(0);
|
||||||
//--------------------
|
setBorderStyle(CellStyle.BORDER_THIN,callRangeAddress,sheet,wb);
|
||||||
}
|
}
|
||||||
Integer rownum=rownums.get(title);
|
Integer rownum=rownums.get(title);
|
||||||
Row headerRow = sheet.createRow(rownum++);
|
Row headerRow = sheet.createRow(rownum++);
|
||||||
@@ -2320,6 +2490,21 @@ public class ExportExcel {
|
|||||||
log.debug("Initialize success.");
|
log.debug("Initialize success.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setBorderStyle(int border, CellRangeAddress region, Sheet sheet, SXSSFWorkbook wb){
|
||||||
|
RegionUtil.setBorderBottom(border, region, sheet, wb);//下边框
|
||||||
|
RegionUtil.setBorderLeft(border, region, sheet, wb); //左边框
|
||||||
|
RegionUtil.setBorderRight(border, region, sheet, wb); //右边框
|
||||||
|
RegionUtil.setBorderTop(border, region, sheet, wb); //上边框
|
||||||
|
RegionUtil.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex(), region, sheet, wb);
|
||||||
|
RegionUtil.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex(), region, sheet, wb);
|
||||||
|
RegionUtil.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex(), region, sheet, wb);
|
||||||
|
RegionUtil.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex(), region, sheet, wb);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 输出数据流
|
* 输出数据流
|
||||||
* @param os 输出数据流
|
* @param os 输出数据流
|
||||||
|
|||||||
@@ -0,0 +1,352 @@
|
|||||||
|
package com.nis.util.excel.thread;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.BlockingQueue;
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.jets3t.service.ServiceException;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
|
import com.beust.jcommander.internal.Lists;
|
||||||
|
import com.beust.jcommander.internal.Sets;
|
||||||
|
import com.nis.domain.FunctionRegionDict;
|
||||||
|
import com.nis.domain.FunctionServiceDict;
|
||||||
|
import com.nis.domain.configuration.AppComplexFeatureCfg;
|
||||||
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.web.service.SpringContextHolder;
|
||||||
|
import com.nis.web.service.configuration.AppMultiFeatureCfgService;
|
||||||
|
|
||||||
|
public class CheckAppFeatureComplexStringFormatThread implements Callable<String>{
|
||||||
|
private Logger logger=Logger.getLogger(CheckAppFeatureComplexStringFormatThread.class);
|
||||||
|
private BlockingQueue<? extends Object> srcQueue;
|
||||||
|
private BlockingQueue<AppComplexFeatureCfg> destQueue;
|
||||||
|
private Properties prop;
|
||||||
|
private FunctionServiceDict serviceDict;
|
||||||
|
private FunctionRegionDict regionDict;
|
||||||
|
|
||||||
|
public CheckAppFeatureComplexStringFormatThread(FunctionServiceDict serviceDict,FunctionRegionDict regionDict,Properties prop,BlockingQueue<? extends Object> srcQueue,BlockingQueue<AppComplexFeatureCfg> destQueue) {
|
||||||
|
this.serviceDict=serviceDict;
|
||||||
|
this.regionDict=regionDict;
|
||||||
|
this.srcQueue=srcQueue;
|
||||||
|
this.destQueue=destQueue;
|
||||||
|
this.prop=prop;
|
||||||
|
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String call() throws Exception {
|
||||||
|
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
StringBuffer msg=new StringBuffer();
|
||||||
|
while(!srcQueue.isEmpty()) {
|
||||||
|
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
if(regionDict.getRegionType().intValue()==3) {
|
||||||
|
try {
|
||||||
|
List<AppComplexFeatureCfg> cfgs=this.checkAppComplexFeatureCfg(msg,dataList);
|
||||||
|
destQueue.addAll(cfgs);
|
||||||
|
}catch (Exception e) {
|
||||||
|
logger.error("checkComplexStringCfg error,",e);
|
||||||
|
// TODO: handle exception
|
||||||
|
//msg=e.getMessage();
|
||||||
|
//msg.append(e.getMessage());
|
||||||
|
//break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dataList.clear();
|
||||||
|
}
|
||||||
|
return msg.toString();
|
||||||
|
}
|
||||||
|
public List<AppComplexFeatureCfg> checkAppComplexFeatureCfg(StringBuffer msg,
|
||||||
|
List<?> list) throws ServiceException {
|
||||||
|
logger.warn("start to validate appfeaturecomplexString data...");
|
||||||
|
long start=System.currentTimeMillis();
|
||||||
|
List<AppComplexFeatureCfg> stringList = new ArrayList<AppComplexFeatureCfg>();
|
||||||
|
String exprTypeP = regionDict.getConfigExprType();
|
||||||
|
if (StringUtils.isBlank(exprTypeP)) {
|
||||||
|
throw new RuntimeException("Found String region,but exprType is Empty");
|
||||||
|
}
|
||||||
|
String matchMethodP = regionDict.getConfigMatchMethod();
|
||||||
|
if (StringUtils.isBlank(matchMethodP)) {
|
||||||
|
throw new RuntimeException("Found String region,but matchMethod is Empty");
|
||||||
|
}
|
||||||
|
String hexP = regionDict.getConfigHex();
|
||||||
|
if (StringUtils.isBlank(hexP)) {
|
||||||
|
throw new RuntimeException("Found String region,but hex is Empty");
|
||||||
|
}
|
||||||
|
String mulityKeywordsP = regionDict.getConfigMultiKeywords();
|
||||||
|
if (StringUtils.isBlank(mulityKeywordsP)) {
|
||||||
|
throw new RuntimeException("Found String region,but mulityKeywords is Empty");
|
||||||
|
}
|
||||||
|
String dirtrictP = regionDict.getConfigDistrict();
|
||||||
|
StringBuffer errTip = new StringBuffer();
|
||||||
|
Pattern pattern = Pattern.compile("\t|\r|\n|\b|\f");
|
||||||
|
AppMultiFeatureCfgService appMultiFeatureCfgService = SpringContextHolder.getBean(AppMultiFeatureCfgService.class);
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
StringBuffer errInfo = new StringBuffer();
|
||||||
|
AppComplexFeatureCfg baseStringCfg = new AppComplexFeatureCfg();
|
||||||
|
BeanUtils.copyProperties(list.get(i), baseStringCfg);
|
||||||
|
// 配置描述、关键字长度限制
|
||||||
|
if(baseStringCfg.getCfgDesc().length() > 128) {
|
||||||
|
errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";");
|
||||||
|
}
|
||||||
|
if(baseStringCfg.getCfgKeywords().length() < 4 || baseStringCfg.getCfgKeywords().length() > 1024){
|
||||||
|
errInfo.append(prop.getProperty("key_word")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("min_length")+":4,"+prop.getProperty("max_length")+":1024") + ";");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (regionDict.getRegionType().equals(3)) {
|
||||||
|
String keyword = baseStringCfg.getCfgKeywords();
|
||||||
|
String district = baseStringCfg.getDistrict();
|
||||||
|
if (StringUtils.isBlank(keyword)) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word") + " ") + ";");
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(dirtrictP)) {
|
||||||
|
if (StringUtils.isBlank(district)) {
|
||||||
|
if (dirtrictP.indexOf(",") == -1) {
|
||||||
|
baseStringCfg.setDistrict(dirtrictP);
|
||||||
|
} else {
|
||||||
|
// baseStringCfg.setDistrict(dirtrictP.split(",")[0]);
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), prop.getProperty("district") + " ")
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
} else if (dirtrictP.indexOf(district) == -1) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("district") + " ")
|
||||||
|
+ ";");
|
||||||
|
} else if (dirtrictP.indexOf("others")>-1&&district.equals("others")) {
|
||||||
|
//不允许自定义匹配区域导入
|
||||||
|
errInfo.append(prop.getProperty("district")+" "+
|
||||||
|
String.format(prop.getProperty("can_not_be"), " 'others'")+ ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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()) {
|
||||||
|
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 (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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Integer exprType = baseStringCfg.getExprType();
|
||||||
|
boolean has = false;
|
||||||
|
if (exprType == null) {
|
||||||
|
if (exprTypeP.indexOf(",") == -1) {
|
||||||
|
if (mulityKeywordsP.equals("0") && exprTypeP.equals("1")) {
|
||||||
|
throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId());
|
||||||
|
}
|
||||||
|
baseStringCfg.setExprType(Integer.parseInt(exprTypeP));
|
||||||
|
} else if (exprTypeP.indexOf("0") > -1 && mulityKeywordsP.equals("0")) {
|
||||||
|
baseStringCfg.setExprType(0);
|
||||||
|
} else if (exprTypeP.indexOf("1") > -1 && mulityKeywordsP.equals("1")
|
||||||
|
&& keyword.indexOf("\n") > -1) {
|
||||||
|
baseStringCfg.setExprType(1);
|
||||||
|
} else if (exprTypeP.indexOf("0") > -1 && mulityKeywordsP.equals("1")
|
||||||
|
&& keyword.indexOf("\n") == -1) {
|
||||||
|
baseStringCfg.setExprType(0);
|
||||||
|
} else {
|
||||||
|
baseStringCfg.setExprType(Integer.parseInt(exprTypeP.split(",")[0]));
|
||||||
|
}
|
||||||
|
// errInfo.append(String.format(prop.getProperty("can_not_null"),
|
||||||
|
// prop.getProperty("expression_type"))+";");
|
||||||
|
} else {
|
||||||
|
for (String exp : exprTypeP.split(",")) {
|
||||||
|
if (exp.equals(exprType.toString())) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("expression_type"))
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
has = false;
|
||||||
|
}
|
||||||
|
exprType = baseStringCfg.getExprType();
|
||||||
|
Integer matchMethod = baseStringCfg.getMatchMethod();
|
||||||
|
if (matchMethod == null) {
|
||||||
|
if (matchMethodP.indexOf(",") == -1) {
|
||||||
|
if (exprTypeP.equals("1") && !matchMethodP.equals("0")) {
|
||||||
|
throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId());
|
||||||
|
}
|
||||||
|
baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP));
|
||||||
|
} else if (exprType != null && exprType.intValue() == 1) {
|
||||||
|
if (matchMethodP.indexOf("0") > -1) {
|
||||||
|
baseStringCfg.setMatchMethod(0);
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId());
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP.split(",")[0]));
|
||||||
|
}
|
||||||
|
// errInfo.append(String.format(prop.getProperty("can_not_null"),
|
||||||
|
// prop.getProperty("match_method"))+";");
|
||||||
|
} else {
|
||||||
|
for (String exp : matchMethodP.split(",")) {
|
||||||
|
if (exp.equals(matchMethod.toString())) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("match_method"))
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Integer isHex = baseStringCfg.getIsHex();
|
||||||
|
Integer isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
|
||||||
|
if (isHex == null || isCaseInsenstive == null) {
|
||||||
|
if (isHex == null) {
|
||||||
|
if (hexP.indexOf("0")>-1 || hexP.indexOf("2")>-1) {
|
||||||
|
baseStringCfg.setIsHex(0);
|
||||||
|
} else if (hexP.indexOf("1")>-1) {
|
||||||
|
baseStringCfg.setIsHex(1);
|
||||||
|
} else {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), prop.getProperty("is_hex")) + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isCaseInsenstive == null) {
|
||||||
|
if (hexP.indexOf("0")>-1 || hexP.indexOf("1")>-1) {
|
||||||
|
baseStringCfg.setIsCaseInsenstive(0);
|
||||||
|
} else if (hexP.indexOf("2")>-1) {
|
||||||
|
baseStringCfg.setIsCaseInsenstive(1);
|
||||||
|
} else {
|
||||||
|
errInfo.append(String.format(prop.getProperty("can_not_null"),
|
||||||
|
prop.getProperty("is_case_insenstive")) + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||||
|
}
|
||||||
|
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||||
|
}
|
||||||
|
if (hexP.equals("1") && isHex.intValue() == 0) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||||
|
}
|
||||||
|
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
// 关键字十六进制校验
|
||||||
|
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
|
||||||
|
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
|
||||||
|
if(!bl) {
|
||||||
|
errInfo.append(
|
||||||
|
prop.getProperty("key_word") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
isHex = baseStringCfg.getIsHex();
|
||||||
|
isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
|
||||||
|
if (isHex != null && isCaseInsenstive != null) {
|
||||||
|
if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 0) {
|
||||||
|
baseStringCfg.setIsHexbin(0);
|
||||||
|
} else if (isHex.intValue() == 1 && isCaseInsenstive.intValue() == 0) {
|
||||||
|
baseStringCfg.setIsHexbin(1);
|
||||||
|
} else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) {
|
||||||
|
baseStringCfg.setIsHexbin(2);
|
||||||
|
} else if (hexP.indexOf("1") != -1 && isHex.intValue() == 1 && isCaseInsenstive.intValue() == 1) {// 只有是十六进制且取值正确的时候, 才进行(十六进制)与(大小写敏感)的校验
|
||||||
|
errInfo.append(prop.getProperty("hex_case_insensitive")+ ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// APP Payload L3_HEADER的特殊属性限制
|
||||||
|
if(baseStringCfg.getDistrict().equals("L3_header")) {
|
||||||
|
String headerType = baseStringCfg.getHeaderType();
|
||||||
|
if(StringUtils.isBlank(headerType)) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), "headerType") + ";");
|
||||||
|
}else if((!"IP_header".equals(headerType)) && (!"ICMP_header".equals(headerType))) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), "headerType") + ";");
|
||||||
|
}else{
|
||||||
|
appMultiFeatureCfgService.checkImportAppPayload(baseStringCfg, errInfo, prop);
|
||||||
|
}
|
||||||
|
appMultiFeatureCfgService.setL3HeaderKeyword(baseStringCfg);
|
||||||
|
}else {
|
||||||
|
baseStringCfg.setHeaderType(null);
|
||||||
|
baseStringCfg.setVer(null);
|
||||||
|
baseStringCfg.setIhl(null);
|
||||||
|
baseStringCfg.setTos(null);
|
||||||
|
baseStringCfg.setTotalLength(null);
|
||||||
|
baseStringCfg.setFlags(null);
|
||||||
|
baseStringCfg.setFragmentOffset(null);
|
||||||
|
baseStringCfg.setProtocol(null);
|
||||||
|
baseStringCfg.setIcmpType(null);
|
||||||
|
baseStringCfg.setIcmpCode(null);
|
||||||
|
baseStringCfg.setIcmpIdentifier(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (errInfo.toString().length() > 0) {
|
||||||
|
errTip.append(String.format(prop.getProperty("line"), baseStringCfg.getIndex()) + ",");
|
||||||
|
errTip.append(errInfo);
|
||||||
|
errTip.append("<br>");
|
||||||
|
}else {
|
||||||
|
stringList.add(baseStringCfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (errTip.toString().length() > 0) {
|
||||||
|
msg.append(errTip);
|
||||||
|
//throw new ServiceException(errTip.toString());
|
||||||
|
}
|
||||||
|
long end=System.currentTimeMillis();
|
||||||
|
logger.warn("validate appfeaturecomplexString data finish,cost:"+(end-start));
|
||||||
|
return stringList;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,6 +18,7 @@ import com.beust.jcommander.internal.Lists;
|
|||||||
import com.beust.jcommander.internal.Sets;
|
import com.beust.jcommander.internal.Sets;
|
||||||
import com.nis.domain.FunctionRegionDict;
|
import com.nis.domain.FunctionRegionDict;
|
||||||
import com.nis.domain.FunctionServiceDict;
|
import com.nis.domain.FunctionServiceDict;
|
||||||
|
import com.nis.domain.SysDataDictionaryItem;
|
||||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||||
import com.nis.domain.configuration.DnsResStrategy;
|
import com.nis.domain.configuration.DnsResStrategy;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
@@ -89,6 +90,14 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
|||||||
StringBuffer errInfo = new StringBuffer();
|
StringBuffer errInfo = new StringBuffer();
|
||||||
ComplexkeywordCfg baseStringCfg = new ComplexkeywordCfg();
|
ComplexkeywordCfg baseStringCfg = new ComplexkeywordCfg();
|
||||||
BeanUtils.copyProperties(list.get(i), baseStringCfg);
|
BeanUtils.copyProperties(list.get(i), baseStringCfg);
|
||||||
|
// 配置描述、关键字长度限制
|
||||||
|
if(baseStringCfg.getCfgDesc().length() > 128) {
|
||||||
|
errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";");
|
||||||
|
}
|
||||||
|
if(baseStringCfg.getCfgKeywords().length() < 4 || baseStringCfg.getCfgKeywords().length() > 1024){
|
||||||
|
errInfo.append(prop.getProperty("key_word")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("min_length")+":4,"+prop.getProperty("max_length")+":1024") + ";");
|
||||||
|
}
|
||||||
|
|
||||||
if (regionDict.getRegionType().equals(3)) {
|
if (regionDict.getRegionType().equals(3)) {
|
||||||
if (regionDict.getFunctionId().equals(7)) {
|
if (regionDict.getFunctionId().equals(7)) {
|
||||||
Long dnsStrategyId = baseStringCfg.getDnsStrategyId();
|
Long dnsStrategyId = baseStringCfg.getDnsStrategyId();
|
||||||
@@ -100,6 +109,72 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 代理HTTP(s)阻断
|
||||||
|
if (regionDict.getFunctionId().equals(207)) {
|
||||||
|
String userRegion1 = baseStringCfg.getUserRegion1();// 应答码
|
||||||
|
if (StringUtils.isNotBlank(userRegion1)) {
|
||||||
|
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("RESPONSE_CODE");
|
||||||
|
boolean has = false;
|
||||||
|
for (SysDataDictionaryItem dict : dicts) {
|
||||||
|
if (dict.getItemCode().equals(userRegion1)) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("response_code") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// 代理 HTTP(s)重定向
|
||||||
|
if (regionDict.getFunctionId().equals(208)) {
|
||||||
|
String userRegion1 = baseStringCfg.getUserRegion1();// 重定向应答码
|
||||||
|
String userRegion2 = baseStringCfg.getUserRegion2();// 重定向URL
|
||||||
|
if (StringUtils.isNotBlank(userRegion1)) {
|
||||||
|
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("REDIRECT_RESPONSE_CODE");
|
||||||
|
boolean has = false;
|
||||||
|
for (SysDataDictionaryItem dict : dicts) {
|
||||||
|
if (dict.getItemCode().equals(userRegion1)) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("redirect_response_code") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(userRegion2)){
|
||||||
|
Pattern pat = Pattern.compile("^[hH][tT][tT][pP]([sS]?):\\/\\/(\\S+\\.)+\\S{2,}$");
|
||||||
|
boolean bl = pat.matcher(userRegion2).matches();
|
||||||
|
if (!bl) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_in_wrong_format"),
|
||||||
|
prop.getProperty("redirect_url") + " '" + userRegion2 + "' ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 代理HTTP(s)替换
|
||||||
|
if (regionDict.getFunctionId().equals(209)) {
|
||||||
|
String userRegion1 = baseStringCfg.getUserRegion1();// 搜索区域
|
||||||
|
if (StringUtils.isNotBlank(userRegion1)) {
|
||||||
|
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("CONTROL_REPLACE_ZONE");
|
||||||
|
boolean has = false;
|
||||||
|
for (SysDataDictionaryItem dict : dicts) {
|
||||||
|
if (dict.getItemCode().equals(userRegion1)) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("replace_zone") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
String keyword = baseStringCfg.getCfgKeywords();
|
String keyword = baseStringCfg.getCfgKeywords();
|
||||||
String district = baseStringCfg.getDistrict();
|
String district = baseStringCfg.getDistrict();
|
||||||
if (StringUtils.isBlank(keyword)) {
|
if (StringUtils.isBlank(keyword)) {
|
||||||
@@ -282,6 +357,14 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
|||||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||||
+ ";");
|
+ ";");
|
||||||
}
|
}
|
||||||
|
// 关键字十六进制校验
|
||||||
|
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
|
||||||
|
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
|
||||||
|
if(!bl) {
|
||||||
|
errInfo.append(
|
||||||
|
prop.getProperty("key_word") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
isHex = baseStringCfg.getIsHex();
|
isHex = baseStringCfg.getIsHex();
|
||||||
isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
|
isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
|
||||||
@@ -292,7 +375,7 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
|||||||
baseStringCfg.setIsHexbin(1);
|
baseStringCfg.setIsHexbin(1);
|
||||||
} else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) {
|
} else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) {
|
||||||
baseStringCfg.setIsHexbin(2);
|
baseStringCfg.setIsHexbin(2);
|
||||||
}else {
|
} else if (hexP.indexOf("1") != -1 && isHex.intValue() == 1 && isCaseInsenstive.intValue() == 1) {// 只有是十六进制且取值正确的时候, 才进行(十六进制)与(大小写敏感)的校验
|
||||||
errInfo.append(prop.getProperty("hex_case_insensitive")+ ";");
|
errInfo.append(prop.getProperty("hex_case_insensitive")+ ";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,6 +103,11 @@ public class CheckIpFormatThread implements Callable<String>{
|
|||||||
StringBuffer errInfo = new StringBuffer();
|
StringBuffer errInfo = new StringBuffer();
|
||||||
IpPortCfg baseIpCfg = new IpPortCfg();
|
IpPortCfg baseIpCfg = new IpPortCfg();
|
||||||
BeanUtils.copyProperties(list.get(i), baseIpCfg);
|
BeanUtils.copyProperties(list.get(i), baseIpCfg);
|
||||||
|
// 配置描述长度限制
|
||||||
|
if(baseIpCfg.getCfgDesc().length() > 128) {
|
||||||
|
errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";");
|
||||||
|
}
|
||||||
|
|
||||||
// 特殊字段验证
|
// 特殊字段验证
|
||||||
// packet ip ratelimit
|
// packet ip ratelimit
|
||||||
if (serviceDict!=null&&serviceDict.getFunctionId().intValue() == 5 && serviceDict.getAction().intValue() == 64) {
|
if (serviceDict!=null&&serviceDict.getFunctionId().intValue() == 5 && serviceDict.getAction().intValue() == 64) {
|
||||||
@@ -294,6 +299,72 @@ public class CheckIpFormatThread implements Callable<String>{
|
|||||||
baseIpCfg.setAntiddosProtocol("");
|
baseIpCfg.setAntiddosProtocol("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 代理HTTP(s)阻断
|
||||||
|
if (regionDict.getFunctionId().equals(207)) {
|
||||||
|
String userRegion1 = baseIpCfg.getUserRegion1();// 应答码
|
||||||
|
if (StringUtils.isNotBlank(userRegion1)) {
|
||||||
|
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("RESPONSE_CODE");
|
||||||
|
boolean has = false;
|
||||||
|
for (SysDataDictionaryItem dict : dicts) {
|
||||||
|
if (dict.getItemCode().equals(userRegion1)) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("response_code") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// 代理 HTTP(s)重定向
|
||||||
|
if (regionDict.getFunctionId().equals(208)) {
|
||||||
|
String userRegion1 = baseIpCfg.getUserRegion1();// 重定向应答码
|
||||||
|
String userRegion2 = baseIpCfg.getUserRegion2();// 重定向URL
|
||||||
|
if (StringUtils.isNotBlank(userRegion1)) {
|
||||||
|
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("REDIRECT_RESPONSE_CODE");
|
||||||
|
boolean has = false;
|
||||||
|
for (SysDataDictionaryItem dict : dicts) {
|
||||||
|
if (dict.getItemCode().equals(userRegion1)) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("redirect_response_code") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(userRegion2)){
|
||||||
|
Pattern pat = Pattern.compile("^[hH][tT][tT][pP]([sS]?):\\/\\/(\\S+\\.)+\\S{2,}$");
|
||||||
|
boolean bl = pat.matcher(userRegion2).matches();
|
||||||
|
if (!bl) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_in_wrong_format"),
|
||||||
|
prop.getProperty("redirect_url") + " '" + userRegion2 + "' ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 代理HTTP(s)替换
|
||||||
|
if (regionDict.getFunctionId().equals(209)) {
|
||||||
|
String userRegion1 = baseIpCfg.getUserRegion1();// 搜索区域
|
||||||
|
if (StringUtils.isNotBlank(userRegion1)) {
|
||||||
|
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("CONTROL_REPLACE_ZONE");
|
||||||
|
boolean has = false;
|
||||||
|
for (SysDataDictionaryItem dict : dicts) {
|
||||||
|
if (dict.getItemCode().equals(userRegion1)) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("replace_zone") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (regionDict.getRegionType().equals(1)) {
|
if (regionDict.getRegionType().equals(1)) {
|
||||||
boolean srcIpEmpty = false;
|
boolean srcIpEmpty = false;
|
||||||
boolean destIpEmpty = false;
|
boolean destIpEmpty = false;
|
||||||
|
|||||||
@@ -88,6 +88,14 @@ public class CheckStringFormatThread implements Callable<String>{
|
|||||||
StringBuffer errInfo = new StringBuffer();
|
StringBuffer errInfo = new StringBuffer();
|
||||||
BaseStringCfg baseStringCfg = new BaseStringCfg();
|
BaseStringCfg baseStringCfg = new BaseStringCfg();
|
||||||
BeanUtils.copyProperties(list.get(i), baseStringCfg);
|
BeanUtils.copyProperties(list.get(i), baseStringCfg);
|
||||||
|
// 配置描述、关键字长度限制
|
||||||
|
if(baseStringCfg.getCfgDesc().length() > 128) {
|
||||||
|
errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";");
|
||||||
|
}
|
||||||
|
if(baseStringCfg.getCfgKeywords().length() < 4 || baseStringCfg.getCfgKeywords().length() > 1024){
|
||||||
|
errInfo.append(prop.getProperty("key_word")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("min_length")+":4,"+prop.getProperty("max_length")+":1024") + ";");
|
||||||
|
}
|
||||||
|
|
||||||
if (regionDict.getRegionType().equals(2)) {
|
if (regionDict.getRegionType().equals(2)) {
|
||||||
if (regionDict.getFunctionId().equals(510) && "p2p_hash".equals(regionDict.getConfigServiceType())) {
|
if (regionDict.getFunctionId().equals(510) && "p2p_hash".equals(regionDict.getConfigServiceType())) {
|
||||||
String userRegion1 = baseStringCfg.getUserRegion1();
|
String userRegion1 = baseStringCfg.getUserRegion1();
|
||||||
@@ -139,6 +147,72 @@ public class CheckStringFormatThread implements Callable<String>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 代理HTTP(s)阻断
|
||||||
|
if (regionDict.getFunctionId().equals(207)) {
|
||||||
|
String userRegion1 = baseStringCfg.getUserRegion1();// 应答码
|
||||||
|
if (StringUtils.isNotBlank(userRegion1)) {
|
||||||
|
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("RESPONSE_CODE");
|
||||||
|
boolean has = false;
|
||||||
|
for (SysDataDictionaryItem dict : dicts) {
|
||||||
|
if (dict.getItemCode().equals(userRegion1)) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("response_code") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// 代理 HTTP(s)重定向
|
||||||
|
if (regionDict.getFunctionId().equals(208)) {
|
||||||
|
String userRegion1 = baseStringCfg.getUserRegion1();// 重定向应答码
|
||||||
|
String userRegion2 = baseStringCfg.getUserRegion2();// 重定向URL
|
||||||
|
if (StringUtils.isNotBlank(userRegion1)) {
|
||||||
|
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("REDIRECT_RESPONSE_CODE");
|
||||||
|
boolean has = false;
|
||||||
|
for (SysDataDictionaryItem dict : dicts) {
|
||||||
|
if (dict.getItemCode().equals(userRegion1)) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("redirect_response_code") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(StringUtils.isNotBlank(userRegion2)){
|
||||||
|
Pattern pat = Pattern.compile("^[hH][tT][tT][pP]([sS]?):\\/\\/(\\S+\\.)+\\S{2,}$");
|
||||||
|
boolean bl = pat.matcher(userRegion2).matches();
|
||||||
|
if (!bl) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_in_wrong_format"),
|
||||||
|
prop.getProperty("redirect_url") + " '" + userRegion2 + "' ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 代理HTTP(s)替换
|
||||||
|
if (regionDict.getFunctionId().equals(209)) {
|
||||||
|
String userRegion1 = baseStringCfg.getUserRegion1();// 搜索区域
|
||||||
|
if (StringUtils.isNotBlank(userRegion1)) {
|
||||||
|
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("CONTROL_REPLACE_ZONE");
|
||||||
|
boolean has = false;
|
||||||
|
for (SysDataDictionaryItem dict : dicts) {
|
||||||
|
if (dict.getItemCode().equals(userRegion1)) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||||
|
prop.getProperty("replace_zone") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
String keyword = baseStringCfg.getCfgKeywords();
|
String keyword = baseStringCfg.getCfgKeywords();
|
||||||
if (!regionDict.getFunctionId().equals(403) && !regionDict.getFunctionId().equals(201)) {// 201域名拦截
|
if (!regionDict.getFunctionId().equals(403) && !regionDict.getFunctionId().equals(201)) {// 201域名拦截
|
||||||
if (StringUtils.isBlank(keyword)) {
|
if (StringUtils.isBlank(keyword)) {
|
||||||
@@ -324,6 +398,14 @@ public class CheckStringFormatThread implements Callable<String>{
|
|||||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||||
+ ";");
|
+ ";");
|
||||||
}
|
}
|
||||||
|
// 十六进制 关键字校验
|
||||||
|
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
|
||||||
|
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
|
||||||
|
if(!bl) {
|
||||||
|
errInfo.append(
|
||||||
|
prop.getProperty("key_word") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
isHex = baseStringCfg.getIsHex();
|
isHex = baseStringCfg.getIsHex();
|
||||||
isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
|
isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
|
||||||
@@ -334,7 +416,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
|||||||
baseStringCfg.setIsHexbin(1);
|
baseStringCfg.setIsHexbin(1);
|
||||||
} else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) {
|
} else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) {
|
||||||
baseStringCfg.setIsHexbin(2);
|
baseStringCfg.setIsHexbin(2);
|
||||||
}else {
|
} else if (hexP.indexOf("1") != -1 && isHex.intValue() == 1 && isCaseInsenstive.intValue() == 1) {// 只有是十六进制且取值正确的时候, 才进行(十六进制)与(大小写敏感)的校验
|
||||||
errInfo.append(prop.getProperty("hex_case_insensitive")+ ";");
|
errInfo.append(prop.getProperty("hex_case_insensitive")+ ";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import com.nis.domain.SysDataDictionaryItem;
|
|||||||
import com.nis.domain.basics.AsnIpCfg;
|
import com.nis.domain.basics.AsnIpCfg;
|
||||||
import com.nis.domain.basics.ServiceDictInfo;
|
import com.nis.domain.basics.ServiceDictInfo;
|
||||||
import com.nis.domain.basics.SysDictInfo;
|
import com.nis.domain.basics.SysDictInfo;
|
||||||
|
import com.nis.domain.configuration.AppComplexFeatureCfg;
|
||||||
import com.nis.domain.configuration.AppDomainCfg;
|
import com.nis.domain.configuration.AppDomainCfg;
|
||||||
import com.nis.domain.configuration.AppFeatureIndex;
|
import com.nis.domain.configuration.AppFeatureIndex;
|
||||||
import com.nis.domain.configuration.AppHttpCfg;
|
import com.nis.domain.configuration.AppHttpCfg;
|
||||||
@@ -75,6 +76,7 @@ import com.nis.domain.configuration.PxyObjTrustedCaCrl;
|
|||||||
import com.nis.domain.configuration.RequestInfo;
|
import com.nis.domain.configuration.RequestInfo;
|
||||||
import com.nis.domain.configuration.StringCfgTemplate;
|
import com.nis.domain.configuration.StringCfgTemplate;
|
||||||
import com.nis.domain.configuration.template.AppDomainTemplate;
|
import com.nis.domain.configuration.template.AppDomainTemplate;
|
||||||
|
import com.nis.domain.configuration.template.AppPayloadTemplate;
|
||||||
import com.nis.domain.configuration.template.AsnIpTemplate;
|
import com.nis.domain.configuration.template.AsnIpTemplate;
|
||||||
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
||||||
import com.nis.domain.configuration.template.DdosIpTemplate;
|
import com.nis.domain.configuration.template.DdosIpTemplate;
|
||||||
@@ -85,6 +87,15 @@ import com.nis.domain.configuration.template.DnsResStrategyTemplate;
|
|||||||
import com.nis.domain.configuration.template.DomainInterceptMonitTemplate;
|
import com.nis.domain.configuration.template.DomainInterceptMonitTemplate;
|
||||||
import com.nis.domain.configuration.template.DomainInterceptRateLimitTemplate;
|
import com.nis.domain.configuration.template.DomainInterceptRateLimitTemplate;
|
||||||
import com.nis.domain.configuration.template.DomainInterceptTemplate;
|
import com.nis.domain.configuration.template.DomainInterceptTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsRedirectComplexTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsRedirectIpTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsRedirectTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsRejectComplexTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsRejectIpTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsRejectTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsReplaceComplexTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsReplaceIpTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsReplaceTemplate;
|
||||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||||
import com.nis.domain.configuration.template.IpCfgTemplate;
|
import com.nis.domain.configuration.template.IpCfgTemplate;
|
||||||
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
||||||
@@ -118,6 +129,7 @@ import com.nis.util.StringUtil;
|
|||||||
import com.nis.util.excel.ExcelCsv;
|
import com.nis.util.excel.ExcelCsv;
|
||||||
import com.nis.util.excel.ExportExcel;
|
import com.nis.util.excel.ExportExcel;
|
||||||
import com.nis.util.excel.ImportBigExcel;
|
import com.nis.util.excel.ImportBigExcel;
|
||||||
|
import com.nis.util.excel.thread.CheckAppFeatureComplexStringFormatThread;
|
||||||
import com.nis.util.excel.thread.CheckComplexStringFormatThread;
|
import com.nis.util.excel.thread.CheckComplexStringFormatThread;
|
||||||
import com.nis.util.excel.thread.CheckDnsResStrategyFormatThread;
|
import com.nis.util.excel.thread.CheckDnsResStrategyFormatThread;
|
||||||
import com.nis.util.excel.thread.CheckIpFormatThread;
|
import com.nis.util.excel.thread.CheckIpFormatThread;
|
||||||
@@ -1084,6 +1096,48 @@ public class BaseController {
|
|||||||
return queue;
|
return queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多线程验证
|
||||||
|
* @param _msg
|
||||||
|
* @param serviceDict
|
||||||
|
* @param regionDict
|
||||||
|
* @param list
|
||||||
|
* @return
|
||||||
|
* @throws InterruptedException
|
||||||
|
* @throws ExecutionException
|
||||||
|
* @throws ServiceException
|
||||||
|
*/
|
||||||
|
public BlockingQueue<AppComplexFeatureCfg> checkAppComplexFeatureStringCfgMulity(StringBuffer _msg,FunctionServiceDict serviceDict, FunctionRegionDict regionDict,BlockingQueue<? extends Object> list) throws InterruptedException, ExecutionException, ServiceException{
|
||||||
|
logger.warn("start checkAppComplexFeatureStringCfgMulity ,size "+list.size());
|
||||||
|
long start=System.currentTimeMillis();
|
||||||
|
BlockingQueue<AppComplexFeatureCfg> queue=new ArrayBlockingQueue<>(list.size());
|
||||||
|
ExecutorService service=Executors.newFixedThreadPool(Constants.MULITY_THREAD_SIZE);
|
||||||
|
List<Future<String>> futures=new ArrayList<>();
|
||||||
|
for(int i=0;i<Constants.MULITY_THREAD_SIZE;i++) {
|
||||||
|
CheckAppFeatureComplexStringFormatThread t = new CheckAppFeatureComplexStringFormatThread(serviceDict,regionDict, this.getMsgProp(), list, queue);
|
||||||
|
futures.add(service.submit(t));
|
||||||
|
}
|
||||||
|
service.shutdown();
|
||||||
|
while(!service.isTerminated()) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(10);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(Future<String> future:futures) {
|
||||||
|
String msg = future.get();
|
||||||
|
if(StringUtils.isNotBlank(msg)) {
|
||||||
|
_msg.append(msg);
|
||||||
|
//throw new ServiceException(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
long end=System.currentTimeMillis();
|
||||||
|
logger.warn("checkAppComplexFeatureStringCfgMulity finish,cost:"+(end-start)+",size:"+queue.size());
|
||||||
|
return queue;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* setReportSearchTime(报表查询设置开始时间与结束时间) (这里描述这个方法适用条件 – 可选)
|
* setReportSearchTime(报表查询设置开始时间与结束时间) (这里描述这个方法适用条件 – 可选)
|
||||||
@@ -1220,14 +1274,17 @@ public class BaseController {
|
|||||||
BlockingQueue<BaseStringCfg<?>> stringCfgs =null;
|
BlockingQueue<BaseStringCfg<?>> stringCfgs =null;
|
||||||
BlockingQueue<ComplexkeywordCfg> complexkeywordCfgs =null;
|
BlockingQueue<ComplexkeywordCfg> complexkeywordCfgs =null;
|
||||||
BlockingQueue<DnsResStrategy> dnsResStrategies=null;
|
BlockingQueue<DnsResStrategy> dnsResStrategies=null;
|
||||||
|
BlockingQueue<AppComplexFeatureCfg> appComplexFeatureCfgs=null;
|
||||||
List<CfgIndexInfo> cfgIndexInfos = new ArrayList<CfgIndexInfo>();
|
List<CfgIndexInfo> cfgIndexInfos = new ArrayList<CfgIndexInfo>();
|
||||||
List<AppPolicyCfg> appPolicyCfgs = new ArrayList<AppPolicyCfg>();
|
List<AppPolicyCfg> appPolicyCfgs = new ArrayList<AppPolicyCfg>();
|
||||||
|
List<AppFeatureIndex> appFeatureIndexs= new ArrayList<AppFeatureIndex>();
|
||||||
List<Map<Long,Integer>> asnNoMaps=Lists.newArrayList();
|
List<Map<Long,Integer>> asnNoMaps=Lists.newArrayList();
|
||||||
Map<Long,Integer> newAsnNoMap=Maps.newConcurrentMap();
|
Map<Long,Integer> newAsnNoMap=Maps.newConcurrentMap();
|
||||||
Map<Long,Integer> OldAsnNoMap=Maps.newConcurrentMap();
|
Map<Long,Integer> OldAsnNoMap=Maps.newConcurrentMap();
|
||||||
asnNoMaps.add(newAsnNoMap);
|
asnNoMaps.add(newAsnNoMap);
|
||||||
asnNoMaps.add(OldAsnNoMap);
|
asnNoMaps.add(OldAsnNoMap);
|
||||||
FunctionRegionDict appRegion = null;
|
FunctionRegionDict appRegion = null;
|
||||||
|
FunctionRegionDict appFeatureRegion = null;
|
||||||
if(serviceDict!=null) {
|
if(serviceDict!=null) {
|
||||||
String regionCode = serviceDict.getRegionCode();
|
String regionCode = serviceDict.getRegionCode();
|
||||||
for (String code : regionCode.split(",")) {
|
for (String code : regionCode.split(",")) {
|
||||||
@@ -1239,6 +1296,12 @@ public class BaseController {
|
|||||||
appRegion = d;
|
appRegion = d;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (d != null && d.getFunctionId() != null
|
||||||
|
&& (d.getFunctionId().intValue()==565 || d.getFunctionId().intValue()==564 || d.getFunctionId().intValue()==566 || d.getFunctionId().intValue()==563)) {
|
||||||
|
appFeatureRegion = d;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1282,6 +1345,15 @@ public class BaseController {
|
|||||||
}else if (regionDict.getFunctionId().equals(301)) {// DDOS IP
|
}else if (regionDict.getFunctionId().equals(301)) {// DDOS IP
|
||||||
BlockingQueue<DdosIpTemplate> list = ei.getDataList(DdosIpTemplate.class );
|
BlockingQueue<DdosIpTemplate> list = ei.getDataList(DdosIpTemplate.class );
|
||||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
|
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
|
||||||
|
}else if(regionDict.getFunctionId().equals(207)){// HTTP(s)阻断
|
||||||
|
BlockingQueue<HttpsRejectIpTemplate> list = ei.getDataList(HttpsRejectIpTemplate.class );
|
||||||
|
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
|
||||||
|
}else if(regionDict.getFunctionId().equals(208)){// HTTP(s)重定向
|
||||||
|
BlockingQueue<HttpsRedirectIpTemplate> list = ei.getDataList(HttpsRedirectIpTemplate.class );
|
||||||
|
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
|
||||||
|
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
|
BlockingQueue<HttpsReplaceIpTemplate> list = ei.getDataList(HttpsReplaceIpTemplate.class );
|
||||||
|
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
|
||||||
} else {
|
} else {
|
||||||
BlockingQueue<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class );
|
BlockingQueue<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class );
|
||||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
|
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null, list);
|
||||||
@@ -1307,6 +1379,15 @@ public class BaseController {
|
|||||||
BlockingQueue<DomainInterceptTemplate> list = ei.getDataList(DomainInterceptTemplate.class);
|
BlockingQueue<DomainInterceptTemplate> list = ei.getDataList(DomainInterceptTemplate.class);
|
||||||
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
}
|
}
|
||||||
|
}else if(regionDict.getFunctionId().equals(207)){// HTTP(s)阻断
|
||||||
|
BlockingQueue<HttpsRejectTemplate> list = ei.getDataList(HttpsRejectTemplate.class);
|
||||||
|
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
}else if(regionDict.getFunctionId().equals(208)){// HTTP(s)重定向
|
||||||
|
BlockingQueue<HttpsRedirectTemplate> list = ei.getDataList(HttpsRedirectTemplate.class);
|
||||||
|
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
|
BlockingQueue<HttpsReplaceTemplate> list = ei.getDataList(HttpsReplaceTemplate.class);
|
||||||
|
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
}else {
|
}else {
|
||||||
BlockingQueue<StringAllTemplate> list = ei.getDataList(StringAllTemplate.class );
|
BlockingQueue<StringAllTemplate> list = ei.getDataList(StringAllTemplate.class );
|
||||||
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
@@ -1317,6 +1398,18 @@ public class BaseController {
|
|||||||
BlockingQueue<DnsComplexStringTemplate> list = ei.getDataList(DnsComplexStringTemplate.class
|
BlockingQueue<DnsComplexStringTemplate> list = ei.getDataList(DnsComplexStringTemplate.class
|
||||||
);
|
);
|
||||||
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
} else if(regionDict.getFunctionId().equals(207)){// HTTP(s)阻断
|
||||||
|
BlockingQueue<HttpsRejectComplexTemplate> list = ei.getDataList(HttpsRejectComplexTemplate.class);
|
||||||
|
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
} else if(regionDict.getFunctionId().equals(208)){// HTTP(s)重定向
|
||||||
|
BlockingQueue<HttpsRedirectComplexTemplate> list = ei.getDataList(HttpsRedirectComplexTemplate.class);
|
||||||
|
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
} else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
|
BlockingQueue<HttpsReplaceComplexTemplate> list = ei.getDataList(HttpsReplaceComplexTemplate.class);
|
||||||
|
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
} else if(regionDict.getFunctionId().equals(563)){// APP Payload
|
||||||
|
BlockingQueue<AppPayloadTemplate> list = ei.getDataList(AppPayloadTemplate.class);
|
||||||
|
appComplexFeatureCfgs = this.checkAppComplexFeatureStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
} else {
|
} else {
|
||||||
BlockingQueue<ComplexStringAllTemplate> list = ei.getDataList(ComplexStringAllTemplate.class
|
BlockingQueue<ComplexStringAllTemplate> list = ei.getDataList(ComplexStringAllTemplate.class
|
||||||
);
|
);
|
||||||
@@ -1339,6 +1432,7 @@ public class BaseController {
|
|||||||
String specServiceId = request.getParameter("appId");
|
String specServiceId = request.getParameter("appId");
|
||||||
String behaviorId = request.getParameter("behaviorId");
|
String behaviorId = request.getParameter("behaviorId");
|
||||||
String asnIpGroup = request.getParameter("asnGroupId");
|
String asnIpGroup = request.getParameter("asnGroupId");
|
||||||
|
|
||||||
String isSend = request.getParameter("isSend")==null?"":request.getParameter("isSend");
|
String isSend = request.getParameter("isSend")==null?"":request.getParameter("isSend");
|
||||||
SpecificServiceCfg specificServiceCfg = null;
|
SpecificServiceCfg specificServiceCfg = null;
|
||||||
if (serviceDict!=null&&(serviceDict.getServiceId().intValue() == 33 || serviceDict.getServiceId().intValue() == 145
|
if (serviceDict!=null&&(serviceDict.getServiceId().intValue() == 33 || serviceDict.getServiceId().intValue() == 145
|
||||||
@@ -1349,6 +1443,9 @@ public class BaseController {
|
|||||||
|| serviceDict.getServiceId().intValue() == 1028// app ip
|
|| serviceDict.getServiceId().intValue() == 1028// app ip
|
||||||
|| serviceDict.getServiceId().intValue() == 1024//app http
|
|| serviceDict.getServiceId().intValue() == 1024//app http
|
||||||
|| serviceDict.getServiceId().intValue() == 1026//app domain
|
|| serviceDict.getServiceId().intValue() == 1026//app domain
|
||||||
|
|| serviceDict.getServiceId().intValue() == 1027//app dns
|
||||||
|
|| serviceDict.getServiceId().intValue() == 1029//app ssl
|
||||||
|
|| serviceDict.getServiceId().intValue() == 1025//app PAYLOAD
|
||||||
)) {
|
)) {
|
||||||
if (StringUtils.isNotBlank(specServiceId)) {
|
if (StringUtils.isNotBlank(specServiceId)) {
|
||||||
specificServiceCfg = specificServiceCfgService
|
specificServiceCfg = specificServiceCfgService
|
||||||
@@ -1494,7 +1591,7 @@ public class BaseController {
|
|||||||
asnIpCfgs.add(_cfg);
|
asnIpCfgs.add(_cfg);
|
||||||
ind++;
|
ind++;
|
||||||
}
|
}
|
||||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, asnIpCfgs, cfgIndexInfos, appPolicyCfgs,isSend.equals("1"));
|
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, asnIpCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1"));
|
||||||
cfgIndexInfos.clear();
|
cfgIndexInfos.clear();
|
||||||
appPolicyCfgs.clear();
|
appPolicyCfgs.clear();
|
||||||
_ipPortCfgs.clear();
|
_ipPortCfgs.clear();
|
||||||
@@ -1507,7 +1604,7 @@ public class BaseController {
|
|||||||
List<Integer> compileIds=Lists.newArrayList();
|
List<Integer> compileIds=Lists.newArrayList();
|
||||||
List<Integer> regionIds=Lists.newArrayList();
|
List<Integer> regionIds=Lists.newArrayList();
|
||||||
List<Integer> groupIds=Lists.newArrayList();
|
List<Integer> groupIds=Lists.newArrayList();
|
||||||
// List<Integer> numRegionGroupIds=Lists.newArrayList();
|
List<Integer> numRegionGroupIds=Lists.newArrayList();
|
||||||
List<Integer> numRegionRegionIds=Lists.newArrayList();
|
List<Integer> numRegionRegionIds=Lists.newArrayList();
|
||||||
if(!regionDict.getFunctionId().equals(405)) {//app ip compileId 从config_group_info中取
|
if(!regionDict.getFunctionId().equals(405)) {//app ip compileId 从config_group_info中取
|
||||||
try {
|
try {
|
||||||
@@ -1517,7 +1614,7 @@ public class BaseController {
|
|||||||
regionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
regionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
||||||
//需要获取数值域的id
|
//需要获取数值域的id
|
||||||
if(serviceDict!=null&&serviceDict.getProtocolId()!=null&&serviceDict.getProtocolId()>0) {
|
if(serviceDict!=null&&serviceDict.getProtocolId()!=null&&serviceDict.getProtocolId()>0) {
|
||||||
// numRegionGroupIds = ConfigServiceUtil.getId(2,_ipPortCfgs.size());
|
numRegionGroupIds = ConfigServiceUtil.getId(2,_ipPortCfgs.size());
|
||||||
numRegionRegionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
numRegionRegionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1558,9 +1655,9 @@ public class BaseController {
|
|||||||
cfg.setRegionId(regionIds.get(ind));
|
cfg.setRegionId(regionIds.get(ind));
|
||||||
}
|
}
|
||||||
if(serviceDict!=null&&serviceDict.getProtocolId()!=null) {
|
if(serviceDict!=null&&serviceDict.getProtocolId()!=null) {
|
||||||
// if(numRegionGroupIds!=null&&numRegionGroupIds.size()==_ipPortCfgs.size()) {
|
if(numRegionGroupIds!=null&&numRegionGroupIds.size()==_ipPortCfgs.size()) {
|
||||||
// cfg.setNumberRegionGroupId(numRegionGroupIds.get(ind));
|
cfg.setNumberRegionGroupId(numRegionGroupIds.get(ind));
|
||||||
// }
|
}
|
||||||
if(numRegionRegionIds!=null&&numRegionRegionIds.size()==_ipPortCfgs.size()) {
|
if(numRegionRegionIds!=null&&numRegionRegionIds.size()==_ipPortCfgs.size()) {
|
||||||
cfg.setNumberRegionRegionId(numRegionRegionIds.get(ind));
|
cfg.setNumberRegionRegionId(numRegionRegionIds.get(ind));
|
||||||
}
|
}
|
||||||
@@ -1615,15 +1712,29 @@ public class BaseController {
|
|||||||
if(regionDict.getFunctionId().intValue()!=600
|
if(regionDict.getFunctionId().intValue()!=600
|
||||||
&®ionDict.getFunctionId().intValue()!=301
|
&®ionDict.getFunctionId().intValue()!=301
|
||||||
&®ionDict.getFunctionId().intValue()!=401
|
&®ionDict.getFunctionId().intValue()!=401
|
||||||
&®ionDict.getFunctionId().intValue()!=405) {
|
&®ionDict.getFunctionId().intValue()!=405
|
||||||
|
&®ionDict.getFunctionId().intValue()!=565
|
||||||
|
&®ionDict.getFunctionId().intValue()!=566
|
||||||
|
&®ionDict.getFunctionId().intValue()!=563) {
|
||||||
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
||||||
BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"});
|
BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"});
|
||||||
cfgIndexInfos.add(cfgIndexInfo);
|
cfgIndexInfos.add(cfgIndexInfo);
|
||||||
}
|
}
|
||||||
|
if(regionDict.getFunctionId().intValue()==565 || regionDict.getFunctionId().intValue()==566 || regionDict.getFunctionId().intValue()==563){
|
||||||
|
AppFeatureIndex appfeature = new AppFeatureIndex();
|
||||||
|
if(regionDict!=null){
|
||||||
|
appfeature.setCfgRegionCode1(String.valueOf(regionDict.getConfigRegionCode()));
|
||||||
|
appfeature.setCfgRegionValue(regionDict.getConfigRegionValue());
|
||||||
|
appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType()));
|
||||||
|
}
|
||||||
|
BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"});
|
||||||
|
appFeatureIndexs.add(appfeature);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
ind++;
|
ind++;
|
||||||
}
|
}
|
||||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _ipPortCfgs, cfgIndexInfos, appPolicyCfgs,isSend.equals("1"));
|
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _ipPortCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1"));
|
||||||
cfgIndexInfos.clear();
|
cfgIndexInfos.clear();
|
||||||
appPolicyCfgs.clear();
|
appPolicyCfgs.clear();
|
||||||
_ipPortCfgs.clear();
|
_ipPortCfgs.clear();
|
||||||
@@ -1748,18 +1859,25 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
ind++;
|
ind++;
|
||||||
}
|
}
|
||||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _stringCfgs, cfgIndexInfos, appPolicyCfgs,isSend.equals("1"));
|
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _stringCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1"));
|
||||||
cfgIndexInfos.clear();
|
cfgIndexInfos.clear();
|
||||||
appPolicyCfgs.clear();
|
appPolicyCfgs.clear();
|
||||||
_stringCfgs.clear();
|
_stringCfgs.clear();
|
||||||
}
|
}
|
||||||
} else if (regionDict.getRegionType().equals(3)) {
|
} else if (regionDict.getRegionType().equals(3)) {
|
||||||
|
if(!regionDict.getFunctionId().equals(563)) {
|
||||||
List<ComplexkeywordCfg> _complexkeywordCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
List<ComplexkeywordCfg> _complexkeywordCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
while(!complexkeywordCfgs.isEmpty()) {
|
while(!complexkeywordCfgs.isEmpty()) {
|
||||||
complexkeywordCfgs.drainTo(_complexkeywordCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
complexkeywordCfgs.drainTo(_complexkeywordCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||||
List<Integer> compileIds=Lists.newArrayList();
|
List<Integer> compileIds=Lists.newArrayList();
|
||||||
|
List<Integer> groupIds=Lists.newArrayList();
|
||||||
|
List<Integer> regionIds=Lists.newArrayList();
|
||||||
try {
|
try {
|
||||||
compileIds = ConfigServiceUtil.getId(1,_complexkeywordCfgs.size());
|
compileIds = ConfigServiceUtil.getId(1,_complexkeywordCfgs.size());
|
||||||
|
if(isSend.equals("1")) {
|
||||||
|
groupIds = ConfigServiceUtil.getId(2,_complexkeywordCfgs.size());
|
||||||
|
regionIds = ConfigServiceUtil.getId(3,_complexkeywordCfgs.size());
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("获取编译ID出错");
|
logger.info("获取编译ID出错");
|
||||||
@@ -1776,8 +1894,23 @@ public class BaseController {
|
|||||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||||
cfg.setDoLog(2);
|
cfg.setDoLog(2);
|
||||||
cfg.setFunctionId(regionDict.getFunctionId());
|
cfg.setFunctionId(regionDict.getFunctionId());
|
||||||
cfg.setIsAudit(0);
|
if(isSend.equals("1")) {
|
||||||
cfg.setIsValid(0);
|
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||||
|
cfg.setIsValid(Constants.VALID_YES);
|
||||||
|
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||||
|
cfg.setAuditTime(date);
|
||||||
|
if(groupIds!=null&&groupIds.size()==_complexkeywordCfgs.size()) {
|
||||||
|
cfg.setGroupId(groupIds.get(ind));
|
||||||
|
}
|
||||||
|
if(regionIds!=null&®ionIds.size()==_complexkeywordCfgs.size()) {
|
||||||
|
cfg.setRegionId(regionIds.get(ind));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
|
cfg.setIsValid(Constants.VALID_NO);
|
||||||
|
}
|
||||||
|
//cfg.setIsAudit(0);
|
||||||
|
//cfg.setIsValid(0);
|
||||||
cfg.setIsAreaEffective(0);
|
cfg.setIsAreaEffective(0);
|
||||||
cfg.setLable("0");
|
cfg.setLable("0");
|
||||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||||
@@ -1817,19 +1950,114 @@ public class BaseController {
|
|||||||
appPolicyCfgs.add(appPolicyCfg);
|
appPolicyCfgs.add(appPolicyCfg);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(!regionDict.getFunctionId().equals(402)) {
|
if(!regionDict.getFunctionId().equals(402) && !regionDict.getFunctionId().equals(565)
|
||||||
|
&& !regionDict.getFunctionId().equals(566) && !regionDict.getFunctionId().equals(564)) {
|
||||||
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
||||||
BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"});
|
BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"});
|
||||||
cfgIndexInfos.add(cfgIndexInfo);
|
cfgIndexInfos.add(cfgIndexInfo);
|
||||||
}
|
}
|
||||||
|
if(regionDict.getFunctionId().intValue()==565 || regionDict.getFunctionId().intValue()==566
|
||||||
|
|| regionDict.getFunctionId().intValue()==564){
|
||||||
|
AppFeatureIndex appfeature = new AppFeatureIndex();
|
||||||
|
BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"});
|
||||||
|
if(regionDict!=null){
|
||||||
|
appfeature.setCfgRegionCode1(String.valueOf(regionDict.getConfigRegionCode()));
|
||||||
|
appfeature.setCfgRegionValue(regionDict.getConfigRegionValue());
|
||||||
|
appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType()));
|
||||||
|
}
|
||||||
|
appFeatureIndexs.add(appfeature);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ind++;
|
ind++;
|
||||||
}
|
}
|
||||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _complexkeywordCfgs, cfgIndexInfos, appPolicyCfgs,isSend.equals("1"));
|
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _complexkeywordCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1"));
|
||||||
cfgIndexInfos.clear();
|
cfgIndexInfos.clear();
|
||||||
appPolicyCfgs.clear();
|
appPolicyCfgs.clear();
|
||||||
_complexkeywordCfgs.clear();
|
_complexkeywordCfgs.clear();
|
||||||
|
appFeatureIndexs.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
// APP Payload处理
|
||||||
|
List<AppComplexFeatureCfg> _complexkeywordCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
while(!appComplexFeatureCfgs.isEmpty()) {
|
||||||
|
appComplexFeatureCfgs.drainTo(_complexkeywordCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
List<Integer> compileIds=Lists.newArrayList();
|
||||||
|
List<Integer> groupIds=Lists.newArrayList();
|
||||||
|
List<Integer> regionIds=Lists.newArrayList();
|
||||||
|
try {
|
||||||
|
compileIds = ConfigServiceUtil.getId(1,_complexkeywordCfgs.size());
|
||||||
|
if(isSend.equals("1")) {
|
||||||
|
groupIds = ConfigServiceUtil.getId(2,_complexkeywordCfgs.size());
|
||||||
|
regionIds = ConfigServiceUtil.getId(3,_complexkeywordCfgs.size());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("获取编译ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
|
int ind=0;
|
||||||
|
for (AppComplexFeatureCfg cfg : _complexkeywordCfgs) {
|
||||||
|
cfg.setAction(serviceDict.getAction());
|
||||||
|
/*cfg.setAuditorId(UserUtils.getUser().getId());
|
||||||
|
cfg.setAuditTime(date);*/
|
||||||
|
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||||
|
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||||
|
cfg.setCreateTime(date);
|
||||||
|
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||||
|
cfg.setDoLog(2);
|
||||||
|
cfg.setFunctionId(regionDict.getFunctionId());
|
||||||
|
if(isSend.equals("1")) {
|
||||||
|
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||||
|
cfg.setIsValid(Constants.VALID_YES);
|
||||||
|
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||||
|
cfg.setAuditTime(date);
|
||||||
|
if(groupIds!=null&&groupIds.size()==_complexkeywordCfgs.size()) {
|
||||||
|
cfg.setGroupId(groupIds.get(ind));
|
||||||
|
}
|
||||||
|
if(regionIds!=null&®ionIds.size()==_complexkeywordCfgs.size()) {
|
||||||
|
cfg.setRegionId(regionIds.get(ind));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
|
cfg.setIsValid(Constants.VALID_NO);
|
||||||
|
}
|
||||||
|
//cfg.setIsAudit(0);
|
||||||
|
//cfg.setIsValid(0);
|
||||||
|
cfg.setIsAreaEffective(0);
|
||||||
|
cfg.setLable("0");
|
||||||
|
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||||
|
cfg.setAttribute(attribute);
|
||||||
|
cfg.setClassify(classify);
|
||||||
|
cfg.setServiceId(serviceDict.getServiceId());
|
||||||
|
if(compileIds!=null&&compileIds.size()==_complexkeywordCfgs.size()) {
|
||||||
|
cfg.setCompileId(compileIds.get(ind));
|
||||||
|
}
|
||||||
|
if(specificServiceCfg!=null) {
|
||||||
|
cfg.setAppCode(specificServiceCfg.getSpecServiceCode());
|
||||||
|
cfg.setSpecServiceId(specificServiceCfg.getSpecServiceId());
|
||||||
|
if(StringUtils.isNotBlank(behaviorId))
|
||||||
|
cfg.setBehavCode(Integer.parseInt(behaviorId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AppFeatureIndex appfeature = new AppFeatureIndex();
|
||||||
|
BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"});
|
||||||
|
if(regionDict!=null){
|
||||||
|
appfeature.setCfgRegionCode1(String.valueOf(regionDict.getConfigRegionCode()));
|
||||||
|
appfeature.setCfgRegionValue(regionDict.getConfigRegionValue());
|
||||||
|
appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType()));
|
||||||
|
}
|
||||||
|
appFeatureIndexs.add(appfeature);
|
||||||
|
|
||||||
|
ind++;
|
||||||
|
}
|
||||||
|
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _complexkeywordCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1"));
|
||||||
|
cfgIndexInfos.clear();
|
||||||
|
appPolicyCfgs.clear();
|
||||||
|
_complexkeywordCfgs.clear();
|
||||||
|
appFeatureIndexs.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else if(regionDict.getRegionType().equals(6)) {
|
}else if(regionDict.getRegionType().equals(6)) {
|
||||||
if(regionDict.getFunctionId().equals(400)) {
|
if(regionDict.getFunctionId().equals(400)) {
|
||||||
@@ -1866,7 +2094,7 @@ public class BaseController {
|
|||||||
cfg.setCompileId(compileIds.get(ind));
|
cfg.setCompileId(compileIds.get(ind));
|
||||||
ind++;
|
ind++;
|
||||||
}
|
}
|
||||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _dnsResStrategies, cfgIndexInfos, appPolicyCfgs,isSend.equals("1"));
|
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _dnsResStrategies, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1"));
|
||||||
_dnsResStrategies.clear();
|
_dnsResStrategies.clear();
|
||||||
cfgIndexInfos.clear();
|
cfgIndexInfos.clear();
|
||||||
appPolicyCfgs.clear();
|
appPolicyCfgs.clear();
|
||||||
@@ -1925,6 +2153,12 @@ public class BaseController {
|
|||||||
ei.loadInitParams(AsnIpTemplate.class, msgProp, regionDict, serviceDict);
|
ei.loadInitParams(AsnIpTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
} else if (regionDict.getFunctionId().equals(301)) {// DDOS IP
|
} else if (regionDict.getFunctionId().equals(301)) {// DDOS IP
|
||||||
ei.loadInitParams(DdosIpTemplate.class, msgProp, regionDict, serviceDict);
|
ei.loadInitParams(DdosIpTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
|
} else if(regionDict.getFunctionId().equals(207)){// HTTP(s)阻断
|
||||||
|
ei.loadInitParams(HttpsRejectIpTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
} else if(regionDict.getFunctionId().equals(208)){// HTTP(s)重定向
|
||||||
|
ei.loadInitParams(HttpsRedirectIpTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
} else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
|
ei.loadInitParams(HttpsReplaceIpTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
} else {
|
} else {
|
||||||
ei.loadInitParams(IpAllTemplate.class, msgProp, regionDict, serviceDict);
|
ei.loadInitParams(IpAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
}
|
}
|
||||||
@@ -1942,6 +2176,12 @@ public class BaseController {
|
|||||||
}else{// 白名单
|
}else{// 白名单
|
||||||
ei.loadInitParams(DomainInterceptTemplate.class, msgProp, regionDict, serviceDict);
|
ei.loadInitParams(DomainInterceptTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
}
|
}
|
||||||
|
}else if(regionDict.getFunctionId().equals(207)){// HTTP(s)阻断
|
||||||
|
ei.loadInitParams(HttpsRejectTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getFunctionId().equals(208)){// HTTP(s)重定向
|
||||||
|
ei.loadInitParams(HttpsRedirectTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
|
ei.loadInitParams(HttpsReplaceTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
}else {
|
}else {
|
||||||
ei.loadInitParams(StringAllTemplate.class, msgProp, regionDict, serviceDict);
|
ei.loadInitParams(StringAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
}
|
}
|
||||||
@@ -1949,6 +2189,14 @@ public class BaseController {
|
|||||||
} else if (regionDict.getRegionType().equals(3)) {// 增强字符串类
|
} else if (regionDict.getRegionType().equals(3)) {// 增强字符串类
|
||||||
if (regionDict.getFunctionId().equals(7)&&serviceDict!=null&&serviceDict.getAction().intValue()==16) {
|
if (regionDict.getFunctionId().equals(7)&&serviceDict!=null&&serviceDict.getAction().intValue()==16) {
|
||||||
ei.loadInitParams(DnsComplexStringTemplate.class, msgProp, regionDict, serviceDict);
|
ei.loadInitParams(DnsComplexStringTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getFunctionId().equals(207)){// HTTP(s)阻断
|
||||||
|
ei.loadInitParams(HttpsRejectComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getFunctionId().equals(208)){// HTTP(s)重定向
|
||||||
|
ei.loadInitParams(HttpsRedirectComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
|
ei.loadInitParams(HttpsReplaceComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getFunctionId().equals(563)) {// APP Payload
|
||||||
|
ei.loadInitParams(AppPayloadTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
} else {
|
} else {
|
||||||
ei.loadInitParams(ComplexStringAllTemplate.class, msgProp, regionDict, serviceDict);
|
ei.loadInitParams(ComplexStringAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
}
|
}
|
||||||
@@ -2031,7 +2279,17 @@ public class BaseController {
|
|||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ExcelCsv.writeCSVFile(response,titleList,headMap,dataList,fileName,titleTime,msgProp);
|
ExcelCsv.writeCSVFile(response,titleList,headMap,dataList,fileName,titleTime,msgProp);
|
||||||
}
|
}
|
||||||
|
public String initLogMap(BaseLogEntity log,String title){
|
||||||
|
Properties msgProp = getMsgProp();
|
||||||
|
String logTime=msgProp.getProperty(title,title);;
|
||||||
|
if(log.getSearchFoundStartTime()!=null){
|
||||||
|
logTime+=" "+msgProp.getProperty("begin_date")+":"+log.getSearchFoundStartTime();
|
||||||
|
}
|
||||||
|
if(log.getSearchFoundEndTime()!=null){
|
||||||
|
logTime+=" "+msgProp.getProperty("end_date")+":"+log.getSearchFoundStartTime();
|
||||||
|
}
|
||||||
|
return logTime;
|
||||||
|
}
|
||||||
|
|
||||||
public String initTimeMap(BaseCfg cfg){
|
public String initTimeMap(BaseCfg cfg){
|
||||||
Properties msgProp = getMsgProp();
|
Properties msgProp = getMsgProp();
|
||||||
@@ -2040,30 +2298,25 @@ public class BaseController {
|
|||||||
titleTime+=" "+msgProp.getProperty("config_time")+":"+DateUtils.formatDateTime(cfg.getSearch_create_time_start());
|
titleTime+=" "+msgProp.getProperty("config_time")+":"+DateUtils.formatDateTime(cfg.getSearch_create_time_start());
|
||||||
if(cfg.getSearch_create_time_end()!=null){
|
if(cfg.getSearch_create_time_end()!=null){
|
||||||
titleTime+="—"+DateUtils.formatDateTime(cfg.getSearch_create_time_end());
|
titleTime+="—"+DateUtils.formatDateTime(cfg.getSearch_create_time_end());
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
if(cfg.getSearch_create_time_end()!=null){
|
titleTime+="—"+DateUtils.getDateTime();
|
||||||
titleTime+=" "+msgProp.getProperty("config_time")+":—"+DateUtils.formatDateTime(cfg.getSearch_create_time_end());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getSearch_edit_time_start()!=null){
|
if(cfg.getSearch_edit_time_start()!=null){
|
||||||
titleTime+=" "+msgProp.getProperty("edit_time")+":"+DateUtils.formatDateTime(cfg.getSearch_edit_time_start());
|
titleTime+=" "+msgProp.getProperty("edit_time")+":"+DateUtils.formatDateTime(cfg.getSearch_edit_time_start());
|
||||||
if(cfg.getSearch_edit_time_end()!=null){
|
if(cfg.getSearch_edit_time_end()!=null){
|
||||||
titleTime+="—"+DateUtils.formatDateTime(cfg.getSearch_edit_time_end());
|
titleTime+="—"+DateUtils.formatDateTime(cfg.getSearch_edit_time_end());
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
if(cfg.getSearch_edit_time_end()!=null){
|
titleTime+="—"+DateUtils.getDateTime();
|
||||||
titleTime+=" "+msgProp.getProperty("edit_time")+":—"+DateUtils.formatDateTime(cfg.getSearch_edit_time_end());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getSearch_audit_time_start()!=null){
|
if(cfg.getSearch_audit_time_start()!=null){
|
||||||
titleTime+=" "+msgProp.getProperty("audit_time")+":"+DateUtils.formatDateTime(cfg.getSearch_audit_time_start());
|
titleTime+=" "+msgProp.getProperty("audit_time")+":"+DateUtils.formatDateTime(cfg.getSearch_audit_time_start());
|
||||||
if(cfg.getSearch_audit_time_end()!=null){
|
if(cfg.getSearch_audit_time_end()!=null){
|
||||||
titleTime+="—"+DateUtils.formatDateTime(cfg.getSearch_audit_time_end());
|
titleTime+="—"+DateUtils.formatDateTime(cfg.getSearch_audit_time_end());
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
if(cfg.getSearch_audit_time_end()!=null){
|
titleTime+="—"+DateUtils.getDateTime();
|
||||||
titleTime+=" "+msgProp.getProperty("audit_time")+": —"+DateUtils.formatDateTime(cfg.getSearch_audit_time_end());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return titleTime;
|
return titleTime;
|
||||||
@@ -2272,7 +2525,7 @@ public class BaseController {
|
|||||||
if(auditBatchCfg != null && !StringUtil.isEmpty(auditBatchCfg.getFunctionId())) {
|
if(auditBatchCfg != null && !StringUtil.isEmpty(auditBatchCfg.getFunctionId())) {
|
||||||
functionId=auditBatchCfg.getFunctionId();
|
functionId=auditBatchCfg.getFunctionId();
|
||||||
}
|
}
|
||||||
List<Map<String,Object>> serviceList = serviceTemplate.getServiceList(functionId);
|
List<Map<String,Object>> serviceList = serviceTemplate.getServiceListByFunctionId(functionId);
|
||||||
|
|
||||||
for(Map<String,Object> service:serviceList){
|
for(Map<String,Object> service:serviceList){
|
||||||
String tableNameXml = service.get("tableName").toString();
|
String tableNameXml = service.get("tableName").toString();
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@@ -18,20 +17,18 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
import com.nis.domain.FunctionRegionDict;
|
import com.nis.domain.FunctionRegionDict;
|
||||||
import com.nis.domain.FunctionServiceDict;
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.AsnIpCfg;
|
import com.nis.domain.basics.AsnIpCfg;
|
||||||
import com.nis.domain.basics.PolicyGroupInfo;
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
import com.nis.domain.configuration.CfgIndexInfo;
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
import com.nis.domain.configuration.IpPortCfg;
|
|
||||||
import com.nis.domain.specific.ConfigGroupInfo;
|
import com.nis.domain.specific.ConfigGroupInfo;
|
||||||
import com.nis.domain.specific.SpecificServiceCfg;
|
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.AsnCacheUtils;
|
import com.nis.util.AsnCacheUtils;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "${adminPath}/basics/asn")
|
@RequestMapping(value = "${adminPath}/basics/asn")
|
||||||
@@ -50,9 +47,9 @@ public class AsnIpController extends BaseController{
|
|||||||
|
|
||||||
// List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(4);
|
// List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(4);
|
||||||
// model.addAttribute("policyGroups", policyGroups);
|
// model.addAttribute("policyGroups", policyGroups);
|
||||||
AsnCacheUtils.init(false);
|
// AsnCacheUtils.init(false);
|
||||||
List<ConfigGroupInfo> policyGroups=AsnCacheUtils.getAllAsnGroup();
|
// List<ConfigGroupInfo> policyGroups=AsnCacheUtils.getAllAsnGroup();
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
// model.addAttribute("policyGroups", policyGroups);
|
||||||
return "/basics/asnIpCfgList";
|
return "/basics/asnIpCfgList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/addForm"})
|
@RequestMapping(value = {"/addForm"})
|
||||||
@@ -186,33 +183,50 @@ public class AsnIpController extends BaseController{
|
|||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap=new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||||
|
List<AsnIpCfg> list = new ArrayList<AsnIpCfg>();
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
/*//导出选中记录
|
list = asnIpCfgService.findByPage(ids);
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
} else {
|
||||||
for(String id:ids.split(",")){
|
|
||||||
Long.parseLong(id);
|
|
||||||
}
|
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
|
||||||
}else{*/
|
|
||||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
|
||||||
Page<AsnIpCfg> pageInfo=new Page<AsnIpCfg>(request, response,"r");
|
Page<AsnIpCfg> pageInfo=new Page<AsnIpCfg>(request, response,"r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<AsnIpCfg> page = asnIpCfgService.findPage(pageInfo, entity);
|
Page<AsnIpCfg> page = asnIpCfgService.findPage(pageInfo, entity);
|
||||||
for (AsnIpCfg asnIp : page.getList()) {
|
list=page.getList();
|
||||||
|
}
|
||||||
|
for (AsnIpCfg asnIp : list) {
|
||||||
asnIp.setIsIssued(String.valueOf(asnIp.getIsValid()));
|
asnIp.setIsIssued(String.valueOf(asnIp.getIsValid()));
|
||||||
}
|
}
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), AsnIpCfg.class);
|
classMap.put(entity.getMenuNameCode(), AsnIpCfg.class);
|
||||||
String ipPortInfoNoExport=",do_log,action,valid_identifier,is_audit"
|
String cfgIndexInfoNoExport=",block_type,do_log,action,valid_identifier,is_audit"
|
||||||
+ ",auditor,audit_time,letter,whether_area_block,classification,attribute,label"
|
+ ",auditor,audit_time,letter,whether_area_block,classification,attribute,label"
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
+",userregion2,userregion3,userregion4,userregion5,ir_type,group_name,&userregion1:asn_no-";
|
||||||
noExportMap.put(entity.getMenuNameCode(),ipPortInfoNoExport);
|
// 时间过滤
|
||||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
if (entity.getSearch_create_time_start() == null ) {
|
||||||
/*}*/
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
|
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||||
|
dataMap.put(entity.getMenuNameCode(), list);
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("asnIp export failed",e);
|
logger.error("asnIp export failed",e);
|
||||||
addMessage(redirectAttributes,"error","export_failed");
|
addMessage(redirectAttributes,"error","export_failed");
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
package com.nis.web.controller.basics;
|
package com.nis.web.controller.basics;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
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.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
@@ -14,6 +20,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.PolicyGroupInfo;
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
/**
|
/**
|
||||||
@@ -133,4 +140,62 @@ public class PolicyGroupController extends BaseController {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Group配置导出
|
||||||
|
@RequestMapping(value = "exportGroup")
|
||||||
|
public void exportGroup(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||||
|
@ModelAttribute("cfg")PolicyGroupInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||||
|
try {
|
||||||
|
//export data info
|
||||||
|
entity.setMenuNameCode("policy_group_manage");
|
||||||
|
List<String> titleList=new ArrayList<String>();
|
||||||
|
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||||
|
Map<String, List> dataMap=new HashMap<String, List>();
|
||||||
|
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||||
|
List<PolicyGroupInfo> list = new ArrayList<PolicyGroupInfo>();
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
|
list = policyGroupInfoService.findPolicyByGroupInfoList(ids);
|
||||||
|
} else {
|
||||||
|
Page<PolicyGroupInfo> pageInfo=new Page<PolicyGroupInfo>(request, response,"r");
|
||||||
|
pageInfo.setPageNo(1);
|
||||||
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
|
Page page = policyGroupInfoService.findPolicyGroupInfoList(pageInfo,entity);
|
||||||
|
list=page.getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
titleList.add(entity.getMenuNameCode());
|
||||||
|
classMap.put(entity.getMenuNameCode(), PolicyGroupInfo.class);
|
||||||
|
String cfgIndexInfoNoExport=",config_describe,cfg_id,block_type,do_log,action,valid_identifier,is_audit"
|
||||||
|
+ ",auditor,audit_time,letter,whether_area_block,classification,attribute,label"
|
||||||
|
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,";
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null ) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||||
|
dataMap.put(entity.getMenuNameCode(), list);
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Group export failed",e);
|
||||||
|
addMessage(redirectAttributes,"error","export_failed");
|
||||||
|
}
|
||||||
|
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +1,37 @@
|
|||||||
package com.nis.web.controller.basics;
|
package com.nis.web.controller.basics;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.shiro.authz.annotation.Logical;
|
import org.apache.shiro.authz.annotation.Logical;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.apache.zookeeper.ZooDefs.Ids;
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.SysUser;
|
||||||
import com.nis.domain.basics.ServiceDictInfo;
|
import com.nis.domain.basics.ServiceDictInfo;
|
||||||
import com.nis.domain.configuration.RequestInfo;
|
|
||||||
import com.nis.exceptions.MaatConvertException;
|
|
||||||
import com.nis.util.ConfigDictUtils;
|
import com.nis.util.ConfigDictUtils;
|
||||||
import com.nis.util.Configurations;
|
import com.nis.util.Configurations;
|
||||||
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.DateUtils;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.util.StringUtils;
|
import com.nis.util.StringUtils;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
import com.nis.web.security.UserUtils;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value = "${adminPath}/basics/serviceDictInfo")
|
@RequestMapping(value = "${adminPath}/basics/serviceDictInfo")
|
||||||
@@ -474,4 +471,126 @@ public class ServiceDictInfoController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// dict配置导出
|
||||||
|
@RequestMapping(value = "exportDict")
|
||||||
|
public void exportDict(String itType, ServiceDictInfo serviceDictInfo,Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
String ids, RedirectAttributes redirectAttributes,String exType,String hColumns) {
|
||||||
|
try {
|
||||||
|
// export data info
|
||||||
|
List<String> titleList = new ArrayList<String>();
|
||||||
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||||
|
List<Integer> intArr = ConfigDictUtils.dealTypeCondition(Configurations.getStringProperty("SERVICE_DICT_ITM_TYPE", ""), itType);
|
||||||
|
//处理数据
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
|
list = serviceDictInfoService.findByDictInfo(ids,intArr);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
Page<ServiceDictInfo> pageCondition = new Page<ServiceDictInfo>(request, response);
|
||||||
|
pageCondition.setPageNo(1);
|
||||||
|
pageCondition.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
|
//查询符合条件总数
|
||||||
|
List<ServiceDictInfo> allList = serviceDictInfoService.findAllServiceDictInfo(serviceDictInfo,intArr,pageCondition.getOrderBy());
|
||||||
|
//查出顶层分页数据
|
||||||
|
Page<ServiceDictInfo> page = serviceDictInfoService.findTopDictList(pageCondition, serviceDictInfo,intArr);
|
||||||
|
// 删除顶层数据、取出id
|
||||||
|
List<Integer> intList = Lists.newArrayList();
|
||||||
|
for(ServiceDictInfo tempSe : page.getList()) {
|
||||||
|
if (tempSe != null) {
|
||||||
|
intList.add(tempSe.getServiceDictId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = allList.size() - 1; i >= 0; i--) {
|
||||||
|
ServiceDictInfo se = allList.get(i);
|
||||||
|
if(se!=null&&intList.contains(se.getServiceDictId())||(se!=null&&se.getParent().getServiceDictId()==0)){
|
||||||
|
allList.remove(se);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
allList.addAll(page.getList());
|
||||||
|
ServiceDictInfo.sortList(list,allList,0,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
for(ServiceDictInfo tempSe : list) {
|
||||||
|
if(tempSe.getServiceDictCreator()!=null){
|
||||||
|
if(tempSe.getServiceDictCreator().getId()!=null){
|
||||||
|
SysUser creator=UserUtils.get(tempSe.getServiceDictCreator().getId().toString());
|
||||||
|
tempSe.setCreatorName(creator.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(tempSe.getServiceDictEditor()!=null){
|
||||||
|
if(tempSe.getServiceDictEditor().getId()!=null){
|
||||||
|
SysUser creator=UserUtils.get(tempSe.getServiceDictEditor().getId().toString());
|
||||||
|
tempSe.setEditorName(creator.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String dictName=getDicName(intArr);
|
||||||
|
titleList.add(dictName);
|
||||||
|
classMap.put(dictName, ServiceDictInfo.class);
|
||||||
|
String cfgIndexInfoNoExport = "";
|
||||||
|
if("5".equals(itType)){
|
||||||
|
cfgIndexInfoNoExport=",item_type,is_leaf,&config_content:vpn_ip-";
|
||||||
|
}
|
||||||
|
if(serviceDictInfo.getBeginDate()==null){
|
||||||
|
cfgIndexInfoNoExport=",create_time,"+cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if(serviceDictInfo.getEditBeginDate()==null){
|
||||||
|
cfgIndexInfoNoExport=",edit_time,"+cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!StringUtil.isEmpty(hColumns)) {
|
||||||
|
cfgIndexInfoNoExport = "," +hColumns+ ","+cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
noExportMap.put(dictName, cfgIndexInfoNoExport);
|
||||||
|
dataMap.put(dictName, list);
|
||||||
|
String timeRange = initDictMap(serviceDictInfo,dictName);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(exType)) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, dictName, titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, dictName, titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("dict white export failed", e);
|
||||||
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String initDictMap(ServiceDictInfo cfg,String dictName){
|
||||||
|
Properties msgProp = getMsgProp();
|
||||||
|
String titleTime=dictName;
|
||||||
|
if(cfg.getBeginDate()!=null){
|
||||||
|
titleTime+=" "+msgProp.getProperty("create_time")+":"+DateUtils.formatDateTime(cfg.getBeginDate());
|
||||||
|
if(cfg.getEndDate()!=null){
|
||||||
|
titleTime+="—"+DateUtils.formatDateTime(cfg.getEndDate());
|
||||||
|
}else{
|
||||||
|
titleTime+="—"+DateUtils.getDateTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(cfg.getEditBeginDate()!=null){
|
||||||
|
titleTime+=" "+msgProp.getProperty("edit_time")+":"+DateUtils.formatDateTime(cfg.getEditBeginDate());
|
||||||
|
if(cfg.getEditEndDate()!=null){
|
||||||
|
titleTime+="—"+DateUtils.formatDateTime(cfg.getEditEndDate());
|
||||||
|
}else{
|
||||||
|
titleTime+="—"+DateUtils.getDateTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return titleTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getDicName(List intArr){
|
||||||
|
String dicName="";
|
||||||
|
Properties msgProp = getMsgProp();
|
||||||
|
List<String> dict=ConfigDictUtils.getItemTypeByNo("SERVICE_DICT_ITM_TYPE",intArr);
|
||||||
|
if(dict.size()>0){
|
||||||
|
dicName=msgProp.getProperty(dict.get(0),dict.get(0));
|
||||||
|
}
|
||||||
|
return dicName;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,14 +13,17 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.configuration.RequestInfo;
|
||||||
import com.nis.domain.configuration.TaskInfo;
|
import com.nis.domain.configuration.TaskInfo;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.DateUtils;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.util.excel.ExcelField;
|
import com.nis.util.excel.ExcelField;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
@@ -74,7 +77,8 @@ public class TaskInfoController extends BaseController{
|
|||||||
}else{
|
}else{
|
||||||
if (!"true".equals(checkTaskName(taskInfo.getTaskName()))){
|
if (!"true".equals(checkTaskName(taskInfo.getTaskName()))){
|
||||||
logger.info(taskInfo.getTaskName()+"重复数据");
|
logger.info(taskInfo.getTaskName()+"重复数据");
|
||||||
addMessage("error",model,"save_failed");
|
Properties props=this.getMsgProp();
|
||||||
|
addMessage("error",model,props.getProperty("duplicate", "Duplicate")+" "+props.getProperty("task_name", "Task Name"));
|
||||||
return form(taskInfo, model);
|
return form(taskInfo, model);
|
||||||
}
|
}
|
||||||
// 保存用户信息
|
// 保存用户信息
|
||||||
@@ -160,7 +164,7 @@ public class TaskInfoController extends BaseController{
|
|||||||
}
|
}
|
||||||
//配置导出
|
//配置导出
|
||||||
@RequestMapping(value = "exportTaskInfo")
|
@RequestMapping(value = "exportTaskInfo")
|
||||||
public void exportTaskInfo(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportTaskInfo(Model model,HttpServletRequest request,HttpServletResponse response,String hcolumn,String exType,
|
||||||
@ModelAttribute("cfg")TaskInfo entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg")TaskInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||||
try {
|
try {
|
||||||
//export data info
|
//export data info
|
||||||
@@ -189,6 +193,18 @@ public class TaskInfoController extends BaseController{
|
|||||||
if(column.toString().length()>0) {
|
if(column.toString().length()>0) {
|
||||||
column.append(",");
|
column.append(",");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(entity.getBeginDate()==null ){
|
||||||
|
hcolumn+=",task_time,";
|
||||||
|
}
|
||||||
|
if(entity.getDobeginDate()==null){
|
||||||
|
hcolumn+=",edit_time,";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!StringUtils.isEmpty(hcolumn)){
|
||||||
|
column.append(","+hcolumn+",");
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(),column.toString());
|
noExportMap.put(entity.getMenuNameCode(),column.toString());
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if(!StringUtil.isEmpty(ids)){
|
||||||
for(String id:ids.split(",")){
|
for(String id:ids.split(",")){
|
||||||
@@ -203,15 +219,43 @@ public class TaskInfoController extends BaseController{
|
|||||||
Page<TaskInfo> page = taskInfoService.findTaskInfo(pageInfo, entity);
|
Page<TaskInfo> page = taskInfoService.findTaskInfo(pageInfo, entity);
|
||||||
list=page.getList();
|
list=page.getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
dataMap.put(entity.getMenuNameCode(),list);
|
dataMap.put(entity.getMenuNameCode(),list);
|
||||||
//获取国际化配置
|
//获取国际化配置
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
String timeRange = initTaskMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(exType)) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("ip addr export failed",e);
|
logger.error("ip addr export failed",e);
|
||||||
addMessage(redirectAttributes,"error", "export_failed");
|
addMessage(redirectAttributes,"error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
public String initTaskMap(TaskInfo info){
|
||||||
|
Properties msgProp = getMsgProp();
|
||||||
|
String logTime=msgProp.getProperty(info.getMenuNameCode(),info.getMenuNameCode());
|
||||||
|
if(info.getBeginDate()!=null){
|
||||||
|
logTime+=" "+msgProp.getProperty("task_time","task_time")+":"+DateUtils.formatDateTime(info.getBeginDate());
|
||||||
|
if(info.getEndDate()!=null){
|
||||||
|
logTime+="—"+DateUtils.formatDateTime(info.getEndDate());
|
||||||
|
}else{
|
||||||
|
logTime+="—"+DateUtils.getDateTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(info.getDobeginDate()!=null){
|
||||||
|
logTime+=" "+msgProp.getProperty("edit_time","edit_time")+":"+DateUtils.formatDateTime(info.getDobeginDate());
|
||||||
|
if(info.getDoendDate()!=null){
|
||||||
|
logTime+="—"+DateUtils.formatDateTime(info.getDoendDate());
|
||||||
|
}else{
|
||||||
|
logTime+="—"+DateUtils.getDateTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return logTime;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -64,6 +64,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 特定协议相关配置控制类
|
* 特定协议相关配置控制类
|
||||||
|
*
|
||||||
* @author zhangwei
|
* @author zhangwei
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -72,6 +73,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
public class AppFeatureCfgController extends BaseController {
|
public class AppFeatureCfgController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* app协议复杂特征配置列表
|
* app协议复杂特征配置列表
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param cfg
|
* @param cfg
|
||||||
* @param request
|
* @param request
|
||||||
@@ -79,7 +81,8 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "multiFeatureCfgList" })
|
@RequestMapping(value = { "multiFeatureCfgList" })
|
||||||
public String multiFeatureCfgList(Model model,@ModelAttribute("cfg")AppFeatureIndex cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String multiFeatureCfgList(Model model, @ModelAttribute("cfg") AppFeatureIndex cfg,
|
||||||
|
HttpServletRequest request, HttpServletResponse response) {
|
||||||
Page<AppFeatureIndex> searchPage = new Page<AppFeatureIndex>(request, response, "r");
|
Page<AppFeatureIndex> searchPage = new Page<AppFeatureIndex>(request, response, "r");
|
||||||
Page<AppFeatureIndex> page = appMultiFeatureCfgService.findAppFeatureIndexList(searchPage, cfg);
|
Page<AppFeatureIndex> page = appMultiFeatureCfgService.findAppFeatureIndexList(searchPage, cfg);
|
||||||
for (AppFeatureIndex entity : page.getList()) {
|
for (AppFeatureIndex entity : page.getList()) {
|
||||||
@@ -90,8 +93,10 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
initPageCondition(model, cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/app/appMultiFeatureCfgList";
|
return "/cfg/app/appMultiFeatureCfgList";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 特征配置表单
|
* 特征配置表单
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param entity
|
* @param entity
|
||||||
@@ -101,10 +106,14 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
public String multiFeatureCfgForm(Model model, String ids, AppFeatureIndex entity) {
|
public String multiFeatureCfgForm(Model model, String ids, AppFeatureIndex entity) {
|
||||||
if (StringUtils.isNotBlank(ids)) {
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(ids));
|
entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(ids));
|
||||||
entity.setIpPortList(appMultiFeatureCfgService.getAppIpRangeCfg(entity.getCompileId(), entity.getFunctionId()));
|
entity.setIpPortList(
|
||||||
entity.setStrList(appMultiFeatureCfgService.getAppStringFeatureCfg(entity.getCompileId(), entity.getFunctionId(),null));
|
appMultiFeatureCfgService.getAppIpRangeCfg(entity.getCompileId(), entity.getFunctionId()));
|
||||||
entity.setComplexList(appMultiFeatureCfgService.getAppComplexFeatureCfg(entity.getCompileId(), entity.getFunctionId(),null));
|
entity.setStrList(appMultiFeatureCfgService.getAppStringFeatureCfg(entity.getCompileId(),
|
||||||
entity.setNumCfgList(appMultiFeatureCfgService.getAppTcpCfg(entity.getCompileId(), entity.getFunctionId(),null));
|
entity.getFunctionId(), null));
|
||||||
|
entity.setComplexList(appMultiFeatureCfgService.getAppComplexFeatureCfg(entity.getCompileId(),
|
||||||
|
entity.getFunctionId(), null));
|
||||||
|
entity.setNumCfgList(
|
||||||
|
appMultiFeatureCfgService.getAppTcpCfg(entity.getCompileId(), entity.getFunctionId(), null));
|
||||||
initUpdateFormCondition(model, entity);
|
initUpdateFormCondition(model, entity);
|
||||||
} else {
|
} else {
|
||||||
initFormCondition(model, entity);
|
initFormCondition(model, entity);
|
||||||
@@ -112,8 +121,10 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/app/appMultiFeatureCfgForm";
|
return "/cfg/app/appMultiFeatureCfgForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 特征配置新增修改
|
* 特征配置新增修改
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
@@ -125,7 +136,8 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
public String saveAppMultiFeatureCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
public String saveAppMultiFeatureCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
AppFeatureIndex entity, RedirectAttributes redirectAttributes) {
|
AppFeatureIndex entity, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
SpecificServiceCfg specificService = specificServiceCfgService
|
||||||
|
.getBySpecServiceId(entity.getSpecServiceId());
|
||||||
if (specificService != null) {
|
if (specificService != null) {
|
||||||
entity.setAppCode(specificService.getSpecServiceCode());
|
entity.setAppCode(specificService.getSpecServiceCode());
|
||||||
}
|
}
|
||||||
@@ -142,8 +154,10 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
|
|
||||||
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 特征配置审核
|
* 特征配置审核
|
||||||
|
*
|
||||||
* @param isAudit
|
* @param isAudit
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
@@ -152,14 +166,9 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "auditAppFeatureCfg" })
|
@RequestMapping(value = { "auditAppFeatureCfg" })
|
||||||
public String auditAppFeatureCfg(Model model,@ModelAttribute("cfg")AppFeatureIndex cfg,
|
public String auditAppFeatureCfg(Model model, @ModelAttribute("cfg") AppFeatureIndex cfg, Integer isValid,
|
||||||
Integer isValid,
|
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
Integer isAudit,
|
HttpServletResponse response, HttpServletRequest request) {
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
AppFeatureIndex entity = new AppFeatureIndex();
|
AppFeatureIndex entity = new AppFeatureIndex();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -206,8 +215,10 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
|
|
||||||
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 特征配置删除
|
* 特征配置删除
|
||||||
|
*
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param functionId
|
* @param functionId
|
||||||
@@ -221,6 +232,7 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询特征子配置
|
* 查询特征子配置
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param cfgId
|
* @param cfgId
|
||||||
* @param index
|
* @param index
|
||||||
@@ -243,15 +255,18 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
map.put("ipRangeList", ipRangeList);
|
map.put("ipRangeList", ipRangeList);
|
||||||
}
|
}
|
||||||
if ("2".equals(cfgRegionType[i])) {
|
if ("2".equals(cfgRegionType[i])) {
|
||||||
List<AppStringFeatureCfg> strList = appMultiFeatureCfgService.getAppStringFeatureCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i]));
|
List<AppStringFeatureCfg> strList = appMultiFeatureCfgService.getAppStringFeatureCfg(compileId,
|
||||||
|
functionId, Integer.valueOf(cfgRegionCode[i]));
|
||||||
map.put("strList", strList);
|
map.put("strList", strList);
|
||||||
}
|
}
|
||||||
if ("3".equals(cfgRegionType[i])) {
|
if ("3".equals(cfgRegionType[i])) {
|
||||||
List<AppComplexFeatureCfg> complexList = appMultiFeatureCfgService.getAppComplexFeatureCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i]));
|
List<AppComplexFeatureCfg> complexList = appMultiFeatureCfgService
|
||||||
|
.getAppComplexFeatureCfg(compileId, functionId, Integer.valueOf(cfgRegionCode[i]));
|
||||||
map.put("complexList", complexList);
|
map.put("complexList", complexList);
|
||||||
}
|
}
|
||||||
if ("4".equals(cfgRegionType[i])) {
|
if ("4".equals(cfgRegionType[i])) {
|
||||||
List<AppTcpCfg> numCfgList = appMultiFeatureCfgService.getAppTcpCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i]));
|
List<AppTcpCfg> numCfgList = appMultiFeatureCfgService.getAppTcpCfg(compileId, functionId,
|
||||||
|
Integer.valueOf(cfgRegionCode[i]));
|
||||||
map.put("numCfgList", numCfgList);
|
map.put("numCfgList", numCfgList);
|
||||||
}
|
}
|
||||||
tabList.add(map);
|
tabList.add(map);
|
||||||
@@ -263,34 +278,21 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
tabList.add(map);
|
tabList.add(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(ipRangeList!=null){
|
/*
|
||||||
String cfgType = null;
|
* if(ipRangeList!=null){ String cfgType = null; for(AppIpCfg
|
||||||
for(AppIpCfg ip:ipRangeList){
|
* ip:ipRangeList){ if(!ip.getCfgType().equals(cfgType)){
|
||||||
if(!ip.getCfgType().equals(cfgType)){
|
* tabList.add(new String[]{"1",ip.getCfgType()}); cfgType =
|
||||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
* ip.getCfgType(); } } } if(strList!=null){ String cfgType = null;
|
||||||
cfgType = ip.getCfgType();
|
* for(AppStringFeatureCfg cfg:strList){
|
||||||
}
|
* if(!cfg.getCfgType().equals(cfgType)){ tabList.add(new
|
||||||
}
|
* String[]{"2",cfg.getCfgType()}); cfgType = cfg.getCfgType(); } } }
|
||||||
}
|
* if(complexList!=null){ String cfgType = null;
|
||||||
if(strList!=null){
|
* for(AppComplexFeatureCfg cfg:complexList){
|
||||||
String cfgType = null;
|
* if(!cfg.getCfgType().equals(cfgType)){ tabList.add(new
|
||||||
for(AppStringFeatureCfg cfg:strList){
|
* String[]{"3",cfg.getCfgType()}); cfgType = cfg.getCfgType();0.
|
||||||
if(!cfg.getCfgType().equals(cfgType)){
|
*
|
||||||
tabList.add(new String[]{"2",cfg.getCfgType()});
|
* } } }
|
||||||
cfgType = cfg.getCfgType();
|
*/
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(complexList!=null){
|
|
||||||
String cfgType = null;
|
|
||||||
for(AppComplexFeatureCfg cfg:complexList){
|
|
||||||
if(!cfg.getCfgType().equals(cfgType)){
|
|
||||||
tabList.add(new String[]{"3",cfg.getCfgType()});
|
|
||||||
cfgType = cfg.getCfgType();0.
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/app/appSubFeatureList";
|
return "/cfg/app/appSubFeatureList";
|
||||||
@@ -331,6 +333,21 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), AppFeatureIndex.class);
|
classMap.put(entity.getMenuNameCode(), AppFeatureIndex.class);
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
@@ -385,12 +402,22 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Appfeature export failed", e);
|
logger.error("Appfeature export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<AppComplexFeatureCfg> replaceKeyList(List<AppComplexFeatureCfg> list) {
|
public static List<AppComplexFeatureCfg> replaceKeyList(List<AppComplexFeatureCfg> list) {
|
||||||
@@ -413,5 +440,4 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 基础协议控制类
|
* 基础协议控制类
|
||||||
|
*
|
||||||
* @author wx
|
* @author wx
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -43,6 +44,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
public class BasicProtocolController extends BaseController {
|
public class BasicProtocolController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* app策略列表
|
* app策略列表
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param cfg
|
* @param cfg
|
||||||
* @param request
|
* @param request
|
||||||
@@ -50,11 +52,13 @@ public class BasicProtocolController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "list" })
|
@RequestMapping(value = { "list" })
|
||||||
public String policyCfgList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String policyCfgList(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
||||||
// for(AppPolicyCfg entity:page.getList()){
|
// for(AppPolicyCfg entity:page.getList()){
|
||||||
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
// SpecificServiceCfg app =
|
||||||
|
// specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||||
// if(app!=null) {
|
// if(app!=null) {
|
||||||
// entity.setAppName(app.getSpecServiceName());
|
// entity.setAppName(app.getSpecServiceName());
|
||||||
// }
|
// }
|
||||||
@@ -64,8 +68,10 @@ public class BasicProtocolController extends BaseController {
|
|||||||
initPageCondition(model, cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/basicprotocol/list";
|
return "/cfg/basicprotocol/list";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询APP策略IP子配置
|
* 查询APP策略IP子配置
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param cfgId
|
* @param cfgId
|
||||||
* @param index
|
* @param index
|
||||||
@@ -98,8 +104,10 @@ public class BasicProtocolController extends BaseController {
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/basicprotocol/basicProtocolSubList";
|
return "/cfg/basicprotocol/basicProtocolSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置表单
|
* 策略配置表单
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param entity
|
* @param entity
|
||||||
@@ -117,8 +125,10 @@ public class BasicProtocolController extends BaseController {
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/basicprotocol/form";
|
return "/cfg/basicprotocol/form";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置新增修改
|
* 策略配置新增修改
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
@@ -131,7 +141,8 @@ public class BasicProtocolController extends BaseController {
|
|||||||
public String saveAppPolicyCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
public String saveAppPolicyCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
AppPolicyCfg entity, RedirectAttributes redirectAttributes) {
|
AppPolicyCfg entity, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
SpecificServiceCfg specificService = specificServiceCfgService
|
||||||
|
.getBySpecServiceId(entity.getSpecServiceId());
|
||||||
if (specificService != null) {
|
if (specificService != null) {
|
||||||
entity.setAppCode(specificService.getSpecServiceCode());
|
entity.setAppCode(specificService.getSpecServiceCode());
|
||||||
}
|
}
|
||||||
@@ -152,8 +163,10 @@ public class BasicProtocolController extends BaseController {
|
|||||||
|
|
||||||
return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置审核
|
* 策略配置审核
|
||||||
|
*
|
||||||
* @param isAudit
|
* @param isAudit
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
@@ -163,14 +176,9 @@ public class BasicProtocolController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "audit" })
|
@RequestMapping(value = { "audit" })
|
||||||
@RequiresPermissions(value = { "basicprotocol:confirm" })
|
@RequiresPermissions(value = { "basicprotocol:confirm" })
|
||||||
public String auditAppPolicyCfg(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,
|
public String auditAppPolicyCfg(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, Integer isValid,
|
||||||
Integer isValid,
|
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
Integer isAudit,
|
HttpServletResponse response, HttpServletRequest request) {
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
AppPolicyCfg entity = new AppPolicyCfg();
|
AppPolicyCfg entity = new AppPolicyCfg();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -188,7 +196,8 @@ public class BasicProtocolController extends BaseController {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("app策略配置下发失败:"+e.getMessage());;
|
logger.info("app策略配置下发失败:" + e.getMessage());
|
||||||
|
;
|
||||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
} else {
|
} else {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -220,8 +229,10 @@ public class BasicProtocolController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置删除
|
* 策略配置删除
|
||||||
|
*
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param functionId
|
* @param functionId
|
||||||
@@ -229,7 +240,8 @@ public class BasicProtocolController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "updateValid" })
|
@RequestMapping(value = { "updateValid" })
|
||||||
@RequiresPermissions(value = { "basicprotocol:config" })
|
@RequiresPermissions(value = { "basicprotocol:config" })
|
||||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String updateAppPolicyCfgValid(Integer isValid, String ids, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId);
|
appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId);
|
||||||
addMessage(redirectAttributes, "success", "delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
@@ -265,7 +277,7 @@ public class BasicProtocolController extends BaseController {
|
|||||||
ipLists = appCfgService.findAppByPolicyList(ids);
|
ipLists = appCfgService.findAppByPolicyList(ids);
|
||||||
} else {
|
} else {
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
entity.setTableName(IpPortCfg.getTablename());
|
||||||
Page<AppPolicyCfg> pageInfo=new Page<AppPolicyCfg>(request, response,"a");
|
Page<AppPolicyCfg> pageInfo = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
||||||
@@ -293,6 +305,21 @@ public class BasicProtocolController extends BaseController {
|
|||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||||
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
|
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
|
||||||
@@ -309,12 +336,22 @@ public class BasicProtocolController extends BaseController {
|
|||||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||||
|
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("ip addr export failed", e);
|
logger.error("ip addr export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 加密隧道行为控制类
|
* 加密隧道行为控制类
|
||||||
|
*
|
||||||
* @author wx
|
* @author wx
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -45,6 +46,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
public class EncryptedTunnelBehaviorController extends BaseController {
|
public class EncryptedTunnelBehaviorController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* app策略列表
|
* app策略列表
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param cfg
|
* @param cfg
|
||||||
* @param request
|
* @param request
|
||||||
@@ -52,32 +54,39 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "list" })
|
@RequestMapping(value = { "list" })
|
||||||
public String policyCfgList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String policyCfgList(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
||||||
// for(AppPolicyCfg entity:page.getList()){
|
// for(AppPolicyCfg entity:page.getList()){
|
||||||
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
// SpecificServiceCfg app =
|
||||||
|
// specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||||
// if(app!=null) {
|
// if(app!=null) {
|
||||||
// entity.setAppName(app.getSpecServiceName());
|
// entity.setAppName(app.getSpecServiceName());
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// //查找社交应用的所有有效二级特定服务
|
// //查找社交应用的所有有效二级特定服务
|
||||||
// SpecificServiceCfg second=new SpecificServiceCfg();
|
// SpecificServiceCfg second=new SpecificServiceCfg();
|
||||||
// for(SysDataDictionaryItem dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
// for(SysDataDictionaryItem
|
||||||
// if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) {
|
// dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
||||||
|
// if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue()))
|
||||||
|
// {
|
||||||
// second.setCfgType(Integer.parseInt(dict.getItemCode()));
|
// second.setCfgType(Integer.parseInt(dict.getItemCode()));
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// second.setIsValid(Constants.VALID_YES);
|
// second.setIsValid(Constants.VALID_YES);
|
||||||
// second.setIsLeaf(1);
|
// second.setIsLeaf(1);
|
||||||
// List<SpecificServiceCfg> secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
// List<SpecificServiceCfg>
|
||||||
|
// secondList=specificServiceCfgService.findAllSpecificServiceCfg(second,
|
||||||
|
// null);
|
||||||
// //遍历,找到匹配项后将行为设置进去
|
// //遍历,找到匹配项后将行为设置进去
|
||||||
// for(AppPolicyCfg entity:page.getList()){
|
// for(AppPolicyCfg entity:page.getList()){
|
||||||
// if(entity.getBehavCode()==null) continue;
|
// if(entity.getBehavCode()==null) continue;
|
||||||
// for(SpecificServiceCfg secondCfg:secondList) {
|
// for(SpecificServiceCfg secondCfg:secondList) {
|
||||||
// if(secondCfg.getSpecServiceCode()==null) continue;
|
// if(secondCfg.getSpecServiceCode()==null) continue;
|
||||||
// if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue()) {
|
// if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue())
|
||||||
|
// {
|
||||||
// entity.setBehavName(secondCfg.getSpecServiceName());
|
// entity.setBehavName(secondCfg.getSpecServiceName());
|
||||||
// break;
|
// break;
|
||||||
// }
|
// }
|
||||||
@@ -87,8 +96,10 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
initPageCondition(model, cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/encryptedtunnelbehav/list";
|
return "/cfg/encryptedtunnelbehav/list";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询APP策略IP子配置
|
* 查询APP策略IP子配置
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param cfgId
|
* @param cfgId
|
||||||
* @param index
|
* @param index
|
||||||
@@ -121,8 +132,10 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/encryptedtunnelbehav/encrypedTunnelSubList";
|
return "/cfg/encryptedtunnelbehav/encrypedTunnelSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置表单
|
* 策略配置表单
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param entity
|
* @param entity
|
||||||
@@ -140,8 +153,10 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/encryptedtunnelbehav/form";
|
return "/cfg/encryptedtunnelbehav/form";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置新增修改
|
* 策略配置新增修改
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
@@ -154,7 +169,8 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
public String saveAppPolicyCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
public String saveAppPolicyCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
AppPolicyCfg entity, RedirectAttributes redirectAttributes) {
|
AppPolicyCfg entity, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
SpecificServiceCfg specificService = specificServiceCfgService
|
||||||
|
.getBySpecServiceId(entity.getSpecServiceId());
|
||||||
if (specificService != null) {
|
if (specificService != null) {
|
||||||
entity.setAppCode(specificService.getSpecServiceCode());
|
entity.setAppCode(specificService.getSpecServiceCode());
|
||||||
}
|
}
|
||||||
@@ -174,8 +190,10 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
|
|
||||||
return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置审核
|
* 策略配置审核
|
||||||
|
*
|
||||||
* @param isAudit
|
* @param isAudit
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
@@ -185,14 +203,9 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "audit" })
|
@RequestMapping(value = { "audit" })
|
||||||
@RequiresPermissions(value = { "encryptedtunnelbehav:confirm" })
|
@RequiresPermissions(value = { "encryptedtunnelbehav:confirm" })
|
||||||
public String auditAppPolicyCfg(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,
|
public String auditAppPolicyCfg(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, Integer isValid,
|
||||||
Integer isValid,
|
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
Integer isAudit,
|
HttpServletResponse response, HttpServletRequest request) {
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
AppPolicyCfg entity = new AppPolicyCfg();
|
AppPolicyCfg entity = new AppPolicyCfg();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -210,7 +223,8 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("加密隧道配置下发失败:"+e.getMessage());;
|
logger.info("加密隧道配置下发失败:" + e.getMessage());
|
||||||
|
;
|
||||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
} else {
|
} else {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -243,8 +257,10 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
|
|
||||||
return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置删除
|
* 策略配置删除
|
||||||
|
*
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param functionId
|
* @param functionId
|
||||||
@@ -252,7 +268,8 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "updateValid" })
|
@RequestMapping(value = { "updateValid" })
|
||||||
@RequiresPermissions(value = { "encryptedtunnelbehav:config" })
|
@RequiresPermissions(value = { "encryptedtunnelbehav:config" })
|
||||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String updateAppPolicyCfgValid(Integer isValid, String ids, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId);
|
appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -284,7 +301,7 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
ipLists = appCfgService.findAppByPolicyList(ids);
|
ipLists = appCfgService.findAppByPolicyList(ids);
|
||||||
} else {
|
} else {
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
entity.setTableName(IpPortCfg.getTablename());
|
||||||
Page<AppPolicyCfg> pageInfo=new Page<AppPolicyCfg>(request, response,"a");
|
Page<AppPolicyCfg> pageInfo = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
||||||
@@ -309,9 +326,11 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
List<SpecificServiceCfg> secondList = specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
List<SpecificServiceCfg> secondList = specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
||||||
// 遍历,找到匹配项后将行为设置进去
|
// 遍历,找到匹配项后将行为设置进去
|
||||||
for (AppPolicyCfg policy : ipLists) {
|
for (AppPolicyCfg policy : ipLists) {
|
||||||
if(policy.getBehavCode()==null) continue;
|
if (policy.getBehavCode() == null)
|
||||||
|
continue;
|
||||||
for (SpecificServiceCfg secondCfg : secondList) {
|
for (SpecificServiceCfg secondCfg : secondList) {
|
||||||
if(secondCfg.getSpecServiceCode()==null) continue;
|
if (secondCfg.getSpecServiceCode() == null)
|
||||||
|
continue;
|
||||||
if (secondCfg.getSpecServiceCode().intValue() == policy.getBehavCode().intValue()) {
|
if (secondCfg.getSpecServiceCode().intValue() == policy.getBehavCode().intValue()) {
|
||||||
policy.setBehavName(secondCfg.getSpecServiceName());
|
policy.setBehavName(secondCfg.getSpecServiceName());
|
||||||
break;
|
break;
|
||||||
@@ -333,6 +352,21 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||||
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
|
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
|
||||||
@@ -349,13 +383,22 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||||
|
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("TunnelBehavior export failed", e);
|
logger.error("TunnelBehavior export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
@@ -22,7 +23,9 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.configuration.RequestInfo;
|
import com.nis.domain.configuration.RequestInfo;
|
||||||
import com.nis.domain.configuration.TaskInfo;
|
import com.nis.domain.configuration.TaskInfo;
|
||||||
|
import com.nis.domain.log.BaseLogEntity;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.DateUtils;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.util.excel.ExcelField;
|
import com.nis.util.excel.ExcelField;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
@@ -80,7 +83,8 @@ public class RequestInfoController extends BaseController{
|
|||||||
}else{
|
}else{
|
||||||
if (!"true".equals(checkRequestNumber(requestInfo.getRequestNumber()))){
|
if (!"true".equals(checkRequestNumber(requestInfo.getRequestNumber()))){
|
||||||
logger.info(requestInfo.getRequestNumber()+"重复数据");
|
logger.info(requestInfo.getRequestNumber()+"重复数据");
|
||||||
addMessage("error",model,"save_failed");
|
Properties props=this.getMsgProp();
|
||||||
|
addMessage("error",model,props.getProperty("duplicate", "Duplicate")+" "+props.getProperty("title", "Title"));
|
||||||
return form(requestInfo, model);
|
return form(requestInfo, model);
|
||||||
}
|
}
|
||||||
// 保存用户信息
|
// 保存用户信息
|
||||||
@@ -188,7 +192,7 @@ public class RequestInfoController extends BaseController{
|
|||||||
}
|
}
|
||||||
//配置导出
|
//配置导出
|
||||||
@RequestMapping(value = "exportRequestInfo")
|
@RequestMapping(value = "exportRequestInfo")
|
||||||
public void exportTaskInfo(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportTaskInfo(Model model,HttpServletRequest request,HttpServletResponse response, String exType,String hcolumn,
|
||||||
@ModelAttribute("requestInfo")RequestInfo entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("requestInfo")RequestInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||||
try {
|
try {
|
||||||
//export data info
|
//export data info
|
||||||
@@ -196,8 +200,6 @@ public class RequestInfoController extends BaseController{
|
|||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap=new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
//导出选中记录
|
//导出选中记录
|
||||||
List<RequestInfo> list=Lists.newArrayList();
|
List<RequestInfo> list=Lists.newArrayList();
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
@@ -217,6 +219,17 @@ public class RequestInfoController extends BaseController{
|
|||||||
if(column.toString().length()>0) {
|
if(column.toString().length()>0) {
|
||||||
column.append(",");
|
column.append(",");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(entity.getBeginDate()==null){
|
||||||
|
hcolumn+=",request_time,";
|
||||||
|
}
|
||||||
|
if(entity.getDobeginDate()==null){
|
||||||
|
hcolumn+=",edit_time,";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!StringUtils.isEmpty(hcolumn)){
|
||||||
|
column.append(","+hcolumn+",");
|
||||||
|
}
|
||||||
noExportMap.put(entity.getMenuNameCode(),column.toString());
|
noExportMap.put(entity.getMenuNameCode(),column.toString());
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if(!StringUtil.isEmpty(ids)){
|
||||||
for(String id:ids.split(",")){
|
for(String id:ids.split(",")){
|
||||||
@@ -231,14 +244,43 @@ public class RequestInfoController extends BaseController{
|
|||||||
Page<RequestInfo> page = requestInfoService.findRequestInfo(pageInfo, entity);
|
Page<RequestInfo> page = requestInfoService.findRequestInfo(pageInfo, entity);
|
||||||
list=page.getList();
|
list=page.getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
dataMap.put(entity.getMenuNameCode(),list);
|
dataMap.put(entity.getMenuNameCode(),list);
|
||||||
// 获取国际化配置
|
// 获取国际化配置
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
String timeRange = initRequestMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(exType)) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("ip addr export failed",e);
|
logger.error("ip addr export failed",e);
|
||||||
addMessage(redirectAttributes,"error", "export_failed");
|
addMessage(redirectAttributes,"error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String initRequestMap(RequestInfo info){
|
||||||
|
Properties msgProp = getMsgProp();
|
||||||
|
String logTime=msgProp.getProperty(info.getMenuNameCode(),info.getMenuNameCode());
|
||||||
|
if(info.getBeginDate()!=null){
|
||||||
|
logTime+=" "+msgProp.getProperty("request_time","request_time")+":"+DateUtils.formatDateTime(info.getBeginDate());
|
||||||
|
if(info.getEndDate()!=null){
|
||||||
|
logTime+="—"+DateUtils.formatDateTime(info.getEndDate());
|
||||||
|
}else{
|
||||||
|
logTime+="—"+DateUtils.getDateTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(info.getDobeginDate()!=null){
|
||||||
|
logTime+=" "+msgProp.getProperty("edit_time","edit_time")+":"+DateUtils.formatDateTime(info.getDobeginDate());
|
||||||
|
if(info.getDoendDate()!=null){
|
||||||
|
logTime+="—"+DateUtils.formatDateTime(info.getDoendDate());
|
||||||
|
}else{
|
||||||
|
logTime+="—"+DateUtils.getDateTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return logTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,28 +44,29 @@ import com.nis.web.service.configuration.DnsIpCfgService;
|
|||||||
public class DnsIpCfgController extends BaseController {
|
public class DnsIpCfgController extends BaseController {
|
||||||
|
|
||||||
@RequestMapping(value = { "/list" })
|
@RequestMapping(value = { "/list" })
|
||||||
public String list(Model model,HttpServletRequest request
|
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response,@ModelAttribute("cfg")DnsIpCfg entity
|
@ModelAttribute("cfg") DnsIpCfg entity, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
Page<DnsIpCfg> page = dnsIpCfgService.findPage(new Page<DnsIpCfg>(request, response, "r"), entity);
|
Page<DnsIpCfg> page = dnsIpCfgService.findPage(new Page<DnsIpCfg>(request, response, "r"), entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/dnsIpCfgList";
|
return "/cfg/dnsIpCfgList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/form" })
|
@RequestMapping(value = { "/form" })
|
||||||
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||||
public String form(Model model,HttpServletRequest request
|
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")DnsIpCfg cfg
|
@ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
cfg = dnsIpCfgService.getDnsIpCfg(Long.parseLong(ids));
|
cfg = dnsIpCfgService.getDnsIpCfg(Long.parseLong(ids));
|
||||||
initUpdateFormCondition(model, cfg);
|
initUpdateFormCondition(model, cfg);
|
||||||
} else {
|
} else {
|
||||||
initFormCondition(model, cfg);
|
initFormCondition(model, cfg);
|
||||||
}
|
}
|
||||||
/*//获取所有响应策略信息
|
/*
|
||||||
List<DnsResStrategy> resStrategys=dnsResStrategyService.findDnsResStrategys(null, 1,1);
|
* //获取所有响应策略信息 List<DnsResStrategy>
|
||||||
model.addAttribute("dnsResStrategys", resStrategys);*/
|
* resStrategys=dnsResStrategyService.findDnsResStrategys(null, 1,1);
|
||||||
|
* model.addAttribute("dnsResStrategys", resStrategys);
|
||||||
|
*/
|
||||||
// 查询policyGroup列表,供响应策略选择 2018-07-24 经确定IP欺骗只能选择非0号分组
|
// 查询policyGroup列表,供响应策略选择 2018-07-24 经确定IP欺骗只能选择非0号分组
|
||||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(1);
|
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(1);
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
model.addAttribute("policyGroups", policyGroups);
|
||||||
@@ -75,6 +76,7 @@ public class DnsIpCfgController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化一条dns fakeip配置
|
* 初始化一条dns fakeip配置
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@@ -101,12 +103,11 @@ public class DnsIpCfgController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "success";
|
return "success";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/saveOrUpdate" })
|
@RequestMapping(value = { "/saveOrUpdate" })
|
||||||
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||||
public String saveOrUpdate(Model model,HttpServletRequest request
|
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response,
|
@ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) {
|
||||||
@ModelAttribute("cfg")DnsIpCfg cfg
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
try {
|
try {
|
||||||
dnsIpCfgService.saveOrUpdate(cfg);
|
dnsIpCfgService.saveOrUpdate(cfg);
|
||||||
addMessage(redirectAttributes, "success", "save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
@@ -125,21 +126,16 @@ public class DnsIpCfgController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/delete" })
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||||
public String delete(Integer isAudit,Integer isValid
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||||
,String ids,Integer functionId
|
RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
dnsIpCfgService.delete(isAudit, isValid, ids, functionId);
|
dnsIpCfgService.delete(isAudit, isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/audit" })
|
@RequestMapping(value = { "/audit" })
|
||||||
@RequiresPermissions(value = { "dns:fake:ip:confirm" })
|
@RequiresPermissions(value = { "dns:fake:ip:confirm" })
|
||||||
public String audit(Model model,@ModelAttribute("cfg")DnsIpCfg cfg,
|
public String audit(Model model, @ModelAttribute("cfg") DnsIpCfg cfg, Integer isValid, Integer isAudit, String ids,
|
||||||
Integer isValid,
|
Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -185,6 +181,7 @@ public class DnsIpCfgController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* DNS阻断无策略时检验
|
* DNS阻断无策略时检验
|
||||||
|
*
|
||||||
* @param entity
|
* @param entity
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
@@ -213,7 +210,6 @@ public class DnsIpCfgController extends BaseController {
|
|||||||
Map<String, List> dataMap = new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
List<DnsIpCfg> ipLists = new ArrayList<DnsIpCfg>();
|
List<DnsIpCfg> ipLists = new ArrayList<DnsIpCfg>();
|
||||||
// 导出选中记录
|
// 导出选中记录
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
@@ -235,10 +231,33 @@ public class DnsIpCfgController extends BaseController {
|
|||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), DnsIpCfg.class);
|
classMap.put(entity.getMenuNameCode(), DnsIpCfg.class);
|
||||||
String cfgIndexInfoNoExport = ",whether_area_block,client_ip,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
String cfgIndexInfoNoExport = ",whether_area_block,client_ip,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
/*}*/
|
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("DnsIp export failed", e);
|
logger.error("DnsIp export failed", e);
|
||||||
if (e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
@@ -247,6 +266,7 @@ public class DnsIpCfgController extends BaseController {
|
|||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import com.nis.web.controller.BaseController;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* dns响应策略
|
* dns响应策略
|
||||||
|
*
|
||||||
* @author ddm
|
* @author ddm
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -42,12 +43,8 @@ public class DnsResStrategyController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/form" })
|
@RequestMapping(value = { "/form" })
|
||||||
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||||
public String from(Model model,
|
public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
HttpServletRequest request,
|
@ModelAttribute("cfg") DnsResStrategy cfg, RedirectAttributes redirectAttributes) {
|
||||||
HttpServletResponse response,
|
|
||||||
String ids,
|
|
||||||
@ModelAttribute("cfg")DnsResStrategy cfg
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
if (cfg == null) {
|
if (cfg == null) {
|
||||||
cfg = new DnsResStrategy();
|
cfg = new DnsResStrategy();
|
||||||
}
|
}
|
||||||
@@ -56,18 +53,18 @@ public class DnsResStrategyController extends BaseController {
|
|||||||
initFormCondition(model, cfg);
|
initFormCondition(model, cfg);
|
||||||
model.addAttribute("isAdd", false);
|
model.addAttribute("isAdd", false);
|
||||||
} else {
|
} else {
|
||||||
/*//不存在响应策略为0的配置,则新策略时,cfgId默认为0
|
/*
|
||||||
DnsResStrategy dns0=dnsResStrategyService.getDnsResStrategy(0l,null);
|
* //不存在响应策略为0的配置,则新策略时,cfgId默认为0 DnsResStrategy
|
||||||
if(dns0 == null){
|
* dns0=dnsResStrategyService.getDnsResStrategy(0l,null); if(dns0 ==
|
||||||
cfg.setCfgId(0l);
|
* null){ cfg.setCfgId(0l); cfg.setCfgDesc("无策略"); }
|
||||||
cfg.setCfgDesc("无策略");
|
*/
|
||||||
}*/
|
|
||||||
initFormCondition(model, cfg);
|
initFormCondition(model, cfg);
|
||||||
model.addAttribute("isAdd", true);
|
model.addAttribute("isAdd", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询policyGroup列表,供响应策略选择
|
// 查询policyGroup列表,供响应策略选择
|
||||||
// List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1);
|
// List<PolicyGroupInfo>
|
||||||
|
// policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1);
|
||||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findHasIpPolicyGroupInfosByType(1);
|
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findHasIpPolicyGroupInfosByType(1);
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
model.addAttribute("policyGroups", policyGroups);
|
||||||
|
|
||||||
@@ -78,8 +75,7 @@ public class DnsResStrategyController extends BaseController {
|
|||||||
@RequestMapping(value = { "/saveOrUpdate" })
|
@RequestMapping(value = { "/saveOrUpdate" })
|
||||||
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||||
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")DnsResStrategy cfg
|
@ModelAttribute("cfg") DnsResStrategy cfg, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
dnsResStrategyService.saveOrUpdate(cfg);
|
dnsResStrategyService.saveOrUpdate(cfg);
|
||||||
@@ -95,11 +91,11 @@ public class DnsResStrategyController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/list" })
|
@RequestMapping(value = { "/list" })
|
||||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response
|
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,@ModelAttribute("cfg")DnsResStrategy entity
|
@ModelAttribute("cfg") DnsResStrategy entity, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
// 查询时left join policyGroup
|
// 查询时left join policyGroup
|
||||||
Page<DnsResStrategy> page = dnsResStrategyService.findPage(new Page<DnsResStrategy>(request, response,"r"), entity);
|
Page<DnsResStrategy> page = dnsResStrategyService.findPage(new Page<DnsResStrategy>(request, response, "r"),
|
||||||
|
entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/maintenance/dnsResStrategy/list";
|
return "/cfg/maintenance/dnsResStrategy/list";
|
||||||
@@ -107,10 +103,8 @@ public class DnsResStrategyController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/delete" })
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
||||||
,Model model,HttpServletRequest request
|
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||||
,HttpServletResponse response
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
dnsResStrategyService.delete(isAudit, isValid, ids, functionId);
|
dnsResStrategyService.delete(isAudit, isValid, ids, functionId);
|
||||||
}
|
}
|
||||||
@@ -120,13 +114,8 @@ public class DnsResStrategyController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/audit" })
|
@RequestMapping(value = { "/audit" })
|
||||||
@RequiresPermissions(value = { "dns:res:strategy:confirm" })
|
@RequiresPermissions(value = { "dns:res:strategy:confirm" })
|
||||||
public String audit(Model model,@ModelAttribute("cfg")DnsResStrategy cfg,
|
public String audit(Model model, @ModelAttribute("cfg") DnsResStrategy cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -164,6 +153,7 @@ public class DnsResStrategyController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = "/validCfgId")
|
@RequestMapping(value = "/validCfgId")
|
||||||
public boolean validCfgId(Long cfgId) {
|
public boolean validCfgId(Long cfgId) {
|
||||||
@@ -198,16 +188,42 @@ public class DnsResStrategyController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ipLists.size(); i++) {
|
for (int i = 0; i < ipLists.size(); i++) {
|
||||||
ipLists.get(i).setMiTtlmax(String.valueOf(ipLists.get(i).getMinTtl())+"-"+String.valueOf(ipLists.get(i).getMaxTtl()));
|
ipLists.get(i).setMiTtlmax(
|
||||||
|
String.valueOf(ipLists.get(i).getMinTtl()) + "-" + String.valueOf(ipLists.get(i).getMaxTtl()));
|
||||||
ipLists.get(i).setDnsId(String.valueOf(ipLists.get(i).getCfgId()));
|
ipLists.get(i).setDnsId(String.valueOf(ipLists.get(i).getCfgId()));
|
||||||
}
|
}
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), DnsResStrategy.class);
|
classMap.put(entity.getMenuNameCode(), DnsResStrategy.class);
|
||||||
String cfgIndexInfoNoExport=",cfg_id,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
String cfgIndexInfoNoExport = ",cfg_id,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:policy_name-";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
if (entity.gethColumns().contains("policy_name")) {
|
||||||
|
cfgIndexInfoNoExport = ",config_describe," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
/*}*/
|
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Dns export failed", e);
|
logger.error("Dns export failed", e);
|
||||||
if (e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
@@ -216,6 +232,7 @@ public class DnsResStrategyController extends BaseController {
|
|||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.nis.web.controller.configuration.maintenance;
|
package com.nis.web.controller.configuration.maintenance;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -21,7 +20,6 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.IpReuseIpCfg;
|
import com.nis.domain.basics.IpReuseIpCfg;
|
||||||
import com.nis.domain.configuration.BaseIpCfg;
|
|
||||||
import com.nis.domain.configuration.IpAddrPoolCfg;
|
import com.nis.domain.configuration.IpAddrPoolCfg;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.ConfigServiceUtil;
|
import com.nis.util.ConfigServiceUtil;
|
||||||
@@ -225,4 +223,66 @@ public class IpAddrPoolController extends BaseController{
|
|||||||
return ipList;
|
return ipList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping(value = "exportIpPool")
|
||||||
|
public void exportIpPool(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
@ModelAttribute("cfg") IpAddrPoolCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
|
try {
|
||||||
|
// export data info
|
||||||
|
List<String> titleList = new ArrayList<String>();
|
||||||
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
List<IpAddrPoolCfg> ipLists = new ArrayList<IpAddrPoolCfg>();
|
||||||
|
// 导出选中记录
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
|
ipLists = ipAddrPoolCfgService.findByPage(ids);
|
||||||
|
} else {
|
||||||
|
Page<IpAddrPoolCfg> pageInfo = new Page<IpAddrPoolCfg>(request, response, "r");
|
||||||
|
pageInfo.setPageNo(1);
|
||||||
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
|
Page<IpAddrPoolCfg> page = ipAddrPoolCfgService.findPage(pageInfo, entity);
|
||||||
|
ipLists = page.getList();
|
||||||
|
}
|
||||||
|
for (IpAddrPoolCfg ipAddrPoolCfg : ipLists) {
|
||||||
|
Integer compId=ipAddrPoolCfg.getCfgId().intValue();
|
||||||
|
ipAddrPoolCfg.setCompileId(compId);
|
||||||
|
}
|
||||||
|
|
||||||
|
titleList.add(entity.getMenuNameCode());
|
||||||
|
classMap.put(entity.getMenuNameCode(), IpAddrPoolCfg.class);
|
||||||
|
String cfgIndexInfoNoExport = ",cfg_id,config_describe,block_type,policy_name,do_log,,whether_area_block,do_blacklist,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("ip white export failed", e);
|
||||||
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,10 +38,7 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/form" })
|
@RequestMapping(value = { "/form" })
|
||||||
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
||||||
public String from(Model model,
|
public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
HttpServletRequest request,
|
|
||||||
HttpServletResponse response,
|
|
||||||
String ids,
|
|
||||||
@ModelAttribute("cfg") IpMultiplexPoolCfg cfg) {
|
@ModelAttribute("cfg") IpMultiplexPoolCfg cfg) {
|
||||||
if (cfg == null) {
|
if (cfg == null) {
|
||||||
cfg = new IpMultiplexPoolCfg();
|
cfg = new IpMultiplexPoolCfg();
|
||||||
@@ -62,8 +59,8 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/saveOrUpdate" })
|
@RequestMapping(value = { "/saveOrUpdate" })
|
||||||
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
||||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
RedirectAttributes redirectAttributes, @ModelAttribute("cfg") IpMultiplexPoolCfg cfg) {
|
||||||
try {
|
try {
|
||||||
// 设置省份信息
|
// 设置省份信息
|
||||||
groupAreaService.setAreaCodeByGroupId(cfg);
|
groupAreaService.setAreaCodeByGroupId(cfg);
|
||||||
@@ -84,9 +81,11 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/list" })
|
@RequestMapping(value = { "/list" })
|
||||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){
|
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
@ModelAttribute("cfg") IpMultiplexPoolCfg entity) {
|
||||||
// 查询时left join policyGroup
|
// 查询时left join policyGroup
|
||||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request, response,"r"), entity);
|
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService
|
||||||
|
.findPage(new Page<IpMultiplexPoolCfg>(request, response, "r"), entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/maintenance/ipMultiplexPool/list";
|
return "/cfg/maintenance/ipMultiplexPool/list";
|
||||||
@@ -94,8 +93,8 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/delete" })
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
||||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
||||||
,HttpServletRequest request,HttpServletResponse response){
|
RedirectAttributes redirectAttributes, HttpServletRequest request, HttpServletResponse response) {
|
||||||
try {
|
try {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
ipMultiplexPoolCfgService.delete(isAudit, isValid, ids, functionId);
|
ipMultiplexPoolCfgService.delete(isAudit, isValid, ids, functionId);
|
||||||
@@ -110,7 +109,8 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/audit" })
|
@RequestMapping(value = { "/audit" })
|
||||||
@RequiresPermissions(value = { "ip:mulitiplex:pool:confirm" })
|
@RequiresPermissions(value = { "ip:mulitiplex:pool:confirm" })
|
||||||
public String audit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String audit(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
Date auditTime = new Date();
|
Date auditTime = new Date();
|
||||||
@@ -132,6 +132,7 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = "/validCfgId")
|
@RequestMapping(value = "/validCfgId")
|
||||||
public boolean validCfgId(Long cfgId) {
|
public boolean validCfgId(Long cfgId) {
|
||||||
@@ -143,104 +144,90 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@RequestMapping(value = {"/snatlist"})
|
/*
|
||||||
public String snatlist(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){
|
* @RequestMapping(value = {"/snatlist"}) public String snatlist(Model
|
||||||
//查询时left join policyGroup
|
* model,HttpServletRequest request,HttpServletResponse
|
||||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request, response,"r"), entity);
|
* response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){ //查询时left join
|
||||||
model.addAttribute("page", page);
|
* policyGroup Page<IpMultiplexPoolCfg> page =
|
||||||
initFormCondition(model,entity);
|
* ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request,
|
||||||
return "/cfg/maintenance/ipMultiplexPool/snatlist";
|
* response,"r"), entity); model.addAttribute("page", page);
|
||||||
}
|
* initFormCondition(model,entity); return
|
||||||
|
* "/cfg/maintenance/ipMultiplexPool/snatlist"; }
|
||||||
@RequestMapping(value = {"/snatform"})
|
*
|
||||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
* @RequestMapping(value = {"/snatform"})
|
||||||
public String snatfrom(Model model,
|
*
|
||||||
HttpServletRequest request,
|
* @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String
|
||||||
HttpServletResponse response,
|
* snatfrom(Model model, HttpServletRequest request, HttpServletResponse
|
||||||
String ids,
|
* response, String ids,
|
||||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
*
|
||||||
if(cfg == null){
|
* @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ if(cfg == null){ cfg=new
|
||||||
cfg=new IpMultiplexPoolCfg();
|
* IpMultiplexPoolCfg(); } if(!StringUtil.isEmpty(ids)){ cfg =
|
||||||
}
|
* ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null);
|
||||||
if(!StringUtil.isEmpty(ids)){
|
* initUpdateFormCondition(model, cfg); }else{ initFormCondition(model,
|
||||||
cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null);
|
* cfg); }
|
||||||
initUpdateFormCondition(model, cfg);
|
*
|
||||||
}else{
|
* //查询ip复用地址池配置的policyGroup列表 List<PolicyGroupInfo>
|
||||||
initFormCondition(model, cfg);
|
* policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(2);
|
||||||
}
|
* model.addAttribute("policyGroups", policyGroups);
|
||||||
|
* model.addAttribute("_cfg", cfg); return
|
||||||
//查询ip复用地址池配置的policyGroup列表
|
* "/cfg/maintenance/ipMultiplexPool/snatform"; }
|
||||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(2);
|
*
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
* @RequestMapping(value = {"/snatsaveOrUpdate"})
|
||||||
model.addAttribute("_cfg", cfg);
|
*
|
||||||
return "/cfg/maintenance/ipMultiplexPool/snatform";
|
* @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String
|
||||||
}
|
* snatsaveOrUpdate(Model model,HttpServletRequest
|
||||||
|
* request,HttpServletResponse response,RedirectAttributes
|
||||||
@RequestMapping(value = {"/snatsaveOrUpdate"})
|
* redirectAttributes,
|
||||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
*
|
||||||
public String snatsaveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
* @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ try{ // 设置省份信息
|
||||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
* if(!StringUtil.isEmpty(cfg.getPolicyGroup())){
|
||||||
try{
|
* groupAreaService.setAreaCodeByGroupId(cfg); }
|
||||||
// 设置省份信息
|
* ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
||||||
if(!StringUtil.isEmpty(cfg.getPolicyGroup())){
|
*
|
||||||
groupAreaService.setAreaCodeByGroupId(cfg);
|
* addMessage(redirectAttributes,"success","save_success"); }catch(Exception
|
||||||
}
|
* e){ e.printStackTrace(); if(e instanceof MaatConvertException) {
|
||||||
ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
* addMessage(redirectAttributes,"error", "request_service_failed"); }else {
|
||||||
|
* addMessage(redirectAttributes,"error", "save_failed"); } }
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
*
|
||||||
}catch(Exception e){
|
* return "redirect:" + adminPath
|
||||||
e.printStackTrace();
|
* +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId
|
||||||
if(e instanceof MaatConvertException) {
|
* (); }
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
*
|
||||||
}else {
|
* @RequestMapping(value = {"/snataudit"})
|
||||||
addMessage(redirectAttributes,"error", "save_failed");
|
*
|
||||||
}
|
* @RequiresPermissions(value={"ip:mulitiplex:pool:confirm"}) public String
|
||||||
}
|
* snataudit(Integer isAudit,Integer isValid,String ids,Integer
|
||||||
|
* functionId,RedirectAttributes redirectAttributes) {
|
||||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId();
|
* if(!StringUtil.isEmpty(ids)){ String[] idArray = ids.split(","); Date
|
||||||
}
|
* auditTime=new Date(); for(String id :idArray){ try {
|
||||||
|
* ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||||
@RequestMapping(value = {"/snataudit"})
|
* } catch (Exception e) { e.printStackTrace();
|
||||||
@RequiresPermissions(value={"ip:mulitiplex:pool:confirm"})
|
* logger.error("SNAT地址池管理配置下发失败:"+e.getMessage()); if(e instanceof
|
||||||
public String snataudit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
* MaatConvertException) { addMessage(redirectAttributes,"error",
|
||||||
if(!StringUtil.isEmpty(ids)){
|
* "request_service_failed"); }else { addMessage(redirectAttributes,"error",
|
||||||
String[] idArray = ids.split(",");
|
* "audit_failed"); } } }
|
||||||
Date auditTime=new Date();
|
*
|
||||||
for(String id :idArray){
|
* } return "redirect:" + adminPath
|
||||||
try {
|
* +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; }
|
||||||
ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
*
|
||||||
} catch (Exception e) {
|
* @RequestMapping(value = {"/snatdelete"})
|
||||||
e.printStackTrace();
|
*
|
||||||
logger.error("SNAT地址池管理配置下发失败:"+e.getMessage());
|
* @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String
|
||||||
if(e instanceof MaatConvertException) {
|
* snatdelete(Integer isAudit,Integer isValid,String ids,Integer
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
* functionId,Model model,RedirectAttributes redirectAttributes
|
||||||
}else {
|
* ,HttpServletRequest request,HttpServletResponse response){ try{
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
* if(!StringUtil.isEmpty(ids)){
|
||||||
}
|
* ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId); }
|
||||||
}
|
* addMessage(redirectAttributes,"success","delete_success");
|
||||||
}
|
* }catch(Exception e){ logger.error(e);
|
||||||
|
* addMessage(redirectAttributes,"error","delete_failed"); } return
|
||||||
}
|
* "redirect:" + adminPath
|
||||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
|
* +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; }
|
||||||
}
|
*/
|
||||||
@RequestMapping(value = {"/snatdelete"})
|
|
||||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
|
||||||
public String snatdelete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes
|
|
||||||
,HttpServletRequest request,HttpServletResponse response){
|
|
||||||
try{
|
|
||||||
if(!StringUtil.isEmpty(ids)){
|
|
||||||
ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId);
|
|
||||||
}
|
|
||||||
addMessage(redirectAttributes,"success","delete_success");
|
|
||||||
}catch(Exception e){
|
|
||||||
logger.error(e);
|
|
||||||
addMessage(redirectAttributes,"error","delete_failed");
|
|
||||||
}
|
|
||||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验IP是否已存在
|
* 校验IP是否已存在
|
||||||
|
*
|
||||||
* @param cfg
|
* @param cfg
|
||||||
* @param redirectAttributes
|
* @param redirectAttributes
|
||||||
* @param request
|
* @param request
|
||||||
@@ -276,14 +263,12 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
Map<String, List> dataMap = new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
/*
|
||||||
/*//导出选中记录
|
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||||
for(String id:ids.split(",")){
|
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||||
Long.parseLong(id);
|
* , entity.getFunctionId(), ids); }else{
|
||||||
}
|
*/
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
|
||||||
}else{*/
|
|
||||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||||
Page<IpMultiplexPoolCfg> pageInfo = new Page<IpMultiplexPoolCfg>(request, response, "r");
|
Page<IpMultiplexPoolCfg> pageInfo = new Page<IpMultiplexPoolCfg>(request, response, "r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
@@ -293,15 +278,40 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
||||||
String snatNoExport = ",server_port,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
String snatNoExport = ",server_port,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
snatNoExport = ",config_time" + snatNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
snatNoExport = ",edit_time" + snatNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
snatNoExport = ",audit_time" + snatNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
snatNoExport = "," + entity.gethColumns() + "," + snatNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||||
/*}*/
|
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("snat export failed", e);
|
logger.error("snat export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// dnat配置导出
|
// dnat配置导出
|
||||||
@@ -315,14 +325,12 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
Map<String, List> dataMap = new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
/*
|
||||||
/*//导出选中记录
|
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||||
for(String id:ids.split(",")){
|
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||||
Long.parseLong(id);
|
* , entity.getFunctionId(), ids); }else{
|
||||||
}
|
*/
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
|
||||||
}else{*/
|
|
||||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||||
Page<IpMultiplexPoolCfg> pageInfo = new Page<IpMultiplexPoolCfg>(request, response, "r");
|
Page<IpMultiplexPoolCfg> pageInfo = new Page<IpMultiplexPoolCfg>(request, response, "r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
@@ -331,14 +339,39 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
||||||
String snatNoExport = ",isp,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
String snatNoExport = ",isp,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
snatNoExport = ",config_time" + snatNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
snatNoExport = ",edit_time" + snatNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
snatNoExport = ",audit_time" + snatNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
snatNoExport = "," + entity.gethColumns() + "," + snatNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("dnat export failed", e);
|
logger.error("dnat export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,14 @@ import com.google.common.collect.Maps;
|
|||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.IpReuseIpCfg;
|
import com.nis.domain.basics.IpReuseIpCfg;
|
||||||
import com.nis.domain.basics.ServiceDictInfo;
|
import com.nis.domain.basics.ServiceDictInfo;
|
||||||
|
import com.nis.domain.configuration.BaseCfg;
|
||||||
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.configuration.UserManage;
|
import com.nis.domain.configuration.UserManage;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.DateUtils;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.util.StringUtils;
|
import com.nis.util.StringUtils;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
@@ -352,4 +357,83 @@ public class UserManageController extends BaseController{
|
|||||||
model.addAttribute("user", user);
|
model.addAttribute("user", user);
|
||||||
return "/cfg/maintenance/userManage/userView";
|
return "/cfg/maintenance/userManage/userView";
|
||||||
}*/
|
}*/
|
||||||
|
// 配置导出
|
||||||
|
@RequestMapping(value = "exportUser")
|
||||||
|
public void exportbgp(Model model, HttpServletRequest request, HttpServletResponse response,String hColumns,String exType,
|
||||||
|
@ModelAttribute("cfg") UserManage entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
|
try {
|
||||||
|
// export data info
|
||||||
|
List<String> titleList = new ArrayList<String>();
|
||||||
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
List<UserManage> ipLists = new ArrayList<UserManage>();
|
||||||
|
// 导出选中记录
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
|
ipLists = userManageService.findByPage(ids);
|
||||||
|
} else {
|
||||||
|
Page<UserManage> pageInfo = new Page<UserManage>(request, response, "a");
|
||||||
|
pageInfo.setPageNo(1);
|
||||||
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
|
Page<UserManage> page = userManageService.findPage(pageInfo, entity);
|
||||||
|
ipLists = page.getList();
|
||||||
|
}
|
||||||
|
titleList.add("user_manage");
|
||||||
|
classMap.put("user_manage", UserManage.class);
|
||||||
|
String cfgIndexInfoNoExport = ",";
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!StringUtil.isEmpty(hColumns)) {
|
||||||
|
cfgIndexInfoNoExport = "," + hColumns + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
for (UserManage userManage : ipLists) {
|
||||||
|
if(!StringUtils.isEmpty( userManage.getServerIp())){
|
||||||
|
userManage.setServerIp(userManage.getServerIp().substring(0,userManage.getServerIp().length()-1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
noExportMap.put("user_manage", cfgIndexInfoNoExport);
|
||||||
|
dataMap.put("user_manage", ipLists);
|
||||||
|
String timeRange = initUserMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(exType)) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, "user_manage", titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, "user_manage", titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("user export failed", e);
|
||||||
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
|
}
|
||||||
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
|
}
|
||||||
|
public String initUserMap(UserManage cfg){
|
||||||
|
Properties msgProp = getMsgProp();
|
||||||
|
String titleTime=msgProp.getProperty("user_manage","user_manage");
|
||||||
|
if(cfg.getSearch_create_time_start()!=null){
|
||||||
|
titleTime+=" "+msgProp.getProperty("config_time")+":"+DateUtils.formatDateTime(cfg.getSearch_create_time_start());
|
||||||
|
if(cfg.getSearch_create_time_end()!=null){
|
||||||
|
titleTime+="—"+DateUtils.formatDateTime(cfg.getSearch_create_time_end());
|
||||||
|
}else {
|
||||||
|
titleTime+="—"+DateUtils.getDateTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(cfg.getSearch_edit_time_start()!=null){
|
||||||
|
titleTime+=" "+msgProp.getProperty("edit_time")+":"+DateUtils.formatDateTime(cfg.getSearch_edit_time_start());
|
||||||
|
if(cfg.getSearch_edit_time_end()!=null){
|
||||||
|
titleTime+="—"+DateUtils.formatDateTime(cfg.getSearch_edit_time_end());
|
||||||
|
}else{
|
||||||
|
titleTime+="—"+DateUtils.getDateTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return titleTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,15 +41,18 @@ import com.nis.web.security.UserUtils;
|
|||||||
public class DdosCfgController extends BaseController {
|
public class DdosCfgController extends BaseController {
|
||||||
|
|
||||||
@RequestMapping(value = { "/list" })
|
@RequestMapping(value = { "/list" })
|
||||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")DdosIpCfg entity){
|
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
@ModelAttribute("cfg") DdosIpCfg entity) {
|
||||||
Page<DdosIpCfg> page = ddosCfgService.findPage(new Page<DdosIpCfg>(request, response, "r"), entity);
|
Page<DdosIpCfg> page = ddosCfgService.findPage(new Page<DdosIpCfg>(request, response, "r"), entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/ddosIpCfgList";
|
return "/cfg/ddosIpCfgList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/form" })
|
@RequestMapping(value = { "/form" })
|
||||||
@RequiresPermissions(value = { "ddos:ip:config" })
|
@RequiresPermissions(value = { "ddos:ip:config" })
|
||||||
public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")DdosIpCfg cfg){
|
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
|
@ModelAttribute("cfg") DdosIpCfg cfg) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
cfg = ddosCfgService.getDdosIpCfg(Long.parseLong(ids), null);
|
cfg = ddosCfgService.getDdosIpCfg(Long.parseLong(ids), null);
|
||||||
initUpdateFormCondition(model, cfg);
|
initUpdateFormCondition(model, cfg);
|
||||||
@@ -86,15 +89,11 @@ public class DdosCfgController extends BaseController {
|
|||||||
ddosCfgService.delete(isAudit, isValid, ids, functionId);
|
ddosCfgService.delete(isAudit, isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/manipulation/ddos/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/manipulation/ddos/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/audit" })
|
@RequestMapping(value = { "/audit" })
|
||||||
// @RequiresPermissions(value={"ddos:ip:confirm"})
|
// @RequiresPermissions(value={"ddos:ip:confirm"})
|
||||||
public String audit(Model model,@ModelAttribute("cfg")DdosIpCfg cfg,
|
public String audit(Model model, @ModelAttribute("cfg") DdosIpCfg cfg, Integer isValid, Integer isAudit, String ids,
|
||||||
Integer isValid,
|
Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -160,30 +159,55 @@ public class DdosCfgController extends BaseController {
|
|||||||
Page<DdosIpCfg> page = ddosCfgService.findPage(pageInfo, entity);
|
Page<DdosIpCfg> page = ddosCfgService.findPage(pageInfo, entity);
|
||||||
ipLists = page.getList();
|
ipLists = page.getList();
|
||||||
}
|
}
|
||||||
/*//导出选中记录
|
/*
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||||
for(String id:ids.split(",")){
|
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||||
Long.parseLong(id);
|
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||||
}
|
* , entity.getFunctionId(), ids); }else{
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
*/
|
||||||
}else{*/
|
|
||||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||||
|
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), DdosIpCfg.class);
|
classMap.put(entity.getMenuNameCode(), DdosIpCfg.class);
|
||||||
String cfgIndexInfoNoExport = ",do_log,client_ip,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
String cfgIndexInfoNoExport = ",do_log,client_ip,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
/*}*/
|
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("ddos export failed", e);
|
logger.error("ddos export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据索引表信息异步获取子表信息
|
* 根据索引表信息异步获取子表信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "/ajaxDdosInfo" })
|
@RequestMapping(value = { "/ajaxDdosInfo" })
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import com.nis.domain.Page;
|
|||||||
import com.nis.domain.SysDataDictionaryItem;
|
import com.nis.domain.SysDataDictionaryItem;
|
||||||
import com.nis.domain.basics.PolicyGroupInfo;
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
import com.nis.domain.configuration.BaseIpCfg;
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
import com.nis.domain.configuration.IpAddrPoolCfg;
|
import com.nis.domain.configuration.IpAddrPoolCfg;
|
||||||
import com.nis.domain.configuration.IpPortCfg;
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.configuration.IpReuseDnatPolicyCfg;
|
import com.nis.domain.configuration.IpReuseDnatPolicyCfg;
|
||||||
@@ -61,12 +62,14 @@ public class IpMultiplexController extends CommonController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/list" })
|
@RequestMapping(value = { "/list" })
|
||||||
// @RequiresPermissions(value={"ip:mulitiplex:config","ip:mulitiplex:confirm"},logical=Logical.OR)
|
// @RequiresPermissions(value={"ip:mulitiplex:config","ip:mulitiplex:confirm"},logical=Logical.OR)
|
||||||
public String ipList(String cfgName,Model model,@ModelAttribute("cfg")IpPortCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String ipList(String cfgName, Model model, @ModelAttribute("cfg") IpPortCfg cfg, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
this._ipList(cfgName, model, cfg, request, response);
|
this._ipList(cfgName, model, cfg, request, response);
|
||||||
model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex");
|
model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex");
|
||||||
model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
||||||
return "/cfg/common/ipList";
|
return "/cfg/common/ipList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/form" })
|
@RequestMapping(value = { "/form" })
|
||||||
@RequiresPermissions(value = { "ip:mulitiplex:config" })
|
@RequiresPermissions(value = { "ip:mulitiplex:config" })
|
||||||
public String ipForm(String cfgName, Model model, String ids, Integer functionId, BaseIpCfg entity) {
|
public String ipForm(String cfgName, Model model, String ids, Integer functionId, BaseIpCfg entity) {
|
||||||
@@ -80,26 +83,31 @@ public class IpMultiplexController extends CommonController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dict != null) {
|
if (dict != null) {
|
||||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(Integer.parseInt(dict.getItemCode()));
|
List<PolicyGroupInfo> policyGroups = policyGroupInfoService
|
||||||
|
.findPolicyGroupInfosByType(Integer.parseInt(dict.getItemCode()));
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
model.addAttribute("policyGroups", policyGroups);
|
||||||
}
|
}
|
||||||
model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex");
|
model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex");
|
||||||
model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
||||||
return "/cfg/manipulation/ipmulitiplex/form";
|
return "/cfg/manipulation/ipmulitiplex/form";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/saveOrUpdate" })
|
@RequestMapping(value = { "/saveOrUpdate" })
|
||||||
public String saveOrUpdateIp(String cfgName, RedirectAttributes model, IpPortCfg cfg) {
|
public String saveOrUpdateIp(String cfgName, RedirectAttributes model, IpPortCfg cfg) {
|
||||||
this._saveOrUpdateIp(cfgName, model, cfg);
|
this._saveOrUpdateIp(cfgName, model, cfg);
|
||||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId();
|
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/delete" })
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions("ip:mulitiplex:config")
|
@RequiresPermissions("ip:mulitiplex:config")
|
||||||
public String deleteIp(String cfgName,String ids,String compileIds,Integer functionId,RedirectAttributes model) {
|
public String deleteIp(String cfgName, String ids, String compileIds, Integer functionId,
|
||||||
|
RedirectAttributes model) {
|
||||||
this._deleteIp(cfgName, ids, compileIds, functionId, model);
|
this._deleteIp(cfgName, ids, compileIds, functionId, model);
|
||||||
model.addAttribute("urlPrefix", "/proxy/ipmulitiplex");
|
model.addAttribute("urlPrefix", "/proxy/ipmulitiplex");
|
||||||
model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
||||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/audit" })
|
@RequestMapping(value = { "/audit" })
|
||||||
@RequiresPermissions("ip:mulitiplex:confirm")
|
@RequiresPermissions("ip:mulitiplex:confirm")
|
||||||
public String auditIp(String cfgName, String ids, IpPortCfg cfg, RedirectAttributes redirectAttributes) {
|
public String auditIp(String cfgName, String ids, IpPortCfg cfg, RedirectAttributes redirectAttributes) {
|
||||||
@@ -108,21 +116,28 @@ public class IpMultiplexController extends CommonController {
|
|||||||
redirectAttributes.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
redirectAttributes.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
||||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId();
|
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ip配置导入
|
// ip配置导入
|
||||||
/*@RequestMapping(value = "/import", method=RequestMethod.POST)
|
/*
|
||||||
public String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
* @RequestMapping(value = "/import", method=RequestMethod.POST) public
|
||||||
@RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
* String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||||
this._importIp(cfgName,redirectAttributes, file,cfg,IpMultiplexPolicyTemplate.class);
|
*
|
||||||
redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
* @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||||
redirectAttributes.addAttribute("requiresPermissionPrefix","ip:mulitiplex");
|
* this._importIp(cfgName,redirectAttributes,
|
||||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId();
|
* file,cfg,IpMultiplexPolicyTemplate.class);
|
||||||
}*/
|
* redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex")
|
||||||
|
* ; redirectAttributes.addAttribute("requiresPermissionPrefix",
|
||||||
|
* "ip:mulitiplex"); return "redirect:" + adminPath
|
||||||
|
* +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId(); }
|
||||||
|
*/
|
||||||
// ip模板下载
|
// ip模板下载
|
||||||
@RequestMapping(value = "import/template")
|
@RequestMapping(value = "import/template")
|
||||||
public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
|
public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
|
||||||
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
|
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
|
||||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,IpMultiplexPolicyTemplate.class);
|
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,
|
||||||
|
IpMultiplexPolicyTemplate.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ip配置导出
|
// ip配置导出
|
||||||
@RequestMapping(value = "export")
|
@RequestMapping(value = "export")
|
||||||
public void exportIp(String columns, Model model, HttpServletRequest request, HttpServletResponse response,
|
public void exportIp(String columns, Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@@ -134,10 +149,11 @@ public class IpMultiplexController extends CommonController {
|
|||||||
* IP复用策略拆分为SNAT/DNAT复用策略
|
* IP复用策略拆分为SNAT/DNAT复用策略
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "/snatPolicyList" })
|
@RequestMapping(value = { "/snatPolicyList" })
|
||||||
public String snatPolicyList(Model model,@ModelAttribute("cfg")IpReusePolicyCfg cfg,
|
public String snatPolicyList(Model model, @ModelAttribute("cfg") IpReusePolicyCfg cfg, HttpServletRequest request,
|
||||||
HttpServletRequest request,HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
|
|
||||||
Page<IpReusePolicyCfg> page = ipMultiplexService.findPage(new Page<IpReusePolicyCfg>(request, response,"r"), cfg);
|
Page<IpReusePolicyCfg> page = ipMultiplexService.findPage(new Page<IpReusePolicyCfg>(request, response, "r"),
|
||||||
|
cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initFormCondition(model, cfg);
|
initFormCondition(model, cfg);
|
||||||
|
|
||||||
@@ -151,8 +167,8 @@ public class IpMultiplexController extends CommonController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/snatPolicyForm" })
|
@RequestMapping(value = { "/snatPolicyForm" })
|
||||||
@RequiresPermissions(value = { "snat_policy:config" })
|
@RequiresPermissions(value = { "snat_policy:config" })
|
||||||
public String snatPolicyForm(Model model, String ids, IpReusePolicyCfg cfg,
|
public String snatPolicyForm(Model model, String ids, IpReusePolicyCfg cfg, HttpServletRequest request,
|
||||||
HttpServletRequest request,HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
if (cfg == null) {
|
if (cfg == null) {
|
||||||
cfg = new IpReusePolicyCfg();
|
cfg = new IpReusePolicyCfg();
|
||||||
}
|
}
|
||||||
@@ -211,7 +227,8 @@ public class IpMultiplexController extends CommonController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/auditSnat" })
|
@RequestMapping(value = { "/auditSnat" })
|
||||||
@RequiresPermissions("snat_policy:confirm")
|
@RequiresPermissions("snat_policy:confirm")
|
||||||
public String auditSnat(String ids,Integer isAudit,Integer isValid,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String auditSnat(String ids, Integer isAudit, Integer isValid, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -235,7 +252,6 @@ public class IpMultiplexController extends CommonController {
|
|||||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/snatPolicyList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/snatPolicyList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = { "/ajaxSnatInfo" })
|
@RequestMapping(value = { "/ajaxSnatInfo" })
|
||||||
public String ajaxSnatInfo(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxSnatInfo(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
IpReusePolicyCfg cfg = ipMultiplexService.getSnatCfg(cfgId, compileId);
|
IpReusePolicyCfg cfg = ipMultiplexService.getSnatCfg(cfgId, compileId);
|
||||||
@@ -256,8 +272,6 @@ public class IpMultiplexController extends CommonController {
|
|||||||
return "/cfg/manipulation/ipmulitiplex/snatSubList";
|
return "/cfg/manipulation/ipmulitiplex/snatSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = { "/ajaxDnatInfo" })
|
@RequestMapping(value = { "/ajaxDnatInfo" })
|
||||||
public String ajaxDnatInfo(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxDnatInfo(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
IpReuseDnatPolicyCfg cfg = ipMultiplexService.getDnatCfg(cfgId, compileId);
|
IpReuseDnatPolicyCfg cfg = ipMultiplexService.getDnatCfg(cfgId, compileId);
|
||||||
@@ -273,9 +287,9 @@ public class IpMultiplexController extends CommonController {
|
|||||||
return "/cfg/manipulation/ipmulitiplex/dnatSubList";
|
return "/cfg/manipulation/ipmulitiplex/dnatSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步获取地址池信息
|
* 异步获取地址池信息
|
||||||
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
@@ -290,8 +304,7 @@ public class IpMultiplexController extends CommonController {
|
|||||||
params.put("addr_pool_id", addrPool.getCfgId());
|
params.put("addr_pool_id", addrPool.getCfgId());
|
||||||
String url = Constants.IP_REUSE_CALL_CGI_URL;
|
String url = Constants.IP_REUSE_CALL_CGI_URL;
|
||||||
Map<String, Object> resultMap = ConfigServiceUtil.getCGIInfo(url, Constants.IP_NUM_GET, params);
|
Map<String, Object> resultMap = ConfigServiceUtil.getCGIInfo(url, Constants.IP_NUM_GET, params);
|
||||||
if(!StringUtil.isEmpty(resultMap)
|
if (!StringUtil.isEmpty(resultMap) && !StringUtil.isEmpty(resultMap.get("num"))
|
||||||
&& !StringUtil.isEmpty(resultMap.get("num"))
|
|
||||||
&& Integer.parseInt(resultMap.get("num").toString()) > 0) {
|
&& Integer.parseInt(resultMap.get("num").toString()) > 0) {
|
||||||
addrPoolsNew.add(addrPool);
|
addrPoolsNew.add(addrPool);
|
||||||
}
|
}
|
||||||
@@ -301,6 +314,7 @@ public class IpMultiplexController extends CommonController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验地址池是否被策略引用
|
* 校验地址池是否被策略引用
|
||||||
|
*
|
||||||
* @param addrPoolIds
|
* @param addrPoolIds
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
@@ -319,7 +333,6 @@ public class IpMultiplexController extends CommonController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = { "/dnatPolicyList" })
|
@RequestMapping(value = { "/dnatPolicyList" })
|
||||||
public String dnatPolicyList(String cfgName, Model model, @ModelAttribute("cfg") IpReuseDnatPolicyCfg cfg,
|
public String dnatPolicyList(String cfgName, Model model, @ModelAttribute("cfg") IpReuseDnatPolicyCfg cfg,
|
||||||
HttpServletRequest request, HttpServletResponse response) {
|
HttpServletRequest request, HttpServletResponse response) {
|
||||||
@@ -334,7 +347,8 @@ public class IpMultiplexController extends CommonController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/dnatPolicyForm" })
|
@RequestMapping(value = { "/dnatPolicyForm" })
|
||||||
@RequiresPermissions(value = { "dnat_policy:config" })
|
@RequiresPermissions(value = { "dnat_policy:config" })
|
||||||
public String dnatPolicyForm(String cfgName,Model model,String ids,Integer functionId,IpReuseDnatPolicyCfg cfg) {
|
public String dnatPolicyForm(String cfgName, Model model, String ids, Integer functionId,
|
||||||
|
IpReuseDnatPolicyCfg cfg) {
|
||||||
// this._ipForm(cfgName,model, ids, functionId, entity);
|
// this._ipForm(cfgName,model, ids, functionId, entity);
|
||||||
|
|
||||||
if (cfg == null) {
|
if (cfg == null) {
|
||||||
@@ -388,7 +402,8 @@ public class IpMultiplexController extends CommonController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/auditDnat" })
|
@RequestMapping(value = { "/auditDnat" })
|
||||||
@RequiresPermissions("dnat_policy:confirm")
|
@RequiresPermissions("dnat_policy:confirm")
|
||||||
public String auditDnat(String ids,Integer isAudit,Integer isValid,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String auditDnat(String ids, Integer isAudit, Integer isValid, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
// this._auditIp(cfgName,ids, cfg, redirectAttributes);
|
// this._auditIp(cfgName,ids, cfg, redirectAttributes);
|
||||||
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
@@ -416,7 +431,7 @@ public class IpMultiplexController extends CommonController {
|
|||||||
// snat配置导出
|
// snat配置导出
|
||||||
@RequestMapping(value = "exportSnat")
|
@RequestMapping(value = "exportSnat")
|
||||||
public void exportSnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
public void exportSnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")BaseIpCfg entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") IpReusePolicyCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
// export data info
|
// export data info
|
||||||
List<String> titleList = new ArrayList<String>();
|
List<String> titleList = new ArrayList<String>();
|
||||||
@@ -424,44 +439,77 @@ public class IpMultiplexController extends CommonController {
|
|||||||
Map<String, List> dataMap = new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
Properties msgProp = getMsgProp();
|
Properties msgProp = getMsgProp();
|
||||||
|
// 导出选中记录
|
||||||
|
List<IpReusePolicyCfg> ipLists = new ArrayList<IpReusePolicyCfg>();
|
||||||
|
|
||||||
/*//导出选中记录
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
ipLists = ipMultiplexService.findByPage(ids);
|
||||||
for(String id:ids.split(",")){
|
} else {
|
||||||
Long.parseLong(id);
|
Page<IpReusePolicyCfg> pageInfo = new Page<IpReusePolicyCfg>(request, response, "r");
|
||||||
}
|
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
|
||||||
}else{*/
|
|
||||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
|
||||||
Page<BaseIpCfg> pageInfo=new Page<BaseIpCfg>(request, response,"r");
|
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<BaseIpCfg> page = ipCfgService.findPage(pageInfo, entity);//
|
Page<IpReusePolicyCfg> page = ipMultiplexService.findPage(pageInfo,entity);
|
||||||
for (BaseIpCfg baseIp : page.getList()) {
|
ipLists = page.getList();
|
||||||
if(StringUtil.isEmpty(baseIp.getGroupName())){
|
}
|
||||||
baseIp.setGroupName(msgProp.getProperty("default_group"));
|
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
||||||
|
for (IpReusePolicyCfg ipReusePolicyCfg : ipLists) {
|
||||||
|
if(ipReusePolicyCfg.getAddrPoolId()!=null){
|
||||||
|
for (IpAddrPoolCfg addr : addrPools) {
|
||||||
|
if(ipReusePolicyCfg.getAddrPoolId()==addr.getCfgId().intValue()){
|
||||||
|
ipReusePolicyCfg.setAddrPoolName(addr.getAddrPoolName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(ipReusePolicyCfg.getUserType().equals("VPN")){
|
||||||
|
ipReusePolicyCfg.setUserType(msgProp.getProperty("policy_vpn_user","VPN"));
|
||||||
|
}else if(ipReusePolicyCfg.getUserType().equals("SIPv4")){
|
||||||
|
ipReusePolicyCfg.setUserType(msgProp.getProperty("policy_sipv4_user","SIPv4"));
|
||||||
|
}else if(ipReusePolicyCfg.getUserType().equals("SIPv6")){
|
||||||
|
ipReusePolicyCfg.setUserType(msgProp.getProperty("policy_sipv6_user","SIPv6"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), BaseIpCfg.class);
|
classMap.put(entity.getMenuNameCode(), IpReusePolicyCfg.class);
|
||||||
String snatNoExport=",client_ip,group_name,server_ip,ip_type,ip_pattern,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
String snatNoExport = ",block_type,client_ip,group_name,server_ip,ip_type,ip_pattern,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
snatNoExport = ",config_time" + snatNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
snatNoExport = ",edit_time" + snatNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
snatNoExport = ",audit_time" + snatNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
snatNoExport = "," + entity.gethColumns() + "," + snatNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
/*}*/
|
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("snat export failed", e);
|
logger.error("snat export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// dnat配置导出
|
// dnat配置导出
|
||||||
@RequestMapping(value = "exportDnat")
|
@RequestMapping(value = "exportDnat")
|
||||||
public void exportDnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
public void exportDnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")BaseIpCfg entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") IpReuseDnatPolicyCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
// export data info
|
// export data info
|
||||||
List<String> titleList = new ArrayList<String>();
|
List<String> titleList = new ArrayList<String>();
|
||||||
@@ -469,36 +517,53 @@ public class IpMultiplexController extends CommonController {
|
|||||||
Map<String, List> dataMap = new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
Properties msgProp = getMsgProp();
|
Properties msgProp = getMsgProp();
|
||||||
|
// 导出选中记录
|
||||||
/*//导出选中记录
|
List<BaseIpCfg> ipLists = new ArrayList<BaseIpCfg>();
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
for(String id:ids.split(",")){
|
ipLists = ipMultiplexService.findPageByDnat(ids);
|
||||||
Long.parseLong(id);
|
} else {
|
||||||
}
|
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
|
||||||
}else{*/
|
|
||||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
|
||||||
Page<BaseIpCfg> pageInfo = new Page<BaseIpCfg>(request, response, "r");
|
Page<BaseIpCfg> pageInfo = new Page<BaseIpCfg>(request, response, "r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<BaseIpCfg> page = ipCfgService.findPage(pageInfo, entity);//
|
Page<BaseIpCfg> page = ipMultiplexService.findPageDnat(pageInfo, entity);
|
||||||
for (BaseIpCfg baseIp : page.getList()) {
|
ipLists = page.getList();
|
||||||
if(StringUtil.isEmpty(baseIp.getGroupName())){
|
|
||||||
baseIp.setGroupName(msgProp.getProperty("default_group"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), BaseIpCfg.class);
|
classMap.put(entity.getMenuNameCode(), IpReuseDnatPolicyCfg.class);
|
||||||
String snatNoExport=",direction,client_ip,ip_type,ip_pattern,port_pattern,client_port,ir_type,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
String snatNoExport = ",group_name,block_type,direction,client_ip,ip_type,ip_pattern,port_pattern,client_port,ir_type,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
snatNoExport = ",config_time" + snatNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
snatNoExport = ",edit_time" + snatNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
snatNoExport = ",audit_time" + snatNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
snatNoExport = "," + entity.gethColumns() + "," + snatNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
dataMap.put(entity.getMenuNameCode(),ipLists);
|
||||||
/*}*/
|
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("dnat export failed", e);
|
logger.error("dnat export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,24 +19,24 @@ import com.nis.domain.specific.ConfigGroupInfo;
|
|||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/cfg/asnPolicy")
|
@RequestMapping("${adminPath}/cfg/asnPolicy")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public class AsnPolicyCfgController extends BaseController {
|
public class AsnPolicyCfgController extends BaseController {
|
||||||
@RequestMapping(value = { "/list" })
|
@RequestMapping(value = { "/list" })
|
||||||
public String list(Model model,HttpServletRequest request
|
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo entity
|
@ModelAttribute("cfg") CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
Page<CfgIndexInfo> page = asnPolicyCfgService.findPage(new Page<CfgIndexInfo>(request, response, "r"), entity);
|
Page<CfgIndexInfo> page = asnPolicyCfgService.findPage(new Page<CfgIndexInfo>(request, response, "r"), entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/asnPolicyCfgList";
|
return "/cfg/asnPolicyCfgList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/form" })
|
@RequestMapping(value = { "/form" })
|
||||||
@RequiresPermissions(value = { "asn:policy:config" })
|
@RequiresPermissions(value = { "asn:policy:config" })
|
||||||
public String form(Model model,HttpServletRequest request
|
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")CfgIndexInfo entity
|
@ModelAttribute("cfg") CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
entity = asnPolicyCfgService.get(Long.parseLong(ids));
|
entity = asnPolicyCfgService.get(Long.parseLong(ids));
|
||||||
initUpdateFormCondition(model, entity);
|
initUpdateFormCondition(model, entity);
|
||||||
@@ -48,12 +48,11 @@ public class AsnPolicyCfgController extends BaseController {
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/asnPolicyCfgForm";
|
return "/cfg/asnPolicyCfgForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/saveOrUpdate" })
|
@RequestMapping(value = { "/saveOrUpdate" })
|
||||||
@RequiresPermissions(value = { "asn:policy:config" })
|
@RequiresPermissions(value = { "asn:policy:config" })
|
||||||
public String saveOrUpdate(Model model,HttpServletRequest request
|
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response,
|
@ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
||||||
@ModelAttribute("cfg")CfgIndexInfo cfg
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
try {
|
try {
|
||||||
asnPolicyCfgService.saveOrUpdate(cfg);
|
asnPolicyCfgService.saveOrUpdate(cfg);
|
||||||
addMessage(redirectAttributes, "success", "save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
@@ -69,11 +68,11 @@ public class AsnPolicyCfgController extends BaseController {
|
|||||||
|
|
||||||
return "redirect:" + adminPath + "/cfg/asnPolicy/list?functionId=" + cfg.getFunctionId();
|
return "redirect:" + adminPath + "/cfg/asnPolicy/list?functionId=" + cfg.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/delete" })
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions(value = { "asn:policy:config" })
|
@RequiresPermissions(value = { "asn:policy:config" })
|
||||||
public String delete(Integer isAudit,Integer isValid
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||||
,String ids,Integer functionId
|
RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
asnPolicyCfgService.delete(functionId, isValid, ids);
|
asnPolicyCfgService.delete(functionId, isValid, ids);
|
||||||
return "redirect:" + adminPath + "/cfg/asnPolicy/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/cfg/asnPolicy/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
@@ -100,6 +99,7 @@ public class AsnPolicyCfgController extends BaseController {
|
|||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
// return "redirect:" + adminPath +"/cfg/asnPolicy/list?functionId="+functionId;
|
// return "redirect:" + adminPath
|
||||||
|
// +"/cfg/asnPolicy/list?functionId="+functionId;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import com.nis.web.controller.BaseController;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理音视频文本业务
|
* 处理音视频文本业务
|
||||||
|
*
|
||||||
* @author ddm
|
* @author ddm
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -52,8 +53,8 @@ public class AvContentController extends BaseController {
|
|||||||
// 音视频VOIP IP配置新增界面
|
// 音视频VOIP IP配置新增界面
|
||||||
@RequestMapping(value = { "/voipForm" })
|
@RequestMapping(value = { "/voipForm" })
|
||||||
@RequiresPermissions(value = { "avVoip:config" })
|
@RequiresPermissions(value = { "avVoip:config" })
|
||||||
public String voipFrom(Model model,HttpServletRequest request ,HttpServletResponse response
|
public String voipFrom(Model model, HttpServletRequest request, HttpServletResponse response, String compileIds,
|
||||||
,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){
|
String ids, CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
cfg.setCfgId(Long.parseLong(ids));
|
cfg.setCfgId(Long.parseLong(ids));
|
||||||
cfg = avContentCfgService.getCfgIndexInfo(cfg);
|
cfg = avContentCfgService.getCfgIndexInfo(cfg);
|
||||||
@@ -66,22 +67,20 @@ public class AvContentController extends BaseController {
|
|||||||
return "/cfg/av/voip/voipForm";
|
return "/cfg/av/voip/voipForm";
|
||||||
}
|
}
|
||||||
// 音视频VOIP Account配置新增界面
|
// 音视频VOIP Account配置新增界面
|
||||||
/* @RequestMapping(value = {"/voipAccountForm"})
|
/*
|
||||||
@RequiresPermissions(value={"avVoipAccount:config"})
|
* @RequestMapping(value = {"/voipAccountForm"})
|
||||||
public String voipAccountForm(Model model,HttpServletRequest request ,HttpServletResponse response
|
*
|
||||||
,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){
|
* @RequiresPermissions(value={"avVoipAccount:config"}) public String
|
||||||
//修改
|
* voipAccountForm(Model model,HttpServletRequest request
|
||||||
if(!StringUtil.isEmpty(compileIds)){
|
* ,HttpServletResponse response ,String compileIds,String ids, CfgIndexInfo
|
||||||
cfg.setCompileId(Integer.parseInt(compileIds));
|
* cfg ,RedirectAttributes redirectAttributes){ //修改
|
||||||
cfg = avContentCfgService.getCfgIndexInfo2(cfg);
|
* if(!StringUtil.isEmpty(compileIds)){
|
||||||
initUpdateFormCondition(model, cfg);
|
* cfg.setCompileId(Integer.parseInt(compileIds)); cfg =
|
||||||
}else{
|
* avContentCfgService.getCfgIndexInfo2(cfg); initUpdateFormCondition(model,
|
||||||
initFormCondition(model,cfg);//新增
|
* cfg); }else{ initFormCondition(model,cfg);//新增 }
|
||||||
}
|
*
|
||||||
|
* model.addAttribute("_cfg", cfg); return "/cfg/av/voip/voipAccountForm"; }
|
||||||
model.addAttribute("_cfg", cfg);
|
*/
|
||||||
return "/cfg/av/voip/voipAccountForm";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// 保存voip ip信息
|
// 保存voip ip信息
|
||||||
@RequestMapping(value = { "/saveVoip" })
|
@RequestMapping(value = { "/saveVoip" })
|
||||||
@@ -103,67 +102,56 @@ public class AvContentController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/av/voipList?functionId=" + cfg.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/av/voipList?functionId=" + cfg.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存voip Account信息
|
// 保存voip Account信息
|
||||||
/* @RequestMapping(value = {"/saveAccountVoip"})
|
/*
|
||||||
public String saveAccountVoip(Model model,HttpServletRequest request,HttpServletResponse response,String ids,
|
* @RequestMapping(value = {"/saveAccountVoip"}) public String
|
||||||
CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){
|
* saveAccountVoip(Model model,HttpServletRequest
|
||||||
try{
|
* request,HttpServletResponse response,String ids, CfgIndexInfo cfg
|
||||||
avContentCfgService.saveOrUpdateAvVoipAccount(cfg);
|
* ,RedirectAttributes redirectAttributes){ try{
|
||||||
addMessage(redirectAttributes,"save_success");
|
* avContentCfgService.saveOrUpdateAvVoipAccount(cfg);
|
||||||
}catch(Exception e){
|
* addMessage(redirectAttributes,"save_success"); }catch(Exception e){ if(e
|
||||||
if(e instanceof MaatConvertException) {
|
* instanceof MaatConvertException) { e.printStackTrace();
|
||||||
e.printStackTrace();
|
* logger.error("voip Account信息保存失败",e);
|
||||||
logger.error("voip Account信息保存失败",e);
|
* addMessage(redirectAttributes,"request_service_failed"); }else {
|
||||||
addMessage(redirectAttributes,"request_service_failed");
|
* e.printStackTrace(); logger.error("voip Account信息保存失败",e);
|
||||||
}else {
|
* addMessage(redirectAttributes,"save_failed"); } } return "redirect:" +
|
||||||
e.printStackTrace();
|
* adminPath +"/ntc/av/voipAccountList?functionId="+cfg.getFunctionId(); }
|
||||||
logger.error("voip Account信息保存失败",e);
|
*/
|
||||||
addMessage(redirectAttributes,"save_failed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+cfg.getFunctionId();
|
|
||||||
}*/
|
|
||||||
// 视频文本VOIP 配置列表
|
// 视频文本VOIP 配置列表
|
||||||
@RequestMapping(value = { "/voipList" })
|
@RequestMapping(value = { "/voipList" })
|
||||||
public String voipCfgList(Model model,HttpServletRequest request ,HttpServletResponse response ,@ModelAttribute("cfg")CfgIndexInfo entity
|
public String voipCfgList(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||||
/*if(entity.getIpPort()== null){
|
/*
|
||||||
entity.setIpPort(new IpPortCfg());
|
* if(entity.getIpPort()== null){ entity.setIpPort(new IpPortCfg()); }
|
||||||
}
|
* if(entity.getVoipAccount()== null){ entity.setVoipAccount(new
|
||||||
if(entity.getVoipAccount()== null){
|
* AvVoipAccountCfg()); } if(entity.getNtcSubscribeIdCfg()==null){
|
||||||
entity.setVoipAccount(new AvVoipAccountCfg());
|
* entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); }
|
||||||
}
|
*/
|
||||||
if(entity.getNtcSubscribeIdCfg()==null){
|
|
||||||
entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg());
|
|
||||||
}*/
|
|
||||||
Page<CfgIndexInfo> page = avContentCfgService.findPage(new Page<CfgIndexInfo>(request, response, "r"), entity);
|
Page<CfgIndexInfo> page = avContentCfgService.findPage(new Page<CfgIndexInfo>(request, response, "r"), entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/av/voip/voipList";
|
return "/cfg/av/voip/voipList";
|
||||||
}
|
}
|
||||||
// 视频文本VOIP Account配置列表
|
// 视频文本VOIP Account配置列表
|
||||||
/* @RequestMapping(value = {"/voipAccountList"})
|
/*
|
||||||
public String voipCfgAccountList(Model model,HttpServletRequest request ,HttpServletResponse response
|
* @RequestMapping(value = {"/voipAccountList"}) public String
|
||||||
,@ModelAttribute("cfg")CfgIndexInfo entity ,RedirectAttributes redirectAttributes){
|
* voipCfgAccountList(Model model,HttpServletRequest request
|
||||||
if(entity.getVoipAccount()== null){
|
* ,HttpServletResponse response ,@ModelAttribute("cfg")CfgIndexInfo entity
|
||||||
entity.setVoipAccount(new AvVoipAccountCfg());
|
* ,RedirectAttributes redirectAttributes){ if(entity.getVoipAccount()==
|
||||||
}
|
* null){ entity.setVoipAccount(new AvVoipAccountCfg()); }
|
||||||
if(entity.getNtcSubscribeIdCfg()==null){
|
* if(entity.getNtcSubscribeIdCfg()==null){ entity.setNtcSubscribeIdCfg(new
|
||||||
entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg());
|
* NtcSubscribeIdCfg()); } Page<CfgIndexInfo> page =
|
||||||
}
|
* avContentCfgService.findAccountPage(new Page<CfgIndexInfo>(request,
|
||||||
Page<CfgIndexInfo> page = avContentCfgService.findAccountPage(new Page<CfgIndexInfo>(request, response,"r"), entity);
|
* response,"r"), entity); model.addAttribute("page", page);
|
||||||
model.addAttribute("page", page);
|
* initPageCondition(model,entity); return "/cfg/av/voip/voipAccountList"; }
|
||||||
initPageCondition(model,entity);
|
*/
|
||||||
return "/cfg/av/voip/voipAccountList";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
// 修改VOIP IP配置状态
|
// 修改VOIP IP配置状态
|
||||||
@RequestMapping(value = { "/updateAvVoipValid" })
|
@RequestMapping(value = { "/updateAvVoipValid" })
|
||||||
@RequiresPermissions(value = { "avVoip:config" })
|
@RequiresPermissions(value = { "avVoip:config" })
|
||||||
public String updateVoipValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId
|
public String updateVoipValid(Integer isAudit, String compileIds, Integer isValid, String ids, Integer functionId,
|
||||||
,RedirectAttributes redirectAttributes
|
RedirectAttributes redirectAttributes) {
|
||||||
) {
|
|
||||||
try {
|
try {
|
||||||
avContentCfgService.updateAvVoipValid(isAudit, isValid, compileIds, functionId);
|
avContentCfgService.updateAvVoipValid(isAudit, isValid, compileIds, functionId);
|
||||||
addMessage(redirectAttributes, "success", "delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
@@ -180,37 +168,29 @@ public class AvContentController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/av/voipList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/voipList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改VOIP account配置状态
|
// 修改VOIP account配置状态
|
||||||
/* @RequestMapping(value = {"/updateAvVoipAccountValid"})
|
/*
|
||||||
@RequiresPermissions(value={"avVoipAccount:config"})
|
* @RequestMapping(value = {"/updateAvVoipAccountValid"})
|
||||||
public String updateVoipAccountValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId
|
*
|
||||||
,RedirectAttributes redirectAttributes
|
* @RequiresPermissions(value={"avVoipAccount:config"}) public String
|
||||||
) {
|
* updateVoipAccountValid(Integer isAudit,String compileIds,Integer
|
||||||
try {
|
* isValid,String ids,Integer functionId ,RedirectAttributes
|
||||||
avContentCfgService.updateAvVoipAccountValid(isAudit,isValid,compileIds,functionId);
|
* redirectAttributes ) { try {
|
||||||
} catch (Exception e) {
|
* avContentCfgService.updateAvVoipAccountValid(isAudit,isValid,compileIds,
|
||||||
if(e instanceof MaatConvertException) {
|
* functionId); } catch (Exception e) { if(e instanceof
|
||||||
e.printStackTrace();
|
* MaatConvertException) { e.printStackTrace();
|
||||||
logger.error("voip Account信息审核失败",e);
|
* logger.error("voip Account信息审核失败",e);
|
||||||
addMessage(redirectAttributes,"request_service_failed");
|
* addMessage(redirectAttributes,"request_service_failed"); }else {
|
||||||
}else {
|
* e.printStackTrace(); logger.error("voip Account信息审核失败",e);
|
||||||
e.printStackTrace();
|
* addMessage(redirectAttributes,"audit_failed"); } } return "redirect:" +
|
||||||
logger.error("voip Account信息审核失败",e);
|
* adminPath +"/ntc/av/voipAccountList?functionId="+functionId; }
|
||||||
addMessage(redirectAttributes,"audit_failed");
|
*/
|
||||||
}
|
|
||||||
}
|
|
||||||
return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId;
|
|
||||||
}*/
|
|
||||||
// 修改VOIP IP配置审核状态
|
// 修改VOIP IP配置审核状态
|
||||||
@RequestMapping(value = { "/auditAvVoip" })
|
@RequestMapping(value = { "/auditAvVoip" })
|
||||||
@RequiresPermissions(value = { "avVoip:confirm" })
|
@RequiresPermissions(value = { "avVoip:confirm" })
|
||||||
public String auditVoip(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditVoip(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -222,7 +202,8 @@ public class AvContentController extends BaseController {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("VOIP配置下发失败:"+e.getMessage());;
|
logger.error("VOIP配置下发失败:" + e.getMessage());
|
||||||
|
;
|
||||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
} else {
|
} else {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -255,55 +236,54 @@ public class AvContentController extends BaseController {
|
|||||||
return "redirect:" + adminPath + "/ntc/av/voipList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/voipList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
// 修改VOIP IP配置审核状态
|
// 修改VOIP IP配置审核状态
|
||||||
/* @RequestMapping(value = {"/auditAvVoipAccount"})
|
/*
|
||||||
@RequiresPermissions(value={"avVoipAccount:confirm"})
|
* @RequestMapping(value = {"/auditAvVoipAccount"})
|
||||||
public String auditVoipAccount(Integer isAudit,Integer isValid,String ids
|
*
|
||||||
,String compileIds,Integer functionId
|
* @RequiresPermissions(value={"avVoipAccount:confirm"}) public String
|
||||||
,RedirectAttributes redirectAttributes) {
|
* auditVoipAccount(Integer isAudit,Integer isValid,String ids ,String
|
||||||
if(!StringUtil.isEmpty(compileIds)){
|
* compileIds,Integer functionId ,RedirectAttributes redirectAttributes) {
|
||||||
String[] idArray = compileIds.split(",");
|
* if(!StringUtil.isEmpty(compileIds)){ String[] idArray =
|
||||||
Date auditTime=new Date();
|
* compileIds.split(","); Date auditTime=new Date(); for(String id
|
||||||
for(String id :idArray){
|
* :idArray){ try {
|
||||||
try {
|
* avContentCfgService.auditAvVoipAccount(isAudit,isValid,functionId,id,
|
||||||
avContentCfgService.auditAvVoipAccount(isAudit,isValid,functionId,id,auditTime);
|
* auditTime); } catch (MaatConvertException e) { if(e instanceof
|
||||||
} catch (MaatConvertException e) {
|
* MaatConvertException) { e.printStackTrace();
|
||||||
if(e instanceof MaatConvertException) {
|
* logger.info("VOIPAccount配置下发失败:"+e.getMessage());;
|
||||||
e.printStackTrace();
|
* addMessage(redirectAttributes,"request_service_failed"); }else {
|
||||||
logger.info("VOIPAccount配置下发失败:"+e.getMessage());;
|
* e.printStackTrace(); logger.error("VOIPAccount配置下发失败",e);
|
||||||
addMessage(redirectAttributes,"request_service_failed");
|
* addMessage(redirectAttributes,"audit_failed"); } } }
|
||||||
}else {
|
*
|
||||||
e.printStackTrace();
|
* } return "redirect:" + adminPath
|
||||||
logger.error("VOIPAccount配置下发失败",e);
|
* +"/ntc/av/voipAccountList?functionId="+functionId; }
|
||||||
addMessage(redirectAttributes,"audit_failed");
|
*/
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号account
|
* 账号account 根据索引表信息异步获取子表信息
|
||||||
* 根据索引表信息异步获取子表信息
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
/*@ResponseBody
|
/*
|
||||||
@RequestMapping(value = "ajaxVoipAccountInfo")
|
* @ResponseBody
|
||||||
public Map getVoipAccountInfo(CfgIndexInfo cfgIndexInfo) {
|
*
|
||||||
Map<String, Object> voipAndAccountInfoMap=new HashMap<String, Object>();
|
* @RequestMapping(value = "ajaxVoipAccountInfo") public Map
|
||||||
List<AvVoipAccountCfg> voipAccountCfgList=new ArrayList<AvVoipAccountCfg>();
|
* getVoipAccountInfo(CfgIndexInfo cfgIndexInfo) { Map<String, Object>
|
||||||
List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList=new ArrayList<NtcSubscribeIdCfg>();
|
* voipAndAccountInfoMap=new HashMap<String, Object>();
|
||||||
|
* List<AvVoipAccountCfg> voipAccountCfgList=new
|
||||||
voipAccountCfgList = avContentCfgService.getVoipAccountCfgList(cfgIndexInfo);
|
* ArrayList<AvVoipAccountCfg>(); List<NtcSubscribeIdCfg>
|
||||||
ntcSubscribeIdCfgList=avContentCfgService.getSubscribeIdCfgList(cfgIndexInfo);
|
* ntcSubscribeIdCfgList=new ArrayList<NtcSubscribeIdCfg>();
|
||||||
|
*
|
||||||
voipAndAccountInfoMap.put("account", voipAccountCfgList);
|
* voipAccountCfgList =
|
||||||
voipAndAccountInfoMap.put("subscribe", ntcSubscribeIdCfgList);
|
* avContentCfgService.getVoipAccountCfgList(cfgIndexInfo);
|
||||||
return voipAndAccountInfoMap;
|
* ntcSubscribeIdCfgList=avContentCfgService.getSubscribeIdCfgList(
|
||||||
}*/
|
* cfgIndexInfo);
|
||||||
|
*
|
||||||
|
* voipAndAccountInfoMap.put("account", voipAccountCfgList);
|
||||||
|
* voipAndAccountInfoMap.put("subscribe", ntcSubscribeIdCfgList); return
|
||||||
|
* voipAndAccountInfoMap; }
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* 根据索引表信息异步获取子表信息
|
* 根据索引表信息异步获取子表信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "/ajaxVoipIpInfo" })
|
@RequestMapping(value = { "/ajaxVoipIpInfo" })
|
||||||
@@ -314,15 +294,12 @@ public class AvContentController extends BaseController {
|
|||||||
CfgIndexInfo cfg = avContentCfgService.getCfgIndexInfo(cfgIndexInfo);
|
CfgIndexInfo cfg = avContentCfgService.getCfgIndexInfo(cfgIndexInfo);
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
// 获取voipIpCfg信息
|
// 获取voipIpCfg信息
|
||||||
/* if(cfg.getVoipIps()!=null){
|
/*
|
||||||
String cfgType = null;
|
* if(cfg.getVoipIps()!=null){ String cfgType = null; for(AvVoipIpCfg
|
||||||
for(AvVoipIpCfg ip:cfg.getVoipIps()){
|
* ip:cfg.getVoipIps()){ if(!ip.getCfgType().equals(cfgType)){
|
||||||
if(!ip.getCfgType().equals(cfgType)){
|
* tabList.add(new String[]{"1",ip.getCfgType()}); cfgType =
|
||||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
* ip.getCfgType(); } } }
|
||||||
cfgType = ip.getCfgType();
|
*/
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
if (cfg.getIpPortList() != null) {
|
if (cfg.getIpPortList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for (IpPortCfg ip : cfg.getIpPortList()) {
|
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||||
@@ -357,27 +334,25 @@ public class AvContentController extends BaseController {
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/av/voip/voipSubList";
|
return "/cfg/av/voip/voipSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************** voip业务 ***************/
|
/***************************** voip业务 ***************/
|
||||||
|
|
||||||
/***************************** contIp业务 ***************/
|
/***************************** contIp业务 ***************/
|
||||||
// 视频文本内容配置列表
|
// 视频文本内容配置列表
|
||||||
@RequestMapping(value = { "/contIpList" })
|
@RequestMapping(value = { "/contIpList" })
|
||||||
public String contIpList(Model model,HttpServletRequest request
|
public String contIpList(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response
|
@ModelAttribute("cfg") BaseIpCfg entity, RedirectAttributes redirectAttributes) {
|
||||||
,@ModelAttribute("cfg")BaseIpCfg entity
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
Page<BaseIpCfg> page = avContentCfgService.findContIpPage(new Page<BaseIpCfg>(request, response, "r"), entity);
|
Page<BaseIpCfg> page = avContentCfgService.findContIpPage(new Page<BaseIpCfg>(request, response, "r"), entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/av/contIp/contIpList";
|
return "/cfg/av/contIp/contIpList";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 音视频CONTIP新增界面
|
// 音视频CONTIP新增界面
|
||||||
@RequestMapping(value = { "/contIpForm" })
|
@RequestMapping(value = { "/contIpForm" })
|
||||||
@RequiresPermissions(value = { "avContIp:config" })
|
@RequiresPermissions(value = { "avContIp:config" })
|
||||||
public String contIpForm(Model model,HttpServletRequest request,HttpServletResponse response
|
public String contIpForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
,String ids,String compileIds
|
String compileIds, BaseIpCfg cfg, RedirectAttributes redirectAttributes) {
|
||||||
,BaseIpCfg cfg
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
if (!StringUtil.isEmpty(compileIds)) {
|
if (!StringUtil.isEmpty(compileIds)) {
|
||||||
cfg.setCompileId(Integer.parseInt(compileIds));
|
cfg.setCompileId(Integer.parseInt(compileIds));
|
||||||
cfg = avContentCfgService.getContIpCfgById(cfg);
|
cfg = avContentCfgService.getContIpCfgById(cfg);
|
||||||
@@ -391,11 +366,9 @@ public class AvContentController extends BaseController {
|
|||||||
|
|
||||||
// 保存CONTIP信息
|
// 保存CONTIP信息
|
||||||
@RequestMapping(value = { "/saveContIp" })
|
@RequestMapping(value = { "/saveContIp" })
|
||||||
public String saveContIp(Model model,HttpServletRequest request
|
public String saveContIp(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response,
|
@ModelAttribute("cfg") BaseIpCfg cfg, @ModelAttribute("areaCfgIds") String areaCfgIds,
|
||||||
@ModelAttribute("cfg")BaseIpCfg cfg,
|
RedirectAttributes redirectAttributes) {
|
||||||
@ModelAttribute("areaCfgIds")String areaCfgIds
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
try {
|
try {
|
||||||
avContentCfgService.saveOrUpdateContIp(cfg, areaCfgIds);
|
avContentCfgService.saveOrUpdateContIp(cfg, areaCfgIds);
|
||||||
addMessage(redirectAttributes, "success", "save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
@@ -415,18 +388,17 @@ public class AvContentController extends BaseController {
|
|||||||
// 修改CONTIP例配置状态
|
// 修改CONTIP例配置状态
|
||||||
@RequestMapping(value = { "/updateAvContIpValid" })
|
@RequestMapping(value = { "/updateAvContIpValid" })
|
||||||
@RequiresPermissions(value = { "avContIp:config" })
|
@RequiresPermissions(value = { "avContIp:config" })
|
||||||
public String updateAvContIpValid(Integer isAudit,Integer isValid
|
public String updateAvContIpValid(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||||
,String ids,Integer functionId
|
RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
avContentCfgService.updateContIpValid(isAudit, isValid, ids, functionId);
|
avContentCfgService.updateContIpValid(isAudit, isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/ntc/av/contIpList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/contIpList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改CONTIP配置审核
|
// 修改CONTIP配置审核
|
||||||
@RequestMapping(value = { "/auditAvContIp" })
|
@RequestMapping(value = { "/auditAvContIp" })
|
||||||
@RequiresPermissions(value = { "avContIp:confirm" })
|
@RequiresPermissions(value = { "avContIp:confirm" })
|
||||||
public String auditContIp(Integer isAudit,Integer isValid
|
public String auditContIp(Integer isAudit, Integer isValid, String ids, String compileIds, Integer functionId,
|
||||||
,String ids,String compileIds,Integer functionId
|
RedirectAttributes redirectAttributes) {
|
||||||
, RedirectAttributes redirectAttributes) {
|
|
||||||
if (!StringUtil.isEmpty(compileIds)) {
|
if (!StringUtil.isEmpty(compileIds)) {
|
||||||
String[] idArray = compileIds.split(",");
|
String[] idArray = compileIds.split(",");
|
||||||
Date auditTime = new Date();
|
Date auditTime = new Date();
|
||||||
@@ -447,6 +419,7 @@ public class AvContentController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/av/contIpList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/contIpList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取域配置信息
|
// 获取域配置信息
|
||||||
@RequestMapping(value = { "ajaxAvContIpList" })
|
@RequestMapping(value = { "ajaxAvContIpList" })
|
||||||
public String ajaxAvContIpList(Model model, Long cfgId, Integer index) {
|
public String ajaxAvContIpList(Model model, Long cfgId, Integer index) {
|
||||||
@@ -470,27 +443,25 @@ public class AvContentController extends BaseController {
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/av/subList";
|
return "/cfg/av/subList";
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************** contIp业务 ***************/
|
/***************************** contIp业务 ***************/
|
||||||
|
|
||||||
/***************************** picIp业务 ***************/
|
/***************************** picIp业务 ***************/
|
||||||
// 视频文本内容配置列表
|
// 视频文本内容配置列表
|
||||||
@RequestMapping(value = { "/picIpList" })
|
@RequestMapping(value = { "/picIpList" })
|
||||||
public String picIpList(Model model,HttpServletRequest request
|
public String picIpList(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response
|
@ModelAttribute("cfg") BaseIpCfg entity, RedirectAttributes redirectAttributes) {
|
||||||
,@ModelAttribute("cfg")BaseIpCfg entity
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
Page<BaseIpCfg> page = avContentCfgService.findPicIpPage(new Page<BaseIpCfg>(request, response, "r"), entity);
|
Page<BaseIpCfg> page = avContentCfgService.findPicIpPage(new Page<BaseIpCfg>(request, response, "r"), entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/av/picIp/picIpList";
|
return "/cfg/av/picIp/picIpList";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 音视频CONTIP新增界面
|
// 音视频CONTIP新增界面
|
||||||
@RequestMapping(value = { "/picIpForm" })
|
@RequestMapping(value = { "/picIpForm" })
|
||||||
@RequiresPermissions(value = { "avPicIp:config" })
|
@RequiresPermissions(value = { "avPicIp:config" })
|
||||||
public String picIpForm(Model model,HttpServletRequest request
|
public String picIpForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
,HttpServletResponse response,String ids
|
String compileIds, BaseIpCfg cfg, RedirectAttributes redirectAttributes) {
|
||||||
,String compileIds,BaseIpCfg cfg
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
if (!StringUtil.isEmpty(compileIds)) {
|
if (!StringUtil.isEmpty(compileIds)) {
|
||||||
cfg.setCompileId(Integer.parseInt(compileIds));
|
cfg.setCompileId(Integer.parseInt(compileIds));
|
||||||
cfg = avContentCfgService.getPicIpCfgById(cfg);
|
cfg = avContentCfgService.getPicIpCfgById(cfg);
|
||||||
@@ -504,11 +475,9 @@ public class AvContentController extends BaseController {
|
|||||||
|
|
||||||
// 保存CONTIP信息
|
// 保存CONTIP信息
|
||||||
@RequestMapping(value = { "/savePicIp" })
|
@RequestMapping(value = { "/savePicIp" })
|
||||||
public String savePicIp(Model model,HttpServletRequest request
|
public String savePicIp(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response,
|
@ModelAttribute("cfg") BaseIpCfg cfg, @ModelAttribute("areaCfgIds") String areaCfgIds,
|
||||||
@ModelAttribute("cfg")BaseIpCfg cfg,
|
RedirectAttributes redirectAttributes) {
|
||||||
@ModelAttribute("areaCfgIds")String areaCfgIds
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
try {
|
try {
|
||||||
avContentCfgService.saveOrUpdatePicIp(cfg, areaCfgIds);
|
avContentCfgService.saveOrUpdatePicIp(cfg, areaCfgIds);
|
||||||
addMessage(redirectAttributes, "success", "save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
@@ -528,18 +497,17 @@ public class AvContentController extends BaseController {
|
|||||||
// 修改CONTIP例配置状态
|
// 修改CONTIP例配置状态
|
||||||
@RequestMapping(value = { "/updatePicIpValid" })
|
@RequestMapping(value = { "/updatePicIpValid" })
|
||||||
@RequiresPermissions(value = { "avPicIp:config" })
|
@RequiresPermissions(value = { "avPicIp:config" })
|
||||||
public String updateAvPicIpValid(Integer isAudit,Integer isValid
|
public String updateAvPicIpValid(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||||
,String ids,Integer functionId
|
RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
avContentCfgService.updatePicIpValid(isAudit, isValid, ids, functionId);
|
avContentCfgService.updatePicIpValid(isAudit, isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/ntc/av/picIpList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/picIpList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改CONTIP配置审核
|
// 修改CONTIP配置审核
|
||||||
@RequestMapping(value = { "/auditPicIp" })
|
@RequestMapping(value = { "/auditPicIp" })
|
||||||
@RequiresPermissions(value = { "avPicIp:confirm" })
|
@RequiresPermissions(value = { "avPicIp:confirm" })
|
||||||
public String auditPicIp(Integer isAudit,Integer isValid,String ids
|
public String auditPicIp(Integer isAudit, Integer isValid, String ids, String compileIds, Integer functionId,
|
||||||
,String compileIds,Integer functionId
|
RedirectAttributes redirectAttributes) {
|
||||||
, RedirectAttributes redirectAttributes) {
|
|
||||||
if (!StringUtil.isEmpty(compileIds)) {
|
if (!StringUtil.isEmpty(compileIds)) {
|
||||||
String[] idArray = compileIds.split(",");
|
String[] idArray = compileIds.split(",");
|
||||||
Date auditTime = new Date();
|
Date auditTime = new Date();
|
||||||
@@ -561,6 +529,7 @@ public class AvContentController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/av/picIpList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/picIpList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取域配置信息
|
// 获取域配置信息
|
||||||
@RequestMapping(value = { "ajaxAvPicIpList" })
|
@RequestMapping(value = { "ajaxAvPicIpList" })
|
||||||
public String ajaxAvPicIpList(Model model, Long cfgId, Integer index) {
|
public String ajaxAvPicIpList(Model model, Long cfgId, Integer index) {
|
||||||
@@ -584,35 +553,31 @@ public class AvContentController extends BaseController {
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/av/subList";
|
return "/cfg/av/subList";
|
||||||
}
|
}
|
||||||
/*****************************picIp业务***************/
|
|
||||||
|
|
||||||
|
/***************************** picIp业务 ***************/
|
||||||
|
|
||||||
/***************************** contUrl业务 ***************/
|
/***************************** contUrl业务 ***************/
|
||||||
// 视频文本内容配置列表
|
// 视频文本内容配置列表
|
||||||
@RequestMapping(value = { "/contUrlList" })
|
@RequestMapping(value = { "/contUrlList" })
|
||||||
public String contUrlList(Model model,HttpServletRequest request
|
public String contUrlList(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response
|
@ModelAttribute("cfg") CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||||
,@ModelAttribute("cfg")CfgIndexInfo entity
|
/*
|
||||||
,RedirectAttributes redirectAttributes){
|
* if(entity.getIpPort()== null){ entity.setIpPort(new IpPortCfg()); }
|
||||||
/*if(entity.getIpPort()== null){
|
* if(entity.getAvContUrlCfgList()== null){ entity.setAvContUrlCfg(new
|
||||||
entity.setIpPort(new IpPortCfg());
|
* AvContUrlCfg());; } if(entity.getNtcSubscribeIdCfg()==null){
|
||||||
}
|
* entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); }
|
||||||
if(entity.getAvContUrlCfgList()== null){
|
*/
|
||||||
entity.setAvContUrlCfg(new AvContUrlCfg());;
|
|
||||||
}
|
|
||||||
if(entity.getNtcSubscribeIdCfg()==null){
|
|
||||||
entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg());
|
|
||||||
}*/
|
|
||||||
Page<CfgIndexInfo> page = avContentCfgService.findPage(new Page<CfgIndexInfo>(request, response, "r"), entity);
|
Page<CfgIndexInfo> page = avContentCfgService.findPage(new Page<CfgIndexInfo>(request, response, "r"), entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/av/contUrl/contUrlList";
|
return "/cfg/av/contUrl/contUrlList";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 音视频CONTUrl新增界面
|
// 音视频CONTUrl新增界面
|
||||||
@RequestMapping(value = { "/contUrlForm" })
|
@RequestMapping(value = { "/contUrlForm" })
|
||||||
@RequiresPermissions(value = { "avContUrl:config" })
|
@RequiresPermissions(value = { "avContUrl:config" })
|
||||||
public String contUrlForm(Model model,HttpServletRequest request ,HttpServletResponse response
|
public String contUrlForm(Model model, HttpServletRequest request, HttpServletResponse response, String compileIds,
|
||||||
,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){
|
String ids, CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
cfg.setCfgId(Long.parseLong(ids));
|
cfg.setCfgId(Long.parseLong(ids));
|
||||||
cfg = avContentCfgService.getUrlCfgIndexInfo(cfg);
|
cfg = avContentCfgService.getUrlCfgIndexInfo(cfg);
|
||||||
@@ -660,22 +625,17 @@ public class AvContentController extends BaseController {
|
|||||||
// 修改CONTUrl例配置状态
|
// 修改CONTUrl例配置状态
|
||||||
@RequestMapping(value = { "/updateAvContUrlValid" })
|
@RequestMapping(value = { "/updateAvContUrlValid" })
|
||||||
@RequiresPermissions(value = { "avContUrl:config" })
|
@RequiresPermissions(value = { "avContUrl:config" })
|
||||||
public String updateAvContUrlValid(Integer isAudit,Integer isValid
|
public String updateAvContUrlValid(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||||
,String ids,Integer functionId
|
RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
avContentCfgService.updateContUrlValid(isAudit, isValid, ids, functionId);
|
avContentCfgService.updateContUrlValid(isAudit, isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/ntc/av/contUrlList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/contUrlList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改CONTUrl配置审核
|
// 修改CONTUrl配置审核
|
||||||
@RequestMapping(value = { "/auditAvContUrl" })
|
@RequestMapping(value = { "/auditAvContUrl" })
|
||||||
@RequiresPermissions(value = { "avContUrl:confirm" })
|
@RequiresPermissions(value = { "avContUrl:confirm" })
|
||||||
public String auditContUrl(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditContUrl(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -716,6 +676,7 @@ public class AvContentController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/av/contUrlList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/contUrlList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取域配置信息
|
// 获取域配置信息
|
||||||
@RequestMapping(value = { "ajaxAvContUrlList" })
|
@RequestMapping(value = { "ajaxAvContUrlList" })
|
||||||
public String ajaxAvContUrlList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxAvContUrlList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
@@ -743,7 +704,6 @@ public class AvContentController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 查询关键字
|
// 查询关键字
|
||||||
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
@@ -759,28 +719,26 @@ public class AvContentController extends BaseController {
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/av/contUrl/contSubList";
|
return "/cfg/av/contUrl/contSubList";
|
||||||
}
|
}
|
||||||
/*****************************contUrl业务***************/
|
|
||||||
|
|
||||||
|
/***************************** contUrl业务 ***************/
|
||||||
|
|
||||||
/***************************** picUrl业务 ***************/
|
/***************************** picUrl业务 ***************/
|
||||||
// 视频文本内容配置列表
|
// 视频文本内容配置列表
|
||||||
@RequestMapping(value = { "/picUrlList" })
|
@RequestMapping(value = { "/picUrlList" })
|
||||||
public String picUrlList(Model model,HttpServletRequest request
|
public String picUrlList(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response
|
@ModelAttribute("cfg") BaseStringCfg entity, RedirectAttributes redirectAttributes) {
|
||||||
,@ModelAttribute("cfg")BaseStringCfg entity
|
Page<BaseStringCfg> page = avContentCfgService.findPicUrlPage(new Page<BaseStringCfg>(request, response, "r"),
|
||||||
,RedirectAttributes redirectAttributes){
|
entity);
|
||||||
Page<BaseStringCfg> page = avContentCfgService.findPicUrlPage(new Page<BaseStringCfg>(request, response,"r"), entity);
|
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/av/picUrl/picUrlList";
|
return "/cfg/av/picUrl/picUrlList";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 音视频CONTUrl新增界面
|
// 音视频CONTUrl新增界面
|
||||||
@RequestMapping(value = { "/picUrlForm" })
|
@RequestMapping(value = { "/picUrlForm" })
|
||||||
@RequiresPermissions(value = { "avPicUrl:config" })
|
@RequiresPermissions(value = { "avPicUrl:config" })
|
||||||
public String picUrlForm(Model model,HttpServletRequest request
|
public String picUrlForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
,HttpServletResponse response,String ids
|
String compileIds, @ModelAttribute("cfg") BaseStringCfg cfg, RedirectAttributes redirectAttributes) {
|
||||||
,String compileIds,@ModelAttribute("cfg")BaseStringCfg cfg
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
if (!StringUtil.isEmpty(compileIds)) {
|
if (!StringUtil.isEmpty(compileIds)) {
|
||||||
cfg.setCompileId(Integer.parseInt(compileIds));
|
cfg.setCompileId(Integer.parseInt(compileIds));
|
||||||
cfg = avContentCfgService.getPicUrlCfgById(cfg);
|
cfg = avContentCfgService.getPicUrlCfgById(cfg);
|
||||||
@@ -794,11 +752,9 @@ public class AvContentController extends BaseController {
|
|||||||
|
|
||||||
// 保存CONTUrl信息
|
// 保存CONTUrl信息
|
||||||
@RequestMapping(value = { "/savePicUrl" })
|
@RequestMapping(value = { "/savePicUrl" })
|
||||||
public String savePicUrl(Model model,HttpServletRequest request
|
public String savePicUrl(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response,
|
@ModelAttribute("cfg") BaseStringCfg cfg, @ModelAttribute("areaCfgIds") String areaCfgIds,
|
||||||
@ModelAttribute("cfg")BaseStringCfg cfg,
|
RedirectAttributes redirectAttributes) {
|
||||||
@ModelAttribute("areaCfgIds")String areaCfgIds
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
try {
|
try {
|
||||||
avContentCfgService.saveOrUpdatePicUrl(cfg, areaCfgIds);
|
avContentCfgService.saveOrUpdatePicUrl(cfg, areaCfgIds);
|
||||||
addMessage(redirectAttributes, "success", "save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
@@ -817,18 +773,17 @@ public class AvContentController extends BaseController {
|
|||||||
// 修改CONTUrl例配置状态
|
// 修改CONTUrl例配置状态
|
||||||
@RequestMapping(value = { "/updateAvPicUrlValid" })
|
@RequestMapping(value = { "/updateAvPicUrlValid" })
|
||||||
@RequiresPermissions(value = { "avPicUrl:config" })
|
@RequiresPermissions(value = { "avPicUrl:config" })
|
||||||
public String updateAvPicUrlValid(Integer isAudit,Integer isValid
|
public String updateAvPicUrlValid(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||||
,String ids,Integer functionId
|
RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
avContentCfgService.updatePicUrlValid(isAudit, isValid, ids, functionId);
|
avContentCfgService.updatePicUrlValid(isAudit, isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/ntc/av/picUrlList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/picUrlList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改CONTUrl配置审核
|
// 修改CONTUrl配置审核
|
||||||
@RequestMapping(value = { "/auditAvPicUrl" })
|
@RequestMapping(value = { "/auditAvPicUrl" })
|
||||||
@RequiresPermissions(value = { "avPicUrl:confirm" })
|
@RequiresPermissions(value = { "avPicUrl:confirm" })
|
||||||
public String auditPicUrl(Integer isAudit,Integer isValid
|
public String auditPicUrl(Integer isAudit, Integer isValid, String ids, String compileIds, Integer functionId,
|
||||||
,String ids,String compileIds,Integer functionId
|
RedirectAttributes redirectAttributes) {
|
||||||
, RedirectAttributes redirectAttributes) {
|
|
||||||
if (!StringUtil.isEmpty(compileIds)) {
|
if (!StringUtil.isEmpty(compileIds)) {
|
||||||
String[] idArray = compileIds.split(",");
|
String[] idArray = compileIds.split(",");
|
||||||
Date auditTime = new Date();
|
Date auditTime = new Date();
|
||||||
@@ -850,6 +805,7 @@ public class AvContentController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/av/picUrlList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/picUrlList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取域配置信息
|
// 获取域配置信息
|
||||||
@RequestMapping(value = { "ajaxAvPicUrlList" })
|
@RequestMapping(value = { "ajaxAvPicUrlList" })
|
||||||
public String ajaxAvPicUrlList(Model model, Long cfgId, Integer index) {
|
public String ajaxAvPicUrlList(Model model, Long cfgId, Integer index) {
|
||||||
@@ -873,10 +829,10 @@ public class AvContentController extends BaseController {
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/av/subList";
|
return "/cfg/av/subList";
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************** picUrl业务 ***************/
|
/***************************** picUrl业务 ***************/
|
||||||
/**
|
/**
|
||||||
* 1、effectiveIds分组展示
|
* 1、effectiveIds分组展示 2、无effectiveIds查询area_ip,根据compileId查询展示
|
||||||
* 2、无effectiveIds查询area_ip,根据compileId查询展示
|
|
||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = "/area/ajaxAreaEffictiveInfo")
|
@RequestMapping(value = "/area/ajaxAreaEffictiveInfo")
|
||||||
@@ -901,14 +857,11 @@ public class AvContentController extends BaseController {
|
|||||||
data.put("areaIps", areaIps);
|
data.put("areaIps", areaIps);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 视频文本VOIP配置列表导出
|
// 视频文本VOIP配置列表导出
|
||||||
@RequestMapping(value = { "/voipExport" })
|
@RequestMapping(value = { "/voipExport" })
|
||||||
public String voipExport(Model model,
|
public String voipExport(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
HttpServletRequest request,
|
@ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
HttpServletResponse response,
|
|
||||||
@ModelAttribute("cfg")CfgIndexInfo entity,
|
|
||||||
String ids,
|
|
||||||
RedirectAttributes redirectAttributes){
|
|
||||||
try {
|
try {
|
||||||
// 获取国际化配置
|
// 获取国际化配置
|
||||||
Properties msgProp = getMsgProp();
|
Properties msgProp = getMsgProp();
|
||||||
@@ -945,7 +898,8 @@ public class AvContentController extends BaseController {
|
|||||||
pageInfo.setPageSize(-1);
|
pageInfo.setPageSize(-1);
|
||||||
}
|
}
|
||||||
Page<CfgIndexInfo> page = avContentCfgService.findPage(pageInfo, entity);
|
Page<CfgIndexInfo> page = avContentCfgService.findPage(pageInfo, entity);
|
||||||
new ExportExcel(msgProp,null, CfgIndexInfo.class,1).setDataList(msgProp,page.getList(),map).write(response, fileName).dispose();
|
new ExportExcel(msgProp, null, CfgIndexInfo.class, 1).setDataList(msgProp, page.getList(), map)
|
||||||
|
.write(response, fileName).dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@@ -977,15 +931,6 @@ public class AvContentController extends BaseController {
|
|||||||
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "r");
|
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
if(entity.getIpPort()== null){
|
|
||||||
entity.setIpPort(new IpPortCfg());
|
|
||||||
}
|
|
||||||
if(entity.getAvContUrlCfgList()== null){
|
|
||||||
entity.setAvContUrlCfg(new AvContUrlCfg());;
|
|
||||||
}
|
|
||||||
if(entity.getNtcSubscribeIdCfg()==null){
|
|
||||||
entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg());
|
|
||||||
}
|
|
||||||
Page<CfgIndexInfo> page = avContentCfgService.findPage(pageInfo, entity);
|
Page<CfgIndexInfo> page = avContentCfgService.findPage(pageInfo, entity);
|
||||||
ipLists = page.getList();
|
ipLists = page.getList();
|
||||||
}
|
}
|
||||||
@@ -1012,6 +957,20 @@ public class AvContentController extends BaseController {
|
|||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport);
|
noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport);
|
||||||
noExportMap.put("NTC_STREAMING_MEDIA_URL", regionCfgNoExport);
|
noExportMap.put("NTC_STREAMING_MEDIA_URL", regionCfgNoExport);
|
||||||
@@ -1031,13 +990,22 @@ public class AvContentController extends BaseController {
|
|||||||
dataMap.put("NTC_UNIVERSAL_IP", ipList);
|
dataMap.put("NTC_UNIVERSAL_IP", ipList);
|
||||||
dataMap.put("NTC_STREAMING_MEDIA_URL", streamurlList);
|
dataMap.put("NTC_STREAMING_MEDIA_URL", streamurlList);
|
||||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||||
/*}*/
|
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("stream export failed", e);
|
logger.error("stream export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// voip配置导出
|
// voip配置导出
|
||||||
@@ -1051,7 +1019,6 @@ public class AvContentController extends BaseController {
|
|||||||
Map<String, List> dataMap = new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||||
// 导出选中记录
|
// 导出选中记录
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
@@ -1061,16 +1028,8 @@ public class AvContentController extends BaseController {
|
|||||||
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "r");
|
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
if(entity.getIpPort()== null){
|
Page<CfgIndexInfo> page = avContentCfgService.findPage(new Page<CfgIndexInfo>(request, response, "r"),
|
||||||
entity.setIpPort(new IpPortCfg());
|
entity);
|
||||||
}
|
|
||||||
if(entity.getVoipAccount()== null){
|
|
||||||
entity.setVoipAccount(new AvVoipAccountCfg());
|
|
||||||
}
|
|
||||||
if(entity.getNtcSubscribeIdCfg()==null){
|
|
||||||
entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg());
|
|
||||||
}
|
|
||||||
Page<CfgIndexInfo> page = avContentCfgService.findPage(new Page<CfgIndexInfo>(request, response,"r"), entity);
|
|
||||||
ipLists = page.getList();
|
ipLists = page.getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1097,6 +1056,20 @@ public class AvContentController extends BaseController {
|
|||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport);
|
noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport);
|
||||||
noExportMap.put("NTC_VOIP_ACCOUNT", regionCfgNoExport);
|
noExportMap.put("NTC_VOIP_ACCOUNT", regionCfgNoExport);
|
||||||
@@ -1116,12 +1089,21 @@ public class AvContentController extends BaseController {
|
|||||||
dataMap.put("NTC_UNIVERSAL_IP", ipList);
|
dataMap.put("NTC_UNIVERSAL_IP", ipList);
|
||||||
dataMap.put("NTC_VOIP_ACCOUNT", countlList);
|
dataMap.put("NTC_VOIP_ACCOUNT", countlList);
|
||||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||||
/*}*/
|
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("voip export failed", e);
|
logger.error("voip export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import com.nis.domain.configuration.AvSignSampleCfg;
|
|||||||
import com.nis.domain.configuration.AvSignSampleCfgModel;
|
import com.nis.domain.configuration.AvSignSampleCfgModel;
|
||||||
import com.nis.domain.configuration.BaseIpCfg;
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
import com.nis.domain.configuration.BaseStringCfg;
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
import com.nis.domain.configuration.FileDigestCfg;
|
import com.nis.domain.configuration.FileDigestCfg;
|
||||||
import com.nis.domain.configuration.IpPortCfg;
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.maat.ToMaatResult;
|
import com.nis.domain.maat.ToMaatResult;
|
||||||
@@ -71,6 +72,7 @@ import it.sauronsoftware.jave.VideoInfo;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理音视频业务
|
* 处理音视频业务
|
||||||
|
*
|
||||||
* @author zhangwei
|
* @author zhangwei
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -79,9 +81,12 @@ import it.sauronsoftware.jave.VideoInfo;
|
|||||||
public class AvController extends BaseController {
|
public class AvController extends BaseController {
|
||||||
|
|
||||||
// 音视频文件样例配置列表
|
// 音视频文件样例配置列表
|
||||||
@RequestMapping(value = {"/sample/fileSampleList","/sample/fileSampleSpeakerList","/sample/fileSampleLogoList","/sample/fileSampleFaceList"})
|
@RequestMapping(value = { "/sample/fileSampleList", "/sample/fileSampleSpeakerList", "/sample/fileSampleLogoList",
|
||||||
public String fileSampleList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AvFileSampleCfg entity){
|
"/sample/fileSampleFaceList" })
|
||||||
Page<AvFileSampleCfg> page = avCfgService.getAvFileSampleList(new Page<AvFileSampleCfg>(request, response,"a"), entity);
|
public String fileSampleList(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
@ModelAttribute("cfg") AvFileSampleCfg entity) {
|
||||||
|
Page<AvFileSampleCfg> page = avCfgService.getAvFileSampleList(new Page<AvFileSampleCfg>(request, response, "a"),
|
||||||
|
entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||||
@@ -91,10 +96,13 @@ public class AvController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "/cfg/av/fileSampleList";
|
return "/cfg/av/fileSampleList";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 音视频标志样例配置列表
|
// 音视频标志样例配置列表
|
||||||
@RequestMapping(value = { "/sample/audioSignSampleList" })
|
@RequestMapping(value = { "/sample/audioSignSampleList" })
|
||||||
public String audioSignSampleList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AvSignSampleCfg entity){
|
public String audioSignSampleList(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
Page<AvSignSampleCfg> page = avCfgService.getAvSignSampleList(new Page<AvSignSampleCfg>(request, response,"a"), entity);
|
@ModelAttribute("cfg") AvSignSampleCfg entity) {
|
||||||
|
Page<AvSignSampleCfg> page = avCfgService.getAvSignSampleList(new Page<AvSignSampleCfg>(request, response, "a"),
|
||||||
|
entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||||
@@ -104,23 +112,28 @@ public class AvController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "/cfg/av/signSampleList";
|
return "/cfg/av/signSampleList";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 视频标志样例配置列表
|
// 视频标志样例配置列表
|
||||||
@RequestMapping(value = { "/sample/signSampleList" })
|
@RequestMapping(value = { "/sample/signSampleList" })
|
||||||
public String signSampleList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AvSignSampleCfg entity){
|
public String signSampleList(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
@ModelAttribute("cfg") AvSignSampleCfg entity) {
|
||||||
List<AvSignSampleCfg> list = avCfgService.getSignSampleList(entity);
|
List<AvSignSampleCfg> list = avCfgService.getSignSampleList(entity);
|
||||||
model.addAttribute("cfgs", list);
|
model.addAttribute("cfgs", list);
|
||||||
model.addAttribute("functionId", entity.getFunctionId());
|
model.addAttribute("functionId", entity.getFunctionId());
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
/*List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
/*
|
||||||
for(FunctionRegionDict region:regionList){
|
* List<FunctionRegionDict> regionList =
|
||||||
model.addAttribute("regionValue",region.getConfigRegionValue());
|
* DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||||
break;
|
* for(FunctionRegionDict region:regionList){
|
||||||
}*/
|
* model.addAttribute("regionValue",region.getConfigRegionValue());
|
||||||
|
* break; }
|
||||||
|
*/
|
||||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||||
model.addAttribute("serviceList", serviceList);
|
model.addAttribute("serviceList", serviceList);
|
||||||
// return "/cfg/av/signSampleList";
|
// return "/cfg/av/signSampleList";
|
||||||
return "/cfg/av/switchSignSample";
|
return "/cfg/av/switchSignSample";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 日志获取样例获取域配置信息
|
// 日志获取样例获取域配置信息
|
||||||
@RequestMapping(value = { "ajaxSignSampleList" })
|
@RequestMapping(value = { "ajaxSignSampleList" })
|
||||||
public String ajaxSignSampleList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxSignSampleList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
@@ -146,7 +159,8 @@ public class AvController extends BaseController {
|
|||||||
|
|
||||||
// 文件样例配置界面
|
// 文件样例配置界面
|
||||||
@RequestMapping(value = { "/sample/fileSampleForm" })
|
@RequestMapping(value = { "/sample/fileSampleForm" })
|
||||||
public String fileSampleForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvFileSampleCfg entity){
|
public String fileSampleForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
|
AvFileSampleCfg entity) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
entity = avCfgService.getAvFileSampleById(Long.parseLong(ids), null);
|
entity = avCfgService.getAvFileSampleById(Long.parseLong(ids), null);
|
||||||
}
|
}
|
||||||
@@ -155,6 +169,7 @@ public class AvController extends BaseController {
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/av/fileSampleForm";
|
return "/cfg/av/fileSampleForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 日志获取样例获取域配置信息
|
// 日志获取样例获取域配置信息
|
||||||
@RequestMapping(value = { "ajaxfileSampleList" })
|
@RequestMapping(value = { "ajaxfileSampleList" })
|
||||||
public String ajaxAvContIpList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxAvContIpList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
@@ -172,9 +187,11 @@ public class AvController extends BaseController {
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/av/fileSampleSubList";
|
return "/cfg/av/fileSampleSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 标志样例配置界面
|
// 标志样例配置界面
|
||||||
@RequestMapping(value = { "/sample/audioSignSampleForm" })
|
@RequestMapping(value = { "/sample/audioSignSampleForm" })
|
||||||
public String audioSignSampleForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,AvSignSampleCfg entity){
|
public String audioSignSampleForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
|
AvSignSampleCfg entity) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
entity = avCfgService.getAvSignSampleById(Long.parseLong(ids));
|
entity = avCfgService.getAvSignSampleById(Long.parseLong(ids));
|
||||||
}
|
}
|
||||||
@@ -182,10 +199,12 @@ public class AvController extends BaseController {
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/av/signSampleForm";
|
return "/cfg/av/signSampleForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存文件样例配置
|
// 保存文件样例配置
|
||||||
@RequestMapping(value = { "/sample/saveFileSample" })
|
@RequestMapping(value = { "/sample/saveFileSample" })
|
||||||
public String saveFileSample(Model model,HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes,
|
public String saveFileSample(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
String ids,AvFileSampleCfg entity,MultipartFile srcFile,MultipartFile sampleFile,String picPath,String videoToPicture){
|
RedirectAttributes redirectAttributes, String ids, AvFileSampleCfg entity, MultipartFile srcFile,
|
||||||
|
MultipartFile sampleFile, String picPath, String videoToPicture) {
|
||||||
try {
|
try {
|
||||||
// if(srcFile!=null && sampleFile!=null &&
|
// if(srcFile!=null && sampleFile!=null &&
|
||||||
// srcFile.getSize()>0 && sampleFile.getSize()>0){
|
// srcFile.getSize()>0 && sampleFile.getSize()>0){
|
||||||
@@ -230,7 +249,8 @@ public class AvController extends BaseController {
|
|||||||
if (StringUtil.isBlank(srcFile.getOriginalFilename())) {
|
if (StringUtil.isBlank(srcFile.getOriginalFilename())) {
|
||||||
srcFileAllPath = srcFilePath + sep + fileName + FileUtils.getSuffix(srcFile.getName(), true);
|
srcFileAllPath = srcFilePath + sep + fileName + FileUtils.getSuffix(srcFile.getName(), true);
|
||||||
} else {
|
} else {
|
||||||
srcFileAllPath = srcFilePath+sep+fileName+FileUtils.getSuffix(srcFile.getOriginalFilename(), true);
|
srcFileAllPath = srcFilePath + sep + fileName
|
||||||
|
+ FileUtils.getSuffix(srcFile.getOriginalFilename(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
String sampleFileAllPath = sampleFilePath + sep + fileName + ".sample";
|
String sampleFileAllPath = sampleFilePath + sep + fileName + ".sample";
|
||||||
@@ -245,15 +265,21 @@ public class AvController extends BaseController {
|
|||||||
}
|
}
|
||||||
entity.setSrcUrl("");
|
entity.setSrcUrl("");
|
||||||
entity.setSampleUrl("");
|
entity.setSampleUrl("");
|
||||||
/*String host = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath();
|
/*
|
||||||
String srcUrl = host+srcFilePath.substring(srcFilePath.indexOf(Constants.AV_FILE_PATH)+Constants.AV_FILE_PATH.length()-1)+sep+uploadSrcFile.getName();
|
* String host =
|
||||||
String sampleUrl = host+sampleFilePath.substring(sampleFilePath.indexOf(Constants.AV_FILE_PATH)+Constants.AV_FILE_PATH.length()-1)+sep+uploadSampleFile.getName();
|
* request.getScheme()+"://"+request.getServerName()+":"+request
|
||||||
srcUrl = srcUrl.replace("\\", "/");
|
* .getServerPort()+request.getContextPath(); String srcUrl =
|
||||||
sampleUrl = sampleUrl.replace("\\", "/");
|
* host+srcFilePath.substring(srcFilePath.indexOf(Constants.
|
||||||
logger.info("srcUrl:"+srcUrl);
|
* AV_FILE_PATH)+Constants.AV_FILE_PATH.length()-1)+sep+
|
||||||
logger.info("sampleUrl:"+sampleUrl);
|
* uploadSrcFile.getName(); String sampleUrl =
|
||||||
entity.setSrcUrl(srcUrl);
|
* host+sampleFilePath.substring(sampleFilePath.indexOf(
|
||||||
entity.setSampleUrl(sampleUrl);*/
|
* Constants.AV_FILE_PATH)+Constants.AV_FILE_PATH.length()-1)+
|
||||||
|
* sep+uploadSampleFile.getName(); srcUrl =
|
||||||
|
* srcUrl.replace("\\", "/"); sampleUrl =
|
||||||
|
* sampleUrl.replace("\\", "/"); logger.info("srcUrl:"+srcUrl);
|
||||||
|
* logger.info("sampleUrl:"+sampleUrl);
|
||||||
|
* entity.setSrcUrl(srcUrl); entity.setSampleUrl(sampleUrl);
|
||||||
|
*/
|
||||||
|
|
||||||
// File uploadSrcFile = new File(srcFilePath);
|
// File uploadSrcFile = new File(srcFilePath);
|
||||||
// FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile);
|
// FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile);
|
||||||
@@ -268,11 +294,11 @@ public class AvController extends BaseController {
|
|||||||
if (Constants.AUDIO_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(), false))
|
if (Constants.AUDIO_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(), false))
|
||||||
|| Constants.VIDEO_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(), false))
|
|| Constants.VIDEO_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(), false))
|
||||||
|| Constants.VOIP_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(), false))
|
|| Constants.VOIP_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(), false))
|
||||||
||Constants.SPEAKER_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(),false))
|
|| Constants.SPEAKER_FILE_TYPE.contains(FileUtils.getSuffix(uploadSrcFile.getName(), false))) {
|
||||||
){
|
|
||||||
if (!validateAvDuration(uploadSrcFile)) {
|
if (!validateAvDuration(uploadSrcFile)) {
|
||||||
addMessage(redirectAttributes, "error", "exceeds_duration_limit");
|
addMessage(redirectAttributes, "error", "exceeds_duration_limit");
|
||||||
logger.error("The duration of uploaded files exceeds the limit("+Constants.AV_DURATION_LIMIT+"s).");
|
logger.error("The duration of uploaded files exceeds the limit(" + Constants.AV_DURATION_LIMIT
|
||||||
|
+ "s).");
|
||||||
throw new MultiPartNewException(this.getMsgProp().getProperty("exceeds_duration_limit"));
|
throw new MultiPartNewException(this.getMsgProp().getProperty("exceeds_duration_limit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,7 +306,6 @@ public class AvController extends BaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
avCfgService.saveOrUpdateAvFileSample(entity, srcFile);
|
avCfgService.saveOrUpdateAvFileSample(entity, srcFile);
|
||||||
addMessage(redirectAttributes, "success", "save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -299,9 +324,11 @@ public class AvController extends BaseController {
|
|||||||
|
|
||||||
return "redirect:" + adminPath + "/ntc/av/sample/fileSampleList?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/av/sample/fileSampleList?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存标志样例配置
|
// 保存标志样例配置
|
||||||
@RequestMapping(value = { "/sample/saveAudioSignSample" })
|
@RequestMapping(value = { "/sample/saveAudioSignSample" })
|
||||||
public String saveAudioSignSample(Model model,HttpServletRequest request,HttpServletResponse response, RedirectAttributes redirectAttributes,String ids,AvSignSampleCfg entity){
|
public String saveAudioSignSample(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
RedirectAttributes redirectAttributes, String ids, AvSignSampleCfg entity) {
|
||||||
try {
|
try {
|
||||||
avCfgService.saveOrUpdateAvSignSample(entity);
|
avCfgService.saveOrUpdateAvSignSample(entity);
|
||||||
addMessage(redirectAttributes, "success", "save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
@@ -318,16 +345,20 @@ public class AvController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/av/sample/audioSignSampleList?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/av/sample/audioSignSampleList?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改文件样例配置状态
|
// 修改文件样例配置状态
|
||||||
@RequestMapping(value = { "/sample/updateAvFileSampleValid" })
|
@RequestMapping(value = { "/sample/updateAvFileSampleValid" })
|
||||||
public String updateAvFileSampleValid(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes){
|
public String updateAvFileSampleValid(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
avCfgService.updateAvFileSampleValid(isAudit, isValid, ids);
|
avCfgService.updateAvFileSampleValid(isAudit, isValid, ids);
|
||||||
addMessage(redirectAttributes, "success", "delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
return "redirect:" + adminPath + "/ntc/av/sample/fileSampleList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/sample/fileSampleList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改文件样例配置审核状态
|
// 修改文件样例配置审核状态
|
||||||
/**
|
/**
|
||||||
* 审核配置下发,为了保证配置下发过程事务正确,一条配置提交一次
|
* 审核配置下发,为了保证配置下发过程事务正确,一条配置提交一次
|
||||||
|
*
|
||||||
* @param isAudit
|
* @param isAudit
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
@@ -335,14 +366,9 @@ public class AvController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "/sample/auditAvFileSample" })
|
@RequestMapping(value = { "/sample/auditAvFileSample" })
|
||||||
public String auditAvFileSample(Model model,@ModelAttribute("cfg")AvFileSampleCfg cfg,
|
public String auditAvFileSample(Model model, @ModelAttribute("cfg") AvFileSampleCfg cfg, Integer isValid,
|
||||||
Integer isValid,
|
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
Integer isAudit,
|
HttpServletResponse response, HttpServletRequest request) {
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request){
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
// avCfgService.auditAvFileSample(isAudit,isValid,ids);
|
// avCfgService.auditAvFileSample(isAudit,isValid,ids);
|
||||||
AvFileSampleCfg entity = new AvFileSampleCfg();
|
AvFileSampleCfg entity = new AvFileSampleCfg();
|
||||||
@@ -356,57 +382,55 @@ public class AvController extends BaseController {
|
|||||||
// String oldSrcUrl = entity.getSrcPath();
|
// String oldSrcUrl = entity.getSrcPath();
|
||||||
// String oldSampleUrl = entity.getSamplePath();
|
// String oldSampleUrl = entity.getSamplePath();
|
||||||
try {
|
try {
|
||||||
/*if(isAudit==1){
|
/*
|
||||||
Date creatTime = entity.getCreateTime();
|
* if(isAudit==1){ Date creatTime = entity.getCreateTime();
|
||||||
//音视频文件上传接口调用
|
* //音视频文件上传接口调用 File srcFile = new File(oldSrcUrl);
|
||||||
File srcFile = new File(oldSrcUrl);
|
* Map<String,Object> srcMap = new HashMap();
|
||||||
Map<String,Object> srcMap = new HashMap();
|
* srcMap.put("filetype",
|
||||||
srcMap.put("filetype", FileUtils.getSuffix(srcFile.getName(), false));
|
* FileUtils.getSuffix(srcFile.getName(), false));
|
||||||
srcMap.put("datatype", "dbSystem");//源文件存入数据中心
|
* srcMap.put("datatype", "dbSystem");//源文件存入数据中心
|
||||||
|
*
|
||||||
srcMap.put("createTime",creatTime);
|
* srcMap.put("createTime",creatTime);
|
||||||
srcMap.put("key",FileUtils.getPrefix(srcFile.getName(), false));
|
* srcMap.put("key",FileUtils.getPrefix(srcFile.getName(),
|
||||||
srcMap.put("fileName", srcFile.getName());
|
* false)); srcMap.put("fileName", srcFile.getName());
|
||||||
srcMap.put("checksum", entity.getSrcMd5());
|
* srcMap.put("checksum", entity.getSrcMd5()); ToMaatResult
|
||||||
ToMaatResult result1 = ConfigServiceUtil.postFileCfg(null, srcFile, JsonMapper.toJsonString(srcMap));
|
* result1 = ConfigServiceUtil.postFileCfg(null, srcFile,
|
||||||
logger.info("音视频源文件上传响应信息:"+result1);
|
* JsonMapper.toJsonString(srcMap));
|
||||||
//获取文件上传响应信息(新的文件访问路径)
|
* logger.info("音视频源文件上传响应信息:"+result1);
|
||||||
String srcAccessUrl = null;
|
* //获取文件上传响应信息(新的文件访问路径) String srcAccessUrl = null;
|
||||||
if(!StringUtil.isEmpty(result1)){
|
* if(!StringUtil.isEmpty(result1)){ ResponseData data =
|
||||||
ResponseData data = result1.getData();
|
* result1.getData(); srcAccessUrl=data.getAccessUrl();
|
||||||
srcAccessUrl=data.getAccessUrl();
|
* entity.setSrcUrl(srcAccessUrl); // entity.setSrcPath("");
|
||||||
entity.setSrcUrl(srcAccessUrl);
|
* } File sampleFile = new File(oldSampleUrl);
|
||||||
// entity.setSrcPath("");
|
* Map<String,Object> sampleMap = new HashMap();
|
||||||
}
|
* sampleMap.put("filetype",
|
||||||
File sampleFile = new File(oldSampleUrl);
|
* FileUtils.getSuffix(sampleFile.getName(), false));
|
||||||
Map<String,Object> sampleMap = new HashMap();
|
* sampleMap.put("datatype", "fileSystem");//样例文件存入fastdfs
|
||||||
sampleMap.put("filetype", FileUtils.getSuffix(sampleFile.getName(), false));
|
* sampleMap.put("createTime", creatTime);
|
||||||
sampleMap.put("datatype", "fileSystem");//样例文件存入fastdfs
|
* sampleMap.put("key",FileUtils.getPrefix(sampleFile.
|
||||||
sampleMap.put("createTime", creatTime);
|
* getName(), false)); sampleMap.put("fileName",
|
||||||
sampleMap.put("key",FileUtils.getPrefix(sampleFile.getName(), false));
|
* sampleFile.getName()); sampleMap.put("checksum",
|
||||||
sampleMap.put("fileName", sampleFile.getName());
|
* entity.getSampleMd5()); ToMaatResult result2 =
|
||||||
sampleMap.put("checksum", entity.getSampleMd5());
|
* ConfigServiceUtil.postFileCfg(null, sampleFile,
|
||||||
ToMaatResult result2 = ConfigServiceUtil.postFileCfg(null, sampleFile, JsonMapper.toJsonString(sampleMap));
|
* JsonMapper.toJsonString(sampleMap));
|
||||||
logger.info("音视频样例文件上传响应信息:"+result2);
|
* logger.info("音视频样例文件上传响应信息:"+result2);
|
||||||
|
*
|
||||||
//获取文件上传响应信息(新的文件访问路径)
|
* //获取文件上传响应信息(新的文件访问路径) String sampleAccessUrl = null;
|
||||||
String sampleAccessUrl = null;
|
* if(!StringUtil.isEmpty(result2)){ ResponseData data =
|
||||||
if(!StringUtil.isEmpty(result2)){
|
* result2.getData(); sampleAccessUrl = data.getAccessUrl();
|
||||||
ResponseData data = result2.getData();
|
* entity.setSampleUrl(sampleAccessUrl); //
|
||||||
sampleAccessUrl = data.getAccessUrl();
|
* entity.setSamplePath("");
|
||||||
entity.setSampleUrl(sampleAccessUrl);
|
*
|
||||||
// entity.setSamplePath("");
|
* } }
|
||||||
|
*/
|
||||||
}
|
|
||||||
}*/
|
|
||||||
avCfgService.auditAvFileSample(entity, isAudit);
|
avCfgService.auditAvFileSample(entity, isAudit);
|
||||||
// 删除本地源文件和样例文件
|
// 删除本地源文件和样例文件
|
||||||
/*if(!oldSrcUrl.equals(entity.getSrcUrl())){
|
/*
|
||||||
FileUtils.deleteFile(oldSrcUrl);
|
* if(!oldSrcUrl.equals(entity.getSrcUrl())){
|
||||||
}
|
* FileUtils.deleteFile(oldSrcUrl); }
|
||||||
if(!oldSampleUrl.equals(entity.getSampleUrl())){
|
* if(!oldSampleUrl.equals(entity.getSampleUrl())){
|
||||||
FileUtils.deleteFile(oldSampleUrl);
|
* FileUtils.deleteFile(oldSampleUrl); }
|
||||||
}*/
|
*/
|
||||||
addMessage(redirectAttributes, "success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -441,6 +465,7 @@ public class AvController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/av/sample/fileSampleList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/sample/fileSampleList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改标志样例配置状态
|
// 修改标志样例配置状态
|
||||||
@RequestMapping(value = { "/sample/updateAvSignSampleValid" })
|
@RequestMapping(value = { "/sample/updateAvSignSampleValid" })
|
||||||
public String updateAvSignSampleValid(Integer isAudit, Integer isValid, String ids, Integer functionId) {
|
public String updateAvSignSampleValid(Integer isAudit, Integer isValid, String ids, Integer functionId) {
|
||||||
@@ -451,6 +476,7 @@ public class AvController extends BaseController {
|
|||||||
// 修改标志样例配置审核状态
|
// 修改标志样例配置审核状态
|
||||||
/**
|
/**
|
||||||
* 审核配置下发,为了保证配置下发过程事务正确,一条配置提交一次
|
* 审核配置下发,为了保证配置下发过程事务正确,一条配置提交一次
|
||||||
|
*
|
||||||
* @param isAudit
|
* @param isAudit
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
@@ -458,7 +484,8 @@ public class AvController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "/sample/auditAvAudioSignSample" })
|
@RequestMapping(value = { "/sample/auditAvAudioSignSample" })
|
||||||
public String auditAvAudioSignSample(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes){
|
public String auditAvAudioSignSample(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
// avCfgService.auditAvSignSample(isAudit,isValid,ids);
|
// avCfgService.auditAvSignSample(isAudit,isValid,ids);
|
||||||
AvSignSampleCfg entity = new AvSignSampleCfg();
|
AvSignSampleCfg entity = new AvSignSampleCfg();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -484,9 +511,11 @@ public class AvController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/av/sample/signSampleList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/av/sample/signSampleList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改标志样例配置审核状态
|
// 修改标志样例配置审核状态
|
||||||
/**
|
/**
|
||||||
* 审核配置下发,为了保证配置下发过程事务正确,一条配置提交一次
|
* 审核配置下发,为了保证配置下发过程事务正确,一条配置提交一次
|
||||||
|
*
|
||||||
* @param isAudit
|
* @param isAudit
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
@@ -494,7 +523,8 @@ public class AvController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "/sample/auditAvSignSample" })
|
@RequestMapping(value = { "/sample/auditAvSignSample" })
|
||||||
public String auditAvSignSample(Integer preset,AvSignSampleCfgModel cfg,Integer functionId,RedirectAttributes redirectAttributes){
|
public String auditAvSignSample(Integer preset, AvSignSampleCfgModel cfg, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
// 预置配置
|
// 预置配置
|
||||||
try {
|
try {
|
||||||
if (preset != null && 1 == preset) {// 预置信息需要在数据库中插入一条记录
|
if (preset != null && 1 == preset) {// 预置信息需要在数据库中插入一条记录
|
||||||
@@ -516,9 +546,10 @@ public class AvController extends BaseController {
|
|||||||
// 修改下发配置
|
// 修改下发配置
|
||||||
if (cfg != null && cfg.getCfgs() != null) {
|
if (cfg != null && cfg.getCfgs() != null) {
|
||||||
for (AvSignSampleCfg avSignSampleCfg : cfg.getCfgs()) {
|
for (AvSignSampleCfg avSignSampleCfg : cfg.getCfgs()) {
|
||||||
/*if(StringUtil.isEmpty(avSignSampleCfg.getIsValid())){
|
/*
|
||||||
avSignSampleCfg.setIsValid(0);
|
* if(StringUtil.isEmpty(avSignSampleCfg.getIsValid())){
|
||||||
}*/
|
* avSignSampleCfg.setIsValid(0); }
|
||||||
|
*/
|
||||||
if (cfg.getAction() != null) {
|
if (cfg.getAction() != null) {
|
||||||
avSignSampleCfg.setAction(cfg.getAction());
|
avSignSampleCfg.setAction(cfg.getAction());
|
||||||
}
|
}
|
||||||
@@ -555,36 +586,61 @@ public class AvController extends BaseController {
|
|||||||
Map<String, List> dataMap = new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
List<AvFileSampleCfg> ipLists = new ArrayList<AvFileSampleCfg>();
|
||||||
/*//导出选中记录
|
// 导出选中记录
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
for(String id:ids.split(",")){
|
ipLists = avCfgService.getAvFileBySampleList(ids);
|
||||||
Long.parseLong(id);
|
} else {
|
||||||
}
|
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
|
||||||
}else{*/
|
|
||||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
entity.setTableName(IpPortCfg.getTablename());
|
||||||
Page<AvFileSampleCfg> pageInfo = new Page<AvFileSampleCfg>(request, response, "a");
|
Page<AvFileSampleCfg> pageInfo = new Page<AvFileSampleCfg>(request, response, "a");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<AvFileSampleCfg> page = avCfgService.getAvFileSampleList(pageInfo, entity);
|
Page<AvFileSampleCfg> page = avCfgService.getAvFileSampleList(pageInfo, entity);
|
||||||
|
ipLists = page.getList();
|
||||||
|
}
|
||||||
|
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||||
|
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), AvFileSampleCfg.class);
|
classMap.put(entity.getMenuNameCode(), AvFileSampleCfg.class);
|
||||||
String cfgIndexInfoNoExport = ",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
String cfgIndexInfoNoExport = ",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
/*}*/
|
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("ysp export failed", e);
|
logger.error("ysp export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证音视频时长
|
* 验证音视频时长
|
||||||
|
*
|
||||||
* @throws EncoderException
|
* @throws EncoderException
|
||||||
* @throws InputFormatException
|
* @throws InputFormatException
|
||||||
*/
|
*/
|
||||||
@@ -605,8 +661,10 @@ public class AvController extends BaseController {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传视频文件,调用脚本生成关键帧图片,返回图片保存路径
|
* 上传视频文件,调用脚本生成关键帧图片,返回图片保存路径
|
||||||
|
*
|
||||||
* @param cfg
|
* @param cfg
|
||||||
* @param functionId
|
* @param functionId
|
||||||
* @param redirectAttributes
|
* @param redirectAttributes
|
||||||
@@ -632,7 +690,8 @@ public class AvController extends BaseController {
|
|||||||
FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile);// 保存源文件
|
FileCopyUtils.copy(srcFile.getBytes(), uploadSrcFile);// 保存源文件
|
||||||
if (validateAvDuration(uploadSrcFile)) {
|
if (validateAvDuration(uploadSrcFile)) {
|
||||||
String shellName = Constants.VEDIO_TO_PICTURE_PROC;
|
String shellName = Constants.VEDIO_TO_PICTURE_PROC;
|
||||||
// String params = srcFileAllPath+" "+picFilePath+" 0.95 90.0 0.5";
|
// String params = srcFileAllPath+" "+picFilePath+" 0.95 90.0
|
||||||
|
// 0.5";
|
||||||
String[] params = new String[] { srcFileAllPath, picFilePath };
|
String[] params = new String[] { srcFileAllPath, picFilePath };
|
||||||
logger.info("调用视频转关键帧图片程序:" + shellName + " " + StringUtils.join(params, " "));
|
logger.info("调用视频转关键帧图片程序:" + shellName + " " + StringUtils.join(params, " "));
|
||||||
Map resultMap = avCfgService.execShell(shellName, params);
|
Map resultMap = avCfgService.execShell(shellName, params);
|
||||||
@@ -662,7 +721,8 @@ public class AvController extends BaseController {
|
|||||||
} else {
|
} else {
|
||||||
if (StringUtil.isEmpty(resObject.getString("message"))) {
|
if (StringUtil.isEmpty(resObject.getString("message"))) {
|
||||||
map.put("status", 0);
|
map.put("status", 0);
|
||||||
map.put("msg", msgProp.getProperty("call_external_procedures_failed", "Call external procedures failed"));
|
map.put("msg", msgProp.getProperty("call_external_procedures_failed",
|
||||||
|
"Call external procedures failed"));
|
||||||
} else {
|
} else {
|
||||||
map.put("status", 0);
|
map.put("status", 0);
|
||||||
map.put("msg", resObject.getString("message"));
|
map.put("msg", resObject.getString("message"));
|
||||||
@@ -671,7 +731,8 @@ public class AvController extends BaseController {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
map.put("status", 0);
|
map.put("status", 0);
|
||||||
map.put("msg", msgProp.getProperty("call_external_procedures_failed", "Call external procedures failed"));
|
map.put("msg",
|
||||||
|
msgProp.getProperty("call_external_procedures_failed", "Call external procedures failed"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
map.put("status", 0);
|
map.put("status", 0);
|
||||||
@@ -693,8 +754,10 @@ public class AvController extends BaseController {
|
|||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传图片文件,调用脚本压缩图片,返回图片保存路径
|
* 上传图片文件,调用脚本压缩图片,返回图片保存路径
|
||||||
|
*
|
||||||
* @param cfg
|
* @param cfg
|
||||||
* @param functionId
|
* @param functionId
|
||||||
* @param redirectAttributes
|
* @param redirectAttributes
|
||||||
@@ -702,10 +765,12 @@ public class AvController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = { "/sample/faceToPicture" })
|
@RequestMapping(value = { "/sample/faceToPicture" })
|
||||||
public Map faceToPicture(Model model,@RequestParam("srcFile") CommonsMultipartFile[] srcFile,@RequestParam("faceFilePath")String faceFilePath){
|
public Map faceToPicture(Model model, @RequestParam("srcFile") CommonsMultipartFile[] srcFile,
|
||||||
|
@RequestParam("faceFilePath") String faceFilePath) {
|
||||||
String sep = System.getProperty("file.separator");
|
String sep = System.getProperty("file.separator");
|
||||||
String random = UUID.randomUUID() + "";
|
String random = UUID.randomUUID() + "";
|
||||||
// String srcFilePath = Constants.AV_FILE_PATH+"face"+random+sep+"srcFile";//视频源文件保存路径
|
// String srcFilePath =
|
||||||
|
// Constants.AV_FILE_PATH+"face"+random+sep+"srcFile";//视频源文件保存路径
|
||||||
String srcFilePath = "";
|
String srcFilePath = "";
|
||||||
if (StringUtil.isBlank(faceFilePath)) {
|
if (StringUtil.isBlank(faceFilePath)) {
|
||||||
srcFilePath = StringUtils.getUserfilesBaseDir() + "face" + sep + "picFile" + sep + random + sep;// 视频生成的关键帧图片文件保存路径
|
srcFilePath = StringUtils.getUserfilesBaseDir() + "face" + sep + "picFile" + sep + random + sep;// 视频生成的关键帧图片文件保存路径
|
||||||
@@ -727,7 +792,6 @@ public class AvController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
map.put("picFilePath", srcFilePath);
|
map.put("picFilePath", srcFilePath);
|
||||||
map.put("faceFilePath", faceFilePath);
|
map.put("faceFilePath", faceFilePath);
|
||||||
@@ -749,11 +813,13 @@ public class AvController extends BaseController {
|
|||||||
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/sample/selectVedioPicture" })
|
@RequestMapping(value = { "/sample/selectVedioPicture" })
|
||||||
public String selectVedioPicture(Model model, HttpServletRequest request, String picFilePath, String srcPath) {
|
public String selectVedioPicture(Model model, HttpServletRequest request, String picFilePath, String srcPath) {
|
||||||
Collection<File> files = FileUtils.listFiles(new File(picFilePath), null, true);
|
Collection<File> files = FileUtils.listFiles(new File(picFilePath), null, true);
|
||||||
List<Map<String, String>> fileList = new ArrayList();
|
List<Map<String, String>> fileList = new ArrayList();
|
||||||
String picUrl = picFilePath.substring(picFilePath.indexOf(Configurations.getStringProperty("userfiles.basedir", "upload")));
|
String picUrl = picFilePath
|
||||||
|
.substring(picFilePath.indexOf(Configurations.getStringProperty("userfiles.basedir", "upload")));
|
||||||
String sep = System.getProperty("file.separator");
|
String sep = System.getProperty("file.separator");
|
||||||
String[] checkedPic = null;
|
String[] checkedPic = null;
|
||||||
if (srcPath != null) {
|
if (srcPath != null) {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.nis.web.controller.configuration.ntc;
|
package com.nis.web.controller.configuration.ntc;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -34,6 +33,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* BGP配置
|
* BGP配置
|
||||||
|
*
|
||||||
* @author dell
|
* @author dell
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -43,8 +43,8 @@ public class BgpCfgController extends BaseController{
|
|||||||
|
|
||||||
@RequestMapping(value = { "bgpList" })
|
@RequestMapping(value = { "bgpList" })
|
||||||
// @RequiresPermissions(value={"other:bgp:config"})
|
// @RequiresPermissions(value={"other:bgp:config"})
|
||||||
public String bgpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg
|
public String bgpList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
,HttpServletRequest request,HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(searchPage, cfg);
|
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
@@ -67,9 +67,8 @@ public class BgpCfgController extends BaseController{
|
|||||||
|
|
||||||
@RequestMapping(value = { "saveBgpCfg" })
|
@RequestMapping(value = { "saveBgpCfg" })
|
||||||
@RequiresPermissions(value = { "other:bgp:config" })
|
@RequiresPermissions(value = { "other:bgp:config" })
|
||||||
public String saveBgpCfg(Model model,HttpServletRequest request,HttpServletResponse response
|
public String saveBgpCfg(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
,String ids,CfgIndexInfo entity
|
CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes) {
|
|
||||||
bgpCfgService.saveBgpCfg(entity);
|
bgpCfgService.saveBgpCfg(entity);
|
||||||
return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
@@ -105,16 +104,13 @@ public class BgpCfgController extends BaseController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*TODO
|
/*
|
||||||
* if(cfg.getDomainList()!=null){
|
* TODO if(cfg.getDomainList()!=null){ String cfgType = null;
|
||||||
String cfgType = null;
|
* for(ComplexkeywordCfg keyword:cfg.getDomainList()){
|
||||||
for(ComplexkeywordCfg keyword:cfg.getDomainList()){
|
* if(!keyword.getCfgType().equals(cfgType)){ tabList.add(new
|
||||||
if(!keyword.getCfgType().equals(cfgType)){
|
* String[]{"3",keyword.getCfgType()}); cfgType = keyword.getCfgType();
|
||||||
tabList.add(new String[]{"3",keyword.getCfgType()});
|
* } } }
|
||||||
cfgType = keyword.getCfgType();
|
*/
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
@@ -123,20 +119,16 @@ public class BgpCfgController extends BaseController{
|
|||||||
|
|
||||||
@RequestMapping(value = { "updateBgpCfgValid" })
|
@RequestMapping(value = { "updateBgpCfgValid" })
|
||||||
@RequiresPermissions(value = { "other:bgp:config" })
|
@RequiresPermissions(value = { "other:bgp:config" })
|
||||||
public String updateBgpCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String updateBgpCfgValid(Integer isValid, String ids, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
bgpCfgService.updateBgpCfgValid(isValid, ids, functionId);
|
bgpCfgService.updateBgpCfgValid(isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "auditBgpCfg" })
|
@RequestMapping(value = { "auditBgpCfg" })
|
||||||
@RequiresPermissions(value = { "other:bgp:confirm" })
|
@RequiresPermissions(value = { "other:bgp:confirm" })
|
||||||
public String auditBgpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditBgpCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
@@ -194,7 +186,6 @@ public class BgpCfgController extends BaseController{
|
|||||||
Map<String, List> dataMap = new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||||
// 导出选中记录
|
// 导出选中记录
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
@@ -228,12 +219,28 @@ public class BgpCfgController extends BaseController{
|
|||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||||
noExportMap.put("NTC_BGP_AS", regionCfgNoExport);
|
noExportMap.put("NTC_BGP_AS", regionCfgNoExport);
|
||||||
// noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
// noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||||
// List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
|
// List<BaseStringCfg> subscribeInfoList=new
|
||||||
|
// ArrayList<BaseStringCfg>();
|
||||||
List<BaseStringCfg> asInfoList = new ArrayList<BaseStringCfg>();
|
List<BaseStringCfg> asInfoList = new ArrayList<BaseStringCfg>();
|
||||||
for (CfgIndexInfo cfg : ipLists) {
|
for (CfgIndexInfo cfg : ipLists) {
|
||||||
CfgIndexInfo cfgIndexInfo = bgpCfgService.exportbgp(cfg);
|
CfgIndexInfo cfgIndexInfo = bgpCfgService.exportbgp(cfg);
|
||||||
@@ -249,12 +256,22 @@ public class BgpCfgController extends BaseController{
|
|||||||
// dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
// dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||||
|
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("bgp export failed", e);
|
logger.error("bgp export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件传输相关配置控制类
|
* 文件传输相关配置控制类
|
||||||
|
*
|
||||||
* @author dell
|
* @author dell
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -56,13 +57,15 @@ import com.nis.web.security.UserUtils;
|
|||||||
public class FileTransferCfgController extends BaseController {
|
public class FileTransferCfgController extends BaseController {
|
||||||
@RequestMapping(value = { "ftpList" })
|
@RequestMapping(value = { "ftpList" })
|
||||||
// @RequiresPermissions(value={"fileTransfer:ftp:config"})
|
// @RequiresPermissions(value={"fileTransfer:ftp:config"})
|
||||||
public String ftpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String ftpList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = fileTransferCfgService.getFtpList(searchPage, cfg);
|
Page<CfgIndexInfo> page = fileTransferCfgService.getFtpList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/fileTransfer/ftpList";
|
return "/cfg/fileTransfer/ftpList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "ftpForm" })
|
@RequestMapping(value = { "ftpForm" })
|
||||||
@RequiresPermissions(value = { "fileTransfer:ftp:config" })
|
@RequiresPermissions(value = { "fileTransfer:ftp:config" })
|
||||||
public String ftpForm(Model model, String compileIds, String ids, CfgIndexInfo entity) {
|
public String ftpForm(Model model, String compileIds, String ids, CfgIndexInfo entity) {
|
||||||
@@ -75,6 +78,7 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/fileTransfer/ftpForm";
|
return "/cfg/fileTransfer/ftpForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "saveFtpCfg" })
|
@RequestMapping(value = { "saveFtpCfg" })
|
||||||
@RequiresPermissions(value = { "fileTransfer:ftp:config" })
|
@RequiresPermissions(value = { "fileTransfer:ftp:config" })
|
||||||
public String saveFtpCfg(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
public String saveFtpCfg(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
@@ -95,6 +99,7 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/fileTransfer/ftpList?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/fileTransfer/ftpList?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "ajaxFtpSubList" })
|
@RequestMapping(value = { "ajaxFtpSubList" })
|
||||||
public String ajaxFtpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxFtpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
CfgIndexInfo cfg = fileTransferCfgService.getFtpCfg(cfgId, compileId);
|
CfgIndexInfo cfg = fileTransferCfgService.getFtpCfg(cfgId, compileId);
|
||||||
@@ -133,9 +138,9 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
return "/cfg/fileTransfer/ftpSubList";
|
return "/cfg/fileTransfer/ftpSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 做删除操作
|
* 做删除操作
|
||||||
|
*
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param functionId
|
* @param functionId
|
||||||
@@ -143,14 +148,16 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "updateFtpCfgValid" })
|
@RequestMapping(value = { "updateFtpCfgValid" })
|
||||||
@RequiresPermissions(value = { "fileTransfer:ftp:config" })
|
@RequiresPermissions(value = { "fileTransfer:ftp:config" })
|
||||||
public String updateFtpCfgValid(Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
public String updateFtpCfgValid(Integer isValid, String ids, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
fileTransferCfgService.updateFtpCfgValid(isValid, ids, functionId);
|
fileTransferCfgService.updateFtpCfgValid(isValid, ids, functionId);
|
||||||
addMessage(redirectAttributes, "success", "delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("ftp配置删除失败:"+e.getMessage());;
|
logger.info("ftp配置删除失败:" + e.getMessage());
|
||||||
|
;
|
||||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
} else {
|
} else {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -160,15 +167,11 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/fileTransfer/ftpList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/fileTransfer/ftpList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "auditFtpCfg" })
|
@RequestMapping(value = { "auditFtpCfg" })
|
||||||
@RequiresPermissions(value = { "fileTransfer:ftp:confirm" })
|
@RequiresPermissions(value = { "fileTransfer:ftp:confirm" })
|
||||||
public String auditFtpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditFtpCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
@@ -186,7 +189,8 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("ftp配置下发失败:"+e.getMessage());;
|
logger.error("ftp配置下发失败:" + e.getMessage());
|
||||||
|
;
|
||||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
} else {
|
} else {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -219,9 +223,8 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
|
|
||||||
@RequestMapping(value = { "fileDigestList" })
|
@RequestMapping(value = { "fileDigestList" })
|
||||||
// @RequiresPermissions(value={"fileTransfer:fileDigest:config"})
|
// @RequiresPermissions(value={"fileTransfer:fileDigest:config"})
|
||||||
public String fileDigestList(Model model,@ModelAttribute("cfg")FileDigestCfg cfg
|
public String fileDigestList(Model model, @ModelAttribute("cfg") FileDigestCfg cfg, HttpServletRequest request,
|
||||||
,HttpServletRequest request,HttpServletResponse response
|
HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes) {
|
|
||||||
Page<FileDigestCfg> searchPage = new Page<FileDigestCfg>(request, response, "a");
|
Page<FileDigestCfg> searchPage = new Page<FileDigestCfg>(request, response, "a");
|
||||||
Page<FileDigestCfg> page = fileTransferCfgService.getFileDigestList(searchPage, cfg);
|
Page<FileDigestCfg> page = fileTransferCfgService.getFileDigestList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
@@ -241,13 +244,12 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/fileTransfer/fileDigestForm";
|
return "/cfg/fileTransfer/fileDigestForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "saveFileDigestCfg" })
|
@RequestMapping(value = { "saveFileDigestCfg" })
|
||||||
@RequiresPermissions(value = { "fileTransfer:fileDigest:config" })
|
@RequiresPermissions(value = { "fileTransfer:fileDigest:config" })
|
||||||
public String saveFileDigestCfg(Model model,HttpServletRequest request
|
public String saveFileDigestCfg(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
,HttpServletResponse response,String ids,
|
FileDigestCfg entity, MultipartFile file, @ModelAttribute("areaCfgIds") String areaCfgIds,
|
||||||
FileDigestCfg entity,MultipartFile file
|
RedirectAttributes redirectAttributes) {
|
||||||
,@ModelAttribute("areaCfgIds")String areaCfgIds
|
|
||||||
,RedirectAttributes redirectAttributes) {
|
|
||||||
try {
|
try {
|
||||||
Date fileTime = null;
|
Date fileTime = null;
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
@@ -296,24 +298,20 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/fileTransfer/fileDigestList?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/fileTransfer/fileDigestList?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "updateFileDigestValid" })
|
@RequestMapping(value = { "updateFileDigestValid" })
|
||||||
@RequiresPermissions(value = { "fileTransfer:fileDigest:config" })
|
@RequiresPermissions(value = { "fileTransfer:fileDigest:config" })
|
||||||
public String updateFileDigestValid(Integer isValid,String ids,Integer functionId
|
public String updateFileDigestValid(Integer isValid, String ids, Integer functionId,
|
||||||
,RedirectAttributes redirectAttributes) {
|
RedirectAttributes redirectAttributes) {
|
||||||
fileTransferCfgService.updateFileDigestCfgValid(isValid, ids, functionId);
|
fileTransferCfgService.updateFileDigestCfgValid(isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/ntc/fileTransfer/fileDigestList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/fileTransfer/fileDigestList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "auditFileDigestCfg" })
|
@RequestMapping(value = { "auditFileDigestCfg" })
|
||||||
@RequiresPermissions(value = { "fileTransfer:fileDigest:confirm" })
|
@RequiresPermissions(value = { "fileTransfer:fileDigest:confirm" })
|
||||||
public String auditFileDigestCfg(Model model,@ModelAttribute("cfg")FileDigestCfg cfg,
|
public String auditFileDigestCfg(Model model, @ModelAttribute("cfg") FileDigestCfg cfg, Integer isValid,
|
||||||
Integer isValid,
|
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
Integer isAudit,
|
HttpServletResponse response, HttpServletRequest request) {
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
Date auditTime = new Date();
|
Date auditTime = new Date();
|
||||||
@@ -356,6 +354,7 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/fileTransfer/fileDigestList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/fileTransfer/fileDigestList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "ajaxFileDigestSubIdList" })
|
@RequestMapping(value = { "ajaxFileDigestSubIdList" })
|
||||||
public String ajaxFileDigestSubIdList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxFileDigestSubIdList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
FileDigestCfg cfg = fileTransferCfgService.getFileDigestSubIdCfg(cfgId, compileId);
|
FileDigestCfg cfg = fileTransferCfgService.getFileDigestSubIdCfg(cfgId, compileId);
|
||||||
@@ -391,11 +390,9 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
return "/cfg/fileTransfer/fileDigestLogSubList";
|
return "/cfg/fileTransfer/fileDigestLogSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = { "p2pList" })
|
@RequestMapping(value = { "p2pList" })
|
||||||
public String p2pList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String p2pList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = fileTransferCfgService.getP2pList(searchPage, cfg);
|
Page<CfgIndexInfo> page = fileTransferCfgService.getP2pList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
@@ -463,8 +460,8 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
|
|
||||||
@RequestMapping(value = { "saveP2pCfg" })
|
@RequestMapping(value = { "saveP2pCfg" })
|
||||||
@RequiresPermissions(value = { "fileTransfer:p2p:config" })
|
@RequiresPermissions(value = { "fileTransfer:p2p:config" })
|
||||||
public String saveP2pCfg(Model model,HttpServletRequest request,HttpServletResponse response,
|
public String saveP2pCfg(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
String ids,CfgIndexInfo entity,RedirectAttributes redirectAttributes) {
|
CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
fileTransferCfgService.saveP2pCfg(entity);
|
fileTransferCfgService.saveP2pCfg(entity);
|
||||||
addMessage(redirectAttributes, "success", "save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
@@ -484,14 +481,16 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
|
|
||||||
@RequestMapping(value = { "updateP2pCfgValid" })
|
@RequestMapping(value = { "updateP2pCfgValid" })
|
||||||
@RequiresPermissions(value = { "fileTransfer:p2p:config" })
|
@RequiresPermissions(value = { "fileTransfer:p2p:config" })
|
||||||
public String updateP2pCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String updateP2pCfgValid(Integer isValid, String ids, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
fileTransferCfgService.updateP2pCfgValid(isValid, ids, functionId);
|
fileTransferCfgService.updateP2pCfgValid(isValid, ids, functionId);
|
||||||
addMessage(redirectAttributes, "success", "delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("P2P配置删除失败:"+e.getMessage());;
|
logger.info("P2P配置删除失败:" + e.getMessage());
|
||||||
|
;
|
||||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
} else {
|
} else {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -550,13 +549,8 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
|
|
||||||
@RequestMapping(value = { "auditP2pCfg" })
|
@RequestMapping(value = { "auditP2pCfg" })
|
||||||
@RequiresPermissions(value = { "fileTransfer:p2p:confirm" })
|
@RequiresPermissions(value = { "fileTransfer:p2p:confirm" })
|
||||||
public String auditP2pCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditP2pCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
@@ -655,6 +649,20 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport);
|
noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport);
|
||||||
noExportMap.put("NTC_FTP_URL", regionCfgNoExport);
|
noExportMap.put("NTC_FTP_URL", regionCfgNoExport);
|
||||||
@@ -680,12 +688,22 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
dataMap.put("NTC_FTP_CONTENT", ftpkeyList);
|
dataMap.put("NTC_FTP_CONTENT", ftpkeyList);
|
||||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("ftp export failed", e);
|
logger.error("ftp export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// p2p配置导出
|
// p2p配置导出
|
||||||
@@ -699,7 +717,6 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
Map<String, List> dataMap = new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
|
||||||
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||||
// 导出选中记录
|
// 导出选中记录
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
@@ -713,7 +730,6 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
ipLists = page.getList();
|
ipLists = page.getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
titleList.add("NTC_UNIVERSAL_IP");
|
titleList.add("NTC_UNIVERSAL_IP");
|
||||||
titleList.add("NTC_P2P_KEYWORDS");
|
titleList.add("NTC_P2P_KEYWORDS");
|
||||||
@@ -743,6 +759,20 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport);
|
noExportMap.put("NTC_UNIVERSAL_IP", ipPortInfoNoExport);
|
||||||
noExportMap.put("NTC_P2P_KEYWORDS", keyCfgNoExport);
|
noExportMap.put("NTC_P2P_KEYWORDS", keyCfgNoExport);
|
||||||
@@ -768,15 +798,24 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
dataMap.put("NTC_P2P_HASH_BIN", hashList);
|
dataMap.put("NTC_P2P_HASH_BIN", hashList);
|
||||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("p2p export failed", e);
|
logger.error("p2p export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// file配置导出
|
// file配置导出
|
||||||
@RequestMapping(value = "exportFile")
|
@RequestMapping(value = "exportFile")
|
||||||
public void exportFile(Model model, HttpServletRequest request, HttpServletResponse response,
|
public void exportFile(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@@ -787,32 +826,54 @@ public class FileTransferCfgController extends BaseController{
|
|||||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap = new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
List<FileDigestCfg> ipLists = new ArrayList<FileDigestCfg>();
|
||||||
|
// 导出选中记录
|
||||||
/*//导出选中记录
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
ipLists = fileTransferCfgService.getFileByDigestList(ids);
|
||||||
for(String id:ids.split(",")){
|
} else {
|
||||||
Long.parseLong(id);
|
|
||||||
}
|
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
|
||||||
}else{*/
|
|
||||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
|
||||||
Page<FileDigestCfg> pageInfo = new Page<FileDigestCfg>(request, response, "a");
|
Page<FileDigestCfg> pageInfo = new Page<FileDigestCfg>(request, response, "a");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<FileDigestCfg> page = fileTransferCfgService.getFileDigestList(pageInfo, entity);
|
Page<FileDigestCfg> page = fileTransferCfgService.getFileDigestList(pageInfo, entity);
|
||||||
|
ipLists = page.getList();
|
||||||
|
}
|
||||||
|
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), FileDigestCfg.class);
|
classMap.put(entity.getMenuNameCode(), FileDigestCfg.class);
|
||||||
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("file export failed", e);
|
logger.error("file export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import com.nis.domain.configuration.CfgIndexInfo;
|
|||||||
import com.nis.domain.configuration.IpPortCfg;
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||||
import com.nis.domain.configuration.template.AppDomainTemplate;
|
import com.nis.domain.configuration.template.AppDomainTemplate;
|
||||||
|
import com.nis.domain.configuration.template.AppPayloadTemplate;
|
||||||
import com.nis.domain.configuration.template.AsnIpTemplate;
|
import com.nis.domain.configuration.template.AsnIpTemplate;
|
||||||
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
||||||
import com.nis.domain.configuration.template.DdosIpTemplate;
|
import com.nis.domain.configuration.template.DdosIpTemplate;
|
||||||
@@ -41,6 +42,15 @@ import com.nis.domain.configuration.template.IpAllTemplate;
|
|||||||
import com.nis.domain.configuration.template.DomainInterceptMonitTemplate;
|
import com.nis.domain.configuration.template.DomainInterceptMonitTemplate;
|
||||||
import com.nis.domain.configuration.template.DomainInterceptRateLimitTemplate;
|
import com.nis.domain.configuration.template.DomainInterceptRateLimitTemplate;
|
||||||
import com.nis.domain.configuration.template.DomainInterceptTemplate;
|
import com.nis.domain.configuration.template.DomainInterceptTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsRedirectComplexTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsRedirectIpTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsRedirectTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsRejectComplexTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsRejectIpTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsRejectTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsReplaceComplexTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsReplaceIpTemplate;
|
||||||
|
import com.nis.domain.configuration.template.HttpsReplaceTemplate;
|
||||||
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
||||||
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||||
import com.nis.domain.configuration.template.IpWhitelistTemplate;
|
import com.nis.domain.configuration.template.IpWhitelistTemplate;
|
||||||
@@ -291,11 +301,16 @@ public class IpController extends BaseController{
|
|||||||
,FunctionServiceDict serviceDict
|
,FunctionServiceDict serviceDict
|
||||||
,Integer requestId) throws Exception{
|
,Integer requestId) throws Exception{
|
||||||
Properties pro=getMsgProp();
|
Properties pro=getMsgProp();
|
||||||
//String serviceName=pro.getProperty(serviceDict.getServiceName());
|
String menuCode = menuService.getMenuCodeByFunctionId(serviceDict.getFunctionId());
|
||||||
|
String menuName = pro.getProperty(menuCode);
|
||||||
String regionName = pro.getProperty(regionDict.getConfigRegionValue());
|
String regionName = pro.getProperty(regionDict.getConfigRegionValue());
|
||||||
//serviceName=StringUtil.isEmpty(serviceName) ?serviceDict.getServiceName():serviceName;
|
menuName = StringUtil.isEmpty(menuName) ? menuCode : menuName;
|
||||||
regionName = StringUtil.isEmpty(regionName) ? regionDict.getConfigRegionValue() : regionName;
|
regionName = StringUtil.isEmpty(regionName) ? regionDict.getConfigRegionValue() : regionName;
|
||||||
|
|
||||||
String fileName = regionName + "_Template.xlsx";
|
String fileName = regionName + "_Template.xlsx";
|
||||||
|
if(!menuName.equalsIgnoreCase(regionName)) {
|
||||||
|
fileName = menuName +"_"+ fileName;
|
||||||
|
}
|
||||||
//ip类模板
|
//ip类模板
|
||||||
if(regionDict.getRegionType().equals(1)){
|
if(regionDict.getRegionType().equals(1)){
|
||||||
if(regionDict.getFunctionId().equals(5)){// IP Address
|
if(regionDict.getFunctionId().equals(5)){// IP Address
|
||||||
@@ -315,7 +330,12 @@ public class IpController extends BaseController{
|
|||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpPayloadTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpPayloadTemplate.class, 2);
|
||||||
excel.setDataList(pro,classList,null).
|
excel.setDataList(pro,classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
}else if(regionDict.getFunctionId().equals(7)||regionDict.getFunctionId().equals(401)){ //Dns IP,DNS FAKE IP
|
}else if(regionDict.getFunctionId().equals(7)) {
|
||||||
|
List<DnsIpTemplate> classList=new ArrayList<DnsIpTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, DnsIpTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(401)){ //Dns IP,DNS FAKE IP
|
||||||
List<DnsFakeIpTemplate> classList=new ArrayList<DnsFakeIpTemplate>();
|
List<DnsFakeIpTemplate> classList=new ArrayList<DnsFakeIpTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, DnsFakeIpTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, DnsFakeIpTemplate.class, 2);
|
||||||
excel.setDataList(pro,classList,null).
|
excel.setDataList(pro,classList,null).
|
||||||
@@ -345,6 +365,21 @@ public class IpController extends BaseController{
|
|||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, SnatTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, SnatTemplate.class, 2);
|
||||||
excel.setDataList(pro,classList,null).
|
excel.setDataList(pro,classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(207)){// HTTP(s)阻断
|
||||||
|
List<HttpsRejectIpTemplate> classList=new ArrayList<HttpsRejectIpTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsRejectIpTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(208)){// HTTP(s)重定向
|
||||||
|
List<HttpsRedirectIpTemplate> classList=new ArrayList<HttpsRedirectIpTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsRedirectIpTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
|
List<HttpsReplaceIpTemplate> classList=new ArrayList<HttpsReplaceIpTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceIpTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
}else{
|
}else{
|
||||||
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpAllTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpAllTemplate.class, 2);
|
||||||
@@ -381,6 +416,21 @@ public class IpController extends BaseController{
|
|||||||
excel.setDataList(pro,classList,null).
|
excel.setDataList(pro,classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
}
|
}
|
||||||
|
}else if(regionDict.getFunctionId().equals(207)){// HTTP(s)阻断
|
||||||
|
List<HttpsRejectTemplate> classList=new ArrayList<HttpsRejectTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsRejectTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(208)){// HTTP(s)重定向
|
||||||
|
List<HttpsRedirectTemplate> classList=new ArrayList<HttpsRedirectTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsRedirectTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
|
List<HttpsReplaceTemplate> classList=new ArrayList<HttpsReplaceTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
}else{
|
}else{
|
||||||
List<StringAllTemplate> classList=new ArrayList<StringAllTemplate>();
|
List<StringAllTemplate> classList=new ArrayList<StringAllTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, StringAllTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, StringAllTemplate.class, 2);
|
||||||
@@ -396,6 +446,26 @@ public class IpController extends BaseController{
|
|||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, DnsComplexStringTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, DnsComplexStringTemplate.class, 2);
|
||||||
excel.setDataList(pro,classList,null).
|
excel.setDataList(pro,classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(207)){// HTTP(s)阻断
|
||||||
|
List<HttpsRejectComplexTemplate> classList=new ArrayList<HttpsRejectComplexTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsRejectComplexTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(208)){// HTTP(s)重定向
|
||||||
|
List<HttpsRedirectComplexTemplate> classList=new ArrayList<HttpsRedirectComplexTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsRedirectComplexTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
|
List<HttpsReplaceComplexTemplate> classList=new ArrayList<HttpsReplaceComplexTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceComplexTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(563)) {// APP Payload
|
||||||
|
List<AppPayloadTemplate> classList=new ArrayList<AppPayloadTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, AppPayloadTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
}else{
|
}else{
|
||||||
List<ComplexStringAllTemplate> classList=new ArrayList<ComplexStringAllTemplate>();
|
List<ComplexStringAllTemplate> classList=new ArrayList<ComplexStringAllTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, ComplexStringAllTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, ComplexStringAllTemplate.class, 2);
|
||||||
@@ -462,6 +532,19 @@ public class IpController extends BaseController{
|
|||||||
+",letter,whether_area_block,classification,attribute,label"
|
+",letter,whether_area_block,classification,attribute,label"
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||||
String asnGroupInfoNoExport="";
|
String asnGroupInfoNoExport="";
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||||
noExportMap.put("asn_policy", asnGroupInfoNoExport);
|
noExportMap.put("asn_policy", asnGroupInfoNoExport);
|
||||||
@@ -480,9 +563,16 @@ public class IpController extends BaseController{
|
|||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
dataMap.put("NTC_IP", ipList);
|
dataMap.put("NTC_IP", ipList);
|
||||||
dataMap.put("asn_policy", groupInfoList);
|
dataMap.put("asn_policy", groupInfoList);
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
/*}*/
|
/*}*/
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("ip addr export failed",e);
|
logger.error("ip addr export failed",e);
|
||||||
addMessage(redirectAttributes,"error", "export_failed");
|
addMessage(redirectAttributes,"error", "export_failed");
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 邮件相关配置控制类
|
* 邮件相关配置控制类
|
||||||
|
*
|
||||||
* @author dell
|
* @author dell
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -52,13 +53,15 @@ import com.nis.web.security.UserUtils;
|
|||||||
public class MailCfgController extends BaseController {
|
public class MailCfgController extends BaseController {
|
||||||
@RequestMapping(value = { "mailList" })
|
@RequestMapping(value = { "mailList" })
|
||||||
// @RequiresPermissions(value={"mail:config"})
|
// @RequiresPermissions(value={"mail:config"})
|
||||||
public String mailList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String mailList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = mailCfgService.getMailList(searchPage, cfg);
|
Page<CfgIndexInfo> page = mailCfgService.getMailList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/mail/mailList";
|
return "/cfg/mail/mailList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "mailForm" })
|
@RequestMapping(value = { "mailForm" })
|
||||||
@RequiresPermissions(value = { "mail:config" })
|
@RequiresPermissions(value = { "mail:config" })
|
||||||
public String mailForm(Model model, String ids, CfgIndexInfo entity) {
|
public String mailForm(Model model, String ids, CfgIndexInfo entity) {
|
||||||
@@ -71,14 +74,16 @@ public class MailCfgController extends BaseController{
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/mail/mailForm";
|
return "/cfg/mail/mailForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "saveMailCfg" })
|
@RequestMapping(value = { "saveMailCfg" })
|
||||||
@RequiresPermissions(value = { "mail:config" })
|
@RequiresPermissions(value = { "mail:config" })
|
||||||
public String saveMailCfg( RedirectAttributes redirectAttributes, Model model,HttpServletRequest request,HttpServletResponse response,String ids,
|
public String saveMailCfg(RedirectAttributes redirectAttributes, Model model, HttpServletRequest request,
|
||||||
CfgIndexInfo entity,MultipartFile file) {
|
HttpServletResponse response, String ids, CfgIndexInfo entity, MultipartFile file) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ToMaatResult result = null;
|
ToMaatResult result = null;
|
||||||
if(file!=null && file.getSize()>0 && entity.getDigestList()!=null && entity.getDigestList().size()>0){
|
if (file != null && file.getSize() > 0 && entity.getDigestList() != null
|
||||||
|
&& entity.getDigestList().size() > 0) {
|
||||||
String sep = System.getProperty("file.separator");
|
String sep = System.getProperty("file.separator");
|
||||||
String digestFilePath = request.getRealPath("/") + "digestFile";
|
String digestFilePath = request.getRealPath("/") + "digestFile";
|
||||||
FileUtils.createDirectory(digestFilePath);
|
FileUtils.createDirectory(digestFilePath);
|
||||||
@@ -114,6 +119,7 @@ public class MailCfgController extends BaseController{
|
|||||||
|
|
||||||
return "redirect:" + adminPath + "/ntc/mail/mailList?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/mail/mailList?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "ajaxMailSubList" })
|
@RequestMapping(value = { "ajaxMailSubList" })
|
||||||
public String ajaxMailSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxMailSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
CfgIndexInfo cfg = mailCfgService.getMailCfg(cfgId, compileId);
|
CfgIndexInfo cfg = mailCfgService.getMailCfg(cfgId, compileId);
|
||||||
@@ -159,21 +165,18 @@ public class MailCfgController extends BaseController{
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/mail/mailSubList";
|
return "/cfg/mail/mailSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "updateMailCfgValid" })
|
@RequestMapping(value = { "updateMailCfgValid" })
|
||||||
@RequiresPermissions(value = { "mail:config" })
|
@RequiresPermissions(value = { "mail:config" })
|
||||||
public String updateMailCfgValid(Integer isValid, String ids, Integer functionId) {
|
public String updateMailCfgValid(Integer isValid, String ids, Integer functionId) {
|
||||||
mailCfgService.updateMailCfgValid(isValid, ids, functionId);
|
mailCfgService.updateMailCfgValid(isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/ntc/mail/mailList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/mail/mailList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "auditMailCfg" })
|
@RequestMapping(value = { "auditMailCfg" })
|
||||||
@RequiresPermissions(value = { "mail:confirm" })
|
@RequiresPermissions(value = { "mail:confirm" })
|
||||||
public String auditMailCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditMailCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
@@ -261,6 +264,21 @@ public class MailCfgController extends BaseController{
|
|||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
if (entity.getFunctionId() != null) {
|
if (entity.getFunctionId() != null) {
|
||||||
if (entity.getFunctionId() != 37) {
|
if (entity.getFunctionId() != 37) {
|
||||||
titleList.add("NTC_IP");
|
titleList.add("NTC_IP");
|
||||||
@@ -307,12 +325,22 @@ public class MailCfgController extends BaseController{
|
|||||||
dataMap.put("NTC_MAIL_HDR", mailReqHdrList);
|
dataMap.put("NTC_MAIL_HDR", mailReqHdrList);
|
||||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("mail export failed", e);
|
logger.error("mail export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 网站配置
|
* 网站配置
|
||||||
|
*
|
||||||
* @author dell
|
* @author dell
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -59,16 +60,19 @@ public class WebsiteController extends BaseController{
|
|||||||
|
|
||||||
@RequestMapping(value = { "httpList" })
|
@RequestMapping(value = { "httpList" })
|
||||||
// @RequiresPermissions(value={"website:http:config"})
|
// @RequiresPermissions(value={"website:http:config"})
|
||||||
public String httpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String httpList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/website/httpList";
|
return "/cfg/website/httpList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "dnsList" })
|
@RequestMapping(value = { "dnsList" })
|
||||||
// @RequiresPermissions(value={"website:dns:config"})
|
// @RequiresPermissions(value={"website:dns:config"})
|
||||||
public String dnsList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String dnsList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
@@ -105,12 +109,9 @@ public class WebsiteController extends BaseController{
|
|||||||
subscribeId.setCfgType(Constants.NTC_SUBSCRIBE_ID);
|
subscribeId.setCfgType(Constants.NTC_SUBSCRIBE_ID);
|
||||||
entity.setNtcSubscribeIdCfg(subscribeId);
|
entity.setNtcSubscribeIdCfg(subscribeId);
|
||||||
|
|
||||||
int httpReqCfgNum = entity.getIpPortList().size()+
|
int httpReqCfgNum = entity.getIpPortList().size() + entity.getHttpUrlList().size()
|
||||||
entity.getHttpUrlList().size()+
|
+ entity.getHttpReqBodyList().size() + entity.getHttpReqHdrList().size();
|
||||||
entity.getHttpReqBodyList().size()+
|
int httpResCfgNum = entity.getHttpResHdrList().size() + entity.getHttpResBodyList().size();
|
||||||
entity.getHttpReqHdrList().size();
|
|
||||||
int httpResCfgNum = entity.getHttpResHdrList().size()+
|
|
||||||
entity.getHttpResBodyList().size();
|
|
||||||
model.addAttribute("httpReqCfgNum", httpReqCfgNum);
|
model.addAttribute("httpReqCfgNum", httpReqCfgNum);
|
||||||
model.addAttribute("httpResCfgNum", httpResCfgNum);
|
model.addAttribute("httpResCfgNum", httpResCfgNum);
|
||||||
if (entity.getIpPortList().size() == 0) {
|
if (entity.getIpPortList().size() == 0) {
|
||||||
@@ -189,10 +190,12 @@ public class WebsiteController extends BaseController{
|
|||||||
|
|
||||||
@RequestMapping(value = { "saveHttpCfg" })
|
@RequestMapping(value = { "saveHttpCfg" })
|
||||||
@RequiresPermissions(value = { "website:http:config" })
|
@RequiresPermissions(value = { "website:http:config" })
|
||||||
public String saveHttpCfg(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
public String saveHttpCfg(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
String ids, CfgIndexInfo entity) {
|
||||||
websiteCfgService.saveHttpCfg(entity);
|
websiteCfgService.saveHttpCfg(entity);
|
||||||
return "redirect:" + adminPath + "/ntc/website/httpList?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/website/httpList?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "ajaxHttpSubList" })
|
@RequestMapping(value = { "ajaxHttpSubList" })
|
||||||
public String ajaxHttpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxHttpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
CfgIndexInfo cfg = websiteCfgService.getHttpCfg(cfgId, compileId);
|
CfgIndexInfo cfg = websiteCfgService.getHttpCfg(cfgId, compileId);
|
||||||
@@ -200,21 +203,18 @@ public class WebsiteController extends BaseController{
|
|||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
return "/cfg/website/httpSubList";
|
return "/cfg/website/httpSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "updateHttpCfgValid" })
|
@RequestMapping(value = { "updateHttpCfgValid" })
|
||||||
@RequiresPermissions(value = { "website:http:config" })
|
@RequiresPermissions(value = { "website:http:config" })
|
||||||
public String updateHttpCfgValid(Integer isValid, String ids, Integer functionId) {
|
public String updateHttpCfgValid(Integer isValid, String ids, Integer functionId) {
|
||||||
websiteCfgService.updateHttpCfgValid(isValid, ids, functionId);
|
websiteCfgService.updateHttpCfgValid(isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/ntc/website/httpList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/website/httpList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "auditHttpCfg" })
|
@RequestMapping(value = { "auditHttpCfg" })
|
||||||
@RequiresPermissions(value = { "website:http:confirm" })
|
@RequiresPermissions(value = { "website:http:confirm" })
|
||||||
public String auditHttpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditHttpCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
@@ -259,15 +259,18 @@ public class WebsiteController extends BaseController{
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/website/httpList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/website/httpList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "sslList" })
|
@RequestMapping(value = { "sslList" })
|
||||||
// @RequiresPermissions(value={"website:ssl:config"})
|
// @RequiresPermissions(value={"website:ssl:config"})
|
||||||
public String sslList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String sslList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/website/sslList";
|
return "/cfg/website/sslList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "sslForm" })
|
@RequestMapping(value = { "sslForm" })
|
||||||
@RequiresPermissions(value = { "website:ssl:config" })
|
@RequiresPermissions(value = { "website:ssl:config" })
|
||||||
public String sslForm(Model model, String ids, CfgIndexInfo entity) {
|
public String sslForm(Model model, String ids, CfgIndexInfo entity) {
|
||||||
@@ -280,17 +283,23 @@ public class WebsiteController extends BaseController{
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/website/sslForm";
|
return "/cfg/website/sslForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "saveSslCfg" })
|
@RequestMapping(value = { "saveSslCfg" })
|
||||||
@RequiresPermissions(value = { "website:ssl:config" })
|
@RequiresPermissions(value = { "website:ssl:config" })
|
||||||
public String saveSslCfg(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
public String saveSslCfg(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
String ids, CfgIndexInfo entity) {
|
||||||
websiteCfgService.saveSslCfg(entity);
|
websiteCfgService.saveSslCfg(entity);
|
||||||
return "redirect:" + adminPath + "/ntc/website/sslList?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/website/sslList?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "ajaxSslSubList" })
|
@RequestMapping(value = { "ajaxSslSubList" })
|
||||||
public String ajaxSslSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxSslSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
CfgIndexInfo cfg = websiteCfgService.getSslCfg(cfgId, compileId);
|
CfgIndexInfo cfg = websiteCfgService.getSslCfg(cfgId, compileId);
|
||||||
/*List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(cfg.getFunctionId());
|
/*
|
||||||
model.addAttribute("regionList", regionList);*/
|
* List<FunctionRegionDict> regionList =
|
||||||
|
* DictUtils.getFunctionRegionDictList(cfg.getFunctionId());
|
||||||
|
* model.addAttribute("regionList", regionList);
|
||||||
|
*/
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
if (cfg.getIpPortList() != null) {
|
if (cfg.getIpPortList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
@@ -324,21 +333,18 @@ public class WebsiteController extends BaseController{
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/website/sslSubList";
|
return "/cfg/website/sslSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "updateSslCfgValid" })
|
@RequestMapping(value = { "updateSslCfgValid" })
|
||||||
@RequiresPermissions(value = { "website:ssl:config" })
|
@RequiresPermissions(value = { "website:ssl:config" })
|
||||||
public String updateSslCfgValid(Integer isValid, String ids, Integer functionId) {
|
public String updateSslCfgValid(Integer isValid, String ids, Integer functionId) {
|
||||||
websiteCfgService.updateSslCfgValid(isValid, ids, functionId);
|
websiteCfgService.updateSslCfgValid(isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/ntc/website/sslList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/website/sslList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "auditSslCfg" })
|
@RequestMapping(value = { "auditSslCfg" })
|
||||||
@RequiresPermissions(value = { "website:ssl:confirm" })
|
@RequiresPermissions(value = { "website:ssl:confirm" })
|
||||||
public String auditSslCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditSslCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isAudit, Integer isValid,
|
||||||
Integer isAudit,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletRequest request,
|
||||||
Integer isValid,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletRequest request,
|
|
||||||
HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
@@ -404,12 +410,15 @@ public class WebsiteController extends BaseController{
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/website/dnsForm";
|
return "/cfg/website/dnsForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "saveDnsCfg" })
|
@RequestMapping(value = { "saveDnsCfg" })
|
||||||
@RequiresPermissions(value = { "website:dns:config" })
|
@RequiresPermissions(value = { "website:dns:config" })
|
||||||
public String saveDnsCfg(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
public String saveDnsCfg(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
String ids, CfgIndexInfo entity) {
|
||||||
websiteCfgService.saveDnsCfg(entity);
|
websiteCfgService.saveDnsCfg(entity);
|
||||||
return "redirect:" + adminPath + "/ntc/website/dnsList?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/website/dnsList?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "ajaxDnsSubList" })
|
@RequestMapping(value = { "ajaxDnsSubList" })
|
||||||
public String ajaxDnsSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxDnsSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
CfgIndexInfo cfg = websiteCfgService.getDnsCfg(cfgId, compileId);
|
CfgIndexInfo cfg = websiteCfgService.getDnsCfg(cfgId, compileId);
|
||||||
@@ -446,21 +455,18 @@ public class WebsiteController extends BaseController{
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/website/dnsSubList";
|
return "/cfg/website/dnsSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "updateDnsCfgValid" })
|
@RequestMapping(value = { "updateDnsCfgValid" })
|
||||||
@RequiresPermissions(value = { "website:dns:config" })
|
@RequiresPermissions(value = { "website:dns:config" })
|
||||||
public String updateDnsCfgValid(Integer isValid, String ids, Integer functionId) {
|
public String updateDnsCfgValid(Integer isValid, String ids, Integer functionId) {
|
||||||
websiteCfgService.updateDnsCfgValid(isValid, ids, functionId);
|
websiteCfgService.updateDnsCfgValid(isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/ntc/website/dnsList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/website/dnsList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "auditDnsCfg" })
|
@RequestMapping(value = { "auditDnsCfg" })
|
||||||
@RequiresPermissions(value = { "website:dns:confirm" })
|
@RequiresPermissions(value = { "website:dns:confirm" })
|
||||||
public String auditDnsCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditDnsCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isAudit, Integer isValid,
|
||||||
Integer isAudit,
|
String ids, Integer functionId, HttpServletRequest request, HttpServletResponse response,
|
||||||
Integer isValid,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
HttpServletRequest request,
|
|
||||||
HttpServletResponse response,
|
|
||||||
RedirectAttributes redirectAttributes) {
|
RedirectAttributes redirectAttributes) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
@@ -507,6 +513,7 @@ public class WebsiteController extends BaseController{
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/website/dnsList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/website/dnsList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
// 下载导入模板
|
// 下载导入模板
|
||||||
@RequestMapping(value = "import/template")
|
@RequestMapping(value = "import/template")
|
||||||
@@ -515,115 +522,85 @@ public class WebsiteController extends BaseController{
|
|||||||
this.importCfgTemplate(request, response, redirectAttributes, functionId, cfgRegionCode);
|
this.importCfgTemplate(request, response, redirectAttributes, functionId, cfgRegionCode);
|
||||||
}
|
}
|
||||||
// http配置导入
|
// http配置导入
|
||||||
/*@RequestMapping(value = "importHttp", method=RequestMethod.POST)
|
/*
|
||||||
public String importHttpFile(HttpServletRequest request,Model model,HttpServletResponse response, RedirectAttributes redirectAttributes,
|
* @RequestMapping(value = "importHttp", method=RequestMethod.POST) public
|
||||||
@RequestParam("file") MultipartFile file,CfgIndexInfo cfgIndex,Integer protocolId) {
|
* String importHttpFile(HttpServletRequest request,Model
|
||||||
try {
|
* model,HttpServletResponse response, RedirectAttributes
|
||||||
ImportExcel ei = new ImportExcel(file, 0, 0);
|
* redirectAttributes,
|
||||||
if(cfgIndex.getCfgType().equals(Constants.HTTP_IP_REGION)){
|
*
|
||||||
List<IpCfgTemplate> list = ei.getDataList(IpCfgTemplate.class);
|
* @RequestParam("file") MultipartFile file,CfgIndexInfo cfgIndex,Integer
|
||||||
for(IpCfgTemplate cfg : list){
|
* protocolId) { try { ImportExcel ei = new ImportExcel(file, 0, 0);
|
||||||
List<IpPortCfg> ipList = new ArrayList();
|
* if(cfgIndex.getCfgType().equals(Constants.HTTP_IP_REGION)){
|
||||||
BeanUtils.copyProperties(cfg, cfgIndex);
|
* List<IpCfgTemplate> list = ei.getDataList(IpCfgTemplate.class);
|
||||||
IpPortCfg ip = new IpPortCfg();
|
* for(IpCfgTemplate cfg : list){ List<IpPortCfg> ipList = new ArrayList();
|
||||||
BeanUtils.copyProperties(cfg, ip);
|
* BeanUtils.copyProperties(cfg, cfgIndex); IpPortCfg ip = new IpPortCfg();
|
||||||
ip.setProtocolId(protocolId);
|
* BeanUtils.copyProperties(cfg, ip); ip.setProtocolId(protocolId);
|
||||||
ip.setCfgRegionCode(cfgIndex.getCfgRegionCode());
|
* ip.setCfgRegionCode(cfgIndex.getCfgRegionCode());
|
||||||
ip.setCfgType(cfgIndex.getCfgType());
|
* ip.setCfgType(cfgIndex.getCfgType()); ipList.add(ip);
|
||||||
ipList.add(ip);
|
* cfgIndex.setIpPortList(ipList); cfgIndex.setIsAreaEffective(0);
|
||||||
cfgIndex.setIpPortList(ipList);
|
* websiteCfgService.saveHttpCfg(cfgIndex); }
|
||||||
cfgIndex.setIsAreaEffective(0);
|
*
|
||||||
websiteCfgService.saveHttpCfg(cfgIndex);
|
* }else if(cfgIndex.getCfgType().equals(Constants.HTTP_URL_REGION)){
|
||||||
}
|
* List<StringCfgTemplate> list = ei.getDataList(StringCfgTemplate.class);
|
||||||
|
* for(StringCfgTemplate cfg : list){ List<HttpUrlCfg> urlList = new
|
||||||
}else if(cfgIndex.getCfgType().equals(Constants.HTTP_URL_REGION)){
|
* ArrayList(); BeanUtils.copyProperties(cfg, cfgIndex); HttpUrlCfg url =
|
||||||
List<StringCfgTemplate> list = ei.getDataList(StringCfgTemplate.class);
|
* new HttpUrlCfg(); BeanUtils.copyProperties(cfg, url);
|
||||||
for(StringCfgTemplate cfg : list){
|
* url.setCfgRegionCode(cfgIndex.getCfgRegionCode());
|
||||||
List<HttpUrlCfg> urlList = new ArrayList();
|
* url.setCfgType(cfgIndex.getCfgType()); urlList.add(url);
|
||||||
BeanUtils.copyProperties(cfg, cfgIndex);
|
* cfgIndex.setHttpUrlList(urlList); cfgIndex.setIsAreaEffective(0);
|
||||||
HttpUrlCfg url = new HttpUrlCfg();
|
* websiteCfgService.saveHttpCfg(cfgIndex); }
|
||||||
BeanUtils.copyProperties(cfg, url);
|
*
|
||||||
url.setCfgRegionCode(cfgIndex.getCfgRegionCode());
|
* }else if(cfgIndex.getCfgType().equals(Constants.HTTP_REQ_HEAD_REGION)){
|
||||||
url.setCfgType(cfgIndex.getCfgType());
|
* List<ComplexStringCfgTemplate> list =
|
||||||
urlList.add(url);
|
* ei.getDataList(ComplexStringCfgTemplate.class);
|
||||||
cfgIndex.setHttpUrlList(urlList);
|
* for(ComplexStringCfgTemplate cfg : list){ List<HttpReqHeadCfg> headList =
|
||||||
cfgIndex.setIsAreaEffective(0);
|
* new ArrayList(); BeanUtils.copyProperties(cfg, cfgIndex); HttpReqHeadCfg
|
||||||
websiteCfgService.saveHttpCfg(cfgIndex);
|
* head = new HttpReqHeadCfg(); BeanUtils.copyProperties(cfg, head);
|
||||||
}
|
* head.setCfgRegionCode(cfgIndex.getCfgRegionCode());
|
||||||
|
* head.setCfgType(cfgIndex.getCfgType()); headList.add(head);
|
||||||
}else if(cfgIndex.getCfgType().equals(Constants.HTTP_REQ_HEAD_REGION)){
|
* cfgIndex.setHttpReqHdrList(headList); cfgIndex.setIsAreaEffective(0);
|
||||||
List<ComplexStringCfgTemplate> list = ei.getDataList(ComplexStringCfgTemplate.class);
|
* websiteCfgService.saveHttpCfg(cfgIndex); }
|
||||||
for(ComplexStringCfgTemplate cfg : list){
|
*
|
||||||
List<HttpReqHeadCfg> headList = new ArrayList();
|
* }else if(cfgIndex.getCfgType().equals(Constants.HTTP_REQ_BODY_REGION)){
|
||||||
BeanUtils.copyProperties(cfg, cfgIndex);
|
* List<StringCfgTemplate> list = ei.getDataList(StringCfgTemplate.class);
|
||||||
HttpReqHeadCfg head = new HttpReqHeadCfg();
|
* for(StringCfgTemplate cfg : list){ List<HttpBodyCfg> bodyList = new
|
||||||
BeanUtils.copyProperties(cfg, head);
|
* ArrayList(); BeanUtils.copyProperties(cfg, cfgIndex); HttpBodyCfg body =
|
||||||
head.setCfgRegionCode(cfgIndex.getCfgRegionCode());
|
* new HttpBodyCfg(); BeanUtils.copyProperties(cfg, body);
|
||||||
head.setCfgType(cfgIndex.getCfgType());
|
* body.setCfgRegionCode(cfgIndex.getCfgRegionCode());
|
||||||
headList.add(head);
|
* body.setCfgType(cfgIndex.getCfgType()); bodyList.add(body);
|
||||||
cfgIndex.setHttpReqHdrList(headList);
|
* cfgIndex.setHttpReqBodyList(bodyList); cfgIndex.setIsAreaEffective(0);
|
||||||
cfgIndex.setIsAreaEffective(0);
|
* websiteCfgService.saveHttpCfg(cfgIndex); }
|
||||||
websiteCfgService.saveHttpCfg(cfgIndex);
|
*
|
||||||
}
|
* }else if(cfgIndex.getCfgType().equals(Constants.HTTP_RES_HEAD_REGION)){
|
||||||
|
* List<ComplexStringCfgTemplate> list =
|
||||||
}else if(cfgIndex.getCfgType().equals(Constants.HTTP_REQ_BODY_REGION)){
|
* ei.getDataList(ComplexStringCfgTemplate.class);
|
||||||
List<StringCfgTemplate> list = ei.getDataList(StringCfgTemplate.class);
|
* for(ComplexStringCfgTemplate cfg : list){ List<HttpResHeadCfg> headList =
|
||||||
for(StringCfgTemplate cfg : list){
|
* new ArrayList(); BeanUtils.copyProperties(cfg, cfgIndex); HttpResHeadCfg
|
||||||
List<HttpBodyCfg> bodyList = new ArrayList();
|
* head = new HttpResHeadCfg(); BeanUtils.copyProperties(cfg, head);
|
||||||
BeanUtils.copyProperties(cfg, cfgIndex);
|
* head.setCfgRegionCode(cfgIndex.getCfgRegionCode());
|
||||||
HttpBodyCfg body = new HttpBodyCfg();
|
* head.setCfgType(cfgIndex.getCfgType()); headList.add(head);
|
||||||
BeanUtils.copyProperties(cfg, body);
|
* cfgIndex.setHttpResHdrList(headList); cfgIndex.setIsAreaEffective(0);
|
||||||
body.setCfgRegionCode(cfgIndex.getCfgRegionCode());
|
* websiteCfgService.saveHttpCfg(cfgIndex); }
|
||||||
body.setCfgType(cfgIndex.getCfgType());
|
*
|
||||||
bodyList.add(body);
|
* }else if(cfgIndex.getCfgType().equals(Constants.HTTP_RES_BODY_REGION)){
|
||||||
cfgIndex.setHttpReqBodyList(bodyList);
|
* List<StringCfgTemplate> list = ei.getDataList(StringCfgTemplate.class);
|
||||||
cfgIndex.setIsAreaEffective(0);
|
* for(StringCfgTemplate cfg : list){ List<HttpBodyCfg> bodyList = new
|
||||||
websiteCfgService.saveHttpCfg(cfgIndex);
|
* ArrayList(); BeanUtils.copyProperties(cfg, cfgIndex); HttpBodyCfg body =
|
||||||
}
|
* new HttpBodyCfg(); BeanUtils.copyProperties(cfg, body);
|
||||||
|
* body.setCfgRegionCode(cfgIndex.getCfgRegionCode());
|
||||||
}else if(cfgIndex.getCfgType().equals(Constants.HTTP_RES_HEAD_REGION)){
|
* body.setCfgType(cfgIndex.getCfgType()); bodyList.add(body);
|
||||||
List<ComplexStringCfgTemplate> list = ei.getDataList(ComplexStringCfgTemplate.class);
|
* cfgIndex.setHttpResBodyList(bodyList); cfgIndex.setIsAreaEffective(0);
|
||||||
for(ComplexStringCfgTemplate cfg : list){
|
* websiteCfgService.saveHttpCfg(cfgIndex); }
|
||||||
List<HttpResHeadCfg> headList = new ArrayList();
|
*
|
||||||
BeanUtils.copyProperties(cfg, cfgIndex);
|
* }
|
||||||
HttpResHeadCfg head = new HttpResHeadCfg();
|
*
|
||||||
BeanUtils.copyProperties(cfg, head);
|
*
|
||||||
head.setCfgRegionCode(cfgIndex.getCfgRegionCode());
|
* } catch (Exception e) { addMessage(redirectAttributes, e.getMessage());
|
||||||
head.setCfgType(cfgIndex.getCfgType());
|
* e.printStackTrace(); } return "redirect:" + adminPath
|
||||||
headList.add(head);
|
* +"/ntc/website/httpList?functionId="+cfgIndex.getFunctionId();
|
||||||
cfgIndex.setHttpResHdrList(headList);
|
*
|
||||||
cfgIndex.setIsAreaEffective(0);
|
* }
|
||||||
websiteCfgService.saveHttpCfg(cfgIndex);
|
*/
|
||||||
}
|
|
||||||
|
|
||||||
}else if(cfgIndex.getCfgType().equals(Constants.HTTP_RES_BODY_REGION)){
|
|
||||||
List<StringCfgTemplate> list = ei.getDataList(StringCfgTemplate.class);
|
|
||||||
for(StringCfgTemplate cfg : list){
|
|
||||||
List<HttpBodyCfg> bodyList = new ArrayList();
|
|
||||||
BeanUtils.copyProperties(cfg, cfgIndex);
|
|
||||||
HttpBodyCfg body = new HttpBodyCfg();
|
|
||||||
BeanUtils.copyProperties(cfg, body);
|
|
||||||
body.setCfgRegionCode(cfgIndex.getCfgRegionCode());
|
|
||||||
body.setCfgType(cfgIndex.getCfgType());
|
|
||||||
bodyList.add(body);
|
|
||||||
cfgIndex.setHttpResBodyList(bodyList);
|
|
||||||
cfgIndex.setIsAreaEffective(0);
|
|
||||||
websiteCfgService.saveHttpCfg(cfgIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
addMessage(redirectAttributes, e.getMessage());
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+cfgIndex.getFunctionId();
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// http配置导出
|
// http配置导出
|
||||||
@RequestMapping(value = "exportHttp")
|
@RequestMapping(value = "exportHttp")
|
||||||
@@ -680,6 +657,21 @@ public class WebsiteController extends BaseController{
|
|||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
List<BaseStringCfg> httpUrlList = new ArrayList<>();
|
List<BaseStringCfg> httpUrlList = new ArrayList<>();
|
||||||
List<ComplexkeywordCfg> httpReqHdrList = new ArrayList<>();
|
List<ComplexkeywordCfg> httpReqHdrList = new ArrayList<>();
|
||||||
List<ComplexkeywordCfg> httpResHdrList = new ArrayList<>();
|
List<ComplexkeywordCfg> httpResHdrList = new ArrayList<>();
|
||||||
@@ -741,12 +733,22 @@ public class WebsiteController extends BaseController{
|
|||||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList);
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList);
|
||||||
}
|
}
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("http export failed", e);
|
logger.error("http export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/website/httpList?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// dns配置导出
|
// dns配置导出
|
||||||
@@ -775,7 +777,8 @@ public class WebsiteController extends BaseController{
|
|||||||
|
|
||||||
for (int i = 0; i < ipLists.size(); i++) {
|
for (int i = 0; i < ipLists.size(); i++) {
|
||||||
if (ipLists.get(i).getDnsStrategyId() != null && ipLists.get(i).getDnsStrategyId() != 0) {
|
if (ipLists.get(i).getDnsStrategyId() != null && ipLists.get(i).getDnsStrategyId() != 0) {
|
||||||
List<DnsResStrategy> resStrategys=dnsResStrategyService.findDnsResStrategys(ipLists.get(i).getDnsStrategyId(), 1,1);
|
List<DnsResStrategy> resStrategys = dnsResStrategyService
|
||||||
|
.findDnsResStrategys(ipLists.get(i).getDnsStrategyId(), 1, 1);
|
||||||
if (resStrategys != null && resStrategys.size() > 0) {
|
if (resStrategys != null && resStrategys.size() > 0) {
|
||||||
String msg = msgProp.getProperty(resStrategys.get(0).getCfgDesc());
|
String msg = msgProp.getProperty(resStrategys.get(0).getCfgDesc());
|
||||||
if (!StringUtil.isEmpty(msg)) {
|
if (!StringUtil.isEmpty(msg)) {
|
||||||
@@ -811,6 +814,21 @@ public class WebsiteController extends BaseController{
|
|||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||||
noExportMap.put("NTC_DNS_REGION", regionCfgNoExport);
|
noExportMap.put("NTC_DNS_REGION", regionCfgNoExport);
|
||||||
@@ -832,12 +850,22 @@ public class WebsiteController extends BaseController{
|
|||||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||||
|
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("dns export failed", e);
|
logger.error("dns export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ssl配置导出
|
// ssl配置导出
|
||||||
@@ -890,6 +918,21 @@ public class WebsiteController extends BaseController{
|
|||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport);
|
noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport);
|
||||||
noExportMap.put("NTC_SSL_SNI", sslNoExport);
|
noExportMap.put("NTC_SSL_SNI", sslNoExport);
|
||||||
@@ -921,11 +964,21 @@ public class WebsiteController extends BaseController{
|
|||||||
dataMap.put("NTC_SSL_CN", sslCnList);
|
dataMap.put("NTC_SSL_CN", sslCnList);
|
||||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList);
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList);
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("http export failed", e);
|
logger.error("http export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/website/httpList?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 白名单
|
* 白名单
|
||||||
|
*
|
||||||
* @author dell
|
* @author dell
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -42,13 +43,15 @@ public class WhiteListController extends CommonController{
|
|||||||
|
|
||||||
@RequestMapping(value = { "ip/list" })
|
@RequestMapping(value = { "ip/list" })
|
||||||
// @RequiresPermissions(value={"whitelist:ip:config","whitelist:ip:confirm","whitelist:ip:aduit"},logical=Logical.OR)
|
// @RequiresPermissions(value={"whitelist:ip:config","whitelist:ip:confirm","whitelist:ip:aduit"},logical=Logical.OR)
|
||||||
public String ipList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String ipList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(searchPage, cfg);
|
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/whitelist/ipList";
|
return "/cfg/whitelist/ipList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "ajaxIpSubList" })
|
@RequestMapping(value = { "ajaxIpSubList" })
|
||||||
public String ajaxIpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxIpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
CfgIndexInfo cfg = ipCfgService.getIpPortCfg(cfgId, compileId);
|
CfgIndexInfo cfg = ipCfgService.getIpPortCfg(cfgId, compileId);
|
||||||
@@ -76,6 +79,7 @@ public class WhiteListController extends CommonController{
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/whitelist/ipSubList";
|
return "/cfg/whitelist/ipSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "ip/form" })
|
@RequestMapping(value = { "ip/form" })
|
||||||
@RequiresPermissions(value = { "whitelist:ip:config" })
|
@RequiresPermissions(value = { "whitelist:ip:config" })
|
||||||
public String ipForm(Model model, String ids, CfgIndexInfo entity) {
|
public String ipForm(Model model, String ids, CfgIndexInfo entity) {
|
||||||
@@ -89,22 +93,19 @@ public class WhiteListController extends CommonController{
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/whitelist/ipForm";
|
return "/cfg/whitelist/ipForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "ip/save" })
|
@RequestMapping(value = { "ip/save" })
|
||||||
public String saveIpCfg(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
public String saveIpCfg(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
String ids, CfgIndexInfo entity) {
|
||||||
ipCfgService.saveIpCfg(entity);
|
ipCfgService.saveIpCfg(entity);
|
||||||
return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "ip/audit" })
|
@RequestMapping(value = { "ip/audit" })
|
||||||
@RequiresPermissions("whitelist:ip:confirm")
|
@RequiresPermissions("whitelist:ip:confirm")
|
||||||
public String auditIp(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditIp(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
HttpServletRequest request) {
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request
|
|
||||||
) {
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -148,15 +149,18 @@ public class WhiteListController extends CommonController{
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "updateIpValid" })
|
@RequestMapping(value = { "updateIpValid" })
|
||||||
@RequiresPermissions(value = { "whitelist:ip:config" })
|
@RequiresPermissions(value = { "whitelist:ip:config" })
|
||||||
public String updateIpCfgValid(Integer isValid, String ids, Integer functionId) {
|
public String updateIpCfgValid(Integer isValid, String ids, Integer functionId) {
|
||||||
ipCfgService.updateIpCfgValid(isValid, ids, functionId);
|
ipCfgService.updateIpCfgValid(isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "domain/list" })
|
@RequestMapping(value = { "domain/list" })
|
||||||
// @RequiresPermissions(value={"whitelist:domain:config","whitelist:domain:confirm","whitelist:domain:aduit"},logical=Logical.OR)
|
// @RequiresPermissions(value={"whitelist:domain:config","whitelist:domain:confirm","whitelist:domain:aduit"},logical=Logical.OR)
|
||||||
public String domainList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String domainList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = domainService.getDomainList(searchPage, cfg);
|
Page<CfgIndexInfo> page = domainService.getDomainList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
@@ -165,10 +169,12 @@ public class WhiteListController extends CommonController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "saveHttpUrlCfgs" })
|
@RequestMapping(value = { "saveHttpUrlCfgs" })
|
||||||
public String saveHttpUrlCfgs(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,CfgIndexInfo entity) {
|
public String saveHttpUrlCfgs(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
CfgIndexInfo entity) {
|
||||||
if (!StringUtil.isEmpty(entity) && !StringUtil.isEmpty(entity.getHttpUrlList())) {
|
if (!StringUtil.isEmpty(entity) && !StringUtil.isEmpty(entity.getHttpUrlList())) {
|
||||||
|
|
||||||
CfgIndexInfo sourceCfg=websiteCfgService.getCfgIndexInfo(entity.getHttpUrlList().get(0).getSourceCompileId());
|
CfgIndexInfo sourceCfg = websiteCfgService
|
||||||
|
.getCfgIndexInfo(entity.getHttpUrlList().get(0).getSourceCompileId());
|
||||||
for (HttpUrlCfg httpUrlCfg : entity.getHttpUrlList()) {
|
for (HttpUrlCfg httpUrlCfg : entity.getHttpUrlList()) {
|
||||||
CfgIndexInfo cfg = new CfgIndexInfo();
|
CfgIndexInfo cfg = new CfgIndexInfo();
|
||||||
List httpList = new ArrayList<>();
|
List httpList = new ArrayList<>();
|
||||||
@@ -206,11 +212,14 @@ public class WhiteListController extends CommonController{
|
|||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/whitelist/domainForm";
|
return "/cfg/whitelist/domainForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "domain/save" })
|
@RequestMapping(value = { "domain/save" })
|
||||||
public String saveOrUpdateDomain(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
public String saveOrUpdateDomain(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
String ids, CfgIndexInfo entity) {
|
||||||
domainService.saveDomainCfg(entity);
|
domainService.saveDomainCfg(entity);
|
||||||
return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "domain/ajaxSubList" })
|
@RequestMapping(value = { "domain/ajaxSubList" })
|
||||||
public String ajaxDomainSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxDomainSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
CfgIndexInfo cfg = domainService.getDomainCfg(cfgId, compileId);
|
CfgIndexInfo cfg = domainService.getDomainCfg(cfgId, compileId);
|
||||||
@@ -238,12 +247,14 @@ public class WhiteListController extends CommonController{
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/whitelist/domianSubList";
|
return "/cfg/whitelist/domianSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "domain/updateValid" })
|
@RequestMapping(value = { "domain/updateValid" })
|
||||||
@RequiresPermissions(value = { "whitelist:domain:config" })
|
@RequiresPermissions(value = { "whitelist:domain:config" })
|
||||||
public String updateDomainValid(Integer isValid, String ids, Integer functionId) {
|
public String updateDomainValid(Integer isValid, String ids, Integer functionId) {
|
||||||
domainService.updateDomainCfgValid(isValid, ids, functionId);
|
domainService.updateDomainCfgValid(isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "domain/delete" })
|
@RequestMapping(value = { "domain/delete" })
|
||||||
@RequiresPermissions("whitelist:domain:config")
|
@RequiresPermissions("whitelist:domain:config")
|
||||||
public String deleteDomain(String ids, Integer functionId, RedirectAttributes model) {
|
public String deleteDomain(String ids, Integer functionId, RedirectAttributes model) {
|
||||||
@@ -259,13 +270,8 @@ public class WhiteListController extends CommonController{
|
|||||||
|
|
||||||
@RequestMapping(value = { "domain/audit" })
|
@RequestMapping(value = { "domain/audit" })
|
||||||
@RequiresPermissions("whitelist:domain:confirm")
|
@RequiresPermissions("whitelist:domain:confirm")
|
||||||
public String auditDomain(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditDomain(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
@@ -312,19 +318,25 @@ public class WhiteListController extends CommonController{
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ip配置导入
|
// ip配置导入
|
||||||
/*@RequestMapping(value = "ip/import", method=RequestMethod.POST)
|
/*
|
||||||
public String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
* @RequestMapping(value = "ip/import", method=RequestMethod.POST) public
|
||||||
@RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
* String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||||
this._importIp(cfgName,redirectAttributes, file,cfg,WhiteListIpTemplate.class);
|
*
|
||||||
return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+cfg.getFunctionId();
|
* @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||||
}*/
|
* this._importIp(cfgName,redirectAttributes,
|
||||||
|
* file,cfg,WhiteListIpTemplate.class); return "redirect:" + adminPath
|
||||||
|
* +"/ntc/whitelist/ip/list?functionId="+cfg.getFunctionId(); }
|
||||||
|
*/
|
||||||
// ip模板下载
|
// ip模板下载
|
||||||
@RequestMapping(value = "ip/import/template")
|
@RequestMapping(value = "ip/import/template")
|
||||||
public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
|
public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
|
||||||
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
|
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
|
||||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,WhiteListIpTemplate.class);
|
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,
|
||||||
|
WhiteListIpTemplate.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ip配置导出
|
// ip配置导出
|
||||||
@RequestMapping(value = "ip/export")
|
@RequestMapping(value = "ip/export")
|
||||||
public void exportIp(String columns, Model model, HttpServletRequest request, HttpServletResponse response,
|
public void exportIp(String columns, Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@@ -364,6 +376,21 @@ public class WhiteListController extends CommonController{
|
|||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||||
@@ -374,13 +401,24 @@ public class WhiteListController extends CommonController{
|
|||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
dataMap.put("NTC_IP", ipList);
|
dataMap.put("NTC_IP", ipList);
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("ip white export failed", e);
|
logger.error("ip white export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ip配置导出
|
// ip配置导出
|
||||||
@RequestMapping(value = "exportdomain")
|
@RequestMapping(value = "exportdomain")
|
||||||
public void exportdomain(Model model, HttpServletRequest request, HttpServletResponse response,
|
public void exportdomain(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@@ -414,6 +452,21 @@ public class WhiteListController extends CommonController{
|
|||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_HTTP_URL", httpUrlInfoNoExport);
|
noExportMap.put("NTC_HTTP_URL", httpUrlInfoNoExport);
|
||||||
List<BaseStringCfg> httpurlList = new ArrayList<BaseStringCfg>();
|
List<BaseStringCfg> httpurlList = new ArrayList<BaseStringCfg>();
|
||||||
@@ -425,12 +478,22 @@ public class WhiteListController extends CommonController{
|
|||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
dataMap.put("NTC_HTTP_URL", httpurlList);
|
dataMap.put("NTC_HTTP_URL", httpurlList);
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("ip white export failed", e);
|
logger.error("ip white export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,39 +3,27 @@ package com.nis.web.controller.configuration.proxy;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.beanutils.BeanUtils;
|
import org.apache.commons.beanutils.BeanUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.shiro.authz.annotation.Logical;
|
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
import com.nis.domain.FunctionRegionDict;
|
|
||||||
import com.nis.domain.FunctionServiceDict;
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.callback.ProxyFileStrategyCfg;
|
|
||||||
import com.nis.domain.configuration.BaseStringCfg;
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.domain.configuration.CachePolicyUserRegion;
|
||||||
import com.nis.domain.configuration.CfgIndexInfo;
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||||
import com.nis.domain.configuration.FileDigestCfg;
|
|
||||||
import com.nis.domain.configuration.HttpBodyCfg;
|
|
||||||
import com.nis.domain.configuration.HttpReqHeadCfg;
|
|
||||||
import com.nis.domain.configuration.HttpResHeadCfg;
|
|
||||||
import com.nis.domain.configuration.HttpUrlCfg;
|
import com.nis.domain.configuration.HttpUrlCfg;
|
||||||
import com.nis.domain.configuration.IpPortCfg;
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
@@ -43,7 +31,6 @@ import com.nis.util.StringUtil;
|
|||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
import com.nis.web.security.UserUtils;
|
import com.nis.web.security.UserUtils;
|
||||||
|
|
||||||
import jersey.repackaged.com.google.common.collect.Lists;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* http重定向策略
|
* http重定向策略
|
||||||
@@ -233,166 +220,90 @@ public class CachePolicyController extends BaseController{
|
|||||||
|
|
||||||
|
|
||||||
//http配置导出
|
//http配置导出
|
||||||
/*@RequestMapping(value = "exportHttp")
|
@RequestMapping(value = "exportCache")
|
||||||
public String exportHttp(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportdomain(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg")CachePolicyUserRegion entity,String ids,RedirectAttributes redirectAttributes){
|
||||||
try {
|
try {
|
||||||
//export data info
|
//export data info
|
||||||
List<String> titleList=new ArrayList<String>();
|
List<String> titleList=new ArrayList<String>();
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap=new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
List<CachePolicyUserRegion> ipLists = new ArrayList<CachePolicyUserRegion>();
|
||||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
|
||||||
|
|
||||||
// 导出选中记录
|
// 导出选中记录
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
for(String id:ids.split(",")){
|
ipLists = cachePolicyService.getCachePolicyByUserRegionList(ids);
|
||||||
Long.parseLong(id);
|
|
||||||
}
|
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
|
||||||
} else {
|
} else {
|
||||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
Page<CachePolicyUserRegion> pageInfo=new Page<CachePolicyUserRegion>(request, response,"a");
|
||||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
|
||||||
if(pageInfo.getCount()>Constants.MAX_EXPORT_SIZE){
|
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
}else{
|
Page<CachePolicyUserRegion> page = cachePolicyService.getCachePolicyUserRegionList(pageInfo, entity);
|
||||||
pageInfo.setPageNo(1);
|
ipLists = page.getList();
|
||||||
pageInfo.setPageSize(-1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Page<CfgIndexInfo> page = cachePolicyService.getCachePolicyList(pageInfo, entity);
|
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||||
Properties prop = getMsgProp();
|
Properties msgProp = getMsgProp();
|
||||||
for (CfgIndexInfo str : page.getList()) {
|
for (CachePolicyUserRegion cache : ipLists) {
|
||||||
if(entity.getFunctionId()!=210 && entity.getFunctionId()!=211){
|
for (FunctionServiceDict service : serviceList) {
|
||||||
String type="RESPONSE_CODE";
|
if(cache.getAction().intValue()==service.getAction().intValue()){
|
||||||
if(entity.getFunctionId()==207){
|
cache.setActionCode(msgProp.getProperty(service.getActionCode(),service.getActionCode()));
|
||||||
type="RESPONSE_CODE";
|
|
||||||
}else if(entity.getFunctionId()==208){
|
|
||||||
type="REDIRECT_RESPONSE_CODE";
|
|
||||||
}else if(entity.getFunctionId()==209){
|
|
||||||
type="CONTROL_REPLACE_ZONE";
|
|
||||||
}
|
|
||||||
String dictlabel= DictUtils.getDictLabel(type, str.getUserRegion1());
|
|
||||||
str.setUserRegion1(prop.getProperty(dictlabel));
|
|
||||||
if(entity.getFunctionId()==207 || entity.getFunctionId()==208){
|
|
||||||
if(StringUtil.isEmpty(str.getUserRegion2())){
|
|
||||||
if(!StringUtil.isEmpty(str.getUserRegion3())){
|
|
||||||
ProxyFileStrategyCfg file= new ProxyFileStrategyCfg();
|
|
||||||
file.setCompileId(Integer.valueOf(str.getUserRegion3()));
|
|
||||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(file);
|
|
||||||
if(allProxyFileStrategys!=null && allProxyFileStrategys.size()>0){
|
|
||||||
str.setUserRegion2(allProxyFileStrategys.get(0).getCfgDesc());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
|
||||||
if(entity.getFunctionId()==207){
|
|
||||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:response_code-userregion2:response_content-";
|
|
||||||
}else if(entity.getFunctionId()==208){
|
|
||||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:redirect_response_code-userregion2:redirect_url-";
|
|
||||||
}else if(entity.getFunctionId()==209){
|
|
||||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-";
|
|
||||||
}else if(entity.getFunctionId()==211){
|
|
||||||
cfgIndexInfoNoExport=",do_log,log_total,policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
|
||||||
}
|
|
||||||
String httpUrlCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
|
||||||
String httpReqHeadCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
|
||||||
String httpResHeadCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
|
||||||
String httpReqBodyCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
|
||||||
String httpResBodyCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
|
||||||
String ipPortCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
|
||||||
String ntcSubscribeIdCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
|
||||||
List<BaseStringCfg> httpUrlList = new ArrayList<>();
|
|
||||||
List<ComplexkeywordCfg> httpReqHdrList = new ArrayList<>();
|
|
||||||
List<ComplexkeywordCfg> httpResHdrList = new ArrayList<>();
|
|
||||||
List<BaseStringCfg> httpReqBodyList = new ArrayList<>();
|
|
||||||
List<BaseStringCfg> httpResBodyList = new ArrayList<>();
|
|
||||||
List<IpPortCfg> ipPortList = new ArrayList<>();
|
|
||||||
List<BaseStringCfg> subscribeIdList = new ArrayList<>();
|
|
||||||
for (CfgIndexInfo cfg : page.getList()) {
|
|
||||||
Map<String, List> maps=cachePolicyService.exportCachePolicy(cfg);
|
|
||||||
httpUrlList.addAll(maps.get("NTC_HTTP_URL"));
|
|
||||||
httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR"));
|
|
||||||
httpResHdrList.addAll(maps.get("NTC_HTTP_RES_HDR"));
|
|
||||||
httpReqBodyList.addAll(maps.get("NTC_HTTP_REQ_BODY"));
|
|
||||||
httpResBodyList.addAll(maps.get("NTC_HTTP_RES_BODY"));
|
|
||||||
ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
|
||||||
subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID"));
|
|
||||||
}
|
|
||||||
httpUrlList=BaseStringCfg.replaceBaseKeyList(httpUrlList);
|
|
||||||
httpReqHdrList=ComplexkeywordCfg.replaceComplexKeyList(httpReqHdrList);
|
|
||||||
httpResHdrList=ComplexkeywordCfg.replaceComplexKeyList(httpResHdrList);
|
|
||||||
httpReqBodyList=BaseStringCfg.replaceBaseKeyList(httpReqBodyList);
|
|
||||||
httpResBodyList=BaseStringCfg.replaceBaseKeyList(httpResBodyList);
|
|
||||||
subscribeIdList=BaseStringCfg.baseHexList(subscribeIdList);
|
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
titleList.add("NTC_HTTP_URL");
|
titleList.add("PXY_CACHE_HTTP_URL");
|
||||||
titleList.add("NTC_HTTP_REQ_HDR");
|
titleList.add("PXY_CACHE_HTTP_COOKIE");
|
||||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
classMap.put(entity.getMenuNameCode(), CachePolicyUserRegion.class);
|
||||||
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
classMap.put("PXY_CACHE_HTTP_URL", HttpUrlCfg.class);
|
||||||
classMap.put("NTC_HTTP_REQ_HDR", HttpReqHeadCfg.class);
|
classMap.put("PXY_CACHE_HTTP_COOKIE", HttpUrlCfg.class);
|
||||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
String cfgIndexInfoNoExport=",block_type,policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&action:block_type-";
|
||||||
noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport);
|
String httpUrlInfoNoExport=",block_type,do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||||
noExportMap.put("NTC_HTTP_REQ_HDR", httpReqHeadCfgNoExport);
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
+",letter,whether_area_block,classification,attribute,label"
|
||||||
dataMap.put("NTC_HTTP_URL", httpUrlList);
|
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList);
|
|
||||||
if(entity.getFunctionId()!=208 && entity.getFunctionId()!=211){
|
|
||||||
titleList.add("NTC_HTTP_RES_BODY");
|
|
||||||
classMap.put("NTC_HTTP_RES_BODY", HttpBodyCfg.class);
|
|
||||||
noExportMap.put("NTC_HTTP_RES_BODY", httpResBodyCfgNoExport);
|
|
||||||
dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList);
|
|
||||||
}else if(entity.getFunctionId()!=211){
|
|
||||||
titleList.add("NTC_HTTP_RES_HDR");
|
|
||||||
titleList.add("NTC_HTTP_REQ_BODY");
|
|
||||||
classMap.put("NTC_HTTP_RES_HDR", HttpResHeadCfg.class);
|
|
||||||
classMap.put("NTC_HTTP_REQ_BODY", HttpBodyCfg.class);
|
|
||||||
noExportMap.put("NTC_HTTP_RES_HDR", httpResHeadCfgNoExport);
|
|
||||||
noExportMap.put("NTC_HTTP_REQ_BODY", httpReqBodyCfgNoExport);
|
|
||||||
dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList);
|
|
||||||
dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList);
|
|
||||||
}
|
|
||||||
titleList.add("NTC_UNIVERSAL_IP");
|
|
||||||
titleList.add("NTC_SUBSCRIBE_ID");
|
|
||||||
classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class);
|
|
||||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
|
||||||
noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport);
|
|
||||||
noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
|
||||||
dataMap.put("NTC_UNIVERSAL_IP", ipPortList);
|
|
||||||
dataMap.put("NTC_SUBSCRIBE_ID",subscribeIdList);
|
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
|
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||||
|
noExportMap.put("PXY_CACHE_HTTP_URL", httpUrlInfoNoExport);
|
||||||
|
noExportMap.put("PXY_CACHE_HTTP_COOKIE", httpUrlInfoNoExport);
|
||||||
|
List<BaseStringCfg> urlList=new ArrayList<BaseStringCfg>();
|
||||||
|
List<BaseStringCfg> cookieList=new ArrayList<BaseStringCfg>();
|
||||||
|
for (CachePolicyUserRegion cfg : ipLists) {
|
||||||
|
Map<String, List> maps=cachePolicyService.getExport(Long.valueOf(cfg.getCfgId()));
|
||||||
|
urlList.addAll(maps.get("PXY_CACHE_HTTP_URL"));
|
||||||
|
cookieList.addAll(maps.get("PXY_CACHE_HTTP_COOKIE"));
|
||||||
|
}
|
||||||
|
urlList=BaseStringCfg.replaceBaseKeyList(urlList);
|
||||||
|
cookieList=BaseStringCfg.replaceBaseKeyList(cookieList);
|
||||||
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
|
dataMap.put("PXY_CACHE_HTTP_URL", urlList);
|
||||||
|
dataMap.put("PXY_CACHE_HTTP_COOKIE", cookieList);
|
||||||
|
/*}*/
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
}
|
}
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("http export failed",e);
|
logger.error("ip white export failed",e);
|
||||||
addMessage(redirectAttributes, "export_failed");
|
addMessage(redirectAttributes,"error", "export_failed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId();
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,32 +44,34 @@ import jersey.repackaged.com.google.common.collect.Lists;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* http重定向策略
|
* http重定向策略
|
||||||
|
*
|
||||||
* @author zhangwei
|
* @author zhangwei
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/proxy/control/httpRedirect")
|
@RequestMapping("${adminPath}/proxy/control/httpRedirect")
|
||||||
public class HttpRedirectPolicyController extends BaseController {
|
public class HttpRedirectPolicyController extends BaseController {
|
||||||
@RequestMapping(value = {"httpRedirectList","httpBlockList","httpReplaceList","httpMonitList","httpWhitelistList"})
|
@RequestMapping(value = { "httpRedirectList", "httpBlockList", "httpReplaceList", "httpMonitList",
|
||||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg){
|
"httpWhitelistList", ""})
|
||||||
|
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
@ModelAttribute("cfg") CfgIndexInfo cfg) {
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(searchPage, cfg);
|
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, cfg);
|
initPageCondition(model, cfg);
|
||||||
// 获取所有的响应文件内容,阻断,或重定向时可以选择
|
// 获取所有的响应文件内容,阻断,或重定向时可以选择
|
||||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService
|
||||||
|
.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
||||||
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);
|
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);
|
||||||
return "/cfg/proxy/control/httpRedirectList";
|
return "/cfg/proxy/control/httpRedirectList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "form" })
|
@RequestMapping(value = { "form" })
|
||||||
@RequiresPermissions(value={"control:httpBlock:config"
|
@RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config",
|
||||||
,"control:httpRedirect:config"
|
"control:httpReplace:config", "control:httpMinit:config",
|
||||||
,"control:httpReplace:config"
|
"control:httpWhitelist:config" }, logical = Logical.OR)
|
||||||
,"control:httpMinit:config"
|
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
,"control:httpWhitelist:config"
|
@ModelAttribute("cfg") CfgIndexInfo entity) {
|
||||||
}
|
|
||||||
,logical=Logical.OR)
|
|
||||||
public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")CfgIndexInfo entity){
|
|
||||||
if (StringUtils.isNotBlank(ids)) {
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(ids), null);
|
entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(ids), null);
|
||||||
|
|
||||||
@@ -169,19 +171,17 @@ public class HttpRedirectPolicyController extends BaseController{
|
|||||||
initFormCondition(model, entity);
|
initFormCondition(model, entity);
|
||||||
}
|
}
|
||||||
// 获取所有的响应文件内容,阻断,或重定向时可以选择
|
// 获取所有的响应文件内容,阻断,或重定向时可以选择
|
||||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService
|
||||||
|
.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);
|
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);
|
||||||
return "/cfg/proxy/control/httpRedirectForm";
|
return "/cfg/proxy/control/httpRedirectForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "saveOrUpdate" })
|
@RequestMapping(value = { "saveOrUpdate" })
|
||||||
@RequiresPermissions(value={"control:httpBlock:config"
|
@RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config",
|
||||||
,"control:httpRedirect:config"
|
"control:httpReplace:config", "control:httpMinit:config",
|
||||||
,"control:httpReplace:config"
|
"control:httpWhitelist:config" }, logical = Logical.OR)
|
||||||
,"control:httpMinit:config"
|
|
||||||
,"control:httpWhitelist:config"}
|
|
||||||
,logical=Logical.OR)
|
|
||||||
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
@ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
@@ -197,8 +197,10 @@ public class HttpRedirectPolicyController extends BaseController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+cfg.getFunctionId();
|
return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId="
|
||||||
|
+ cfg.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "ajaxHttpSubList" })
|
@RequestMapping(value = { "ajaxHttpSubList" })
|
||||||
public String ajaxHttpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxHttpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
CfgIndexInfo cfg = httpRedirectCfgService.getHttpCfg(cfgId, compileId);
|
CfgIndexInfo cfg = httpRedirectCfgService.getHttpCfg(cfgId, compileId);
|
||||||
@@ -206,31 +208,22 @@ public class HttpRedirectPolicyController extends BaseController{
|
|||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
return "/cfg/proxy/control/httpRedirectSubList";
|
return "/cfg/proxy/control/httpRedirectSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "delete" })
|
@RequestMapping(value = { "delete" })
|
||||||
@RequiresPermissions(value={"control:httpBlock:config"
|
@RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config",
|
||||||
,"control:httpRedirect:config"
|
"control:httpReplace:config", "control:httpMinit:config",
|
||||||
,"control:httpReplace:config"
|
"control:httpWhitelist:config" }, logical = Logical.OR)
|
||||||
,"control:httpMinit:config"
|
|
||||||
,"control:httpWhitelist:config"}
|
|
||||||
,logical=Logical.OR)
|
|
||||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId) {
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId) {
|
||||||
httpRedirectCfgService.updateHttpCfgValid(isValid, ids, functionId);
|
httpRedirectCfgService.updateHttpCfgValid(isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "audit" })
|
@RequestMapping(value = { "audit" })
|
||||||
@RequiresPermissions(value={"control:httpBlock:confirm"
|
@RequiresPermissions(value = { "control:httpBlock:confirm", "control:httpRedirect:confirm",
|
||||||
,"control:httpRedirect:confirm"
|
"control:httpReplace:confirm", "control:httpMinit:confirm",
|
||||||
,"control:httpReplace:confirm"
|
"control:httpWhitelist:confirm" }, logical = Logical.OR)
|
||||||
,"control:httpMinit:confirm"
|
public String audit(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
,"control:httpWhitelist:confirm"}
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
,logical=Logical.OR)
|
|
||||||
public String audit(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
|
||||||
Integer isValid,
|
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
@@ -278,7 +271,6 @@ public class HttpRedirectPolicyController extends BaseController{
|
|||||||
return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// http配置导出
|
// http配置导出
|
||||||
@RequestMapping(value = "exportHttp")
|
@RequestMapping(value = "exportHttp")
|
||||||
public void exportHttp(Model model, HttpServletRequest request, HttpServletResponse response,
|
public void exportHttp(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@@ -322,7 +314,8 @@ public class HttpRedirectPolicyController extends BaseController{
|
|||||||
if (!StringUtil.isEmpty(str.getUserRegion3())) {
|
if (!StringUtil.isEmpty(str.getUserRegion3())) {
|
||||||
ProxyFileStrategyCfg file = new ProxyFileStrategyCfg();
|
ProxyFileStrategyCfg file = new ProxyFileStrategyCfg();
|
||||||
file.setCompileId(Integer.valueOf(str.getUserRegion3()));
|
file.setCompileId(Integer.valueOf(str.getUserRegion3()));
|
||||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(file);
|
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService
|
||||||
|
.getProxyFileStrategyCfgList(file);
|
||||||
if (allProxyFileStrategys != null && allProxyFileStrategys.size() > 0) {
|
if (allProxyFileStrategys != null && allProxyFileStrategys.size() > 0) {
|
||||||
str.setUserRegion2(allProxyFileStrategys.get(0).getCfgDesc());
|
str.setUserRegion2(allProxyFileStrategys.get(0).getCfgDesc());
|
||||||
}
|
}
|
||||||
@@ -369,6 +362,21 @@ public class HttpRedirectPolicyController extends BaseController{
|
|||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
List<BaseStringCfg> httpUrlList = new ArrayList<>();
|
List<BaseStringCfg> httpUrlList = new ArrayList<>();
|
||||||
List<ComplexkeywordCfg> httpReqHdrList = new ArrayList<>();
|
List<ComplexkeywordCfg> httpReqHdrList = new ArrayList<>();
|
||||||
List<ComplexkeywordCfg> httpResHdrList = new ArrayList<>();
|
List<ComplexkeywordCfg> httpResHdrList = new ArrayList<>();
|
||||||
@@ -429,11 +437,23 @@ public class HttpRedirectPolicyController extends BaseController{
|
|||||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList);
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList);
|
||||||
|
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("http export failed", e);
|
logger.error("http export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
/*return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId();*/
|
/*
|
||||||
|
* return "redirect:" + adminPath
|
||||||
|
* +"/ntc/website/httpList?functionId="+entity.getFunctionId();
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.PolicyGroupInfo;
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
import com.nis.domain.configuration.BaseStringCfg;
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
@@ -27,6 +26,7 @@ import com.nis.domain.configuration.HttpUrlCfg;
|
|||||||
import com.nis.domain.configuration.InterceptPktBin;
|
import com.nis.domain.configuration.InterceptPktBin;
|
||||||
import com.nis.domain.configuration.IpPortCfg;
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.configuration.PxyObjKeyring;
|
import com.nis.domain.configuration.PxyObjKeyring;
|
||||||
|
import com.nis.domain.configuration.PxyObjSpoofingIpPool;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
@@ -36,6 +36,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* IP相关配置控制类
|
* IP相关配置控制类
|
||||||
|
*
|
||||||
* @author dell
|
* @author dell
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -44,7 +45,8 @@ import com.nis.web.security.UserUtils;
|
|||||||
public class InterceptController extends CommonController {
|
public class InterceptController extends CommonController {
|
||||||
|
|
||||||
@RequestMapping(value = { "/ip/list", "/domain/list", "/ippayload/list" })
|
@RequestMapping(value = { "/ip/list", "/domain/list", "/ippayload/list" })
|
||||||
public String ipList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String ipList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
|
HttpServletResponse response) {
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
@@ -59,11 +61,21 @@ public class InterceptController extends CommonController{
|
|||||||
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
||||||
}
|
}
|
||||||
model.addAttribute("certificateList", certificateList);
|
model.addAttribute("certificateList", certificateList);
|
||||||
|
/*if(cfg.getFunctionId().equals(214)){
|
||||||
// IP地址仿冒策略使用策略组
|
// IP地址仿冒策略使用策略组
|
||||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(6);
|
//List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
List<CfgIndexInfo> list = page.getList();
|
||||||
|
for(CfgIndexInfo c:list){
|
||||||
|
Long cfgId = Long.parseLong(c.getUserRegion2());//user_region2字段存储的为IP仿冒池的ID信息(策略组ID)
|
||||||
|
PxyObjSpoofingIpPool pool = pxyObjSpoofingIpPoolService.getPxyObjSpoofingIpPool(cfgId);
|
||||||
|
c.setUserRegion2(pool.getGroupName());//将IP仿冒池的策略组名重新赋给user_region2
|
||||||
|
}
|
||||||
|
|
||||||
|
// model.addAttribute("policyGroups", policyGroups);
|
||||||
|
}*/
|
||||||
return "/cfg/intercept/interceptList";
|
return "/cfg/intercept/interceptList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/interceptIpForm", "interceptDomainForm", "interceptIpPayloadForm" })
|
@RequestMapping(value = { "/interceptIpForm", "interceptDomainForm", "interceptIpPayloadForm" })
|
||||||
public String interceptIpForm(Model model, String ids, CfgIndexInfo entity) {
|
public String interceptIpForm(Model model, String ids, CfgIndexInfo entity) {
|
||||||
if (StringUtils.isNotBlank(ids)) {
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
@@ -84,13 +96,16 @@ public class InterceptController extends CommonController{
|
|||||||
|
|
||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
// IP地址仿冒策略使用策略组
|
// IP地址仿冒策略使用策略组
|
||||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(6);
|
// List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
// List<PxyObjSpoofingIpPool> pools = pxyObjSpoofingIpPoolService.findPxyObjSpoofingIpPools(new PxyObjSpoofingIpPool());
|
||||||
|
// model.addAttribute("policyGroups", pools);
|
||||||
|
|
||||||
return "/cfg/intercept/interceptForm";
|
return "/cfg/intercept/interceptForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/ip/saveOrUpdate", "/domain/saveOrUpdate", "/ippayload/SaveOrUpdate" })
|
@RequestMapping(value = { "/ip/saveOrUpdate", "/domain/saveOrUpdate", "/ippayload/SaveOrUpdate" })
|
||||||
public String saveInterceptIpCfg(RedirectAttributes redirectAttributes,Model model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
public String saveInterceptIpCfg(RedirectAttributes redirectAttributes, Model model, HttpServletRequest request,
|
||||||
|
HttpServletResponse response, String ids, CfgIndexInfo entity) {
|
||||||
try {
|
try {
|
||||||
interceptCfgService.saveInterceptCfg(entity);
|
interceptCfgService.saveInterceptCfg(entity);
|
||||||
addMessage(redirectAttributes, "success", "save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
@@ -105,7 +120,8 @@ public class InterceptController extends CommonController{
|
|||||||
return "redirect:" + adminPath + "/proxy/intercept/ip/list?functionId=" + entity.getFunctionId();
|
return "redirect:" + adminPath + "/proxy/intercept/ip/list?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/ajaxInterceptIpSubList","/ajaxInterceptDomainSubList","/ajaxInterceptIpPayloadSubList"})
|
@RequestMapping(value = { "/ajaxInterceptIpSubList", "/ajaxInterceptDomainSubList",
|
||||||
|
"/ajaxInterceptIpPayloadSubList" })
|
||||||
public String ajaxInterceptIpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
public String ajaxInterceptIpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
CfgIndexInfo cfg = interceptCfgService.getInterceptCfg(cfgId, compileId);
|
CfgIndexInfo cfg = interceptCfgService.getInterceptCfg(cfgId, compileId);
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
@@ -143,14 +159,9 @@ public class InterceptController extends CommonController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "auditInterceptIpCfg", "auditInterceptDomainCfg", "auditInterceptIpPayloadCfg" })
|
@RequestMapping(value = { "auditInterceptIpCfg", "auditInterceptDomainCfg", "auditInterceptIpPayloadCfg" })
|
||||||
public String auditInterceptIpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditInterceptIpCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid,
|
||||||
Integer isValid,
|
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
Integer isAudit,
|
HttpServletResponse response, HttpServletRequest request) {
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -196,7 +207,8 @@ public class InterceptController extends CommonController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "updateInterceptIpValid", "updateInterceptDomainValid", "updateInterceptIpPayloadValid" })
|
@RequestMapping(value = { "updateInterceptIpValid", "updateInterceptDomainValid", "updateInterceptIpPayloadValid" })
|
||||||
public String updateInterceptIpValid(Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
public String updateInterceptIpValid(Integer isValid, String ids, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
interceptCfgService.updatInterceptValid(isValid, ids, functionId);
|
interceptCfgService.updatInterceptValid(isValid, ids, functionId);
|
||||||
addMessage(redirectAttributes, "success", "delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
@@ -208,26 +220,34 @@ public class InterceptController extends CommonController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//ip配置导入
|
* //ip配置导入
|
||||||
@RequestMapping(value = "/ip/import", method=RequestMethod.POST)
|
*
|
||||||
public String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
* @RequestMapping(value = "/ip/import", method=RequestMethod.POST) public
|
||||||
@RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
* String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||||
this._importIp(cfgName,redirectAttributes, file,cfg,IpAddrTemplate.class);
|
*
|
||||||
redirectAttributes.addAttribute("urlPrefix","/proxy/intercept/ip");
|
* @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||||
redirectAttributes.addAttribute("requiresPermissionPrefix","intercept:ip");
|
* this._importIp(cfgName,redirectAttributes,
|
||||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId();
|
* file,cfg,IpAddrTemplate.class);
|
||||||
}
|
* redirectAttributes.addAttribute("urlPrefix","/proxy/intercept/ip");
|
||||||
@RequestMapping(value = "/ip/import/template")
|
* redirectAttributes.addAttribute("requiresPermissionPrefix","intercept:ip"
|
||||||
public void importFileTemplate(HttpServletRequest request,HttpServletResponse response,
|
* ); return "redirect:" + adminPath
|
||||||
RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
|
* +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId(); }
|
||||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,IpAddrTemplate.class);
|
*
|
||||||
}
|
* @RequestMapping(value = "/ip/import/template") public void
|
||||||
//ip配置导出
|
* importFileTemplate(HttpServletRequest request,HttpServletResponse
|
||||||
@RequestMapping(value = "/ip/export")
|
* response, RedirectAttributes redirectAttributes,Integer
|
||||||
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
|
* functionId,Integer cfgRegionCode) { this._importFileTemplate(request,
|
||||||
@ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){
|
* response, redirectAttributes, functionId,
|
||||||
this._exportIp(columns,model, request, response, entity, ids, redirectAttributes);
|
* cfgRegionCode,IpAddrTemplate.class); } //ip配置导出
|
||||||
}*/
|
*
|
||||||
|
* @RequestMapping(value = "/ip/export") public void exportIp(String
|
||||||
|
* columns,Model model,HttpServletRequest request,HttpServletResponse
|
||||||
|
* response,
|
||||||
|
*
|
||||||
|
* @ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes
|
||||||
|
* redirectAttributes){ this._exportIp(columns,model, request, response,
|
||||||
|
* entity, ids, redirectAttributes); }
|
||||||
|
*/
|
||||||
|
|
||||||
// ip配置导出
|
// ip配置导出
|
||||||
@RequestMapping(value = "exportIpAddr")
|
@RequestMapping(value = "exportIpAddr")
|
||||||
@@ -324,27 +344,53 @@ public class InterceptController extends CommonController{
|
|||||||
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
||||||
dataMap.put("PXY_INTERCEPT_PKT_BIN", pktBinList);
|
dataMap.put("PXY_INTERCEPT_PKT_BIN", pktBinList);
|
||||||
} else if (entity.getFunctionId() == 200) {// IP拦截
|
} else if (entity.getFunctionId() == 200) {// IP拦截
|
||||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion2:ratelimit-userregion1:certificate-";
|
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,userregion2,&userregion1:intercept_file_strategy-";
|
||||||
titleList.add("PXY_INTERCEPT_IP");
|
titleList.add("PXY_INTERCEPT_IP");
|
||||||
classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class);
|
classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class);
|
||||||
noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport);
|
noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport);
|
||||||
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
||||||
} else if (entity.getFunctionId() == 201) {// 域名拦截
|
} else if (entity.getFunctionId() == 201) {// 域名拦截
|
||||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,&userregion2:ratelimit-userregion1:certificate-userregion5:intercept_intensity-";
|
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,&userregion2:ratelimit-userregion1:intercept_file_strategy-userregion5:intercept_intensity-";
|
||||||
titleList.add("NTC_HTTP_URL");
|
titleList.add("NTC_HTTP_URL");
|
||||||
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
||||||
noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport);
|
noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport);
|
||||||
dataMap.put("NTC_HTTP_URL", httpUrlList);
|
dataMap.put("NTC_HTTP_URL", httpUrlList);
|
||||||
|
}else if(entity.getFunctionId()==214){
|
||||||
|
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion2:With-userregion1:Spoofing-";
|
||||||
}
|
}
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
|
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("ip addr export failed", e);
|
logger.error("ip addr export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ import com.nis.web.controller.BaseController;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 拦截策略
|
* 拦截策略
|
||||||
|
*
|
||||||
* @author ddm
|
* @author ddm
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -72,12 +73,8 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/form" })
|
@RequestMapping(value = { "/form" })
|
||||||
@RequiresPermissions(value = { "proxy:intercept:config" })
|
@RequiresPermissions(value = { "proxy:intercept:config" })
|
||||||
public String from(Model model,
|
public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
HttpServletRequest request,
|
@ModelAttribute("cfg") PxyObjKeyring cfg, RedirectAttributes redirectAttributes) {
|
||||||
HttpServletResponse response,
|
|
||||||
String ids,
|
|
||||||
@ModelAttribute("cfg")PxyObjKeyring cfg
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
if (cfg == null) {
|
if (cfg == null) {
|
||||||
cfg = new PxyObjKeyring();
|
cfg = new PxyObjKeyring();
|
||||||
}
|
}
|
||||||
@@ -97,9 +94,7 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
@RequestMapping(value = { "/saveOrUpdate" })
|
@RequestMapping(value = { "/saveOrUpdate" })
|
||||||
@RequiresPermissions(value = { "proxy:intercept:config" })
|
@RequiresPermissions(value = { "proxy:intercept:config" })
|
||||||
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")PxyObjKeyring cfg,
|
@ModelAttribute("cfg") PxyObjKeyring cfg, MultipartFile privateKeyFileI, MultipartFile publicKeyFileI,
|
||||||
MultipartFile privateKeyFileI,
|
|
||||||
MultipartFile publicKeyFileI,
|
|
||||||
RedirectAttributes redirectAttributes) {
|
RedirectAttributes redirectAttributes) {
|
||||||
File file = null;
|
File file = null;
|
||||||
boolean validFlag = true;
|
boolean validFlag = true;
|
||||||
@@ -109,10 +104,9 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
boolean privateKeyFileflag = validCertFileContent(privateKeyFileI, "-inkey");
|
boolean privateKeyFileflag = validCertFileContent(privateKeyFileI, "-inkey");
|
||||||
if (!publicKeyFileflag && !privateKeyFileflag) {
|
if (!publicKeyFileflag && !privateKeyFileflag) {
|
||||||
addMessage(redirectAttributes, "error", "save_failed");
|
addMessage(redirectAttributes, "error", "save_failed");
|
||||||
logger.error(publicKeyFileI.getOriginalFilename()+" and "+privateKeyFileI.getOriginalFilename()+" file non certificate file format ");
|
logger.error(publicKeyFileI.getOriginalFilename() + " and " + privateKeyFileI.getOriginalFilename()
|
||||||
throw new MultiPartNewException(
|
+ " file non certificate file format ");
|
||||||
msgProp.getProperty("certificate_error")
|
throw new MultiPartNewException(msgProp.getProperty("certificate_error"));
|
||||||
);
|
|
||||||
} else if (!publicKeyFileflag) {
|
} else if (!publicKeyFileflag) {
|
||||||
addMessage(redirectAttributes, "error", "save_failed");
|
addMessage(redirectAttributes, "error", "save_failed");
|
||||||
logger.error(publicKeyFileI.getOriginalFilename() + " file non public key file format ");
|
logger.error(publicKeyFileI.getOriginalFilename() + " file non public key file format ");
|
||||||
@@ -141,8 +135,10 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
// 获取公钥信息
|
// 获取公钥信息
|
||||||
if (certInfoMap != null && certInfoMap.size() > 0) {
|
if (certInfoMap != null && certInfoMap.size() > 0) {
|
||||||
|
|
||||||
String issuer=StringUtil.isEmpty(certInfoMap.get("ca issuer")) ? "":certInfoMap.get("ca issuer").toString();//颁发者
|
String issuer = StringUtil.isEmpty(certInfoMap.get("ca issuer")) ? ""
|
||||||
String subject=StringUtil.isEmpty(certInfoMap.get("ca subjectname")) ? "":certInfoMap.get("ca subjectname").toString();//颁发给
|
: certInfoMap.get("ca issuer").toString();// 颁发者
|
||||||
|
String subject = StringUtil.isEmpty(certInfoMap.get("ca subjectname")) ? ""
|
||||||
|
: certInfoMap.get("ca subjectname").toString();// 颁发给
|
||||||
String notBeforeStr = "";
|
String notBeforeStr = "";
|
||||||
if (!StringUtil.isEmpty(certInfoMap.get("ca notbefore"))) {
|
if (!StringUtil.isEmpty(certInfoMap.get("ca notbefore"))) {
|
||||||
Date notBeforeTime = new Date(certInfoMap.get("ca notbefore").toString());// 开始时间
|
Date notBeforeTime = new Date(certInfoMap.get("ca notbefore").toString());// 开始时间
|
||||||
@@ -164,7 +160,8 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String altName=StringUtil.isEmpty(certInfoMap.get("ca altname")) ? "":certInfoMap.get("ca altname").toString();//SAN
|
String altName = StringUtil.isEmpty(certInfoMap.get("ca altname")) ? ""
|
||||||
|
: certInfoMap.get("ca altname").toString();// SAN
|
||||||
|
|
||||||
cfg.setIssuer(issuer);
|
cfg.setIssuer(issuer);
|
||||||
cfg.setSubject(subject);
|
cfg.setSubject(subject);
|
||||||
@@ -211,7 +208,8 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
if (!StringUtil.isEmpty(result)) {
|
if (!StringUtil.isEmpty(result)) {
|
||||||
ResponseData data = result.getData();
|
ResponseData data = result.getData();
|
||||||
publicKeyFileAccessUrl = data.getAccessUrl();
|
publicKeyFileAccessUrl = data.getAccessUrl();
|
||||||
cfg.setPublicKeyFile(publicKeyFileAccessUrl);;
|
cfg.setPublicKeyFile(publicKeyFileAccessUrl);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (privateKeyFileI != null) {
|
if (privateKeyFileI != null) {
|
||||||
@@ -234,7 +232,8 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
if (!StringUtil.isEmpty(result)) {
|
if (!StringUtil.isEmpty(result)) {
|
||||||
ResponseData data = result.getData();
|
ResponseData data = result.getData();
|
||||||
privateKeyFileAccessUrl = data.getAccessUrl();
|
privateKeyFileAccessUrl = data.getAccessUrl();
|
||||||
cfg.setPrivateKeyFile(privateKeyFileAccessUrl);;
|
cfg.setPrivateKeyFile(privateKeyFileAccessUrl);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pxyObjKeyringService.saveOrUpdate(cfg);
|
pxyObjKeyringService.saveOrUpdate(cfg);
|
||||||
@@ -258,8 +257,10 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param file
|
* @param file
|
||||||
* @param validateType --incert证书校验 --inkey 私钥
|
* @param validateType
|
||||||
* @param certType 证书类型
|
* --incert证书校验 --inkey 私钥
|
||||||
|
* @param certType
|
||||||
|
* 证书类型
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@@ -269,19 +270,13 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
// 证书文件临时保存路径
|
// 证书文件临时保存路径
|
||||||
String certFilePath = Constants.CERT_FILE_PATH;
|
String certFilePath = Constants.CERT_FILE_PATH;
|
||||||
FileUtils.createDirectory(certFilePath);
|
FileUtils.createDirectory(certFilePath);
|
||||||
String filePath=certFilePath
|
String filePath = certFilePath + File.separator + UUID.randomUUID()
|
||||||
+File.separator
|
|
||||||
+UUID.randomUUID()
|
|
||||||
+ FileUtils.getSuffix(file.getOriginalFilename(), true);
|
+ FileUtils.getSuffix(file.getOriginalFilename(), true);
|
||||||
File uploadFile = new File(filePath);
|
File uploadFile = new File(filePath);
|
||||||
FileCopyUtils.copy(file.getBytes(), uploadFile);
|
FileCopyUtils.copy(file.getBytes(), uploadFile);
|
||||||
// 加载x509脚本
|
// 加载x509脚本
|
||||||
String x509Shell=Thread.currentThread()
|
String x509Shell = Thread.currentThread().getContextClassLoader()
|
||||||
.getContextClassLoader()
|
.getResource(File.separator + "shell" + File.separator + Constants.CERT_VALIDATE_FILE).getPath();
|
||||||
.getResource(
|
|
||||||
File.separator+"shell"
|
|
||||||
+File.separator
|
|
||||||
+Constants.CERT_VALIDATE_FILE).getPath();
|
|
||||||
// x509脚本分配可执行权限
|
// x509脚本分配可执行权限
|
||||||
Map<String, Object> resultMap1 = this.execShell("", "chmod", "+x", x509Shell);
|
Map<String, Object> resultMap1 = this.execShell("", "chmod", "+x", x509Shell);
|
||||||
logger.info("x509 chmod +x :" + resultMap1.get("out").toString());
|
logger.info("x509 chmod +x :" + resultMap1.get("out").toString());
|
||||||
@@ -296,15 +291,15 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
FileUtils.deleteFile(filePath);
|
FileUtils.deleteFile(filePath);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
/*logger.info("x509 Out Info:"+resultMap.get("out").toString());
|
/*
|
||||||
Pattern p = Pattern.compile("\\s*|\t|\r|\n");
|
* logger.info("x509 Out Info:"+resultMap.get("out").toString())
|
||||||
Matcher m = p.matcher(resultMap.get("out").toString());
|
* ; Pattern p = Pattern.compile("\\s*|\t|\r|\n"); Matcher m =
|
||||||
logger.info(m.replaceAll("test"));*/
|
* p.matcher(resultMap.get("out").toString());
|
||||||
|
* logger.info(m.replaceAll("test"));
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
if(resultMap != null
|
if (resultMap != null && !StringUtil.isEmpty(resultMap.get("out"))
|
||||||
&& !StringUtil.isEmpty(resultMap.get("out"))
|
&& (!(resultMap.get("out").toString().indexOf(Constants.CERT_VALIDATE_SUCCESS_INFO) > -1))) {
|
||||||
&& (!(resultMap.get("out").toString().indexOf(Constants.CERT_VALIDATE_SUCCESS_INFO) > -1))
|
|
||||||
){
|
|
||||||
logger.error("x509 Out Info:" + resultMap.get("out").toString());
|
logger.error("x509 Out Info:" + resultMap.get("out").toString());
|
||||||
// 临时文件删除
|
// 临时文件删除
|
||||||
logger.info("delete file" + filePath);
|
logger.info("delete file" + filePath);
|
||||||
@@ -318,12 +313,13 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/list" })
|
@RequestMapping(value = { "/list" })
|
||||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response
|
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,@ModelAttribute("cfg")PxyObjKeyring entity
|
@ModelAttribute("cfg") PxyObjKeyring entity, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
// 查询时left join policyGroup
|
// 查询时left join policyGroup
|
||||||
Page<PxyObjKeyring> page = pxyObjKeyringService.findPage(new Page<PxyObjKeyring>(request, response,"r"), entity);
|
Page<PxyObjKeyring> page = pxyObjKeyringService.findPage(new Page<PxyObjKeyring>(request, response, "r"),
|
||||||
|
entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/intercept/strateagy/list";
|
return "/cfg/intercept/strateagy/list";
|
||||||
@@ -331,10 +327,8 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/delete" })
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions(value = { "proxy:intercept:config" })
|
@RequiresPermissions(value = { "proxy:intercept:config" })
|
||||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
||||||
,Model model,HttpServletRequest request
|
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||||
,HttpServletResponse response
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
pxyObjKeyringService.delete(isAudit, isValid, ids, functionId);
|
pxyObjKeyringService.delete(isAudit, isValid, ids, functionId);
|
||||||
}
|
}
|
||||||
@@ -344,13 +338,8 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/audit" })
|
@RequestMapping(value = { "/audit" })
|
||||||
@RequiresPermissions(value = { "proxy:intercept:confirm" })
|
@RequiresPermissions(value = { "proxy:intercept:confirm" })
|
||||||
public String audit(Model model,@ModelAttribute("cfg")PxyObjKeyring cfg,
|
public String audit(Model model, @ModelAttribute("cfg") PxyObjKeyring cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
HttpServletRequest request) {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
@@ -390,6 +379,7 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/proxy/intercept/strateagy/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/proxy/intercept/strateagy/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = "/validCfgId")
|
@RequestMapping(value = "/validCfgId")
|
||||||
public boolean validCfgId(Long cfgId) {
|
public boolean validCfgId(Long cfgId) {
|
||||||
@@ -401,7 +391,6 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// pxyObjKeyring配置导出
|
// pxyObjKeyring配置导出
|
||||||
@RequestMapping(value = "exportPxy")
|
@RequestMapping(value = "exportPxy")
|
||||||
public void exportPxy(Model model, HttpServletRequest request, HttpServletResponse response,
|
public void exportPxy(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@@ -432,15 +421,40 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), PxyObjKeyring.class);
|
classMap.put(entity.getMenuNameCode(), PxyObjKeyring.class);
|
||||||
String cfgIndexInfoNoExport = ",config_describe,whether_area_block,block_type,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
String cfgIndexInfoNoExport = ",config_describe,whether_area_block,block_type,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("pxyObjKeyring export failed", e);
|
logger.error("pxyObjKeyring export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
// pxyObjTrustedCert配置导出
|
// pxyObjTrustedCert配置导出
|
||||||
@@ -472,23 +486,47 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), PxyObjTrustedCaCert.class);
|
classMap.put(entity.getMenuNameCode(), PxyObjTrustedCaCert.class);
|
||||||
String cfgIndexInfoNoExport = ",whether_area_block,block_type,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:cert_name-";
|
String cfgIndexInfoNoExport = ",whether_area_block,block_type,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:cert_name-";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
/* } */
|
/* } */
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("pxyObjKeyring export failed", e);
|
logger.error("pxyObjKeyring export failed", e);
|
||||||
addMessage(redirectAttributes, "error", "export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = { "/trustedCertList" })
|
@RequestMapping(value = { "/trustedCertList" })
|
||||||
public String trustedCertList(Model model,HttpServletRequest request,HttpServletResponse response
|
public String trustedCertList(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,@ModelAttribute("cfg")PxyObjTrustedCaCert entity
|
@ModelAttribute("cfg") PxyObjTrustedCaCert entity, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
Page<PxyObjTrustedCaCert> page = pxyObjKeyringService
|
||||||
Page<PxyObjTrustedCaCert> page = pxyObjKeyringService.findTrustedCertPage(new Page<PxyObjTrustedCaCert>(request, response,"r"), entity);
|
.findTrustedCertPage(new Page<PxyObjTrustedCaCert>(request, response, "r"), entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model, entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/intercept/strateagy/trustedCertList";
|
return "/cfg/intercept/strateagy/trustedCertList";
|
||||||
@@ -496,12 +534,8 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/trustedCertForm" })
|
@RequestMapping(value = { "/trustedCertForm" })
|
||||||
@RequiresPermissions(value = { "proxy:trustedCert:config" })
|
@RequiresPermissions(value = { "proxy:trustedCert:config" })
|
||||||
public String trustedCertFrom(Model model,
|
public String trustedCertFrom(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
HttpServletRequest request,
|
@ModelAttribute("cfg") PxyObjTrustedCaCert cfg, RedirectAttributes redirectAttributes) {
|
||||||
HttpServletResponse response,
|
|
||||||
String ids,
|
|
||||||
@ModelAttribute("cfg")PxyObjTrustedCaCert cfg
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
if (cfg == null) {
|
if (cfg == null) {
|
||||||
cfg = new PxyObjTrustedCaCert();
|
cfg = new PxyObjTrustedCaCert();
|
||||||
}
|
}
|
||||||
@@ -521,8 +555,7 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
@RequestMapping(value = { "/trustedCertSaveOrUpdate" })
|
@RequestMapping(value = { "/trustedCertSaveOrUpdate" })
|
||||||
@RequiresPermissions(value = { "proxy:trustedCert:config" })
|
@RequiresPermissions(value = { "proxy:trustedCert:config" })
|
||||||
public String trustedCertSaveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
public String trustedCertSaveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")PxyObjTrustedCaCert cfg,
|
@ModelAttribute("cfg") PxyObjTrustedCaCert cfg, MultipartFile certFileI,
|
||||||
MultipartFile certFileI,
|
|
||||||
RedirectAttributes redirectAttributes) {
|
RedirectAttributes redirectAttributes) {
|
||||||
File file = null;
|
File file = null;
|
||||||
boolean validFlag = true;
|
boolean validFlag = true;
|
||||||
@@ -549,7 +582,8 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
if (certFileI != null) {
|
if (certFileI != null) {
|
||||||
// 获取公钥信息
|
// 获取公钥信息
|
||||||
if (certInfoMap != null && certInfoMap.size() > 0) {
|
if (certInfoMap != null && certInfoMap.size() > 0) {
|
||||||
String issuer=StringUtil.isEmpty(certInfoMap.get("ca issuer")) ? "":certInfoMap.get("ca issuer").toString();//颁发者
|
String issuer = StringUtil.isEmpty(certInfoMap.get("ca issuer")) ? ""
|
||||||
|
: certInfoMap.get("ca issuer").toString();// 颁发者
|
||||||
logger.info("issuer:" + issuer);
|
logger.info("issuer:" + issuer);
|
||||||
cfg.setIssuer(issuer);
|
cfg.setIssuer(issuer);
|
||||||
} else {
|
} else {
|
||||||
@@ -584,7 +618,8 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
if (!StringUtil.isEmpty(result)) {
|
if (!StringUtil.isEmpty(result)) {
|
||||||
ResponseData data = result.getData();
|
ResponseData data = result.getData();
|
||||||
certFileAccessUrl = data.getAccessUrl();
|
certFileAccessUrl = data.getAccessUrl();
|
||||||
cfg.setCertFile(certFileAccessUrl);;
|
cfg.setCertFile(certFileAccessUrl);
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pxyObjKeyringService.trustedCertsaveOrUpdate(cfg);
|
pxyObjKeyringService.trustedCertsaveOrUpdate(cfg);
|
||||||
@@ -604,11 +639,14 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
|
|
||||||
return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + cfg.getFunctionId();
|
return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + cfg.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = { "/addOrAuditCrl" })
|
@RequestMapping(value = { "/addOrAuditCrl" })
|
||||||
/*@RequiresPermissions(value={"proxy:trustedCert:config","proxy:trustedCert:confirm"})*/
|
/*
|
||||||
|
* @RequiresPermissions(value={"proxy:trustedCert:config",
|
||||||
|
* "proxy:trustedCert:confirm"})
|
||||||
|
*/
|
||||||
public String trustedCrlSaveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
public String trustedCrlSaveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")PxyObjTrustedCaCrl cfg,
|
@ModelAttribute("cfg") PxyObjTrustedCaCrl cfg, MultipartFile crlFileI,
|
||||||
MultipartFile crlFileI,
|
|
||||||
RedirectAttributes redirectAttributes) {
|
RedirectAttributes redirectAttributes) {
|
||||||
File file = null;
|
File file = null;
|
||||||
boolean validFlag = true;
|
boolean validFlag = true;
|
||||||
@@ -639,7 +677,8 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
if (crlFileI != null) {
|
if (crlFileI != null) {
|
||||||
// 获取issuer
|
// 获取issuer
|
||||||
if (certInfoMap != null && certInfoMap.size() > 0) {
|
if (certInfoMap != null && certInfoMap.size() > 0) {
|
||||||
String issuer=StringUtil.isEmpty(certInfoMap.get("crl issuer")) ? "":certInfoMap.get("crl issuer").toString();//颁发者
|
String issuer = StringUtil.isEmpty(certInfoMap.get("crl issuer")) ? ""
|
||||||
|
: certInfoMap.get("crl issuer").toString();// 颁发者
|
||||||
if (cfg != null) {
|
if (cfg != null) {
|
||||||
if ((cfg.getCertId() != null && cfg.getCertId() > 0) && (!cfg.getIssuer().equals(issuer))) {
|
if ((cfg.getCertId() != null && cfg.getCertId() > 0) && (!cfg.getIssuer().equals(issuer))) {
|
||||||
logger.error("cert 和 crl的issuser不符合");
|
logger.error("cert 和 crl的issuser不符合");
|
||||||
@@ -715,8 +754,7 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
* @param params
|
* @param params
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Map<String, Object> execShell(String shellName,
|
public Map<String, Object> execShell(String shellName, String... params) {
|
||||||
String... params) {
|
|
||||||
Map<String, Object> result = new HashMap<String, Object>();
|
Map<String, Object> result = new HashMap<String, Object>();
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(shellName);
|
sb.append(shellName);
|
||||||
@@ -741,16 +779,13 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
try {
|
try {
|
||||||
exec = Runtime.getRuntime().exec(cmdarray);
|
exec = Runtime.getRuntime().exec(cmdarray);
|
||||||
exec.getInputStream();
|
exec.getInputStream();
|
||||||
br = new BufferedReader(
|
br = new BufferedReader(new InputStreamReader(exec.getInputStream()));
|
||||||
new InputStreamReader(exec.getInputStream()));
|
bre = new BufferedReader(new InputStreamReader(exec.getErrorStream()));
|
||||||
bre = new BufferedReader(new InputStreamReader(
|
|
||||||
exec.getErrorStream()));
|
|
||||||
String s = null;
|
String s = null;
|
||||||
StringBuilder out = new StringBuilder();
|
StringBuilder out = new StringBuilder();
|
||||||
String key = "";
|
String key = "";
|
||||||
String value = "";
|
String value = "";
|
||||||
if((sb.toString().indexOf("inlist") > -1)
|
if ((sb.toString().indexOf("inlist") > -1) || (sb.toString().indexOf("incrl") > -1)
|
||||||
|| ( sb.toString().indexOf("incrl") > -1 )
|
|
||||||
|| (sb.toString().indexOf("incert") > -1)) {
|
|| (sb.toString().indexOf("incert") > -1)) {
|
||||||
certInfoMap = new HashMap<>();
|
certInfoMap = new HashMap<>();
|
||||||
}
|
}
|
||||||
@@ -821,13 +856,10 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping(value = { "/trustedCertDelete" })
|
@RequestMapping(value = { "/trustedCertDelete" })
|
||||||
@RequiresPermissions(value = { "proxy:trustedCert:config" })
|
@RequiresPermissions(value = { "proxy:trustedCert:config" })
|
||||||
public String trustedCertDelete(Integer isAudit,Integer isValid,String ids,Integer functionId
|
public String trustedCertDelete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
||||||
,Model model,HttpServletRequest request
|
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||||
,HttpServletResponse response
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
pxyObjKeyringService.trustedCertDelete(isAudit, isValid, ids, functionId);
|
pxyObjKeyringService.trustedCertDelete(isAudit, isValid, ids, functionId);
|
||||||
}
|
}
|
||||||
@@ -837,14 +869,9 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/trustedCertAudit" })
|
@RequestMapping(value = { "/trustedCertAudit" })
|
||||||
@RequiresPermissions(value = { "proxy:trustedCert:confirm" })
|
@RequiresPermissions(value = { "proxy:trustedCert:confirm" })
|
||||||
public String trustedCertAudit(Model model,@ModelAttribute("cfg")PxyObjTrustedCaCert cfg,
|
public String trustedCertAudit(Model model, @ModelAttribute("cfg") PxyObjTrustedCaCert cfg, Integer isValid,
|
||||||
Integer isValid,
|
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
Integer isAudit,
|
HttpServletResponse response, HttpServletRequest request) {
|
||||||
String ids,
|
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
Date auditTime = new Date();
|
Date auditTime = new Date();
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.PolicyGroupInfo;
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
import com.nis.domain.configuration.DnsResStrategy;
|
import com.nis.domain.configuration.DnsResStrategy;
|
||||||
import com.nis.domain.configuration.IpPortCfg;
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.configuration.PxyObjSpoofingIpPool;
|
import com.nis.domain.configuration.PxyObjSpoofingIpPool;
|
||||||
@@ -88,7 +89,7 @@ public class PxyObjSpoofingIpPoolController extends BaseController {
|
|||||||
model.addAttribute("isAdd", true);
|
model.addAttribute("isAdd", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<PolicyGroupInfo> groups=policyGroupInfoService.findPolicyGroupInfosByType(6);
|
/*List<PolicyGroupInfo> groups=policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||||
List<PolicyGroupInfo> policyGroups = new ArrayList();
|
List<PolicyGroupInfo> policyGroups = new ArrayList();
|
||||||
//解决目前一个分组只能有一个生效IP
|
//解决目前一个分组只能有一个生效IP
|
||||||
for(PolicyGroupInfo group:groups){
|
for(PolicyGroupInfo group:groups){
|
||||||
@@ -100,7 +101,7 @@ public class PxyObjSpoofingIpPoolController extends BaseController {
|
|||||||
policyGroups.add(group);
|
policyGroups.add(group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
model.addAttribute("policyGroups", policyGroups);*/
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
return "/cfg/proxy/spoofingIpPool/form";
|
return "/cfg/proxy/spoofingIpPool/form";
|
||||||
}
|
}
|
||||||
@@ -198,4 +199,66 @@ public class PxyObjSpoofingIpPoolController extends BaseController {
|
|||||||
return "redirect:" + adminPath +"/proxy/spoofing/pool/list?functionId="+functionId;
|
return "redirect:" + adminPath +"/proxy/spoofing/pool/list?functionId="+functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ip配置导出
|
||||||
|
@RequestMapping(value = "exportIpPool")
|
||||||
|
public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
@ModelAttribute("cfg") PxyObjSpoofingIpPool entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
|
try {
|
||||||
|
// export data info
|
||||||
|
List<String> titleList = new ArrayList<String>();
|
||||||
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
List<PxyObjSpoofingIpPool> ipLists = new ArrayList<PxyObjSpoofingIpPool>();
|
||||||
|
// 导出选中记录
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
|
ipLists = pxyObjSpoofingIpPoolService.findByPage(ids);
|
||||||
|
} else {
|
||||||
|
Page<PxyObjSpoofingIpPool> pageInfo = new Page<PxyObjSpoofingIpPool>(request, response, "r");
|
||||||
|
pageInfo.setPageNo(1);
|
||||||
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
|
Page<PxyObjSpoofingIpPool> page = pxyObjSpoofingIpPoolService.findPage(pageInfo, entity);
|
||||||
|
ipLists = page.getList();
|
||||||
|
}
|
||||||
|
titleList.add(entity.getMenuNameCode());
|
||||||
|
classMap.put(entity.getMenuNameCode(), PxyObjSpoofingIpPool.class);
|
||||||
|
String cfgIndexInfoNoExport = ",policy_name,do_log,ir_type,whether_area_block,do_blacklist,block_type,ip_pattern,client_ip,server_ip,port_pattern,client_port,server_port,direction,protocol,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
|
/* } */
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("ip white export failed", e);
|
||||||
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
|
}
|
||||||
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -133,4 +134,61 @@ public class ConfigureStatisticsController extends BaseController{
|
|||||||
map.put("ruleLimit", ruleLimit);
|
map.put("ruleLimit", ruleLimit);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//configureStateStatisticsPrint
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping(value = {"/configureStateStatisticsPrint"})
|
||||||
|
public Map configureStateStatisticsPrint(Model model,HttpServletRequest request
|
||||||
|
,HttpServletResponse response
|
||||||
|
,RedirectAttributes redirectAttributes){
|
||||||
|
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
/****************************Request Info Statistics*****************************/
|
||||||
|
//1、查询所有有效的service
|
||||||
|
List<FunctionServiceDict> serviceDictList = DictUtils.getFunctionServiceDictList();
|
||||||
|
//2、查询所有菜单
|
||||||
|
List<SysMenu> menuList = UserUtils.getMenuCfgList();
|
||||||
|
//3、根据来函分页
|
||||||
|
RequestInfo requestInfo=new RequestInfo();
|
||||||
|
requestInfo.setIsAudit(1);
|
||||||
|
requestInfo.setIsValid(1);
|
||||||
|
Page page = new Page(request, response,"r");
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||||
|
Page requestPage = requestInfoService.findRequestInfo(page,requestInfo);
|
||||||
|
List<RequestInfo> requestInfos=requestPage.getList();
|
||||||
|
//4、根据当前页的requestInfo信息查询request统计信息
|
||||||
|
List<Object[]> requestStatisticList=new ArrayList<Object[]>();
|
||||||
|
if(!StringUtil.isEmpty(requestInfos)){
|
||||||
|
Date requestStatisticTime=configureStatisticsService.getRequestStatisticTime();
|
||||||
|
String requestStatisticTimeStr="";
|
||||||
|
if(!StringUtil.isEmpty(requestStatisticTime)){
|
||||||
|
requestStatisticTimeStr=sdf.format(requestStatisticTime);
|
||||||
|
}
|
||||||
|
requestStatisticList=configureStatisticsService.getRequestStateStatistics(requestInfos,menuList,requestStatisticTimeStr);
|
||||||
|
if(!StringUtil.isEmpty(requestStatisticList)){
|
||||||
|
for (Iterator iterator = requestStatisticList.iterator(); iterator.hasNext();) {
|
||||||
|
Map map = (Map) iterator.next();
|
||||||
|
for (RequestInfo requestInfoO : requestInfos) {
|
||||||
|
if(requestInfoO.getId().toString().equals(map.get("request").toString())){
|
||||||
|
map.put("request", requestInfoO.getRequestTitle());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
model.addAttribute("requestStatisticTime", requestStatisticTimeStr);
|
||||||
|
}
|
||||||
|
Properties msgProp = getMsgProp();
|
||||||
|
for (int i = 0; i < menuList.size(); i++) {
|
||||||
|
String property = msgProp.getProperty(menuList.get(i).getCode(), menuList.get(i).getCode());
|
||||||
|
menuList.get(i).setCode(property);
|
||||||
|
}
|
||||||
|
requestPage.setList(requestStatisticList);
|
||||||
|
model.addAttribute("requestInfos", requestInfos);
|
||||||
|
model.addAttribute("serviceList", serviceDictList);
|
||||||
|
model.addAttribute("page", requestPage);
|
||||||
|
Map<String,Object> maps=new HashMap<String,Object>();
|
||||||
|
maps.put("menuList", menuList);
|
||||||
|
maps.put("requestStatisticList", requestStatisticList);
|
||||||
|
return maps;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import java.net.URLEncoder;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -94,6 +96,49 @@ public class DashboardController extends BaseController{
|
|||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 跳转活跃端口详情界面
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="portActiveChart")
|
||||||
|
@ResponseBody
|
||||||
|
public List portActiveChart(String beginDate,String endDate){
|
||||||
|
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||||
|
List list = new ArrayList();
|
||||||
|
try {
|
||||||
|
String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_PORTACTIVE_FIVEMINUTE;//+Constants.TRAFFIC_IPACTIVE_ONEHOUR;
|
||||||
|
url=urlAddDate(url, beginDate, endDate);
|
||||||
|
String string = HttpClientUtil.get(url);
|
||||||
|
Gson gson = new GsonBuilder().create();
|
||||||
|
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||||
|
logger.debug("活跃端口从"+beginDate+"到"+endDate+",间隔5分钟数据"+fromJsonList);
|
||||||
|
list = (ArrayList) fromJsonList.get("data");
|
||||||
|
return list;
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error("活跃端口详情界面数据获取错误"+e);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跳转活跃端口详情界面
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="portActiveList")
|
||||||
|
public String portActiveList(Model model){
|
||||||
|
// 默认当前时间一小时
|
||||||
|
Calendar cal = Calendar. getInstance ();
|
||||||
|
cal.setTime(new Date());
|
||||||
|
String endDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//获取到完整的时间
|
||||||
|
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
|
||||||
|
String beginDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
|
||||||
|
model.addAttribute("beginDate", beginDate);
|
||||||
|
model.addAttribute("endDate", endDate);
|
||||||
|
return "/dashboard/trafficPortActiveList";
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 活跃IP TOP10
|
* 活跃IP TOP10
|
||||||
*/
|
*/
|
||||||
@@ -194,7 +239,7 @@ public class DashboardController extends BaseController{
|
|||||||
return "/dashboard/trafficIpActiveList";
|
return "/dashboard/trafficIpActiveList";
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 活跃IP TOP10 一小时 间隔5分钟数据
|
* 活跃IP TOP10 一小时每个IP的最大值
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="ajaxIpActiveList")
|
@RequestMapping(value="ajaxIpActiveList")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@@ -209,6 +254,24 @@ public class DashboardController extends BaseController{
|
|||||||
fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType());
|
fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType());
|
||||||
logger.debug("活跃IP1小时"+fromJsonList);
|
logger.debug("活跃IP1小时"+fromJsonList);
|
||||||
list = gson.fromJson(fromJsonList.get("data").toString(), new TypeToken<List<TrafficIpActiveStatistic>>() {}.getType()) ;
|
list = gson.fromJson(fromJsonList.get("data").toString(), new TypeToken<List<TrafficIpActiveStatistic>>() {}.getType()) ;
|
||||||
|
Collections.sort(list, new Comparator<TrafficIpActiveStatistic>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compare(TrafficIpActiveStatistic o1, TrafficIpActiveStatistic o2) {
|
||||||
|
if(o1==null&&o2!=null){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if(o1!=null&&o2==null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
if(o1==o2&&o1==null){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
Long ob1 = o1.getC2sByteLen()+o1.getS2cByteLen();
|
||||||
|
Long ob2 = o2.getC2sByteLen()+o2.getS2cByteLen();
|
||||||
|
return -(ob1).compareTo(ob2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -283,19 +346,19 @@ public class DashboardController extends BaseController{
|
|||||||
//将数字替换为标签文字
|
//将数字替换为标签文字
|
||||||
if(list!=null&&!list.isEmpty()){
|
if(list!=null&&!list.isEmpty()){
|
||||||
for (Map map : list) {
|
for (Map map : list) {
|
||||||
Double value1 = Double.parseDouble(map.get("protoType").toString());
|
Double value1 = Double.parseDouble(map.get("protoType").toString().trim());
|
||||||
for (CodeResult code : codeList) {
|
for (CodeResult code : codeList) {
|
||||||
Double value2 = Double.valueOf(code.getCode());
|
Double value2 = Double.valueOf(code.getCode().trim());
|
||||||
if(value1.equals(value2)){
|
if(value1.equals(value2)){
|
||||||
map.put("protoType", code.getItem());
|
map.put("protoType", code.getItem().trim());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 协议没匹配的匹配app码表
|
// 协议没匹配的匹配app码表
|
||||||
for (CodeResult code : appCodeList) {
|
for (CodeResult code : appCodeList) {
|
||||||
Double value3 = Double.valueOf(code.getCode());
|
Double value3 = Double.valueOf(code.getCode().trim());
|
||||||
if(value1.equals(value3)){
|
if(value1.equals(value3)){
|
||||||
map.put("protoType", code.getItem());
|
map.put("protoType", code.getItem().trim());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -330,11 +393,11 @@ public class DashboardController extends BaseController{
|
|||||||
//将数字替换为标签文字
|
//将数字替换为标签文字
|
||||||
if(list!=null&&!list.isEmpty()){
|
if(list!=null&&!list.isEmpty()){
|
||||||
for (Map map : list) {
|
for (Map map : list) {
|
||||||
Double value1 = Double.parseDouble(map.get("appType").toString());
|
Double value1 = Double.parseDouble(map.get("appType").toString().trim());
|
||||||
for (CodeResult code : codeList) {
|
for (CodeResult code : codeList) {
|
||||||
Double value2 = Double.valueOf(code.getCode());
|
Double value2 = Double.valueOf(code.getCode().trim());
|
||||||
if(value1.equals(value2)){
|
if(value1.equals(value2)){
|
||||||
map.put("appType", code.getItem());
|
map.put("appType", code.getItem().trim());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -369,11 +432,11 @@ public class DashboardController extends BaseController{
|
|||||||
//将数字替换为标签文字
|
//将数字替换为标签文字
|
||||||
if(list!=null&&!list.isEmpty()){
|
if(list!=null&&!list.isEmpty()){
|
||||||
for (Map map : list) {
|
for (Map map : list) {
|
||||||
Double value1 = Double.parseDouble(map.get("osType").toString());
|
Double value1 = Double.parseDouble(map.get("osType").toString().trim());
|
||||||
for (CodeResult code : codeList) {
|
for (CodeResult code : codeList) {
|
||||||
Double value2 = Double.valueOf(code.getCode());
|
Double value2 = Double.valueOf(code.getCode().trim());
|
||||||
if(value1.equals(value2)){
|
if(value1.equals(value2)){
|
||||||
map.put("osType", code.getItem());
|
map.put("osType", code.getItem().trim());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -403,8 +466,8 @@ public class DashboardController extends BaseController{
|
|||||||
//将标签文字转为数字
|
//将标签文字转为数字
|
||||||
Integer os=null;
|
Integer os=null;
|
||||||
for (CodeResult codeResult : codeList1) {
|
for (CodeResult codeResult : codeList1) {
|
||||||
if(osType.equalsIgnoreCase(codeResult.getItem())){
|
if(osType.equalsIgnoreCase(codeResult.getItem().trim())){
|
||||||
os=Integer.parseInt(codeResult.getCode());
|
os=Integer.parseInt(codeResult.getCode().trim());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -421,11 +484,11 @@ public class DashboardController extends BaseController{
|
|||||||
//将数字替换为标签文字
|
//将数字替换为标签文字
|
||||||
if(null!=list&&!list.isEmpty()){
|
if(null!=list&&!list.isEmpty()){
|
||||||
for (Map map : list) {
|
for (Map map : list) {
|
||||||
Double value1 = Double.parseDouble(map.get("bsType").toString());
|
Double value1 = Double.parseDouble(map.get("bsType").toString().trim());
|
||||||
for (CodeResult code : codeList2) {
|
for (CodeResult code : codeList2) {
|
||||||
Double value2 = Double.valueOf(code.getCode());
|
Double value2 = Double.valueOf(code.getCode().trim());
|
||||||
if(value1.equals(value2)){
|
if(value1.equals(value2)){
|
||||||
map.put("bsType", code.getItem());
|
map.put("bsType", code.getItem().trim());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//10个域名之外的为others 设为-1外
|
//10个域名之外的为others 设为-1外
|
||||||
@@ -465,11 +528,11 @@ public class DashboardController extends BaseController{
|
|||||||
//将数字替换为标签文字
|
//将数字替换为标签文字
|
||||||
if(list!=null&&!list.isEmpty()){
|
if(list!=null&&!list.isEmpty()){
|
||||||
for (Map map : list) {
|
for (Map map : list) {
|
||||||
Double value1 = Double.parseDouble(map.get("bsType").toString());
|
Double value1 = Double.parseDouble(map.get("bsType").toString().trim());
|
||||||
for (CodeResult code : codeList) {
|
for (CodeResult code : codeList) {
|
||||||
Double value2 = Double.valueOf(code.getCode());
|
Double value2 = Double.valueOf(code.getCode().trim());
|
||||||
if(value1.equals(value2)){
|
if(value1.equals(value2)){
|
||||||
map.put("bsType", code.getItem());
|
map.put("bsType", code.getItem().trim());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -499,13 +562,13 @@ public class DashboardController extends BaseController{
|
|||||||
//将标签文字转为数字
|
//将标签文字转为数字
|
||||||
Integer bs=null;
|
Integer bs=null;
|
||||||
for (CodeResult codeResult : codeList1) {
|
for (CodeResult codeResult : codeList1) {
|
||||||
if(bsType.equalsIgnoreCase(codeResult.getItem())){
|
if(bsType.equalsIgnoreCase(codeResult.getItem().trim())){
|
||||||
bs=Integer.parseInt(codeResult.getCode());
|
bs=Integer.parseInt(codeResult.getCode().trim());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(bs==null){
|
if(bs==null){
|
||||||
bs=Integer.parseInt(bsType);//处理为匹配项编码
|
bs=Integer.parseInt(bsType.trim());//处理为匹配项编码
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.TRAFFIC_SYSTEM_CHART+"?bsType="+bs);
|
String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.TRAFFIC_SYSTEM_CHART+"?bsType="+bs);
|
||||||
@@ -517,16 +580,16 @@ public class DashboardController extends BaseController{
|
|||||||
//将数字替换为标签文字
|
//将数字替换为标签文字
|
||||||
if(null!=list&&!list.isEmpty()){
|
if(null!=list&&!list.isEmpty()){
|
||||||
for (Map map : list) {
|
for (Map map : list) {
|
||||||
Double value1 = Double.parseDouble(map.get("osType").toString());
|
Double value1 = Double.parseDouble(map.get("osType").toString().trim());
|
||||||
for (CodeResult code : codeList2) {
|
for (CodeResult code : codeList2) {
|
||||||
Double value2 = Double.valueOf(code.getCode());
|
Double value2 = Double.valueOf(code.getCode().trim());
|
||||||
//10个域名之外的为others webId设为-1外
|
//10个域名之外的为others webId设为-1外
|
||||||
if(map.get("osType").toString().equals("-1")){
|
if(map.get("osType").toString().equals("-1")){
|
||||||
map.put("osType", "Others");
|
map.put("osType", "Others");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(value1.equals(value2)){
|
if(value1.equals(value2)){
|
||||||
map.put("osType", code.getItem());
|
map.put("osType", code.getItem().trim());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -563,15 +626,15 @@ public class DashboardController extends BaseController{
|
|||||||
if(list!=null&&!list.isEmpty()){
|
if(list!=null&&!list.isEmpty()){
|
||||||
for (Map map : list) {
|
for (Map map : list) {
|
||||||
Double value1=0d;
|
Double value1=0d;
|
||||||
if(StringUtil.isBlank(map.get("websiteServiceId").toString())){
|
if(StringUtil.isBlank(map.get("websiteServiceId").toString().trim())){
|
||||||
value1=268435455d;
|
value1=268435455d;
|
||||||
}else{
|
}else{
|
||||||
value1 = Double.parseDouble(map.get("websiteServiceId").toString());
|
value1 = Double.parseDouble(map.get("websiteServiceId").toString().trim());
|
||||||
}
|
}
|
||||||
for (SysDataDictionaryItem code : codeList) {
|
for (SysDataDictionaryItem code : codeList) {
|
||||||
Double value2 = Double.valueOf(code.getItemCode());
|
Double value2 = Double.valueOf(code.getItemCode().trim());
|
||||||
if(value1.equals(value2)){
|
if(value1.equals(value2)){
|
||||||
map.put("websiteService", code.getItemValue());
|
map.put("websiteService", code.getItemValue().trim());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -611,7 +674,7 @@ public class DashboardController extends BaseController{
|
|||||||
if(wdt!=null){
|
if(wdt!=null){
|
||||||
String domain = wdt.getDomain();
|
String domain = wdt.getDomain();
|
||||||
Double domainId = wdt.getId().doubleValue();
|
Double domainId = wdt.getId().doubleValue();
|
||||||
Double webId = Double.parseDouble(dataMap.get("webId").toString());
|
Double webId = Double.parseDouble(dataMap.get("webId").toString().trim());
|
||||||
//10个域名之外的为others webId设为-1外
|
//10个域名之外的为others webId设为-1外
|
||||||
if(dataMap.get("webId").toString().equals("-1")){
|
if(dataMap.get("webId").toString().equals("-1")){
|
||||||
dataMap.put("domain", "Others");
|
dataMap.put("domain", "Others");
|
||||||
@@ -661,12 +724,12 @@ public class DashboardController extends BaseController{
|
|||||||
if(StringUtil.isBlank(map.get("topicId").toString())){
|
if(StringUtil.isBlank(map.get("topicId").toString())){
|
||||||
value1=268435455d;
|
value1=268435455d;
|
||||||
}else{
|
}else{
|
||||||
value1 = Double.parseDouble(map.get("topicId").toString());
|
value1 = Double.parseDouble(map.get("topicId").toString().trim());
|
||||||
}
|
}
|
||||||
for (SysDataDictionaryItem code : codeList) {
|
for (SysDataDictionaryItem code : codeList) {
|
||||||
Double value2 = Double.valueOf(code.getItemCode());
|
Double value2 = Double.valueOf(code.getItemCode().trim());
|
||||||
if(value1.equals(value2)){
|
if(value1.equals(value2)){
|
||||||
map.put("topic", code.getItemValue());
|
map.put("topic", code.getItemValue().trim());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -678,7 +741,7 @@ public class DashboardController extends BaseController{
|
|||||||
if(wdt!=null){
|
if(wdt!=null){
|
||||||
String domain = wdt.getDomain();
|
String domain = wdt.getDomain();
|
||||||
Double domainId = wdt.getId().doubleValue();
|
Double domainId = wdt.getId().doubleValue();
|
||||||
Double webId = Double.parseDouble(dataMap.get("webId").toString());
|
Double webId = Double.parseDouble(dataMap.get("webId").toString().trim());
|
||||||
//10个域名之外的为others webId设为-1
|
//10个域名之外的为others webId设为-1
|
||||||
// if(dataMap.get("webId").toString().equals("-1")){
|
// if(dataMap.get("webId").toString().equals("-1")){
|
||||||
// dataMap.put("domain", "Others");
|
// dataMap.put("domain", "Others");
|
||||||
|
|||||||
@@ -67,27 +67,26 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
HashMap<String, Object> m = new HashMap<String, Object>();
|
HashMap<String, Object> m = new HashMap<String, Object>();
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
try {
|
try {
|
||||||
String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.NTC_TOTAL_REPORT);
|
|
||||||
Gson gson = new GsonBuilder().create();
|
|
||||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
|
||||||
list = (ArrayList) fromJsonList.get("data");
|
|
||||||
Random r = new Random();
|
|
||||||
Double rejectNum=0d;
|
Double rejectNum=0d;
|
||||||
Double dropConnNum=0d;
|
Double dropConnNum=0d;
|
||||||
Double monitorNum=0d;
|
Double monitorNum=0d;
|
||||||
Double loopConnNum=0d;
|
Double loopConnNum=0d;
|
||||||
Double liveConnNum=0d;
|
Double closeConnNum=0d;
|
||||||
Double newUniConnNum=0d;
|
Double newUniConnNum=0d;
|
||||||
Double inoctetsNum=0d;
|
Double inoctetsNum=0d;
|
||||||
Double outoctetsNum=0d;
|
Double outoctetsNum=0d;
|
||||||
Double bandwidth=0d;
|
Double bandwidth=0d;
|
||||||
if(list!=null&&list.size()>0){
|
String string = HttpClientUtil.get(Constants.DASHBOARD_URL+Constants.NTC_TOTAL_REPORT);
|
||||||
|
Gson gson = new GsonBuilder().create();
|
||||||
|
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||||
|
list = (ArrayList) fromJsonList.get("data");
|
||||||
|
if(fromJsonList!=null&&list!=null&&list.size()>0){
|
||||||
Map map = (Map) list.get(0);
|
Map map = (Map) list.get(0);
|
||||||
rejectNum = (Double) map.get("rejectNum") ;
|
rejectNum = (Double) map.get("rejectNum") ;
|
||||||
monitorNum = (Double) map.get("monitorNum");
|
monitorNum = (Double) map.get("monitorNum");
|
||||||
dropConnNum = (Double) map.get("dropConnNum");
|
dropConnNum = (Double) map.get("dropConnNum");
|
||||||
loopConnNum = (Double) map.get("loopConnNum");
|
loopConnNum = (Double) map.get("loopConnNum");
|
||||||
liveConnNum = (Double) map.get("liveConnNum");
|
closeConnNum = (Double) map.get("closeConnNum");
|
||||||
newUniConnNum = (Double) map.get("newUniConnNum");
|
newUniConnNum = (Double) map.get("newUniConnNum");
|
||||||
inoctetsNum = (Double) map.get("inoctets");
|
inoctetsNum = (Double) map.get("inoctets");
|
||||||
outoctetsNum = (Double) map.get("outoctets");
|
outoctetsNum = (Double) map.get("outoctets");
|
||||||
@@ -101,7 +100,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
m.put("monitorNum", monitorNum);
|
m.put("monitorNum", monitorNum);
|
||||||
m.put("loopConnNum", loopConnNum);
|
m.put("loopConnNum", loopConnNum);
|
||||||
m.put("dropConnNum", dropConnNum);
|
m.put("dropConnNum", dropConnNum);
|
||||||
m.put("liveConnNum", liveConnNum);
|
m.put("closeConnNum", closeConnNum);
|
||||||
m.put("newUniConnNum", newUniConnNum);
|
m.put("newUniConnNum", newUniConnNum);
|
||||||
|
|
||||||
m.put("bandwidth", bandwidth);
|
m.put("bandwidth", bandwidth);
|
||||||
@@ -261,17 +260,15 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value="bandwidthTransThree")
|
@RequestMapping(value="bandwidthTransThree")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Map bandwidthTransThree(String beginDate,String endDate){
|
public Map bandwidthTransThree(String beginDate,String endDate,String searchQuotaType){
|
||||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
//String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS_TWO;
|
//String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS_TWO;
|
||||||
//String url="http://192.168.11.78:8080/galaxy/service/log/v1/"+Constants.TRAFFIC_BANDWIDTH_TRANS_THREE;
|
|
||||||
//String url="http://192.168.11.78:8080/galaxy/service/log/v1/"+Constants.TRAFFIC_BANDWIDTH_TRANS_FOUR;
|
|
||||||
String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS_THREE;
|
String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS_THREE;
|
||||||
//String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS_FOUR;
|
//String url=Constants.DASHBOARD_URL+Constants.TRAFFIC_BANDWIDTH_TRANS_FOUR;
|
||||||
try {
|
try {
|
||||||
url=urlAddDate(url,beginDate,endDate);
|
url=urlAddDate(url,beginDate,endDate);
|
||||||
|
url=url+"&searchQuotaType="+searchQuotaType;
|
||||||
String string = HttpClientUtil.get(url);
|
String string = HttpClientUtil.get(url);
|
||||||
Gson gson = new GsonBuilder().create();
|
Gson gson = new GsonBuilder().create();
|
||||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||||
@@ -303,12 +300,19 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value="protocolList")
|
@RequestMapping(value="protocolList")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List protocolList(Model model,@RequestParam(required=false)String beginDate,@RequestParam(required=false)String endDate){
|
public List protocolList(Model model,Integer[] protoType,@RequestParam(required=false)String beginDate,@RequestParam(required=false)String endDate){
|
||||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_PROTOCOL_LIST;
|
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_PROTOCOL_LIST;
|
||||||
try {
|
try {
|
||||||
url=urlAddDate(url,beginDate,endDate);
|
url=urlAddDate(url,beginDate,endDate);
|
||||||
|
if(protoType!=null){
|
||||||
|
for (Integer dom : protoType) {
|
||||||
|
if(dom!=null){
|
||||||
|
url=url+"&protoType="+dom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
String string = HttpClientUtil.get(url);
|
String string = HttpClientUtil.get(url);
|
||||||
Gson gson = new GsonBuilder().create();
|
Gson gson = new GsonBuilder().create();
|
||||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
||||||
@@ -374,14 +378,18 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value="appList")
|
@RequestMapping(value="appList")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List appList(@RequestParam(value="appType",required=false)Integer appType,@RequestParam(value="beginDate",required=false)String beginDate,@RequestParam(value="endDate",required=false)String endDate){
|
public List appList(@RequestParam(value="appType",required=false)Integer[] appType,@RequestParam(value="beginDate",required=false)String beginDate,@RequestParam(value="endDate",required=false)String endDate){
|
||||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_APP_LIST;
|
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_APP_LIST;
|
||||||
try {
|
try {
|
||||||
url=urlAddDate(url,beginDate,endDate);
|
url=urlAddDate(url,beginDate,endDate);
|
||||||
if(!StringUtil.isEmpty(appType)){
|
if(appType!=null){
|
||||||
url=url+"&appType="+appType;
|
for (Integer dom : appType) {
|
||||||
|
if(dom!=null){
|
||||||
|
url=url+"&appType="+dom;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
String string = HttpClientUtil.get(url);
|
String string = HttpClientUtil.get(url);
|
||||||
Gson gson = new GsonBuilder().create();
|
Gson gson = new GsonBuilder().create();
|
||||||
@@ -477,7 +485,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value="websiteList")
|
@RequestMapping(value="websiteList")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public List websiteList(Integer entranceId,Integer domain,Model model,@RequestParam(required=false)String beginDate,@RequestParam(required=false)String endDate){
|
public List websiteList(Integer entranceId,Integer[] domain,Model model,@RequestParam(required=false)String beginDate,@RequestParam(required=false)String endDate){
|
||||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_WEBSITELIST_NOTIME;
|
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_WEBSITELIST_NOTIME;
|
||||||
@@ -491,7 +499,11 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
}
|
}
|
||||||
url=urlAddDate(url, beginDate, endDate);
|
url=urlAddDate(url, beginDate, endDate);
|
||||||
if(domain!=null){
|
if(domain!=null){
|
||||||
url=url+"&domain="+domain;
|
for (Integer dom : domain) {
|
||||||
|
if(dom!=null){
|
||||||
|
url=url+"&domain="+dom;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(entranceId!=null){
|
if(entranceId!=null){
|
||||||
url=url+"&entranceId="+entranceId;
|
url=url+"&entranceId="+entranceId;
|
||||||
@@ -502,9 +514,9 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
logger.debug("website接口数据"+fromJsonList);
|
logger.debug("website接口数据"+fromJsonList);
|
||||||
list = (ArrayList) fromJsonList.get("data");
|
list = (ArrayList) fromJsonList.get("data");
|
||||||
BigDecimal divisor=new BigDecimal(1024*1024*1024);
|
BigDecimal divisor=new BigDecimal(1024*1024*1024);
|
||||||
DecimalFormat df = new DecimalFormat("0.00");
|
DecimalFormat df = new DecimalFormat("0.000000000");
|
||||||
DecimalFormat dl = new DecimalFormat("0");
|
DecimalFormat dl = new DecimalFormat("0");
|
||||||
DecimalFormat pf = new DecimalFormat("0.00%");
|
DecimalFormat pf = new DecimalFormat("0.000000000");
|
||||||
// Double totalLink=0d;
|
// Double totalLink=0d;
|
||||||
Double totalGbyte=0d;
|
Double totalGbyte=0d;
|
||||||
Double totalPackets=0d;
|
Double totalPackets=0d;
|
||||||
@@ -528,10 +540,10 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
Map m=(Map)object;
|
Map m=(Map)object;
|
||||||
// Double perLink = ((Double)m.get("linkNum"))/totalLink;
|
// Double perLink = ((Double)m.get("linkNum"))/totalLink;
|
||||||
// m.put("perLink",pf.format(perLink));
|
// m.put("perLink",pf.format(perLink));
|
||||||
Double perPackets = ((Double)m.get("pktCount"))/totalPackets;
|
// Double perPackets = ((Double)m.get("pktCount"))/totalPackets;
|
||||||
m.put("perPackets", pf.format(perPackets));
|
m.put("totalPackets", pf.format(totalPackets));
|
||||||
Double perGbyte = ((Double)m.get("byteCount"))/totalGbyte;
|
// Double perGbyte = ((Double)m.get("byteCount"))/totalGbyte;
|
||||||
m.put("perGbyte", pf.format(perGbyte));
|
m.put("totalGbyte", pf.format(totalGbyte/1024/1024/1024));
|
||||||
if(map.containsKey(Long.parseLong(dl.format(m.get("webId"))))){
|
if(map.containsKey(Long.parseLong(dl.format(m.get("webId"))))){
|
||||||
m.put("website", map.get(Long.parseLong(dl.format(m.get("webId")))));
|
m.put("website", map.get(Long.parseLong(dl.format(m.get("webId")))));
|
||||||
}else{
|
}else{
|
||||||
@@ -626,4 +638,70 @@ public class TrafficStatisticsInfoController extends BaseController {
|
|||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* drop, loop,new link,close link,pass,live link
|
||||||
|
*/
|
||||||
|
@RequestMapping("ntcTotalReportDetail")
|
||||||
|
public String ntcTotalReportDetail(Model model,String searchAction){
|
||||||
|
Calendar cal = Calendar. getInstance ();
|
||||||
|
cal.setTime(new Date());
|
||||||
|
String now = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//鑾峰彇鍒板畬鏁寸殑鏃堕棿
|
||||||
|
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
|
||||||
|
String oneHoursAgo = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
|
||||||
|
model.addAttribute("searchAction", searchAction);
|
||||||
|
model.addAttribute("beginDate", oneHoursAgo);
|
||||||
|
model.addAttribute("endDate", now);
|
||||||
|
return "/dashboard/ntcTotalReportDetailList";
|
||||||
|
}
|
||||||
|
@RequestMapping("ajaxNtcTotalReportDetail")
|
||||||
|
@ResponseBody
|
||||||
|
public Map ajaxNtcTotalReportDetail(String beginDate,String endDate,Model model,String searchAction){
|
||||||
|
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||||
|
Map map = new HashMap();
|
||||||
|
try {
|
||||||
|
String url=Constants.DASHBOARD_URL+Constants.TREND_TOTAL_REPORT;
|
||||||
|
if(StringUtil.isBlank(beginDate)||StringUtil.isBlank(endDate)){
|
||||||
|
Calendar cal = Calendar. getInstance ();
|
||||||
|
cal.setTime(new Date());
|
||||||
|
endDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//获取到完整的时间
|
||||||
|
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
|
||||||
|
beginDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
|
||||||
|
}
|
||||||
|
URIBuilder uriBuilder = new URIBuilder(url);
|
||||||
|
uriBuilder.addParameter("searchReportStartTime",beginDate);
|
||||||
|
uriBuilder.addParameter("searchReportEndTime",endDate);
|
||||||
|
url=uriBuilder.toString();
|
||||||
|
if(searchAction!=null){
|
||||||
|
if("action_drop".equals(searchAction)){
|
||||||
|
url=url+"&searchBusinessType="+1;
|
||||||
|
}
|
||||||
|
if("action_loop".equals(searchAction)){
|
||||||
|
url=url+"&searchBusinessType="+2;
|
||||||
|
}
|
||||||
|
if("new_link".equals(searchAction)){
|
||||||
|
url=url+"&searchBusinessType="+3;
|
||||||
|
}
|
||||||
|
if("close_link".equals(searchAction)){
|
||||||
|
url=url+"&searchBusinessType="+4;
|
||||||
|
}
|
||||||
|
if("pass".equals(searchAction)){
|
||||||
|
url=url+"&searchBusinessType="+6;
|
||||||
|
}
|
||||||
|
if("live_link".equals(searchAction)){
|
||||||
|
url=url+"&searchBusinessType="+5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String string = HttpClientUtil.get(url);
|
||||||
|
Gson gson = new GsonBuilder().create();
|
||||||
|
fromJsonList = gson.fromJson(string, new TypeToken<Map<String, Object>>(){}.getType());
|
||||||
|
logger.debug("动作详情统计一小时"+fromJsonList);
|
||||||
|
map = (Map) fromJsonList.get("data");
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.error("动作详情统计一小时数据获取错误"+e);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,16 @@ import java.util.ArrayList;
|
|||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
@@ -23,20 +26,31 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.PageLog;
|
||||||
|
import com.nis.domain.SysUser;
|
||||||
import com.nis.domain.dashboard.NtcRadiusReport;
|
import com.nis.domain.dashboard.NtcRadiusReport;
|
||||||
|
import com.nis.domain.log.BaseLogEntity;
|
||||||
|
import com.nis.domain.maat.LogRecvData;
|
||||||
|
import com.nis.domain.report.NtcAsnRecord;
|
||||||
|
import com.nis.domain.report.NtcIpRangeReport;
|
||||||
|
import com.nis.util.Configurations;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DateUtils;
|
import com.nis.util.DateUtils;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.util.httpclient.HttpClientUtil;
|
import com.nis.util.httpclient.HttpClientUtil;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
import com.nis.web.security.UserUtils;
|
||||||
|
|
||||||
|
import net.sf.json.JSONObject;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/traffic")
|
@RequestMapping("${adminPath}/traffic")
|
||||||
public class TrafficStatisticsReportController extends BaseController {
|
public class TrafficStatisticsReportController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户行为查询
|
* 用户行为查询
|
||||||
|
*
|
||||||
* @param bean
|
* @param bean
|
||||||
* @param model
|
* @param model
|
||||||
* @param request
|
* @param request
|
||||||
@@ -44,7 +58,8 @@ public class TrafficStatisticsReportController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping("userBehavior")
|
@RequestMapping("userBehavior")
|
||||||
public String list(@ModelAttribute("log") NtcRadiusReport bean,Model model, HttpServletRequest request, HttpServletResponse response,RedirectAttributes redirectAttributes) {
|
public String list(@ModelAttribute("log") NtcRadiusReport bean, Model model, HttpServletRequest request,
|
||||||
|
HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||||
Map<String, Object> userJsonList = new HashMap<String, Object>();
|
Map<String, Object> userJsonList = new HashMap<String, Object>();
|
||||||
Map<String, Object> ipJsonList = new HashMap<String, Object>();
|
Map<String, Object> ipJsonList = new HashMap<String, Object>();
|
||||||
@@ -97,7 +112,8 @@ public class TrafficStatisticsReportController extends BaseController {
|
|||||||
// 用户及IP数据
|
// 用户及IP数据
|
||||||
String string = HttpClientUtil.get(destUrl);
|
String string = HttpClientUtil.get(destUrl);
|
||||||
Gson gson = new GsonBuilder().create();
|
Gson gson = new GsonBuilder().create();
|
||||||
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
|
fromJsonList = gson.fromJson(string, new TypeToken<Map>() {
|
||||||
|
}.getType());
|
||||||
list = (ArrayList) fromJsonList.get("data");
|
list = (ArrayList) fromJsonList.get("data");
|
||||||
Map map = (Map) list.get(0);
|
Map map = (Map) list.get(0);
|
||||||
List nasIpList = (List) map.get("nasIpList");
|
List nasIpList = (List) map.get("nasIpList");
|
||||||
@@ -123,10 +139,12 @@ public class TrafficStatisticsReportController extends BaseController {
|
|||||||
|
|
||||||
accountList = newAccountList;
|
accountList = newAccountList;
|
||||||
}
|
}
|
||||||
System.out.println("-------------------:"+nasIpList.size()+"+++"+accountList.size()+"==================");
|
System.out.println(
|
||||||
|
"-------------------:" + nasIpList.size() + "+++" + accountList.size() + "==================");
|
||||||
model.addAttribute("nasIpList", nasIpList);
|
model.addAttribute("nasIpList", nasIpList);
|
||||||
model.addAttribute("accountList", accountList);
|
model.addAttribute("accountList", accountList);
|
||||||
if(StringUtil.isBlank(account)&&accountList!=null&&accountList.size()>0&&!"3".equals(searchBusinessType)) {
|
if (StringUtil.isBlank(account) && accountList != null && accountList.size() > 0
|
||||||
|
&& !"3".equals(searchBusinessType)) {
|
||||||
Map accountMap = (Map) accountList.get(0);
|
Map accountMap = (Map) accountList.get(0);
|
||||||
String firstAccount = "";
|
String firstAccount = "";
|
||||||
if (accountMap != null && accountMap.get("account") != null) {
|
if (accountMap != null && accountMap.get("account") != null) {
|
||||||
@@ -134,13 +152,15 @@ public class TrafficStatisticsReportController extends BaseController {
|
|||||||
String userString = HttpClientUtil.get(userUrl + "&searchAccount=" + firstAccount);
|
String userString = HttpClientUtil.get(userUrl + "&searchAccount=" + firstAccount);
|
||||||
// 指定用户 查询
|
// 指定用户 查询
|
||||||
Gson usergson = new GsonBuilder().create();
|
Gson usergson = new GsonBuilder().create();
|
||||||
userJsonList = usergson.fromJson(userString, new TypeToken<Map>(){}.getType());
|
userJsonList = usergson.fromJson(userString, new TypeToken<Map>() {
|
||||||
|
}.getType());
|
||||||
userList = (ArrayList) userJsonList.get("data");
|
userList = (ArrayList) userJsonList.get("data");
|
||||||
}
|
}
|
||||||
model.addAttribute("userList", userList);
|
model.addAttribute("userList", userList);
|
||||||
model.addAttribute("searchAccount", firstAccount);
|
model.addAttribute("searchAccount", firstAccount);
|
||||||
}
|
}
|
||||||
if(StringUtil.isBlank(nasIp)&&nasIpList!=null&&nasIpList.size()>0&&!"2".equals(searchBusinessType)) {
|
if (StringUtil.isBlank(nasIp) && nasIpList != null && nasIpList.size() > 0
|
||||||
|
&& !"2".equals(searchBusinessType)) {
|
||||||
Map ipMap = (Map) nasIpList.get(0);
|
Map ipMap = (Map) nasIpList.get(0);
|
||||||
String firstIp = "";
|
String firstIp = "";
|
||||||
if (ipMap != null && ipMap.get("nasIp") != null) {
|
if (ipMap != null && ipMap.get("nasIp") != null) {
|
||||||
@@ -148,7 +168,8 @@ public class TrafficStatisticsReportController extends BaseController {
|
|||||||
String ipString = HttpClientUtil.get(ipUrl + "&searchNasIp=" + firstIp);
|
String ipString = HttpClientUtil.get(ipUrl + "&searchNasIp=" + firstIp);
|
||||||
// 指定IP查询
|
// 指定IP查询
|
||||||
Gson ipgson = new GsonBuilder().create();
|
Gson ipgson = new GsonBuilder().create();
|
||||||
ipJsonList = ipgson.fromJson(ipString, new TypeToken<Map>(){}.getType());
|
ipJsonList = ipgson.fromJson(ipString, new TypeToken<Map>() {
|
||||||
|
}.getType());
|
||||||
ipList = (ArrayList) ipJsonList.get("data");
|
ipList = (ArrayList) ipJsonList.get("data");
|
||||||
}
|
}
|
||||||
model.addAttribute("ipList", ipList);
|
model.addAttribute("ipList", ipList);
|
||||||
@@ -160,7 +181,8 @@ public class TrafficStatisticsReportController extends BaseController {
|
|||||||
String userString = HttpClientUtil.get(userUrl + "&searchAccount=" + account);
|
String userString = HttpClientUtil.get(userUrl + "&searchAccount=" + account);
|
||||||
// 指定用户 查询
|
// 指定用户 查询
|
||||||
Gson usergson = new GsonBuilder().create();
|
Gson usergson = new GsonBuilder().create();
|
||||||
userJsonList = usergson.fromJson(userString, new TypeToken<Map>(){}.getType());
|
userJsonList = usergson.fromJson(userString, new TypeToken<Map>() {
|
||||||
|
}.getType());
|
||||||
userList = (ArrayList) userJsonList.get("data");
|
userList = (ArrayList) userJsonList.get("data");
|
||||||
model.addAttribute("userList", userList);
|
model.addAttribute("userList", userList);
|
||||||
model.addAttribute("searchAccount", account);
|
model.addAttribute("searchAccount", account);
|
||||||
@@ -169,7 +191,8 @@ public class TrafficStatisticsReportController extends BaseController {
|
|||||||
String ipString = HttpClientUtil.get(ipUrl + "&searchNasIp=" + nasIp);
|
String ipString = HttpClientUtil.get(ipUrl + "&searchNasIp=" + nasIp);
|
||||||
// 指定IP查询
|
// 指定IP查询
|
||||||
Gson ipgson = new GsonBuilder().create();
|
Gson ipgson = new GsonBuilder().create();
|
||||||
ipJsonList = ipgson.fromJson(ipString, new TypeToken<Map>(){}.getType());
|
ipJsonList = ipgson.fromJson(ipString, new TypeToken<Map>() {
|
||||||
|
}.getType());
|
||||||
ipList = (ArrayList) ipJsonList.get("data");
|
ipList = (ArrayList) ipJsonList.get("data");
|
||||||
model.addAttribute("ipList", ipList);
|
model.addAttribute("ipList", ipList);
|
||||||
model.addAttribute("searchNasIp", nasIp);
|
model.addAttribute("searchNasIp", nasIp);
|
||||||
@@ -180,4 +203,237 @@ public class TrafficStatisticsReportController extends BaseController {
|
|||||||
}
|
}
|
||||||
return "/dashboard/trafficUserBehavior";
|
return "/dashboard/trafficUserBehavior";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 用户行为导出
|
||||||
|
@RequestMapping(value = "userBehaviorExport")
|
||||||
|
public void userBehaviorExport(@ModelAttribute("log") NtcRadiusReport bean, Model model, String hColumns,
|
||||||
|
String type, HttpServletRequest request, HttpServletResponse response,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
|
|
||||||
|
List<NtcRadiusReport> exportList = new ArrayList<NtcRadiusReport>();
|
||||||
|
|
||||||
|
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)) {
|
||||||
|
// 设置默认时间为1小时
|
||||||
|
// statTime=DateUtils.getDate()+" 00:00:00"; // 默认今天
|
||||||
|
// endTime=DateUtils.getDateTime();
|
||||||
|
|
||||||
|
Calendar cal = Calendar.getInstance();
|
||||||
|
cal.setTime(new Date());
|
||||||
|
endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(cal.getTime());// 获取到完整的时间
|
||||||
|
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
|
||||||
|
statTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(cal.getTime());
|
||||||
|
bean.setSearchFoundStartTime(statTime);
|
||||||
|
bean.setSearchFoundEndTime(endTime);
|
||||||
|
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;
|
||||||
|
} 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;
|
||||||
|
}
|
||||||
|
model.addAttribute("nowTime", DateUtils.getDateTime());
|
||||||
|
// 用户及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");
|
||||||
|
if (!StringUtil.isEmpty(nasIpList) && nasIpList.size() > 0) {
|
||||||
|
List newNasIpList = new ArrayList();
|
||||||
|
for (int i = 0; i < nasIpList.size(); i++) {
|
||||||
|
newNasIpList.add(nasIpList.get(i));
|
||||||
|
if (i + 1 >= 10) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nasIpList = newNasIpList;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(accountList) && accountList.size() > 0) {
|
||||||
|
List newAccountList = new ArrayList();
|
||||||
|
for (int i = 0; i < accountList.size(); i++) {
|
||||||
|
newAccountList.add(accountList.get(i));
|
||||||
|
if (i + 1 >= 10) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
accountList = newAccountList;
|
||||||
|
}
|
||||||
|
System.out.println(
|
||||||
|
"-------------------:" + nasIpList.size() + "+++" + accountList.size() + "==================");
|
||||||
|
model.addAttribute("nasIpList", nasIpList);
|
||||||
|
model.addAttribute("accountList", accountList);
|
||||||
|
if (StringUtil.isBlank(account) && accountList != null && accountList.size() > 0
|
||||||
|
&& !"3".equals(searchBusinessType)) {
|
||||||
|
Map accountMap = (Map) accountList.get(0);
|
||||||
|
String firstAccount = "";
|
||||||
|
if (accountMap != null && accountMap.get("account") != null) {
|
||||||
|
firstAccount = (String) accountMap.get("account");
|
||||||
|
String userString = HttpClientUtil.get(userUrl + "&searchAccount=" + firstAccount);
|
||||||
|
// 指定用户 查询
|
||||||
|
Gson usergson = new GsonBuilder().create();
|
||||||
|
userJsonList = usergson.fromJson(userString, new TypeToken<Map>() {
|
||||||
|
}.getType());
|
||||||
|
userList = (ArrayList) userJsonList.get("data");
|
||||||
|
|
||||||
|
for (int i = 0; i < userList.size(); i++) {
|
||||||
|
JSONObject fromObject = JSONObject.fromObject(userList.get(i));
|
||||||
|
NtcRadiusReport stu = (NtcRadiusReport) JSONObject.toBean(fromObject, NtcRadiusReport.class);
|
||||||
|
exportList.add(stu);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
model.addAttribute("userList", userList);
|
||||||
|
model.addAttribute("searchAccount", firstAccount);
|
||||||
|
}
|
||||||
|
if (StringUtil.isBlank(nasIp) && nasIpList != null && nasIpList.size() > 0
|
||||||
|
&& !"2".equals(searchBusinessType)) {
|
||||||
|
Map ipMap = (Map) nasIpList.get(0);
|
||||||
|
String firstIp = "";
|
||||||
|
if (ipMap != null && ipMap.get("nasIp") != null) {
|
||||||
|
firstIp = (String) ipMap.get("nasIp");
|
||||||
|
String ipString = HttpClientUtil.get(ipUrl + "&searchNasIp=" + firstIp);
|
||||||
|
// 指定IP查询
|
||||||
|
Gson ipgson = new GsonBuilder().create();
|
||||||
|
ipJsonList = ipgson.fromJson(ipString, new TypeToken<Map>() {
|
||||||
|
}.getType());
|
||||||
|
ipList = (ArrayList) ipJsonList.get("data");
|
||||||
|
|
||||||
|
for (int i = 0; i < ipList.size(); i++) {
|
||||||
|
JSONObject fromObject = JSONObject.fromObject(ipList.get(i));
|
||||||
|
NtcRadiusReport stu = (NtcRadiusReport) JSONObject.toBean(fromObject, NtcRadiusReport.class);
|
||||||
|
exportList.add(stu);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
model.addAttribute("ipList", ipList);
|
||||||
|
model.addAttribute("searchNasIp", firstIp);
|
||||||
|
|
||||||
|
}
|
||||||
|
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");
|
||||||
|
|
||||||
|
for (int i = 0; i < userList.size(); i++) {
|
||||||
|
JSONObject fromObject = JSONObject.fromObject(userList.get(i));
|
||||||
|
NtcRadiusReport stu = (NtcRadiusReport) JSONObject.toBean(fromObject, NtcRadiusReport.class);
|
||||||
|
exportList.add(stu);
|
||||||
|
}
|
||||||
|
|
||||||
|
model.addAttribute("userList", userList);
|
||||||
|
model.addAttribute("searchAccount", account);
|
||||||
|
}
|
||||||
|
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");
|
||||||
|
|
||||||
|
for (int i = 0; i < ipList.size(); i++) {
|
||||||
|
JSONObject fromObject = JSONObject.fromObject(ipList.get(i));
|
||||||
|
NtcRadiusReport stu = (NtcRadiusReport) JSONObject.toBean(fromObject, NtcRadiusReport.class);
|
||||||
|
exportList.add(stu);
|
||||||
|
}
|
||||||
|
|
||||||
|
model.addAttribute("ipList", ipList);
|
||||||
|
model.addAttribute("searchNasIp", nasIp);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> titleList = new ArrayList<String>();
|
||||||
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
titleList.add("traffic_user_behavior");
|
||||||
|
classMap.put("traffic_user_behavior", NtcRadiusReport.class);
|
||||||
|
|
||||||
|
Properties msgProp = getMsgProp();
|
||||||
|
NtcRadiusReport ntcRadiusReport = new NtcRadiusReport();
|
||||||
|
long nums = 0;
|
||||||
|
for (NtcRadiusReport entity : exportList) {
|
||||||
|
if (null != entity.getNum()) {
|
||||||
|
nums += entity.getNum();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String report_total = msgProp.getProperty("report_total");
|
||||||
|
ntcRadiusReport.setAccount(report_total);
|
||||||
|
ntcRadiusReport.setNum(nums);
|
||||||
|
ntcRadiusReport.setNasIp(" 一 ");
|
||||||
|
ntcRadiusReport.setReportTime(" 一 ");
|
||||||
|
|
||||||
|
exportList.add(ntcRadiusReport);
|
||||||
|
|
||||||
|
dataMap.put("traffic_user_behavior", exportList);
|
||||||
|
|
||||||
|
String cfgIndexInfoNoExport = "";
|
||||||
|
noExportMap.put("traffic_user_behavior", cfgIndexInfoNoExport);
|
||||||
|
String timeRange = initLogMap(bean, "traffic_user_behavior");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
|
||||||
|
if ("csv".equals(type)) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, "traffic_user_behavior", titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, "traffic_user_behavior", titleList, classMap,
|
||||||
|
dataMap, noExportMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String initLogMap(NtcRadiusReport log, String title) {
|
||||||
|
Properties msgProp = getMsgProp();
|
||||||
|
String logTime = msgProp.getProperty(title, title);
|
||||||
|
;
|
||||||
|
if (log.getSearchFoundStartTime() != null) {
|
||||||
|
logTime += " " + msgProp.getProperty("begin_date") + ":" + log.getSearchFoundStartTime();
|
||||||
|
}
|
||||||
|
if (log.getSearchFoundEndTime() != null) {
|
||||||
|
logTime += " " + msgProp.getProperty("end_date") + ":" + log.getSearchFoundStartTime();
|
||||||
|
}
|
||||||
|
return logTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,9 +42,16 @@ public class DynamicIndexController extends BaseController {
|
|||||||
public String dynamicIndex(HttpServletRequest request){
|
public String dynamicIndex(HttpServletRequest request){
|
||||||
String serviceIds = request.getParameter("sid");
|
String serviceIds = request.getParameter("sid");
|
||||||
String baseNum = request.getParameter("baseNum");
|
String baseNum = request.getParameter("baseNum");
|
||||||
Object trafficAreaStat = trafficAreaStat(null, Integer.parseInt(baseNum));
|
String hourStr = request.getParameter("hour");
|
||||||
Object dropStat = dropStat(null, Integer.parseInt(baseNum));
|
String dropBaseNum = request.getParameter("dropBaseNum");
|
||||||
Object logStat = logStat(null, serviceIds, Integer.parseInt(baseNum));
|
String serviceBaseNum = request.getParameter("serviceBaseNum");
|
||||||
|
Integer hour = null;
|
||||||
|
if(hourStr!=null &&!"".equals(hourStr)){
|
||||||
|
hour = Integer.parseInt(hourStr);
|
||||||
|
}
|
||||||
|
Object trafficAreaStat = trafficAreaStat(hour, Long.valueOf(baseNum));
|
||||||
|
Object dropStat = dropStat(hour, Long.valueOf(dropBaseNum));
|
||||||
|
Object logStat = logStat(hour, serviceIds, Long.valueOf(serviceBaseNum));
|
||||||
Gson gson = new GsonBuilder().create();
|
Gson gson = new GsonBuilder().create();
|
||||||
String trafficJson = gson.toJson(trafficAreaStat);
|
String trafficJson = gson.toJson(trafficAreaStat);
|
||||||
String dropJson = gson.toJson(dropStat);
|
String dropJson = gson.toJson(dropStat);
|
||||||
@@ -89,26 +96,25 @@ public class DynamicIndexController extends BaseController {
|
|||||||
* @param hour 取hour小时内的流量数据,默认24小时
|
* @param hour 取hour小时内的流量数据,默认24小时
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Object trafficAreaStat(Integer hour, Integer baseNum) {
|
public Object trafficAreaStat(Integer hour, long baseNum) {
|
||||||
List<Map> results = new ArrayList<>();
|
List<Map> results = new ArrayList<>();
|
||||||
|
|
||||||
if (hour == null || hour <= 0) {
|
if (hour == null || hour <= 0) {
|
||||||
hour = 24;
|
hour = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
Date start = new Date(now.getTime()-(hour*60*60*1000));
|
Date start = new Date(now.getTime()-(hour*60*60*1000)-(5*60*1000));
|
||||||
|
now = new Date(now.getTime()-5*60*1000);
|
||||||
String nowString = DateUtils.formatDate(now, "yyyy-MM-dd HH:mm:ss");
|
String nowString = DateUtils.formatDate(now, "yyyy-MM-dd HH:mm:ss");
|
||||||
String startString = DateUtils.formatDate(start, "yyyy-MM-dd HH:mm:ss");
|
String startString = DateUtils.formatDate(start, "yyyy-MM-dd HH:mm:ss");
|
||||||
nowString = "2018-12-05 00:00:00";
|
/*nowString = "2018-12-05 00:00:00";
|
||||||
startString = "2018-12-04 17:00:00";
|
startString = "2018-12-04 17:00:00";*/
|
||||||
String url = Constants.LOG_BASE_URL + Constants.TRAFFIC_AREA_STAT;
|
String url = Constants.LOG_BASE_URL + Constants.TRAFFIC_AREA_STAT;
|
||||||
//String url = "http://localhost:8080/ntc/helloworld/test";
|
//String url = "http://localhost:8080/ntc/helloworld/test";
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
params.put("searchReportStartTime", startString);
|
params.put("searchReportStartTime", startString);
|
||||||
params.put("searchReportEndTime", nowString);
|
params.put("searchReportEndTime", nowString);
|
||||||
//params.put("baseNum", baseNum);
|
params.put("baseNum", baseNum);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String recv = HttpClientUtil.getMsg(url, params, null);
|
String recv = HttpClientUtil.getMsg(url, params, null);
|
||||||
@@ -126,7 +132,11 @@ public class DynamicIndexController extends BaseController {
|
|||||||
}
|
}
|
||||||
List<Object> point = new ArrayList<>();//每个点 [时间戳, 数值]
|
List<Object> point = new ArrayList<>();//每个点 [时间戳, 数值]
|
||||||
point.add(DateUtils.parseDate(entity.getReportTime()).getTime());
|
point.add(DateUtils.parseDate(entity.getReportTime()).getTime());
|
||||||
|
/*if(0<entity.getSum()){//1024*1024*1024=1073741824
|
||||||
|
point.add(entity.getSum()/1073741824);
|
||||||
|
}else{
|
||||||
point.add(entity.getSum());
|
point.add(entity.getSum());
|
||||||
|
}*/point.add(entity.getSum());
|
||||||
|
|
||||||
List<List<Object>> points = t.get(entity.getArea());//所有点
|
List<List<Object>> points = t.get(entity.getArea());//所有点
|
||||||
points.add(point);
|
points.add(point);
|
||||||
@@ -166,11 +176,12 @@ public class DynamicIndexController extends BaseController {
|
|||||||
* @param hour 取hour小时内的丢弃数据,默认24小时
|
* @param hour 取hour小时内的丢弃数据,默认24小时
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Object dropStat(Integer hour, Integer baseNum) {
|
public Object dropStat(Integer hour, long baseNum) {
|
||||||
List<Map> results = new ArrayList<>();
|
List<Map> results = new ArrayList<>();
|
||||||
|
|
||||||
if (hour == null || hour <= 0) {
|
if (hour == null || hour <= 0) {
|
||||||
hour = 24;
|
//hour = 24;
|
||||||
|
hour = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
@@ -184,8 +195,8 @@ public class DynamicIndexController extends BaseController {
|
|||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
params.put("searchReportStartTime", startString);
|
params.put("searchReportStartTime", startString);
|
||||||
params.put("searchReportEndTime", nowString);
|
params.put("searchReportEndTime", nowString);
|
||||||
params.put("searchBusinessType", 1);
|
params.put("searchBusinessType", 2);
|
||||||
//params.put("baseNum", baseNum);
|
params.put("baseNum", baseNum);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String recv = HttpClientUtil.getMsg(url, params, null);
|
String recv = HttpClientUtil.getMsg(url, params, null);
|
||||||
@@ -229,7 +240,7 @@ public class DynamicIndexController extends BaseController {
|
|||||||
* @param hour 取hour小时内的日志数据,默认24小时
|
* @param hour 取hour小时内的日志数据,默认24小时
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Object logStat(Integer hour, String serviceIds, Integer baseNum) {
|
public Object logStat(Integer hour, String serviceIds, long baseNum) {
|
||||||
String[] _idsArr = serviceIds.split(",");
|
String[] _idsArr = serviceIds.split(",");
|
||||||
Long[] idsArr = new Long[5];
|
Long[] idsArr = new Long[5];
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
@@ -239,7 +250,7 @@ public class DynamicIndexController extends BaseController {
|
|||||||
List results = new ArrayList<>();
|
List results = new ArrayList<>();
|
||||||
|
|
||||||
if (hour == null || hour <= 0) {
|
if (hour == null || hour <= 0) {
|
||||||
hour = 24;
|
hour = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
|
|||||||
@@ -186,7 +186,8 @@ public class DkBehaviorLogController extends BaseController{
|
|||||||
String cfgIndexInfoNoExport = "," + hColumns;
|
String cfgIndexInfoNoExport = "," + hColumns;
|
||||||
noExportMap.put(name, cfgIndexInfoNoExport);
|
noExportMap.put(name, cfgIndexInfoNoExport);
|
||||||
dataMap.put(name, list);
|
dataMap.put(name, list);
|
||||||
|
String timeRange= initLogMap(entry,name);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, name, titleList, classMap,
|
this._exportCsv(model, request, response, redirectAttributes, name, titleList, classMap,
|
||||||
dataMap, noExportMap);
|
dataMap, noExportMap);
|
||||||
|
|||||||
@@ -124,6 +124,8 @@ public class BgpLogController extends BaseController {
|
|||||||
String cfgIndexInfoNoExport = "," + hColumns;
|
String cfgIndexInfoNoExport = "," + hColumns;
|
||||||
noExportMap.put("bgp_control", cfgIndexInfoNoExport);
|
noExportMap.put("bgp_control", cfgIndexInfoNoExport);
|
||||||
dataMap.put("bgp_control", list);
|
dataMap.put("bgp_control", list);
|
||||||
|
String timeRange= initLogMap(log,"bgp_control");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
/* } */
|
/* } */
|
||||||
if ("csv".equals(types)) {
|
if ("csv".equals(types)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "bgp_control", titleList, classMap,
|
this._exportCsv(model, request, response, redirectAttributes, "bgp_control", titleList, classMap,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import java.util.Date;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -31,6 +32,7 @@ import com.nis.domain.FunctionServiceDict;
|
|||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.PageLog;
|
import com.nis.domain.PageLog;
|
||||||
import com.nis.domain.SysUser;
|
import com.nis.domain.SysUser;
|
||||||
|
import com.nis.domain.log.BaseLogEntity;
|
||||||
import com.nis.domain.log.NtcBGPLog;
|
import com.nis.domain.log.NtcBGPLog;
|
||||||
import com.nis.domain.log.NtcCollectRadiusLog;
|
import com.nis.domain.log.NtcCollectRadiusLog;
|
||||||
import com.nis.domain.log.NtcCollectVoipLog;
|
import com.nis.domain.log.NtcCollectVoipLog;
|
||||||
@@ -140,7 +142,7 @@ public class CollectVoipLogController extends BaseController {
|
|||||||
url = Constants.LOG_BASE_URL + Constants.NTC_COLLECT_VOIP_LOG;
|
url = Constants.LOG_BASE_URL + Constants.NTC_COLLECT_VOIP_LOG;
|
||||||
String jsonString = HttpClientUtil.getMsg(url, params, request);
|
String jsonString = HttpClientUtil.getMsg(url, params, request);
|
||||||
|
|
||||||
// GsonBuilder builder = new GsonBuilder();
|
GsonBuilder builder = new GsonBuilder();
|
||||||
// builder.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
|
// builder.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
|
||||||
//
|
//
|
||||||
// public Date deserialize(JsonElement json, java.lang.reflect.Type typeOfT,
|
// public Date deserialize(JsonElement json, java.lang.reflect.Type typeOfT,
|
||||||
@@ -148,8 +150,8 @@ public class CollectVoipLogController extends BaseController {
|
|||||||
// return new Date(json.getAsJsonPrimitive().getAsLong());
|
// return new Date(json.getAsJsonPrimitive().getAsLong());
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
// Gson gson = builder.setDateFormat("yyyy-MM-dd HH:mm:ss").create();
|
Gson gson = builder.setDateFormat("yyyy-MM-dd HH:mm:ss").create();
|
||||||
Gson gson = new GsonBuilder().create();
|
// Gson gson = new GsonBuilder().create();
|
||||||
// gson泛型支持
|
// gson泛型支持
|
||||||
LogRecvData<NtcCollectVoipLog> fromJson = gson.fromJson(jsonString,
|
LogRecvData<NtcCollectVoipLog> fromJson = gson.fromJson(jsonString,
|
||||||
new TypeToken<LogRecvData<NtcCollectVoipLog>>() {
|
new TypeToken<LogRecvData<NtcCollectVoipLog>>() {
|
||||||
@@ -278,6 +280,8 @@ public class CollectVoipLogController extends BaseController {
|
|||||||
String cfgIndexInfoNoExport = ",cfg_id,action," + hColumns;
|
String cfgIndexInfoNoExport = ",cfg_id,action," + hColumns;
|
||||||
noExportMap.put("collect_voip", cfgIndexInfoNoExport);
|
noExportMap.put("collect_voip", cfgIndexInfoNoExport);
|
||||||
dataMap.put("collect_voip", list);
|
dataMap.put("collect_voip", list);
|
||||||
|
String timeRange= initLogVoipMap(entry,"collect_voip");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
/* } */
|
/* } */
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "collect_voip", titleList, classMap,
|
this._exportCsv(model, request, response, redirectAttributes, "collect_voip", titleList, classMap,
|
||||||
@@ -292,6 +296,20 @@ public class CollectVoipLogController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String initLogVoipMap(NtcCollectVoipLog log,String title){
|
||||||
|
Properties msgProp = getMsgProp();
|
||||||
|
String logTime=msgProp.getProperty(title,title);;
|
||||||
|
if(log.getSearchFoundStartTime()!=null){
|
||||||
|
logTime+=" "+msgProp.getProperty("begin_date")+":"+log.getSearchFoundStartTime();
|
||||||
|
}
|
||||||
|
if(log.getSearchFoundEndTime()!=null){
|
||||||
|
logTime+=" "+msgProp.getProperty("end_date")+":"+log.getSearchFoundStartTime();
|
||||||
|
}
|
||||||
|
return logTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<NtcCollectVoipLog> getList() {
|
public List<NtcCollectVoipLog> getList() {
|
||||||
List<NtcCollectVoipLog> list = new ArrayList<NtcCollectVoipLog>();
|
List<NtcCollectVoipLog> list = new ArrayList<NtcCollectVoipLog>();
|
||||||
for (int i = 0; i < 100; i++) {
|
for (int i = 0; i < 100; i++) {
|
||||||
|
|||||||
@@ -170,7 +170,8 @@ public class DdosLogController extends BaseController{
|
|||||||
String cfgIndexInfoNoExport = "," + hColumns;
|
String cfgIndexInfoNoExport = "," + hColumns;
|
||||||
noExportMap.put("target_ip_protect", cfgIndexInfoNoExport);
|
noExportMap.put("target_ip_protect", cfgIndexInfoNoExport);
|
||||||
dataMap.put("target_ip_protect", list);
|
dataMap.put("target_ip_protect", list);
|
||||||
|
String timeRange= initLogMap(log,"target_ip_protect");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "target_ip_protect", titleList, classMap, dataMap,
|
this._exportCsv(model, request, response, redirectAttributes, "target_ip_protect", titleList, classMap, dataMap,
|
||||||
noExportMap);
|
noExportMap);
|
||||||
|
|||||||
@@ -133,6 +133,8 @@ public class DnsLogController extends BaseController {
|
|||||||
String cfgIndexInfoNoExport = "," + hColumns;
|
String cfgIndexInfoNoExport = "," + hColumns;
|
||||||
noExportMap.put("DNS", cfgIndexInfoNoExport);
|
noExportMap.put("DNS", cfgIndexInfoNoExport);
|
||||||
dataMap.put("DNS", list);
|
dataMap.put("DNS", list);
|
||||||
|
String timeRange= initLogMap(log,"DNS");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
/* } */
|
/* } */
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "DNS", titleList, classMap, dataMap,
|
this._exportCsv(model, request, response, redirectAttributes, "DNS", titleList, classMap, dataMap,
|
||||||
|
|||||||
@@ -144,6 +144,8 @@ public class FtpLogController extends BaseController {
|
|||||||
String cfgIndexInfoNoExport = "," + hColumns;
|
String cfgIndexInfoNoExport = "," + hColumns;
|
||||||
noExportMap.put("ftp_control", cfgIndexInfoNoExport);
|
noExportMap.put("ftp_control", cfgIndexInfoNoExport);
|
||||||
dataMap.put("ftp_control", list);
|
dataMap.put("ftp_control", list);
|
||||||
|
String timeRange= initLogMap(log,"ftp_control");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
/* } */
|
/* } */
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "ftp_control", titleList, classMap,
|
this._exportCsv(model, request, response, redirectAttributes, "ftp_control", titleList, classMap,
|
||||||
|
|||||||
@@ -147,8 +147,8 @@ public class HttpKeyLogController extends BaseController {
|
|||||||
String cfgIndexInfoNoExport = "," + hColumns;
|
String cfgIndexInfoNoExport = "," + hColumns;
|
||||||
noExportMap.put("http_keyword", cfgIndexInfoNoExport);
|
noExportMap.put("http_keyword", cfgIndexInfoNoExport);
|
||||||
dataMap.put("http_keyword", list);
|
dataMap.put("http_keyword", list);
|
||||||
// String timeRange= initLogMap(log,"http_keyword");
|
String timeRange= initLogMap(log,"http_keyword");
|
||||||
// noExportMap.put("timeRange", timeRange);
|
noExportMap.put("timeRange", timeRange);
|
||||||
/* } */
|
/* } */
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "http_keyword", titleList, classMap,
|
this._exportCsv(model, request, response, redirectAttributes, "http_keyword", titleList, classMap,
|
||||||
|
|||||||
@@ -143,8 +143,8 @@ public class HttpLogController extends BaseController {
|
|||||||
String cfgIndexInfoNoExport = "," + hColumns;
|
String cfgIndexInfoNoExport = "," + hColumns;
|
||||||
noExportMap.put("HTTP", cfgIndexInfoNoExport);
|
noExportMap.put("HTTP", cfgIndexInfoNoExport);
|
||||||
dataMap.put("HTTP", list);
|
dataMap.put("HTTP", list);
|
||||||
/*String timeRange= initLogMap(log,"HTTP");
|
String timeRange= initLogMap(log,"HTTP");
|
||||||
noExportMap.put("timeRange", timeRange);*/
|
noExportMap.put("timeRange", timeRange);
|
||||||
/* } */
|
/* } */
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "HTTP", titleList, classMap, dataMap,
|
this._exportCsv(model, request, response, redirectAttributes, "HTTP", titleList, classMap, dataMap,
|
||||||
|
|||||||
@@ -1,25 +1,18 @@
|
|||||||
package com.nis.web.controller.log.ntc;
|
package com.nis.web.controller.log.ntc;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.aspectj.util.FileUtil;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
@@ -27,11 +20,8 @@ import com.nis.domain.FunctionServiceDict;
|
|||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.PageLog;
|
import com.nis.domain.PageLog;
|
||||||
import com.nis.domain.SysUser;
|
import com.nis.domain.SysUser;
|
||||||
import com.nis.domain.log.NtcHttpLog;
|
|
||||||
import com.nis.domain.log.NtcIpLog;
|
|
||||||
import com.nis.domain.log.NtcIpLog;
|
import com.nis.domain.log.NtcIpLog;
|
||||||
import com.nis.domain.maat.LogRecvData;
|
import com.nis.domain.maat.LogRecvData;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
import com.nis.util.httpclient.HttpClientUtil;
|
import com.nis.util.httpclient.HttpClientUtil;
|
||||||
@@ -138,7 +128,6 @@ public class IpLogController extends BaseController {
|
|||||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
|
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
|
||||||
model.addAttribute("serviceList", serviceList);
|
model.addAttribute("serviceList", serviceList);
|
||||||
|
|
||||||
|
|
||||||
String url = Constants.LOG_BASE_URL + Constants.NTC_IP_LOG;
|
String url = Constants.LOG_BASE_URL + Constants.NTC_IP_LOG;
|
||||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||||
List<NtcIpLog> list = new ArrayList<NtcIpLog>();
|
List<NtcIpLog> list = new ArrayList<NtcIpLog>();
|
||||||
@@ -156,8 +145,8 @@ public class IpLogController extends BaseController {
|
|||||||
setLogAction(l, serviceList);
|
setLogAction(l, serviceList);
|
||||||
}
|
}
|
||||||
|
|
||||||
titleList.add("Ip");
|
titleList.add("ip_control");
|
||||||
classMap.put("Ip", NtcIpLog.class);
|
classMap.put("ip_control", NtcIpLog.class);
|
||||||
SysUser user = UserUtils.getUser();
|
SysUser user = UserUtils.getUser();
|
||||||
if (!user.isAdmin()) {
|
if (!user.isAdmin()) {
|
||||||
hColumns += ",scene_file,";
|
hColumns += ",scene_file,";
|
||||||
@@ -165,14 +154,15 @@ public class IpLogController extends BaseController {
|
|||||||
hColumns += ",";
|
hColumns += ",";
|
||||||
}
|
}
|
||||||
String cfgIndexInfoNoExport = "," + hColumns;
|
String cfgIndexInfoNoExport = "," + hColumns;
|
||||||
noExportMap.put("Ip", cfgIndexInfoNoExport);
|
noExportMap.put("ip_control", cfgIndexInfoNoExport);
|
||||||
dataMap.put("Ip", list);
|
dataMap.put("ip_control", list);
|
||||||
|
String timeRange= initLogMap(log,"ip_control");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "Ip", titleList, classMap,
|
this._exportCsv(model, request, response, redirectAttributes, "ip_control", titleList, classMap,
|
||||||
dataMap, noExportMap);
|
dataMap, noExportMap);
|
||||||
} else {
|
} else {
|
||||||
this._export(model, request, response, redirectAttributes, "Ip", titleList, classMap, dataMap,
|
this._export(model, request, response, redirectAttributes, "ip_control", titleList, classMap, dataMap,
|
||||||
noExportMap);
|
noExportMap);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.nis.web.controller.log.ntc;
|
package com.nis.web.controller.log.ntc;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -12,6 +13,7 @@ import org.springframework.stereotype.Controller;
|
|||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
@@ -19,13 +21,14 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
import com.nis.domain.FunctionServiceDict;
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.PageLog;
|
import com.nis.domain.PageLog;
|
||||||
|
import com.nis.domain.SysUser;
|
||||||
import com.nis.domain.log.IrDnatLog;
|
import com.nis.domain.log.IrDnatLog;
|
||||||
import com.nis.domain.log.NtcIpsecLog;
|
|
||||||
import com.nis.domain.maat.LogRecvData;
|
import com.nis.domain.maat.LogRecvData;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
import com.nis.util.httpclient.HttpClientUtil;
|
import com.nis.util.httpclient.HttpClientUtil;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
import com.nis.web.security.UserUtils;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/log/ntc/irDnatLogs")
|
@RequestMapping("${adminPath}/log/ntc/irDnatLogs")
|
||||||
@@ -70,4 +73,69 @@ public class IrDnatLogController extends BaseController {
|
|||||||
return "/log/ntc/irDnatLogList";
|
return "/log/ntc/irDnatLogList";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Ip配置导出
|
||||||
|
@RequestMapping(value = "exportDnat")
|
||||||
|
public void exportIp(@ModelAttribute("log") IrDnatLog log, Model model, String hColumns, String type,
|
||||||
|
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||||
|
try {
|
||||||
|
// export data info
|
||||||
|
List<String> titleList = new ArrayList<String>();
|
||||||
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
// ---------------------------
|
||||||
|
List<IrDnatLog> list = new ArrayList<IrDnatLog>();
|
||||||
|
PageLog<IrDnatLog> page = new PageLog<IrDnatLog>(request, response);
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("pageSize", page.getPageSize());
|
||||||
|
params.put("pageNo", page.getPageNo());
|
||||||
|
initLogSearchValue(log, params);
|
||||||
|
|
||||||
|
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
|
||||||
|
model.addAttribute("serviceList", serviceList);
|
||||||
|
|
||||||
|
String url = Constants.LOG_BASE_URL + Constants.IR_DNAT_LOG;
|
||||||
|
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(recv)) {
|
||||||
|
Gson gson = new GsonBuilder().create();
|
||||||
|
LogRecvData<IrDnatLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<IrDnatLog>>(){}.getType());
|
||||||
|
if (fromJson.getStatus().intValue() == 200) {
|
||||||
|
Page<IrDnatLog> data = fromJson.getData();
|
||||||
|
list = data.getList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (IrDnatLog l : list) {
|
||||||
|
l.setFunctionId(log.getFunctionId());
|
||||||
|
setLogAction(l,serviceList);
|
||||||
|
}
|
||||||
|
titleList.add("dnat_multiplex");
|
||||||
|
classMap.put("dnat_multiplex", IrDnatLog.class);
|
||||||
|
SysUser user = UserUtils.getUser();
|
||||||
|
if (!user.isAdmin()) {
|
||||||
|
hColumns += ",scene_file,";
|
||||||
|
} else {
|
||||||
|
hColumns += ",";
|
||||||
|
}
|
||||||
|
String cfgIndexInfoNoExport = "," + hColumns;
|
||||||
|
noExportMap.put("dnat_multiplex", cfgIndexInfoNoExport);
|
||||||
|
dataMap.put("dnat_multiplex", list);
|
||||||
|
String timeRange= initLogMap(log,"dnat_multiplex");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(type)) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, "dnat_multiplex", titleList, classMap,
|
||||||
|
dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, "dnat_multiplex", titleList, classMap, dataMap,
|
||||||
|
noExportMap);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("dnat_multiplex export failed", e);
|
||||||
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.nis.web.controller.log.ntc;
|
package com.nis.web.controller.log.ntc;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -12,6 +13,7 @@ import org.springframework.stereotype.Controller;
|
|||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
@@ -19,13 +21,14 @@ import com.google.gson.reflect.TypeToken;
|
|||||||
import com.nis.domain.FunctionServiceDict;
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.PageLog;
|
import com.nis.domain.PageLog;
|
||||||
import com.nis.domain.log.IrDnatLog;
|
import com.nis.domain.SysUser;
|
||||||
import com.nis.domain.log.IrSnatLog;
|
import com.nis.domain.log.IrSnatLog;
|
||||||
import com.nis.domain.maat.LogRecvData;
|
import com.nis.domain.maat.LogRecvData;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
import com.nis.util.httpclient.HttpClientUtil;
|
import com.nis.util.httpclient.HttpClientUtil;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
import com.nis.web.security.UserUtils;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/log/ntc/irSnatLogs")
|
@RequestMapping("${adminPath}/log/ntc/irSnatLogs")
|
||||||
@@ -71,4 +74,70 @@ public class IrSnatLogController extends BaseController {
|
|||||||
return "/log/ntc/irSnatLogList";
|
return "/log/ntc/irSnatLogList";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ip配置导出
|
||||||
|
@RequestMapping(value = "exportSnat")
|
||||||
|
public void exportIp(@ModelAttribute("log") IrSnatLog log, Model model, String hColumns, String type,
|
||||||
|
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||||
|
try {
|
||||||
|
// export data info
|
||||||
|
List<String> titleList = new ArrayList<String>();
|
||||||
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
// ---------------------------
|
||||||
|
List<IrSnatLog> list = new ArrayList<IrSnatLog>();
|
||||||
|
PageLog<IrSnatLog> page = new PageLog<IrSnatLog>(request, response);
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("pageSize", page.getPageSize());
|
||||||
|
params.put("pageNo", page.getPageNo());
|
||||||
|
initLogSearchValue(log, params);
|
||||||
|
|
||||||
|
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
|
||||||
|
model.addAttribute("serviceList", serviceList);
|
||||||
|
|
||||||
|
String url = Constants.LOG_BASE_URL + Constants.IR_SNAT_LOG;
|
||||||
|
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(recv)) {
|
||||||
|
Gson gson = new GsonBuilder().create();
|
||||||
|
LogRecvData<IrSnatLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<IrSnatLog>>(){}.getType());
|
||||||
|
if (fromJson.getStatus().intValue() == 200) {
|
||||||
|
Page<IrSnatLog> data = fromJson.getData();
|
||||||
|
list = data.getList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (IrSnatLog l : list) {
|
||||||
|
l.setFunctionId(log.getFunctionId());
|
||||||
|
setLogAction(l,serviceList);
|
||||||
|
}
|
||||||
|
|
||||||
|
titleList.add("snat_multiplex");
|
||||||
|
classMap.put("snat_multiplex", IrSnatLog.class);
|
||||||
|
SysUser user = UserUtils.getUser();
|
||||||
|
if (!user.isAdmin()) {
|
||||||
|
hColumns += ",scene_file,";
|
||||||
|
} else {
|
||||||
|
hColumns += ",";
|
||||||
|
}
|
||||||
|
String cfgIndexInfoNoExport = "," + hColumns;
|
||||||
|
noExportMap.put("snat_multiplex", cfgIndexInfoNoExport);
|
||||||
|
dataMap.put("snat_multiplex", list);
|
||||||
|
String timeRange= initLogMap(log,"snat_multiplex");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(type)) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, "snat_multiplex", titleList, classMap,
|
||||||
|
dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, "snat_multiplex", titleList, classMap, dataMap,
|
||||||
|
noExportMap);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("snat_multiplex export failed", e);
|
||||||
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,6 +151,8 @@ public class MailLogController extends BaseController {
|
|||||||
String cfgIndexInfoNoExport = "," + hColumns;
|
String cfgIndexInfoNoExport = "," + hColumns;
|
||||||
noExportMap.put("mail_control", cfgIndexInfoNoExport);
|
noExportMap.put("mail_control", cfgIndexInfoNoExport);
|
||||||
dataMap.put("mail_control", list);
|
dataMap.put("mail_control", list);
|
||||||
|
String timeRange= initLogMap(log,"mail_control");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
/* } */
|
/* } */
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "mail_control", titleList, classMap,
|
this._exportCsv(model, request, response, redirectAttributes, "mail_control", titleList, classMap,
|
||||||
|
|||||||
@@ -147,6 +147,8 @@ public class MmAvUrlLogController extends BaseController {
|
|||||||
String cfgIndexInfoNoExport = "," + hColumns;
|
String cfgIndexInfoNoExport = "," + hColumns;
|
||||||
noExportMap.put("streaming_media", cfgIndexInfoNoExport);
|
noExportMap.put("streaming_media", cfgIndexInfoNoExport);
|
||||||
dataMap.put("streaming_media", list);
|
dataMap.put("streaming_media", list);
|
||||||
|
String timeRange= initLogMap(log,"streaming_media");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
/* } */
|
/* } */
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "streaming_media", titleList, classMap,
|
this._exportCsv(model, request, response, redirectAttributes, "streaming_media", titleList, classMap,
|
||||||
|
|||||||
@@ -146,7 +146,8 @@ public class MmFileDigestLogController extends BaseController {
|
|||||||
String cfgIndexInfoNoExport = ",log_uri,direction," + hColumns;
|
String cfgIndexInfoNoExport = ",log_uri,direction," + hColumns;
|
||||||
noExportMap.put("file_digest_control", cfgIndexInfoNoExport);
|
noExportMap.put("file_digest_control", cfgIndexInfoNoExport);
|
||||||
dataMap.put("file_digest_control", list);
|
dataMap.put("file_digest_control", list);
|
||||||
|
String timeRange= initLogMap(log,"file_digest_control");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "file_digest_control", titleList, classMap, dataMap,
|
this._exportCsv(model, request, response, redirectAttributes, "file_digest_control", titleList, classMap, dataMap,
|
||||||
noExportMap);
|
noExportMap);
|
||||||
|
|||||||
@@ -169,6 +169,8 @@ public class MmPornAvSampleController extends BaseController {
|
|||||||
String cfgIndexInfoNoExport=","+hColumns;
|
String cfgIndexInfoNoExport=","+hColumns;
|
||||||
noExportMap.put("av_sample_video_porn_control",cfgIndexInfoNoExport);
|
noExportMap.put("av_sample_video_porn_control",cfgIndexInfoNoExport);
|
||||||
dataMap.put("av_sample_video_porn_control",list);
|
dataMap.put("av_sample_video_porn_control",list);
|
||||||
|
String timeRange= initLogMap(log,"av_sample_video_porn_control");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
/*}*/
|
/*}*/
|
||||||
if("csv".equals(type)){
|
if("csv".equals(type)){
|
||||||
this._exportCsv(model, request, response, redirectAttributes,"av_sample_video_porn_control",titleList,classMap,dataMap,noExportMap);
|
this._exportCsv(model, request, response, redirectAttributes,"av_sample_video_porn_control",titleList,classMap,dataMap,noExportMap);
|
||||||
|
|||||||
@@ -127,7 +127,8 @@ public class MmSampleAudioController extends BaseController{
|
|||||||
String cfgIndexInfoNoExport = ",direction," + hColumns;
|
String cfgIndexInfoNoExport = ",direction," + hColumns;
|
||||||
noExportMap.put("av_sample_audio_control", cfgIndexInfoNoExport);
|
noExportMap.put("av_sample_audio_control", cfgIndexInfoNoExport);
|
||||||
dataMap.put("av_sample_audio_control", list);
|
dataMap.put("av_sample_audio_control", list);
|
||||||
|
String timeRange= initLogMap(log,"av_sample_audio_control");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "av_sample_audio_control", titleList, classMap, dataMap,
|
this._exportCsv(model, request, response, redirectAttributes, "av_sample_audio_control", titleList, classMap, dataMap,
|
||||||
noExportMap);
|
noExportMap);
|
||||||
|
|||||||
@@ -112,8 +112,8 @@ public class MmSamplePicController extends BaseController{
|
|||||||
l.setFunctionId(log.getFunctionId());
|
l.setFunctionId(log.getFunctionId());
|
||||||
setLogAction(l, serviceList);
|
setLogAction(l, serviceList);
|
||||||
}
|
}
|
||||||
titleList.add("SamplePic");
|
titleList.add("av_sample_picture_control");
|
||||||
classMap.put("SamplePic", MmSamplePicLog.class);
|
classMap.put("av_sample_picture_control", MmSamplePicLog.class);
|
||||||
SysUser user = UserUtils.getUser();
|
SysUser user = UserUtils.getUser();
|
||||||
if (!user.isAdmin()) {
|
if (!user.isAdmin()) {
|
||||||
hColumns += ",scene_file,";
|
hColumns += ",scene_file,";
|
||||||
@@ -123,7 +123,8 @@ public class MmSamplePicController extends BaseController{
|
|||||||
String cfgIndexInfoNoExport = ",direction," + hColumns;
|
String cfgIndexInfoNoExport = ",direction," + hColumns;
|
||||||
noExportMap.put("av_sample_picture_control", cfgIndexInfoNoExport);
|
noExportMap.put("av_sample_picture_control", cfgIndexInfoNoExport);
|
||||||
dataMap.put("av_sample_picture_control", list);
|
dataMap.put("av_sample_picture_control", list);
|
||||||
|
String timeRange= initLogMap(log,"av_sample_picture_control");
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
if ("csv".equals(type)) {
|
if ("csv".equals(type)) {
|
||||||
this._exportCsv(model, request, response, redirectAttributes, "av_sample_picture_control", titleList, classMap,
|
this._exportCsv(model, request, response, redirectAttributes, "av_sample_picture_control", titleList, classMap,
|
||||||
dataMap, noExportMap);
|
dataMap, noExportMap);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user