Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop
This commit is contained in:
BIN
lib/maat-tools-0.0.1-SNAPSHOT.jar
Normal file
BIN
lib/maat-tools-0.0.1-SNAPSHOT.jar
Normal file
Binary file not shown.
@@ -32,11 +32,6 @@ public class AppIdCfg extends BaseCfg<AppIdCfg> {
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
* 编译id
|
||||
*/
|
||||
private Integer compileId;
|
||||
|
||||
/**
|
||||
* appName
|
||||
* @return appName
|
||||
@@ -69,22 +64,6 @@ public class AppIdCfg extends BaseCfg<AppIdCfg> {
|
||||
this.appId = appId;
|
||||
}
|
||||
|
||||
/**
|
||||
* compileId
|
||||
* @return compileId
|
||||
*/
|
||||
|
||||
public Integer getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param compileId the compileId to set
|
||||
*/
|
||||
public void setCompileId(Integer compileId) {
|
||||
this.compileId = compileId;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.nis.domain.configuration.BaseCfg#initDefaultValue()
|
||||
*/
|
||||
|
||||
@@ -22,7 +22,12 @@ import com.nis.domain.BaseEntity;
|
||||
* @version V1.0
|
||||
*/
|
||||
public class BaseCfg<T> extends BaseEntity<T> {
|
||||
protected String seltype;//选中类型,页面搜索用
|
||||
protected String tableName;
|
||||
/**
|
||||
* 编译id
|
||||
*/
|
||||
protected Integer compileId ;
|
||||
@Expose
|
||||
@SerializedName("maatTable")
|
||||
protected String maatTable;
|
||||
@@ -630,6 +635,33 @@ public class BaseCfg<T> extends BaseEntity<T> {
|
||||
public void setSearch_audit_time_end(Date search_audit_time_end) {
|
||||
this.search_audit_time_end = search_audit_time_end;
|
||||
}
|
||||
/**
|
||||
* seltype
|
||||
* @return seltype
|
||||
*/
|
||||
|
||||
public String getSeltype() {
|
||||
return seltype;
|
||||
}
|
||||
/**
|
||||
* @param seltype the seltype to set
|
||||
*/
|
||||
public void setSeltype(String seltype) {
|
||||
this.seltype = seltype;
|
||||
}
|
||||
/**
|
||||
* compileId
|
||||
* @return compileId
|
||||
*/
|
||||
|
||||
public Integer getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
/**
|
||||
* @param compileId the compileId to set
|
||||
*/
|
||||
public void setCompileId(Integer compileId) {
|
||||
this.compileId = compileId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -98,10 +98,6 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
||||
@Expose
|
||||
@SerializedName("protocolId")
|
||||
protected Integer protocolId ;
|
||||
/**
|
||||
* 编译id
|
||||
*/
|
||||
protected Long compileId ;
|
||||
/**
|
||||
* ipType
|
||||
* @return ipType
|
||||
@@ -270,20 +266,6 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
||||
public void setProtocolId(Integer protocolId) {
|
||||
this.protocolId = protocolId;
|
||||
}
|
||||
/**
|
||||
* compileId
|
||||
* @return compileId
|
||||
*/
|
||||
|
||||
public Long getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
/**
|
||||
* @param compileId the compileId to set
|
||||
*/
|
||||
public void setCompileId(Long compileId) {
|
||||
this.compileId = compileId;
|
||||
}
|
||||
@Override
|
||||
public void initDefaultValue(){
|
||||
super.initDefaultValue();
|
||||
|
||||
@@ -47,10 +47,6 @@ public class BaseStringCfg extends BaseCfg<BaseStringCfg> {
|
||||
public void setCfgKeywords(String cfgKeywords) {
|
||||
this.cfgKeywords = cfgKeywords;
|
||||
}
|
||||
/**
|
||||
* 编译id
|
||||
*/
|
||||
protected Long compileId ;
|
||||
/**
|
||||
* 表达式类型
|
||||
*/
|
||||
@@ -120,19 +116,5 @@ public class BaseStringCfg extends BaseCfg<BaseStringCfg> {
|
||||
super.initDefaultValue();
|
||||
this.isHexbin = 0;
|
||||
}
|
||||
/**
|
||||
* compile_id
|
||||
* @return compile_id
|
||||
*/
|
||||
|
||||
public Long getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
/**
|
||||
* @param compile_id the compile_id to set
|
||||
*/
|
||||
public void setCompileId(Long compileId) {
|
||||
this.compileId = compileId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import com.google.gson.annotations.SerializedName;
|
||||
* @version V1.0
|
||||
*/
|
||||
public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
|
||||
protected String tableName;
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
@@ -33,16 +32,14 @@ public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
|
||||
@Expose
|
||||
@SerializedName("district")
|
||||
protected String district ;
|
||||
protected String districtShowName;
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("keywords")
|
||||
protected String keywords;
|
||||
/**
|
||||
* 编译id
|
||||
*/
|
||||
protected Long compileId;
|
||||
protected String keywordsShowName;
|
||||
/**
|
||||
* 表达式类型
|
||||
*/
|
||||
@@ -89,20 +86,6 @@ public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
|
||||
public void setKeywords(String keywords) {
|
||||
this.keywords = keywords;
|
||||
}
|
||||
/**
|
||||
* compileId
|
||||
* @return compileId
|
||||
*/
|
||||
|
||||
public Long getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
/**
|
||||
* @param compileId the compileId to set
|
||||
*/
|
||||
public void setCompileId(Long compileId) {
|
||||
this.compileId = compileId;
|
||||
}
|
||||
/**
|
||||
* exprType
|
||||
* 继承此类的类会覆盖该方法写自己的缺省值
|
||||
@@ -158,19 +141,4 @@ public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
|
||||
this.isHexbin = 0 ;
|
||||
this.matchMethod=3;
|
||||
}
|
||||
/**
|
||||
* tableName
|
||||
* @return tableName
|
||||
*/
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
/**
|
||||
* @param tableName the tableName to set
|
||||
*/
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ package com.nis.domain.configuration;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.nis.domain.BaseEntity;
|
||||
import com.nis.domain.SysUser;
|
||||
|
||||
@@ -25,6 +26,7 @@ public class DnsIpCfg extends BaseEntity<DnsIpCfg> {
|
||||
/**
|
||||
* 配置ID
|
||||
*/
|
||||
@Expose
|
||||
private Long cfgId;
|
||||
/**
|
||||
* 配置描述
|
||||
@@ -33,46 +35,57 @@ public class DnsIpCfg extends BaseEntity<DnsIpCfg> {
|
||||
/**
|
||||
* ip类型
|
||||
*/
|
||||
@Expose
|
||||
private Integer ipType;
|
||||
/**
|
||||
* 源IP地址
|
||||
*/
|
||||
@Expose
|
||||
private String srcIp;
|
||||
/**
|
||||
* 源地址掩码
|
||||
*/
|
||||
@Expose
|
||||
private String srcIpMask ;
|
||||
/**
|
||||
* 源端口
|
||||
*/
|
||||
@Expose
|
||||
private String srcPort ;
|
||||
/**
|
||||
* 源端口掩码
|
||||
*/
|
||||
@Expose
|
||||
private String srcPortMask ;
|
||||
/**
|
||||
* 目的IP地址
|
||||
*/
|
||||
@Expose
|
||||
private String dstIp ;
|
||||
/**
|
||||
* 目的地址掩码
|
||||
*/
|
||||
@Expose
|
||||
private String dstIpMask ;
|
||||
/**
|
||||
* 目的端口
|
||||
*/
|
||||
@Expose
|
||||
private String dstPort ;
|
||||
/**
|
||||
* 目的端口掩码
|
||||
*/
|
||||
@Expose
|
||||
private String dstPortMask ;
|
||||
/**
|
||||
* 方向
|
||||
*/
|
||||
@Expose
|
||||
private Integer direction ;
|
||||
/**
|
||||
* 方向
|
||||
*/
|
||||
@Expose
|
||||
private Integer protocol ;
|
||||
/**
|
||||
* 有效标识
|
||||
|
||||
156
src/main/java/com/nis/domain/configuration/MultipleCfg.java
Normal file
156
src/main/java/com/nis/domain/configuration/MultipleCfg.java
Normal file
@@ -0,0 +1,156 @@
|
||||
/**
|
||||
*@Title: MultipleCfg.java
|
||||
*@Package com.nis.domain.configuration
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年3月13日 上午8:59:32
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: MultipleCfg.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年3月13日 上午8:59:32
|
||||
* @version V1.0
|
||||
*/
|
||||
public class MultipleCfg extends BaseCfg<MultipleCfg> {
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = -8369567908781421920L;
|
||||
private String mainTable;
|
||||
private String mainTableType;
|
||||
private List<TableBean> otherTables;//key 表名,value 类型
|
||||
// private BaseCfg mainCfg;
|
||||
//ip配置
|
||||
private Map<String,BaseIpCfg> ipCfg;
|
||||
//字符串配置
|
||||
private Map<String,BaseStringCfg> stringCfg;
|
||||
//数值类配置
|
||||
private Map<String,NumBoundaryCfg> numCfg;
|
||||
//增强字符串配置
|
||||
private Map<String,ComplexkeywordCfg> complexCfg;
|
||||
//地域配置
|
||||
private AreaIpCfg areaIpCfg;
|
||||
/**
|
||||
* mainTable
|
||||
* @return mainTable
|
||||
*/
|
||||
|
||||
public String getMainTable() {
|
||||
return mainTable;
|
||||
}
|
||||
/**
|
||||
* @param mainTable the mainTable to set
|
||||
*/
|
||||
public void setMainTable(String mainTable) {
|
||||
this.mainTable = mainTable;
|
||||
}
|
||||
/**
|
||||
* areaIpCfg
|
||||
* @return areaIpCfg
|
||||
*/
|
||||
|
||||
public AreaIpCfg getAreaIpCfg() {
|
||||
return areaIpCfg;
|
||||
}
|
||||
/**
|
||||
* @param areaIpCfg the areaIpCfg to set
|
||||
*/
|
||||
public void setAreaIpCfg(AreaIpCfg areaIpCfg) {
|
||||
this.areaIpCfg = areaIpCfg;
|
||||
}
|
||||
/**
|
||||
* ipCfg
|
||||
* @return ipCfg
|
||||
*/
|
||||
|
||||
public Map<String, BaseIpCfg> getIpCfg() {
|
||||
return ipCfg;
|
||||
}
|
||||
/**
|
||||
* @param ipCfg the ipCfg to set
|
||||
*/
|
||||
public void setIpCfg(Map<String, BaseIpCfg> ipCfg) {
|
||||
this.ipCfg = ipCfg;
|
||||
}
|
||||
/**
|
||||
* stringCfg
|
||||
* @return stringCfg
|
||||
*/
|
||||
|
||||
public Map<String, BaseStringCfg> getStringCfg() {
|
||||
return stringCfg;
|
||||
}
|
||||
/**
|
||||
* @param stringCfg the stringCfg to set
|
||||
*/
|
||||
public void setStringCfg(Map<String, BaseStringCfg> stringCfg) {
|
||||
this.stringCfg = stringCfg;
|
||||
}
|
||||
/**
|
||||
* numCfg
|
||||
* @return numCfg
|
||||
*/
|
||||
|
||||
public Map<String, NumBoundaryCfg> getNumCfg() {
|
||||
return numCfg;
|
||||
}
|
||||
/**
|
||||
* @param numCfg the numCfg to set
|
||||
*/
|
||||
public void setNumCfg(Map<String, NumBoundaryCfg> numCfg) {
|
||||
this.numCfg = numCfg;
|
||||
}
|
||||
/**
|
||||
* complexCfg
|
||||
* @return complexCfg
|
||||
*/
|
||||
|
||||
public Map<String, ComplexkeywordCfg> getComplexCfg() {
|
||||
return complexCfg;
|
||||
}
|
||||
/**
|
||||
* @param complexCfg the complexCfg to set
|
||||
*/
|
||||
public void setComplexCfg(Map<String, ComplexkeywordCfg> complexCfg) {
|
||||
this.complexCfg = complexCfg;
|
||||
}
|
||||
/**
|
||||
* mainTableType
|
||||
* @return mainTableType
|
||||
*/
|
||||
|
||||
public String getMainTableType() {
|
||||
return mainTableType;
|
||||
}
|
||||
/**
|
||||
* @param mainTableType the mainTableType to set
|
||||
*/
|
||||
public void setMainTableType(String mainTableType) {
|
||||
this.mainTableType = mainTableType;
|
||||
}
|
||||
/**
|
||||
* otherTables
|
||||
* @return otherTables
|
||||
*/
|
||||
|
||||
public List<TableBean> getOtherTables() {
|
||||
return otherTables;
|
||||
}
|
||||
/**
|
||||
* @param otherTables the otherTables to set
|
||||
*/
|
||||
public void setOtherTables(List<TableBean> otherTables) {
|
||||
this.otherTables = otherTables;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
/**
|
||||
*@Title: MultipleCfg.java
|
||||
*@Package com.nis.domain.configuration
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年3月13日 上午8:59:32
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName: MultipleCfg.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年3月13日 上午8:59:32
|
||||
* @version V1.0
|
||||
*/
|
||||
public class MultipleSearchCfg extends BaseCfg<MultipleSearchCfg> {
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = -8369567908781421920L;
|
||||
private String mainTable;//主表名
|
||||
private String mainTableType;//主表类型
|
||||
private String ipTable;//查询条件IP表名,界面限制查询条件除了共用属性之外只能查一个条件
|
||||
private String stringTable;//查询条件字符串表名,界面限制查询条件除了共用属性之外只能查一个条件
|
||||
private String complexTable;//查询条件增强字符串串表名,界面限制查询条件除了共用属性之外只能查一个条件
|
||||
private List<TableBean> otherTables;//key 表名,value 类型
|
||||
//ip配置
|
||||
private BaseIpCfg ipCfg;
|
||||
//字符串配置
|
||||
private BaseStringCfg stringCfg;
|
||||
//数值类配置
|
||||
private NumBoundaryCfg numCfg;
|
||||
//增强字符串配置
|
||||
private ComplexkeywordCfg complexCfg;
|
||||
//地域配置
|
||||
private AreaIpCfg areaIpCfg;
|
||||
/**
|
||||
* mainTable
|
||||
* @return mainTable
|
||||
*/
|
||||
|
||||
public String getMainTable() {
|
||||
return mainTable;
|
||||
}
|
||||
/**
|
||||
* @param mainTable the mainTable to set
|
||||
*/
|
||||
public void setMainTable(String mainTable) {
|
||||
this.mainTable = mainTable;
|
||||
}
|
||||
/**
|
||||
* ipCfg
|
||||
* @return ipCfg
|
||||
*/
|
||||
|
||||
public BaseIpCfg getIpCfg() {
|
||||
return ipCfg;
|
||||
}
|
||||
/**
|
||||
* @param ipCfg the ipCfg to set
|
||||
*/
|
||||
public void setIpCfg(BaseIpCfg ipCfg) {
|
||||
this.ipCfg = ipCfg;
|
||||
}
|
||||
/**
|
||||
* stringCfg
|
||||
* @return stringCfg
|
||||
*/
|
||||
|
||||
public BaseStringCfg getStringCfg() {
|
||||
return stringCfg;
|
||||
}
|
||||
/**
|
||||
* @param stringCfg the stringCfg to set
|
||||
*/
|
||||
public void setStringCfg(BaseStringCfg stringCfg) {
|
||||
this.stringCfg = stringCfg;
|
||||
}
|
||||
/**
|
||||
* numCfg
|
||||
* @return numCfg
|
||||
*/
|
||||
|
||||
public NumBoundaryCfg getNumCfg() {
|
||||
return numCfg;
|
||||
}
|
||||
/**
|
||||
* @param numCfg the numCfg to set
|
||||
*/
|
||||
public void setNumCfg(NumBoundaryCfg numCfg) {
|
||||
this.numCfg = numCfg;
|
||||
}
|
||||
/**
|
||||
* complexCfg
|
||||
* @return complexCfg
|
||||
*/
|
||||
|
||||
public ComplexkeywordCfg getComplexCfg() {
|
||||
return complexCfg;
|
||||
}
|
||||
/**
|
||||
* @param complexCfg the complexCfg to set
|
||||
*/
|
||||
public void setComplexCfg(ComplexkeywordCfg complexCfg) {
|
||||
this.complexCfg = complexCfg;
|
||||
}
|
||||
/**
|
||||
* areaIpCfg
|
||||
* @return areaIpCfg
|
||||
*/
|
||||
|
||||
public AreaIpCfg getAreaIpCfg() {
|
||||
return areaIpCfg;
|
||||
}
|
||||
/**
|
||||
* @param areaIpCfg the areaIpCfg to set
|
||||
*/
|
||||
public void setAreaIpCfg(AreaIpCfg areaIpCfg) {
|
||||
this.areaIpCfg = areaIpCfg;
|
||||
}
|
||||
/**
|
||||
* mainTableType
|
||||
* @return mainTableType
|
||||
*/
|
||||
|
||||
public String getMainTableType() {
|
||||
return mainTableType;
|
||||
}
|
||||
/**
|
||||
* @param mainTableType the mainTableType to set
|
||||
*/
|
||||
public void setMainTableType(String mainTableType) {
|
||||
this.mainTableType = mainTableType;
|
||||
}
|
||||
/**
|
||||
* otherTables
|
||||
* @return otherTables
|
||||
*/
|
||||
|
||||
public List<TableBean> getOtherTables() {
|
||||
return otherTables;
|
||||
}
|
||||
/**
|
||||
* @param otherTables the otherTables to set
|
||||
*/
|
||||
public void setOtherTables(List<TableBean> otherTables) {
|
||||
this.otherTables = otherTables;
|
||||
}
|
||||
/**
|
||||
* ipTable
|
||||
* @return ipTable
|
||||
*/
|
||||
|
||||
public String getIpTable() {
|
||||
return ipTable;
|
||||
}
|
||||
/**
|
||||
* @param ipTable the ipTable to set
|
||||
*/
|
||||
public void setIpTable(String ipTable) {
|
||||
this.ipTable = ipTable;
|
||||
}
|
||||
/**
|
||||
* stringTable
|
||||
* @return stringTable
|
||||
*/
|
||||
|
||||
public String getStringTable() {
|
||||
return stringTable;
|
||||
}
|
||||
/**
|
||||
* @param stringTable the stringTable to set
|
||||
*/
|
||||
public void setStringTable(String stringTable) {
|
||||
this.stringTable = stringTable;
|
||||
}
|
||||
/**
|
||||
* complexTable
|
||||
* @return complexTable
|
||||
*/
|
||||
|
||||
public String getComplexTable() {
|
||||
return complexTable;
|
||||
}
|
||||
/**
|
||||
* @param complexTable the complexTable to set
|
||||
*/
|
||||
public void setComplexTable(String complexTable) {
|
||||
this.complexTable = complexTable;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,7 +39,6 @@ public class NumBoundaryCfg extends BaseCfg<NumBoundaryCfg> {
|
||||
@Expose
|
||||
@SerializedName("upBoundary")
|
||||
protected Long upBoundary;
|
||||
protected Long compileId;
|
||||
/* (non-Javadoc)
|
||||
* @see com.nis.domain.configuration.BaseCfg#initDefaultValue()
|
||||
*/
|
||||
@@ -76,19 +75,4 @@ public class NumBoundaryCfg extends BaseCfg<NumBoundaryCfg> {
|
||||
public void setUpBoundary(Long upBoundary) {
|
||||
this.upBoundary = upBoundary;
|
||||
}
|
||||
/**
|
||||
* compileId
|
||||
* @return compileId
|
||||
*/
|
||||
|
||||
public Long getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
/**
|
||||
* @param compileId the compileId to set
|
||||
*/
|
||||
public void setCompileId(Long compileId) {
|
||||
this.compileId = compileId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
80
src/main/java/com/nis/domain/configuration/TableBean.java
Normal file
80
src/main/java/com/nis/domain/configuration/TableBean.java
Normal file
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
*@Title: TableBean.java
|
||||
*@Package com.nis.domain.configuration
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年3月24日 下午5:20:51
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: TableBean.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年3月24日 下午5:20:51
|
||||
* @version V1.0
|
||||
*/
|
||||
public class TableBean implements Serializable{
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = -7276874824312210708L;
|
||||
private String tableName;
|
||||
private String tableType;
|
||||
private boolean canEmpty;
|
||||
public TableBean(){
|
||||
|
||||
}
|
||||
public TableBean(String tableName,String tableType){
|
||||
this.tableName=tableName;
|
||||
this.tableType=tableType;
|
||||
}
|
||||
/**
|
||||
* tableName
|
||||
* @return tableName
|
||||
*/
|
||||
|
||||
public String getTableName() {
|
||||
return tableName;
|
||||
}
|
||||
/**
|
||||
* @param tableName the tableName to set
|
||||
*/
|
||||
public void setTableName(String tableName) {
|
||||
this.tableName = tableName;
|
||||
}
|
||||
/**
|
||||
* tableType
|
||||
* @return tableType
|
||||
*/
|
||||
|
||||
public String getTableType() {
|
||||
return tableType;
|
||||
}
|
||||
/**
|
||||
* @param tableType the tableType to set
|
||||
*/
|
||||
public void setTableType(String tableType) {
|
||||
this.tableType = tableType;
|
||||
}
|
||||
/**
|
||||
* canEmpty
|
||||
* @return canEmpty
|
||||
*/
|
||||
|
||||
public boolean isCanEmpty() {
|
||||
return canEmpty;
|
||||
}
|
||||
/**
|
||||
* @param canEmpty the canEmpty to set
|
||||
*/
|
||||
public void setCanEmpty(boolean canEmpty) {
|
||||
this.canEmpty = canEmpty;
|
||||
}
|
||||
}
|
||||
30
src/main/java/com/nis/domain/maat/DnsIpRecvData.java
Normal file
30
src/main/java/com/nis/domain/maat/DnsIpRecvData.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.nis.domain.maat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class DnsIpRecvData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3438469380427993582L;
|
||||
@Expose
|
||||
@SerializedName("cfgId")
|
||||
private Long cfgId;
|
||||
@Expose
|
||||
@SerializedName("fakeId")
|
||||
private Integer fakeId;
|
||||
|
||||
public Long getCfgId() {
|
||||
return cfgId;
|
||||
}
|
||||
public void setCfgId(Long cfgId) {
|
||||
this.cfgId = cfgId;
|
||||
}
|
||||
public Integer getFakeId() {
|
||||
return fakeId;
|
||||
}
|
||||
public void setFakeId(Integer fakeId) {
|
||||
this.fakeId = fakeId;
|
||||
}
|
||||
}
|
||||
24
src/main/java/com/nis/domain/maat/FromMaatBean.java
Normal file
24
src/main/java/com/nis/domain/maat/FromMaatBean.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.nis.domain.maat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class FromMaatBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1277140754421705676L;
|
||||
@Expose
|
||||
@SerializedName("data")
|
||||
private List<DnsIpRecvData> data;
|
||||
|
||||
public List<DnsIpRecvData> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DnsIpRecvData> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
package com.nis.domain.maat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
@@ -35,28 +36,28 @@ public class MaatCfg implements Serializable {
|
||||
private static final long serialVersionUID = -7745084076394247318L;
|
||||
@Expose
|
||||
@SerializedName("strCfg")
|
||||
private BaseStringCfg[] strCfg;
|
||||
private List<BaseStringCfg> strCfg;
|
||||
@Expose
|
||||
@SerializedName("ipCfg")
|
||||
private BaseIpCfg[] ipCfg;
|
||||
private List<BaseIpCfg> ipCfg;
|
||||
@Expose
|
||||
@SerializedName("numCfg")
|
||||
private NumBoundaryCfg[] numCfg;
|
||||
private List<NumBoundaryCfg> numCfg;
|
||||
@Expose
|
||||
@SerializedName("complexStrCfg")
|
||||
private ComplexkeywordCfg[] complexStrCfg;
|
||||
private List<ComplexkeywordCfg> complexStrCfg;
|
||||
/**
|
||||
* strCfg
|
||||
* @return strCfg
|
||||
*/
|
||||
|
||||
public BaseStringCfg[] getStrCfg() {
|
||||
public List<BaseStringCfg> getStrCfg() {
|
||||
return strCfg;
|
||||
}
|
||||
/**
|
||||
* @param strCfg the strCfg to set
|
||||
*/
|
||||
public void setStrCfg(BaseStringCfg[] strCfg) {
|
||||
public void setStrCfg(List<BaseStringCfg> strCfg) {
|
||||
this.strCfg = strCfg;
|
||||
}
|
||||
/**
|
||||
@@ -64,13 +65,13 @@ public class MaatCfg implements Serializable {
|
||||
* @return ipCfg
|
||||
*/
|
||||
|
||||
public BaseIpCfg[] getIpCfg() {
|
||||
public List<BaseIpCfg> getIpCfg() {
|
||||
return ipCfg;
|
||||
}
|
||||
/**
|
||||
* @param ipCfg the ipCfg to set
|
||||
*/
|
||||
public void setIpCfg(BaseIpCfg[] ipCfg) {
|
||||
public void setIpCfg(List<BaseIpCfg> ipCfg) {
|
||||
this.ipCfg = ipCfg;
|
||||
}
|
||||
/**
|
||||
@@ -78,13 +79,13 @@ public class MaatCfg implements Serializable {
|
||||
* @return numCfg
|
||||
*/
|
||||
|
||||
public NumBoundaryCfg[] getNumCfg() {
|
||||
public List<NumBoundaryCfg> getNumCfg() {
|
||||
return numCfg;
|
||||
}
|
||||
/**
|
||||
* @param numCfg the numCfg to set
|
||||
*/
|
||||
public void setNumCfg(NumBoundaryCfg[] numCfg) {
|
||||
public void setNumCfg(List<NumBoundaryCfg> numCfg) {
|
||||
this.numCfg = numCfg;
|
||||
}
|
||||
/**
|
||||
@@ -92,13 +93,13 @@ public class MaatCfg implements Serializable {
|
||||
* @return complexStrCfg
|
||||
*/
|
||||
|
||||
public ComplexkeywordCfg[] getComplexStrCfg() {
|
||||
public List<ComplexkeywordCfg> getComplexStrCfg() {
|
||||
return complexStrCfg;
|
||||
}
|
||||
/**
|
||||
* @param complexStrCfg the complexStrCfg to set
|
||||
*/
|
||||
public void setComplexStrCfg(ComplexkeywordCfg[] complexStrCfg) {
|
||||
public void setComplexStrCfg(List<ComplexkeywordCfg> complexStrCfg) {
|
||||
this.complexStrCfg = complexStrCfg;
|
||||
}
|
||||
|
||||
|
||||
24
src/main/java/com/nis/domain/maat/MaatDnsIpCfg.java
Normal file
24
src/main/java/com/nis/domain/maat/MaatDnsIpCfg.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.nis.domain.maat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.nis.domain.configuration.DnsIpCfg;
|
||||
|
||||
public class MaatDnsIpCfg implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2407058503197501569L;
|
||||
|
||||
@Expose
|
||||
private List<DnsIpCfg> ipCfg;
|
||||
|
||||
public List<DnsIpCfg> getIpCfg() {
|
||||
return ipCfg;
|
||||
}
|
||||
|
||||
public void setIpCfg(List<DnsIpCfg> ipCfg) {
|
||||
this.ipCfg = ipCfg;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,15 +9,11 @@
|
||||
package com.nis.domain.maat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
|
||||
/**
|
||||
* @ClassName: ToMaatBean.java
|
||||
@@ -37,7 +33,7 @@ public class ToMaatBean implements Serializable{
|
||||
private static final long serialVersionUID = 5123156423588372849L;
|
||||
@Expose
|
||||
@SerializedName("serviceCfg")
|
||||
private List<MaatCfg[]> serviceCfg;
|
||||
private List<MaatCfg> serviceCfg;
|
||||
@Expose
|
||||
@SerializedName("areaCfg")
|
||||
private List<AreaIpCfg> areaCfg;
|
||||
@@ -58,7 +54,7 @@ public class ToMaatBean implements Serializable{
|
||||
private String lable;
|
||||
@Expose
|
||||
@SerializedName("compileId")
|
||||
private Long compileId;
|
||||
private Integer compileId;
|
||||
@Expose
|
||||
@SerializedName("isAreaEffective")
|
||||
private Integer isAreaEffective;
|
||||
@@ -72,18 +68,19 @@ public class ToMaatBean implements Serializable{
|
||||
@SerializedName("serviceId")
|
||||
private Integer serviceId;
|
||||
|
||||
|
||||
/**
|
||||
* serviceCfg
|
||||
* @return serviceCfg
|
||||
*/
|
||||
|
||||
public List<MaatCfg[]> getServiceCfg() {
|
||||
public List<MaatCfg> getServiceCfg() {
|
||||
return serviceCfg;
|
||||
}
|
||||
/**
|
||||
* @param serviceCfg the serviceCfg to set
|
||||
*/
|
||||
public void setServiceCfg(List<MaatCfg[]> serviceCfg) {
|
||||
public void setServiceCfg(List<MaatCfg> serviceCfg) {
|
||||
this.serviceCfg = serviceCfg;
|
||||
}
|
||||
/**
|
||||
@@ -176,13 +173,13 @@ public class ToMaatBean implements Serializable{
|
||||
* @return compileId
|
||||
*/
|
||||
|
||||
public Long getCompileId() {
|
||||
public Integer getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
/**
|
||||
* @param compileId the compileId to set
|
||||
*/
|
||||
public void setCompileId(Long compileId) {
|
||||
public void setCompileId(Integer compileId) {
|
||||
this.compileId = compileId;
|
||||
}
|
||||
/**
|
||||
@@ -242,22 +239,6 @@ public class ToMaatBean implements Serializable{
|
||||
this.serviceId = serviceId;
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
Gson gson=new GsonBuilder().disableHtmlEscaping()
|
||||
.setDateFormat("yyyy-MM-dd HH:mm:ss")
|
||||
.setPrettyPrinting()/*.serializeNulls()*/
|
||||
.excludeFieldsWithoutExposeAnnotation()
|
||||
.create();
|
||||
ToMaatBean bean=new ToMaatBean();
|
||||
List<MaatCfg[]> cfg=new ArrayList<>();
|
||||
MaatCfg[] ma=new MaatCfg[1];
|
||||
MaatCfg mc=new MaatCfg();
|
||||
IpPortCfg[] a=new IpPortCfg[1];
|
||||
a[0]=new IpPortCfg();
|
||||
mc.setIpCfg(a);
|
||||
ma[0]=mc;
|
||||
cfg.add(ma);
|
||||
bean.setServiceCfg(cfg);
|
||||
System.out.println(gson.toJson(bean));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
62
src/main/java/com/nis/domain/maat/ToMaatDnsIpBean.java
Normal file
62
src/main/java/com/nis/domain/maat/ToMaatDnsIpBean.java
Normal file
@@ -0,0 +1,62 @@
|
||||
package com.nis.domain.maat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
public class ToMaatDnsIpBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5124353996884030213L;
|
||||
|
||||
@Expose
|
||||
private List<MaatDnsIpCfg> serviceCfg;
|
||||
@Expose
|
||||
private String attribute;
|
||||
@Expose
|
||||
private String classify;
|
||||
@Expose
|
||||
private Integer isValid;
|
||||
@Expose
|
||||
private String lable;
|
||||
@Expose
|
||||
private Integer requestId;
|
||||
|
||||
public List<MaatDnsIpCfg> getServiceCfg() {
|
||||
return serviceCfg;
|
||||
}
|
||||
public void setServiceCfg(List<MaatDnsIpCfg> serviceCfg) {
|
||||
this.serviceCfg = serviceCfg;
|
||||
}
|
||||
public String getAttribute() {
|
||||
return attribute;
|
||||
}
|
||||
public void setAttribute(String attribute) {
|
||||
this.attribute = attribute;
|
||||
}
|
||||
public String getClassify() {
|
||||
return classify;
|
||||
}
|
||||
public void setClassify(String classify) {
|
||||
this.classify = classify;
|
||||
}
|
||||
public Integer getIsValid() {
|
||||
return isValid;
|
||||
}
|
||||
public void setIsValid(Integer isValid) {
|
||||
this.isValid = isValid;
|
||||
}
|
||||
public String getLable() {
|
||||
return lable;
|
||||
}
|
||||
public void setLable(String lable) {
|
||||
this.lable = lable;
|
||||
}
|
||||
public Integer getRequestId() {
|
||||
return requestId;
|
||||
}
|
||||
public void setRequestId(Integer requestId) {
|
||||
this.requestId = requestId;
|
||||
}
|
||||
|
||||
}
|
||||
51
src/main/java/com/nis/domain/maat/ToMaatUnAuditBean.java
Normal file
51
src/main/java/com/nis/domain/maat/ToMaatUnAuditBean.java
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
*@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.List;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* @ClassName: ToMaatBean.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年2月28日 下午2:03:08
|
||||
* @version V1.0
|
||||
*/
|
||||
public class ToMaatUnAuditBean implements Serializable{
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(转换为maat格式的java bean)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = 5123156423588372849L;
|
||||
@Expose
|
||||
@SerializedName("serviceCfg")
|
||||
private List<UnAuditBean> serviceCfg;
|
||||
/**
|
||||
* serviceCfg
|
||||
* @return serviceCfg
|
||||
*/
|
||||
|
||||
public List<UnAuditBean> getServiceCfg() {
|
||||
return serviceCfg;
|
||||
}
|
||||
/**
|
||||
* @param serviceCfg the serviceCfg to set
|
||||
*/
|
||||
public void setServiceCfg(List<UnAuditBean> serviceCfg) {
|
||||
this.serviceCfg = serviceCfg;
|
||||
}
|
||||
|
||||
}
|
||||
66
src/main/java/com/nis/domain/maat/UnAuditBean.java
Normal file
66
src/main/java/com/nis/domain/maat/UnAuditBean.java
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
*@Title: UnAuditBean.java
|
||||
*@Package com.nis.domain.maat
|
||||
*@Description TODO
|
||||
*@author dell
|
||||
*@date 2018年3月26日 下午1:30:07
|
||||
*@version 版本号
|
||||
*/
|
||||
package com.nis.domain.maat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* @ClassName: UnAuditBean.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年3月26日 下午1:30:07
|
||||
* @version V1.0
|
||||
*/
|
||||
public class UnAuditBean implements Serializable{
|
||||
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
||||
private static final long serialVersionUID = -3497633085090859526L;
|
||||
@Expose
|
||||
@SerializedName("compileId")
|
||||
private Integer compileId;
|
||||
@Expose
|
||||
@SerializedName("maatTable")
|
||||
private String maatTable;
|
||||
/**
|
||||
* compileId
|
||||
* @return compileId
|
||||
*/
|
||||
|
||||
public Integer getCompileId() {
|
||||
return compileId;
|
||||
}
|
||||
/**
|
||||
* @param compileId the compileId to set
|
||||
*/
|
||||
public void setCompileId(Integer compileId) {
|
||||
this.compileId = compileId;
|
||||
}
|
||||
/**
|
||||
* maatTable
|
||||
* @return maatTable
|
||||
*/
|
||||
|
||||
public String getMaatTable() {
|
||||
return maatTable;
|
||||
}
|
||||
/**
|
||||
* @param maatTable the maatTable to set
|
||||
*/
|
||||
public void setMaatTable(String maatTable) {
|
||||
this.maatTable = maatTable;
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,13 @@ public final class Constants {
|
||||
public static final String DEFAULT_CAPTCHA_PARAM = "captcha";
|
||||
public static final String DEFAULT_MOBILE_PARAM = "mobileLogin";
|
||||
public static final String DEFAULT_MESSAGE_PARAM = "message";
|
||||
|
||||
/**
|
||||
* 表类型
|
||||
*/
|
||||
public static final int TABLE_TYPE_IP = 1;
|
||||
public static final int TABLE_TYPE_STRING = 2;
|
||||
public static final int TABLE_TYPE_NUMBER = 3;
|
||||
public static final int TABLE_TYPE_COMPLEX = 4;
|
||||
/**
|
||||
* 词典数据key
|
||||
*/
|
||||
|
||||
@@ -13,10 +13,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -74,7 +74,6 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("sercice id is "+serviceId);
|
||||
if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
@@ -108,10 +107,6 @@ public class ComplexStringCfgController extends BaseController{
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("未获取到正确的serviceId");
|
||||
}
|
||||
|
||||
return "/cfg/complexCfgForm";
|
||||
}
|
||||
@RequestMapping(value = {"updateForm"})
|
||||
@@ -121,26 +116,13 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("tableName", tableName);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
ComplexkeywordCfg searchBean=new ComplexkeywordCfg();
|
||||
searchBean.setCfgId(cfgId);
|
||||
searchBean.setTableName(tableName);
|
||||
ComplexkeywordCfg cfg=complexStringCfgService.getStringCfgById(searchBean);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
List<RequestInfo> requestInfos=requestInfoService.getAllRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
|
||||
model.addAttribute("fls", fls);
|
||||
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
||||
model.addAttribute("lables", lables);
|
||||
}else if(serviceId!=null){
|
||||
try{
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
}
|
||||
}
|
||||
logger.info("table name is "+tableName);
|
||||
ComplexkeywordCfg searchBean=new ComplexkeywordCfg();
|
||||
searchBean.setCfgId(cfgId);
|
||||
@@ -155,13 +137,9 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
||||
model.addAttribute("lables", lables);
|
||||
|
||||
}catch(Exception e){
|
||||
logger.error("发生异常", e);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("未获取到正确的表名");
|
||||
}
|
||||
|
||||
return "/cfg/complexCfgForm";
|
||||
}
|
||||
|
||||
@@ -179,40 +157,21 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("cfgName",cfgName);
|
||||
model.addAttribute("cfgType","complex");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("saveOrUpdateStringCfg loaded");
|
||||
if(cfg==null){
|
||||
logger.error("无法保存空的配置!");
|
||||
addMessage(model,"保存失败!");
|
||||
}else if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
int serviceId=cfg.getServiceId();
|
||||
long compileId=getCompileId(cfg);
|
||||
// cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
// cfg.setCreateTime(new Date());
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setCompileId(compileId);
|
||||
if(cfg.getCfgId()==null){
|
||||
cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
cfg.setCreateTime(new Date());
|
||||
complexStringCfgService.addStringCfg(cfg);
|
||||
}else{
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setEditTime(new Date());
|
||||
complexStringCfgService.updateStringCfg(cfg);
|
||||
}
|
||||
model.addAttribute("serviceId",serviceId);
|
||||
model.addAttribute("serviceId",cfg.getServiceId());
|
||||
model.addAttribute("action",cfg.getAction());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}else if(cfg.getServiceId()!=null){
|
||||
logger.info("saveOrUpdateStringCfg loaded");
|
||||
try {
|
||||
String tableName=cfg.getTableName();
|
||||
int serviceId=cfg.getServiceId();
|
||||
if(StringUtils.isBlank(cfg.getTableName())){
|
||||
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
long compileId=getCompileId(cfg);
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
cfg.setTableName(tableName);
|
||||
// cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
// cfg.setCreateTime(new Date());
|
||||
}
|
||||
}
|
||||
int compileId = new ConvertTool().getCompileId();
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setCompileId(compileId);
|
||||
@@ -225,16 +184,13 @@ public class ComplexStringCfgController extends BaseController{
|
||||
cfg.setEditTime(new Date());
|
||||
complexStringCfgService.updateStringCfg(cfg);
|
||||
}
|
||||
model.addAttribute("serviceId",serviceId);
|
||||
model.addAttribute("action",cfg.getAction());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
logger.error("保存失败!",e);
|
||||
addMessage(model,"保存失败!");
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}
|
||||
return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+cfg.getServiceId()+"&action="+cfg.getAction()+"&cfgName="+cfgName);
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,55 +206,51 @@ public class ComplexStringCfgController extends BaseController{
|
||||
public String auditStringCfg(String cfgName,ComplexkeywordCfg cfg,Model model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||
if(cfg==null){
|
||||
logger.error("无法审核空的配置!");
|
||||
}else if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
int audit=complexStringCfgService.getIsAudit(cfg);
|
||||
if(audit==Constants.AUDIT_YES&&cfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
cfg.setAuditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setAuditTime(new Date());
|
||||
|
||||
if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=complexStringCfgService.auditStringCfg(cfg);
|
||||
model.addAttribute("cfgType", "complex");
|
||||
model.addAttribute("serviceId", cfg.getServiceId());
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
}
|
||||
|
||||
}else if(cfg.getServiceId()!=null){
|
||||
int serviceId=cfg.getServiceId();
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
try{
|
||||
String tableName=cfg.getTableName();
|
||||
String maatTable=null;
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(cfg.getServiceId());
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
cfg.setTableName(tableName);
|
||||
int audit=complexStringCfgService.getIsAudit(cfg);
|
||||
}
|
||||
maatTable=serviceConfigInfo.getMaatTable();
|
||||
}
|
||||
ComplexkeywordCfg bean=complexStringCfgService.getStringCfgById(cfg);
|
||||
bean.setTableName(tableName);
|
||||
int audit=bean.getIsAudit().intValue();
|
||||
if(audit==Constants.AUDIT_YES&&cfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
cfg.setAuditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setAuditTime(new Date());
|
||||
|
||||
bean.setIsAudit(cfg.getIsAudit());
|
||||
if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
bean.setIsValid(Constants.VALID_NO);
|
||||
bean.setMaatTable(maatTable);
|
||||
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
bean.setMaatTable(maatTable);
|
||||
}
|
||||
int result=complexStringCfgService.auditStringCfg(cfg);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
}
|
||||
}
|
||||
}
|
||||
int result=complexStringCfgService.auditStringCfg(bean,cfg);
|
||||
if(result!=0){
|
||||
addMessage(model,"审核成功!");
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
addMessage(model,"审核失败!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/complex/list";
|
||||
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("发生异常",e);
|
||||
addMessage(model,"审核失败!");
|
||||
}
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -316,7 +268,13 @@ public class ComplexStringCfgController extends BaseController{
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("cfgType","complex");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
try{
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
}
|
||||
}
|
||||
int audit=complexStringCfgService.getIsAudit(tableName,cfgId);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
@@ -332,29 +290,9 @@ public class ComplexStringCfgController extends BaseController{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
}
|
||||
|
||||
}else if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
ComplexkeywordCfg cfg=new ComplexkeywordCfg();
|
||||
cfg.setCfgId(cfgId);
|
||||
cfg.setTableName(tableName);
|
||||
int audit=complexStringCfgService.getIsAudit(cfg);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setEditTime(new Date());
|
||||
cfg.setIsValid(Constants.VALID_DEL);
|
||||
int result=complexStringCfgService.deleteStringCfg(cfg);
|
||||
addMessage(model,"删除成功,正在为您跳转页面...");
|
||||
}else{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}catch(Exception e){
|
||||
logger.error("删除失败", e);
|
||||
addMessage(model,"删除失败!");
|
||||
}
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
@@ -367,7 +305,14 @@ public class ComplexStringCfgController extends BaseController{
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected long getCompileId(BaseCfg cfg){
|
||||
return 0;
|
||||
protected long getCompileId(ComplexkeywordCfg cfg){
|
||||
long compileId=0l;
|
||||
try {
|
||||
compileId = cfg.getCompileId()==null?new ConvertTool().getCompileId():cfg.getCompileId();
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return compileId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,9 +64,14 @@ public class DnsIpCfgController extends BaseController {
|
||||
dnsIpCfg.setEditTime(now);
|
||||
}
|
||||
|
||||
try {
|
||||
dnsIpCfgService.save(dnsIpCfg);
|
||||
addMessage(redirectAttributes, "save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "save_failed");
|
||||
}
|
||||
|
||||
addMessage(redirectAttributes, "保存成功");
|
||||
return "redirect:" + adminPath + "/cfg/dnsIp/list";
|
||||
}
|
||||
|
||||
@@ -77,13 +82,13 @@ public class DnsIpCfgController extends BaseController {
|
||||
if (!StringUtils.isEmpty(cfgIds)) {
|
||||
try {
|
||||
dnsIpCfgService.delete(cfgIds);
|
||||
addMessage(model, "删除成功");
|
||||
addMessage(model, "delete_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(model, "删除失败");
|
||||
logger.error("删除失败", e);
|
||||
addMessage(model, "delete_failed");
|
||||
}
|
||||
} else {
|
||||
addMessage(model, "删除失败");
|
||||
addMessage(model, "delete_failed");
|
||||
}
|
||||
|
||||
Page<DnsIpCfg> page = dnsIpCfgService.findPage(new Page<DnsIpCfg>(request, response, 30), dnsIpCfg);
|
||||
|
||||
@@ -12,12 +12,15 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -123,7 +126,6 @@ public class IpCfgController extends BaseController{
|
||||
ipcfg.setAction(action);
|
||||
ipcfg.setServiceId(serviceId);
|
||||
model.addAttribute("_cfg", ipcfg);
|
||||
long compileId=this.getCompileId();
|
||||
model.addAttribute("tableName", tableName);
|
||||
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
@@ -230,13 +232,21 @@ public class IpCfgController extends BaseController{
|
||||
model.addAttribute("cfgName",cfgName);
|
||||
model.addAttribute("cfgType", "ip");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
model.addAttribute("serviceId",ipCfg.getServiceId());
|
||||
model.addAttribute("action",ipCfg.getAction());
|
||||
model.addAttribute("tableName", ipCfg.getTableName());
|
||||
logger.info("saveOrUpdateIpCfg loaded");
|
||||
if(ipCfg==null){
|
||||
logger.error("无法保存空的配置!");
|
||||
addMessage(model,"保存失败!");
|
||||
}else if(!StringUtils.isBlank(ipCfg.getTableName())){
|
||||
try{
|
||||
String tableName=ipCfg.getTableName();
|
||||
int serviceId=ipCfg.getServiceId();
|
||||
long compileId=getCompileId();
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
ipCfg.setTableName(tableName);
|
||||
}
|
||||
}
|
||||
int compileId=new ConvertTool().getCompileId().intValue();
|
||||
ipCfg.setIsValid(Constants.VALID_NO);
|
||||
ipCfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
ipCfg.setCompileId(compileId);
|
||||
@@ -249,42 +259,12 @@ public class IpCfgController extends BaseController{
|
||||
ipCfg.setEditTime(new Date());
|
||||
ipCfgService.updateIpCfg(ipCfg);
|
||||
}
|
||||
model.addAttribute("serviceId",serviceId);
|
||||
model.addAttribute("action",ipCfg.getAction());
|
||||
model.addAttribute("tableName", ipCfg.getTableName());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}else if(ipCfg.getServiceId()!=null){
|
||||
int serviceId=ipCfg.getServiceId();
|
||||
model.addAttribute("serviceId",serviceId);
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
long compileId=getCompileId();
|
||||
ipCfg.setTableName(tableName);
|
||||
// ipCfg.setCreatorId(ipCfg.getCurrentUser().getId());
|
||||
// ipCfg.setCreateTime(new Date());
|
||||
ipCfg.setIsValid(Constants.VALID_NO);
|
||||
ipCfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
ipCfg.setCompileId(compileId);
|
||||
if(ipCfg.getCfgId()==null){
|
||||
ipCfg.setCreatorId(ipCfg.getCurrentUser().getId());
|
||||
ipCfg.setCreateTime(new Date());
|
||||
}else{
|
||||
ipCfg.setEditorId(ipCfg.getCurrentUser().getId());
|
||||
ipCfg.setEditTime(new Date());
|
||||
ipCfgService.updateIpCfg(ipCfg);
|
||||
}
|
||||
model.addAttribute("action",ipCfg.getAction());
|
||||
model.addAttribute("tableName", ipCfg.getTableName());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
}catch(Exception e){
|
||||
logger.error("保存失败",e);
|
||||
addMessage(model,"保存失败!");
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}
|
||||
return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+ipCfg.getServiceId()+"&action="+ipCfg.getAction()+"&cfgName="+cfgName);
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -299,55 +279,52 @@ public class IpCfgController extends BaseController{
|
||||
@RequestMapping(value = {"auditCfg"})
|
||||
public String auditIpCfg(String cfgName,BaseIpCfg ipCfg,Model model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("cfgType", "ip");
|
||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||
if(ipCfg==null){
|
||||
logger.error("无法审核空的配置!");
|
||||
}else if(!StringUtils.isBlank(ipCfg.getTableName())){
|
||||
int audit=ipCfgService.getIsAudit(ipCfg);
|
||||
if(audit==Constants.AUDIT_YES&&ipCfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
ipCfg.setAuditorId(ipCfg.getCurrentUser().getId());
|
||||
ipCfg.setAuditTime(new Date());
|
||||
|
||||
if(ipCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
ipCfg.setIsValid(Constants.VALID_NO);
|
||||
}else if(ipCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
ipCfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=ipCfgService.auditIpCfg(ipCfg);
|
||||
model.addAttribute("serviceId", ipCfg.getServiceId());
|
||||
model.addAttribute("action", ipCfg.getAction());
|
||||
}
|
||||
}else if(ipCfg.getServiceId()!=null){
|
||||
int serviceId=ipCfg.getServiceId();
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
try{
|
||||
String tableName=ipCfg.getTableName();
|
||||
String maatTable=null;
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(ipCfg.getServiceId());
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
ipCfg.setTableName(tableName);
|
||||
int audit=ipCfgService.getIsAudit(ipCfg);
|
||||
}
|
||||
maatTable=serviceConfigInfo.getMaatTable();
|
||||
}
|
||||
BaseIpCfg bean=ipCfgService.getIpCfgById(ipCfg);
|
||||
bean.setTableName(tableName);
|
||||
int audit=bean.getIsAudit().intValue();
|
||||
if(audit==Constants.AUDIT_YES&&ipCfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
ipCfg.setAuditorId(ipCfg.getCurrentUser().getId());
|
||||
ipCfg.setAuditTime(new Date());
|
||||
|
||||
bean.setIsAudit(ipCfg.getIsAudit());
|
||||
if(ipCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
ipCfg.setIsValid(Constants.VALID_NO);
|
||||
bean.setIsValid(Constants.VALID_NO);
|
||||
bean.setMaatTable(maatTable);
|
||||
}else if(ipCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
ipCfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
bean.setMaatTable(maatTable);
|
||||
}
|
||||
int result=ipCfgService.auditIpCfg(ipCfg);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", ipCfg.getAction());
|
||||
}
|
||||
}
|
||||
}
|
||||
int result=ipCfgService.auditIpCfg(bean,ipCfg);
|
||||
if(result!=0){
|
||||
addMessage(model,"审核成功!");
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
addMessage(model, "审核失败");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/ip/list";
|
||||
|
||||
}
|
||||
}catch(Exception e){
|
||||
logger.error("审核失败", e);
|
||||
addMessage(model, "审核失败");
|
||||
}
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -366,7 +343,13 @@ public class IpCfgController extends BaseController{
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("cfgType", "ip");
|
||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
try{
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
}
|
||||
}
|
||||
int audit=ipCfgService.getIsAudit(tableName,cfgId);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
@@ -381,32 +364,11 @@ public class IpCfgController extends BaseController{
|
||||
addMessage(model,"删除成功,正在为您跳转页面...");
|
||||
}else{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
addMessage(model,"删除失败!");
|
||||
}
|
||||
|
||||
}else if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
BaseIpCfg ipCfg=new BaseIpCfg();
|
||||
ipCfg.setCfgId(cfgId);
|
||||
ipCfg.setTableName(tableName);
|
||||
int audit=ipCfgService.getIsAudit(ipCfg);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
ipCfg.setEditorId(ipCfg.getCurrentUser().getId());
|
||||
ipCfg.setEditTime(new Date());
|
||||
ipCfg.setIsValid(Constants.VALID_DEL);
|
||||
int result=ipCfgService.deleteIpCfg(ipCfg);
|
||||
model.addAttribute("tableName", tableName);
|
||||
addMessage(model,"删除成功,正在为您跳转页面...");
|
||||
}else{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}catch(Exception e){
|
||||
logger.error("删除失败", e);
|
||||
addMessage(model,"删除失败!");
|
||||
}
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
@@ -419,7 +381,14 @@ public class IpCfgController extends BaseController{
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected long getCompileId(){
|
||||
return 0;
|
||||
protected long getCompileId(BaseIpCfg cfg){
|
||||
long compileId=0l;
|
||||
try {
|
||||
compileId = cfg.getCompileId()==null?new ConvertTool().getCompileId():cfg.getCompileId();
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return compileId;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,9 +13,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -27,7 +27,6 @@ import com.nis.web.controller.BaseController;
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/cfg/num")
|
||||
public class NumCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"list"})
|
||||
public String cfgList(Model model,Integer audit,Integer pageNo,Integer pageSize,String cfgName,@ModelAttribute("cfg")NumBoundaryCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
@@ -136,16 +135,11 @@ public class NumCfgController extends BaseController{
|
||||
model.addAttribute("cfgType","num");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("saveOrUpdateStringCfg loaded");
|
||||
if(cfg==null){
|
||||
logger.error("无法保存空的配置!");
|
||||
addMessage(model,"保存失败!");
|
||||
}else if(cfg.getServiceId()!=null){
|
||||
try{
|
||||
int serviceId=cfg.getServiceId();
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
long compileId=getCompileId(cfg);
|
||||
// cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
// cfg.setCreateTime(new Date());
|
||||
int compileId=new ConvertTool().getCompileId();
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setCompileId(compileId);
|
||||
@@ -162,11 +156,11 @@ public class NumCfgController extends BaseController{
|
||||
model.addAttribute("action",cfg.getAction());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}
|
||||
}else{
|
||||
}catch(Exception e){
|
||||
logger.error("保存失败", e);
|
||||
addMessage(model,"保存失败!");
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}
|
||||
return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+cfg.getServiceId()+"&action="+cfg.getAction()+"&cfgName="+cfgName);
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,33 +176,46 @@ public class NumCfgController extends BaseController{
|
||||
public String auditStringCfg(String cfgName,NumBoundaryCfg cfg,Model model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||
if(cfg==null){
|
||||
logger.error("无法审核空的配置!");
|
||||
}else if(cfg.getServiceId()!=null){
|
||||
model.addAttribute("cfgType","num");
|
||||
model.addAttribute("serviceId", cfg.getServiceId());
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
try{
|
||||
int serviceId=cfg.getServiceId();
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
int audit=numCfgService.getIsAudit(cfg);
|
||||
NumBoundaryCfg bean=numCfgService.getNumCfgById(cfg);
|
||||
bean.setTableName(serviceConfigInfo.getTableName());
|
||||
int audit=bean.getIsAudit().intValue();
|
||||
if(audit==Constants.AUDIT_YES&&cfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
cfg.setAuditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setAuditTime(new Date());
|
||||
|
||||
bean.setIsAudit(cfg.getIsAudit());
|
||||
if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
bean.setIsValid(Constants.VALID_NO);
|
||||
bean.setMaatTable(serviceConfigInfo.getMaatTable());
|
||||
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
bean.setMaatTable(serviceConfigInfo.getMaatTable());
|
||||
}
|
||||
int result=numCfgService.auditNumCfg(cfg);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", cfg.getAction());
|
||||
}
|
||||
}
|
||||
int result=numCfgService.auditNumCfg(bean,cfg);
|
||||
if(result!=0){
|
||||
addMessage(model, "审核成功");
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
addMessage(model, "审核失败");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/num/list";
|
||||
|
||||
}
|
||||
}
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
logger.error("审核失败",e);
|
||||
addMessage(model, "审核失败");
|
||||
}
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -257,7 +264,14 @@ public class NumCfgController extends BaseController{
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected long getCompileId(BaseCfg cfg){
|
||||
return 0;
|
||||
protected long getCompileId(NumBoundaryCfg cfg){
|
||||
long compileId=0l;
|
||||
try {
|
||||
compileId = cfg.getCompileId()==null?new ConvertTool().getCompileId():cfg.getCompileId();
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
return compileId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.ServiceConfigInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@@ -121,26 +121,13 @@ public class StringCfgController extends BaseController{
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("tableName", tableName);
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
logger.info("table name is "+tableName);
|
||||
BaseStringCfg searchBean=new BaseStringCfg();
|
||||
searchBean.setCfgId(cfgId);
|
||||
searchBean.setTableName(tableName);
|
||||
BaseStringCfg stringCfg=stringCfgService.getStringCfgById(searchBean);
|
||||
model.addAttribute("_cfg", stringCfg);
|
||||
List<RequestInfo> requestInfos=requestInfoService.getAllRequestInfo();
|
||||
model.addAttribute("requestInfos", requestInfos);
|
||||
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
|
||||
model.addAttribute("fls", fls);
|
||||
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
||||
model.addAttribute("lables", lables);
|
||||
}else if(serviceId!=null){
|
||||
try{
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
}
|
||||
}
|
||||
logger.info("table name is "+tableName);
|
||||
BaseStringCfg searchBean=new BaseStringCfg();
|
||||
searchBean.setCfgId(cfgId);
|
||||
@@ -155,13 +142,10 @@ public class StringCfgController extends BaseController{
|
||||
model.addAttribute("xzs", xzs);
|
||||
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
||||
model.addAttribute("lables", lables);
|
||||
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
logger.error("发生异常",e);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("未获取到正确的表名");
|
||||
}
|
||||
|
||||
return "/cfg/stringCfgForm";
|
||||
}
|
||||
|
||||
@@ -179,40 +163,20 @@ public class StringCfgController extends BaseController{
|
||||
model.addAttribute("cfgName",cfgName);
|
||||
model.addAttribute("cfgType","string");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
logger.info("saveOrUpdateStringCfg loaded");
|
||||
if(stringCfg==null){
|
||||
logger.error("无法保存空的配置!");
|
||||
addMessage(model,"保存失败!");
|
||||
}else if(!StringUtils.isBlank(stringCfg.getTableName())){
|
||||
int serviceId=stringCfg.getServiceId();
|
||||
long compileId=getCompileId(stringCfg);
|
||||
// stringCfg.setCreatorId(stringCfg.getCurrentUser().getId());
|
||||
// stringCfg.setCreateTime(new Date());
|
||||
stringCfg.setIsValid(Constants.VALID_NO);
|
||||
stringCfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
stringCfg.setCompileId(compileId);
|
||||
if(stringCfg.getCfgId()==null){
|
||||
stringCfg.setCreatorId(stringCfg.getCurrentUser().getId());
|
||||
stringCfg.setCreateTime(new Date());
|
||||
stringCfgService.addStringCfg(stringCfg);
|
||||
}else{
|
||||
stringCfg.setEditorId(stringCfg.getCurrentUser().getId());
|
||||
stringCfg.setEditTime(new Date());
|
||||
stringCfgService.updateStringCfg(stringCfg);
|
||||
}
|
||||
model.addAttribute("serviceId",serviceId);
|
||||
model.addAttribute("serviceId",stringCfg.getServiceId());
|
||||
model.addAttribute("action",stringCfg.getAction());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}else if(stringCfg.getServiceId()!=null){
|
||||
logger.info("saveOrUpdateStringCfg loaded");
|
||||
try{
|
||||
String tableName=stringCfg.getTableName();
|
||||
int serviceId=stringCfg.getServiceId();
|
||||
if(StringUtils.isBlank(stringCfg.getTableName())){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
long compileId=getCompileId(stringCfg);
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
stringCfg.setTableName(tableName);
|
||||
// stringCfg.setCreatorId(stringCfg.getCurrentUser().getId());
|
||||
// stringCfg.setCreateTime(new Date());
|
||||
}
|
||||
}
|
||||
int compileId=new ConvertTool().getCompileId();
|
||||
stringCfg.setIsValid(Constants.VALID_NO);
|
||||
stringCfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
stringCfg.setCompileId(compileId);
|
||||
@@ -225,16 +189,13 @@ public class StringCfgController extends BaseController{
|
||||
stringCfg.setEditTime(new Date());
|
||||
stringCfgService.updateStringCfg(stringCfg);
|
||||
}
|
||||
model.addAttribute("serviceId",serviceId);
|
||||
model.addAttribute("action",stringCfg.getAction());
|
||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
logger.error("保存失败!",e);
|
||||
addMessage(model,"保存失败!");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
addMessage(model,"保存失败!");
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}
|
||||
return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+stringCfg.getServiceId()+"&action="+stringCfg.getAction()+"&cfgName="+cfgName);
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,55 +211,54 @@ public class StringCfgController extends BaseController{
|
||||
public String auditStringCfg(String cfgName,BaseStringCfg stringCfg,Model model) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||
if(stringCfg==null){
|
||||
logger.error("无法审核空的配置!");
|
||||
}else if(!StringUtils.isBlank(stringCfg.getTableName())){
|
||||
int audit=stringCfgService.getIsAudit(stringCfg);
|
||||
if(audit==Constants.AUDIT_YES&&stringCfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
stringCfg.setAuditorId(stringCfg.getCurrentUser().getId());
|
||||
stringCfg.setAuditTime(new Date());
|
||||
|
||||
if(stringCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
stringCfg.setIsValid(Constants.VALID_NO);
|
||||
}else if(stringCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
stringCfg.setIsValid(Constants.VALID_YES);
|
||||
}
|
||||
int result=stringCfgService.auditStringCfg(stringCfg);
|
||||
model.addAttribute("cfgType","string");
|
||||
model.addAttribute("serviceId", stringCfg.getServiceId());
|
||||
model.addAttribute("action", stringCfg.getAction());
|
||||
}
|
||||
|
||||
}else if(stringCfg.getServiceId()!=null){
|
||||
try{
|
||||
String tableName=stringCfg.getTableName();
|
||||
int serviceId=stringCfg.getServiceId();
|
||||
String maatTable=null;
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
String tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
stringCfg.setTableName(tableName);
|
||||
int audit=stringCfgService.getIsAudit(stringCfg);
|
||||
}
|
||||
maatTable=serviceConfigInfo.getMaatTable();
|
||||
}
|
||||
|
||||
BaseStringCfg bean=stringCfgService.getStringCfgById(stringCfg);
|
||||
bean.setTableName(tableName);
|
||||
int audit=bean.getIsAudit().intValue();
|
||||
if(audit==Constants.AUDIT_YES&&stringCfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||
logger.error("审核通过的配置只能取消审核通过!");
|
||||
}else{
|
||||
stringCfg.setAuditorId(stringCfg.getCurrentUser().getId());
|
||||
stringCfg.setAuditTime(new Date());
|
||||
|
||||
bean.setIsAudit(stringCfg.getIsAudit());
|
||||
if(stringCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||
stringCfg.setIsValid(Constants.VALID_NO);
|
||||
bean.setIsValid(Constants.VALID_NO);
|
||||
bean.setMaatTable(maatTable);
|
||||
}else if(stringCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||
stringCfg.setIsValid(Constants.VALID_YES);
|
||||
bean.setIsValid(Constants.VALID_YES);
|
||||
bean.setMaatTable(maatTable);
|
||||
}
|
||||
int result=stringCfgService.auditStringCfg(stringCfg);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
model.addAttribute("action", stringCfg.getAction());
|
||||
}
|
||||
}
|
||||
}
|
||||
int result=stringCfgService.auditStringCfg(bean,stringCfg);
|
||||
if(result!=0){
|
||||
addMessage(model,"审核成功!");
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
addMessage(model,"审核失败!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/cfg/string/list";
|
||||
|
||||
}
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
logger.error("审核失败", e);
|
||||
addMessage(model,"审核失败!");
|
||||
}
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -316,7 +276,13 @@ public class StringCfgController extends BaseController{
|
||||
model.addAttribute("action", action);
|
||||
model.addAttribute("cfgType","string");
|
||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
try{
|
||||
if(StringUtils.isBlank(tableName)){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
}
|
||||
}
|
||||
int audit=stringCfgService.getIsAudit(tableName,cfgId);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
@@ -332,42 +298,10 @@ public class StringCfgController extends BaseController{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
}
|
||||
|
||||
}else if(serviceId!=null){
|
||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||
if(serviceConfigInfo!=null){
|
||||
tableName=serviceConfigInfo.getTableName();
|
||||
if(!StringUtils.isBlank(tableName)){
|
||||
BaseStringCfg stringCfg=new BaseStringCfg();
|
||||
stringCfg.setCfgId(cfgId);
|
||||
stringCfg.setTableName(tableName);
|
||||
int audit=stringCfgService.getIsAudit(stringCfg);
|
||||
//未审核时可删除
|
||||
if(audit!=Constants.AUDIT_YES){
|
||||
stringCfg.setEditorId(stringCfg.getCurrentUser().getId());
|
||||
stringCfg.setEditTime(new Date());
|
||||
stringCfg.setIsValid(Constants.VALID_DEL);
|
||||
int result=stringCfgService.deleteStringCfg(stringCfg);
|
||||
addMessage(model,"删除成功,正在为您跳转页面...");
|
||||
}else{
|
||||
logger.error("通过审核的配置不能删除!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
logger.error("无法确定IP配置的表名!");
|
||||
}catch(Exception e){
|
||||
logger.error("删除失败",e);
|
||||
addMessage(model,"删除失败!");
|
||||
}
|
||||
return "/cfg/resultPage";
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getCompileId(获取编译ID)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @return
|
||||
*long
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected long getCompileId(BaseCfg cfg){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,9 +105,9 @@ public class SystemServiceController extends BaseController {
|
||||
|
||||
try {
|
||||
systemServiceService.save(systemServiceInfo, insertServiceConfigInfoList, updateServiceConfigInfoList);
|
||||
addMessage(redirectAttributes, "保存成功");
|
||||
addMessage(redirectAttributes, "save_success");
|
||||
} catch (Exception e) {
|
||||
addMessage(redirectAttributes, "保存失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "save_failed");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -122,9 +122,9 @@ public class SystemServiceController extends BaseController {
|
||||
systemServiceInfo.setIsValid(1);
|
||||
Page<SystemServiceInfo> page = systemServiceService.findPage(new Page<SystemServiceInfo>(request, response, 1), systemServiceInfo);
|
||||
model.addAttribute("page", page);
|
||||
addMessage(model, "删除成功");
|
||||
addMessage(model, "delete_success");
|
||||
} catch (Exception e) {
|
||||
addMessage(model, "删除失败:" + e.getMessage());
|
||||
addMessage(model, "delete_failed");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "/systemService/list";
|
||||
@@ -138,11 +138,12 @@ public class SystemServiceController extends BaseController {
|
||||
return "true";
|
||||
} else {
|
||||
if (id != null) {
|
||||
if (list.get(0).getId() == id) {
|
||||
for (SystemServiceInfo info : list) {
|
||||
if (info.getIsValid() == 1 && info.getId().longValue() == id.longValue()) {
|
||||
return "true";
|
||||
} else {
|
||||
return "false";
|
||||
}
|
||||
}
|
||||
return "false";
|
||||
} else {
|
||||
return "false";
|
||||
}
|
||||
|
||||
@@ -26,4 +26,5 @@ public interface ComplexStringCfgDao extends CrudDao<ComplexkeywordCfg>{
|
||||
public int getIsValid(ComplexkeywordCfg entity);
|
||||
public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
||||
public int getIsAudit(ComplexkeywordCfg entity);
|
||||
public int deleteByCompileId(ComplexkeywordCfg entity);
|
||||
}
|
||||
|
||||
@@ -481,4 +481,7 @@
|
||||
SELECT IS_AUDIT FROM ${tableName}
|
||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<update id="deleteByCompileId" parameterType="com.nis.domain.configuration.ComplexkeywordCfg" >
|
||||
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -116,6 +116,9 @@
|
||||
#{isValid}, #{isAudit}, #{creator.id}, #{createTime}, #{request.id}, #{fakeId},
|
||||
#{classify}, #{attribute}, #{lable}
|
||||
)
|
||||
<selectKey keyProperty="cfgId" resultType="java.lang.Long">
|
||||
select LAST_INSERT_ID() as cfg_id
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
|
||||
@@ -26,4 +26,5 @@ public interface IpCfgDao extends CrudDao<BaseIpCfg>{
|
||||
public int getIsValid(BaseIpCfg entity);
|
||||
public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
||||
public int getIsAudit(BaseIpCfg entity);
|
||||
public int deleteByCompileId(BaseIpCfg entity);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@
|
||||
AND ${page.alias}.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIp != null and srcIp != ''">
|
||||
AND ${page.alias}.SRC_IP=#{srcIp,jdbcType=VARCHAR}
|
||||
AND ${page.alias}.SRC_IP like concat('%', #{srcIp,jdbcType=VARCHAR}, '%')
|
||||
</if>
|
||||
<if test="srcIpMask != null and srcIpMask != ''">
|
||||
AND ${page.alias}.SRC_IP_MASK=#{srcIpMask,jdbcType=VARCHAR}
|
||||
@@ -303,7 +303,7 @@
|
||||
AND ${page.alias}.SRC_PORT_MASK=#{srcPortMask,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="dstIp != null and dstIp !=''">
|
||||
AND ${page.alias}.DST_IP=#{dstIp,jdbcType=VARCHAR}
|
||||
AND ${page.alias}.DST_IP like concat('%', #{dstIp,jdbcType=VARCHAR}, '%')
|
||||
</if>
|
||||
<if test="dstIpMask != null and dstIpMask !=''">
|
||||
AND ${page.alias}.DST_IP_MASK=#{dstIpMask,jdbcType=VARCHAR}
|
||||
@@ -583,7 +583,7 @@
|
||||
<if test="editorId != null" >
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editTime != null and editTime != ''" >
|
||||
<if test="editTime != null" >
|
||||
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="auditorId != null" >
|
||||
@@ -639,4 +639,7 @@
|
||||
SELECT IS_AUDIT FROM ${tableName}
|
||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<update id="deleteByCompileId" parameterType="com.nis.domain.configuration.BaseIpCfg" >
|
||||
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.nis.web.dao.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.configuration.MultipleSearchCfg;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
/**
|
||||
* 多域配置数据处理类
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@MyBatisDao
|
||||
public interface MultipleCfgDao extends CrudDao<MultipleSearchCfg>{
|
||||
public MultipleSearchCfg getById(@Param("tableName")String tableName,@Param("cfgId")Long id) ;
|
||||
public MultipleSearchCfg get(MultipleSearchCfg entity) ;
|
||||
public List<MultipleSearchCfg> findList(MultipleSearchCfg entity) ;
|
||||
public int insert(MultipleSearchCfg entity) ;
|
||||
public int updateByPrimaryKeySelective(MultipleSearchCfg entity) ;
|
||||
public int updateValid(MultipleSearchCfg entity) ;
|
||||
public int audit(MultipleSearchCfg entity) ;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.configuration.MultipleCfgDao" >
|
||||
</mapper>
|
||||
@@ -26,4 +26,5 @@ public interface NumCfgDao extends CrudDao<NumBoundaryCfg>{
|
||||
public int getIsValid(NumBoundaryCfg entity);
|
||||
public int getIsAudit(@Param("cfgId")Long id);
|
||||
public int getIsAudit(NumBoundaryCfg entity);
|
||||
public int deleteByCompileId(NumBoundaryCfg entity);
|
||||
}
|
||||
|
||||
@@ -492,4 +492,7 @@
|
||||
SELECT IS_AUDIT FROM NUM_BOUNDARY_CFG
|
||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<update id="deleteByCompileId" parameterType="com.nis.domain.configuration.NumBoundaryCfg" >
|
||||
update NUM_BOUNDARY_CFG set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -26,4 +26,5 @@ public interface StringCfgDao extends CrudDao<BaseStringCfg>{
|
||||
public int getIsValid(BaseStringCfg entity);
|
||||
public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
||||
public int getIsAudit(BaseStringCfg entity);
|
||||
public int deleteByCompileId(BaseStringCfg entity);
|
||||
}
|
||||
|
||||
@@ -491,4 +491,7 @@
|
||||
SELECT IS_AUDIT FROM ${tableName}
|
||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||
</select>
|
||||
<update id="deleteByCompileId" parameterType="com.nis.domain.configuration.BaseStringCfg" >
|
||||
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where compile_id = #{compileId,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -99,7 +99,7 @@
|
||||
|
||||
<select id="getSystemServiceByServiceId" resultType="systemServiceInfo">
|
||||
select
|
||||
id
|
||||
id, is_valid
|
||||
from
|
||||
system_service_info
|
||||
where
|
||||
|
||||
@@ -143,19 +143,6 @@ public abstract class BaseService {
|
||||
|
||||
return scopeSql.toString();
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getTableName(获取Class对应的表名)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param clazz
|
||||
* @return
|
||||
*String
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public String getTableName(String clazz){
|
||||
return Configurations.getStringProperty(clazz, null);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getTableName(获取表名对应的Class)
|
||||
|
||||
@@ -6,6 +6,7 @@ package com.nis.web.service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
@@ -20,8 +21,13 @@ import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatUnAuditBean;
|
||||
import com.nis.domain.maat.UnAuditBean;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
|
||||
/**
|
||||
@@ -191,34 +197,94 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
|
||||
* @param cfg
|
||||
* @return
|
||||
*boolean
|
||||
* @throws Exception
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public boolean sendToMaatConvertor(AreaIpCfg[] areaCfg,T ... cfg){
|
||||
@SuppressWarnings("rawtypes")
|
||||
public boolean sendToMaatConvertor(int operation,List<AreaIpCfg> areaCfg,BaseCfg ... cfg) throws Exception{
|
||||
if(cfg==null){
|
||||
throw new RuntimeException("转换出错,配置为空");
|
||||
}
|
||||
long compileId=0l;
|
||||
Gson gson=new GsonBuilder().disableHtmlEscaping()
|
||||
/*.setPrettyPrinting().serializeNulls()*/
|
||||
.excludeFieldsWithoutExposeAnnotation()
|
||||
.create();
|
||||
if(Constants.AUDIT_NOT_YES==operation){
|
||||
ToMaatUnAuditBean toMaatUnAuditBean=new ToMaatUnAuditBean();
|
||||
toMaatUnAuditBean.setServiceCfg(new ArrayList<UnAuditBean>());
|
||||
for(BaseCfg c:cfg){
|
||||
UnAuditBean bean=new UnAuditBean();
|
||||
if(c.getCompileId()==null||c.getCompileId()==0){
|
||||
throw new RuntimeException("转换出错,未获取到正确的compileId");
|
||||
}
|
||||
if(StringUtils.isBlank(c.getMaatTable())){
|
||||
throw new RuntimeException("转换出错,未获取到正确的maatTalbe");
|
||||
}
|
||||
bean.setCompileId(c.getCompileId());
|
||||
bean.setMaatTable(c.getMaatTable());
|
||||
toMaatUnAuditBean.getServiceCfg().add(bean);
|
||||
}
|
||||
String json=gson.toJson(toMaatUnAuditBean);
|
||||
logger.info("to maat json:"+json);
|
||||
//发送至maat,待完成
|
||||
return new ConvertTool().setConfigInValid(json);
|
||||
}else{
|
||||
int compileId=0;
|
||||
ToMaatBean toMaatBean=new ToMaatBean();
|
||||
toMaatBean.setServiceCfg(new ArrayList<MaatCfg>());
|
||||
MaatCfg maatCfg=new MaatCfg();
|
||||
if(cfg[0] instanceof BaseIpCfg){
|
||||
maatCfg.setIpCfg((BaseIpCfg[])cfg);
|
||||
compileId=((BaseIpCfg)cfg[0]).getCompileId();
|
||||
}else if(cfg[0] instanceof BaseStringCfg){
|
||||
maatCfg.setStrCfg((BaseStringCfg[])cfg);
|
||||
compileId=((BaseStringCfg)cfg[0]).getCompileId();
|
||||
}else if(cfg[0] instanceof ComplexkeywordCfg){
|
||||
maatCfg.setComplexStrCfg((ComplexkeywordCfg[])cfg);
|
||||
compileId=((ComplexkeywordCfg)cfg[0]).getCompileId();
|
||||
for(BaseCfg c:cfg){
|
||||
if(c instanceof BaseIpCfg){
|
||||
compileId=compileId==0?c.getCompileId():compileId;
|
||||
if(maatCfg.getIpCfg()==null){
|
||||
List<BaseIpCfg> list=new ArrayList<>();
|
||||
list.add((BaseIpCfg)c);
|
||||
maatCfg.setIpCfg(list);
|
||||
}else{
|
||||
List<BaseIpCfg> list=maatCfg.getIpCfg();
|
||||
list.add((BaseIpCfg)c);
|
||||
}
|
||||
}else if(c instanceof BaseStringCfg){
|
||||
compileId=compileId==0?c.getCompileId():compileId;
|
||||
if(maatCfg.getStrCfg()==null){
|
||||
List<BaseStringCfg> list=new ArrayList<BaseStringCfg>();
|
||||
list.add((BaseStringCfg)c);
|
||||
maatCfg.setStrCfg(list);
|
||||
}else{
|
||||
List<BaseStringCfg> list=maatCfg.getStrCfg();
|
||||
list.add((BaseStringCfg)c);
|
||||
}
|
||||
}else if(c instanceof ComplexkeywordCfg){
|
||||
compileId=compileId==0?c.getCompileId():compileId;
|
||||
if(maatCfg.getComplexStrCfg()==null){
|
||||
List<ComplexkeywordCfg> list=new ArrayList<ComplexkeywordCfg>();
|
||||
list.add((ComplexkeywordCfg)c);
|
||||
maatCfg.setComplexStrCfg(list);
|
||||
}else{
|
||||
List<ComplexkeywordCfg> list=maatCfg.getComplexStrCfg();
|
||||
list.add((ComplexkeywordCfg)c);
|
||||
}
|
||||
}else if(c instanceof NumBoundaryCfg){
|
||||
compileId=compileId==0?c.getCompileId():compileId;
|
||||
if(maatCfg.getNumCfg()==null){
|
||||
List<NumBoundaryCfg> list=new ArrayList<NumBoundaryCfg>();
|
||||
list.add((NumBoundaryCfg)c);
|
||||
maatCfg.setNumCfg(list);
|
||||
}else{
|
||||
List<NumBoundaryCfg> list=maatCfg.getNumCfg();
|
||||
list.add((NumBoundaryCfg)c);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(areaCfg!=null){
|
||||
AreaIpCfg[] cfgArray=new AreaIpCfg[1];
|
||||
|
||||
toMaatBean.setAreaCfg(areaCfg);
|
||||
}else{
|
||||
toMaatBean.setAreaCfg(new ArrayList<AreaIpCfg>());
|
||||
}
|
||||
List<MaatCfg> serviceCfg=new ArrayList<>();
|
||||
serviceCfg.add(maatCfg);
|
||||
toMaatBean.getServiceCfg().add(maatCfg);
|
||||
BaseCfg baseCfg=(BaseCfg)cfg[0];
|
||||
if(compileId==0l){
|
||||
if(compileId==0){
|
||||
throw new RuntimeException("转换出错,未获取到正确的compileId");
|
||||
}else{
|
||||
toMaatBean.setCompileId(compileId);
|
||||
@@ -252,14 +318,11 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
|
||||
toMaatBean.setAttribute(baseCfg.getAttribute()==null?"":baseCfg.getAttribute());
|
||||
toMaatBean.setClassify(baseCfg.getClassify()==null?"":baseCfg.getClassify());
|
||||
toMaatBean.setLable(baseCfg.getLable()==null?"":baseCfg.getLable());
|
||||
Gson gson=new GsonBuilder().disableHtmlEscaping()
|
||||
.setDateFormat("yyyy-MM-dd HH:mm:ss")
|
||||
/*.setPrettyPrinting().serializeNulls()*/
|
||||
.excludeFieldsWithoutExposeAnnotation()
|
||||
.create();
|
||||
String json=gson.toJson(toMaatBean);
|
||||
//发送至maat,待完成
|
||||
|
||||
return false;
|
||||
String json=gson.toJson(toMaatBean);
|
||||
logger.info("to maat json:"+json);
|
||||
//发送至maat,待完成
|
||||
return new ConvertTool().saveConfig(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.dao.configuration.ComplexStringCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
@@ -30,17 +30,7 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int addStringCfg(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.insert(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
cfg.setTableName(tableName);
|
||||
logger.info("save "+tableName);
|
||||
return complexStringCfgDao.insert(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -54,17 +44,7 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int updateStringCfg(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.updateByPrimaryKeySelective(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
cfg.setTableName(tableName);
|
||||
logger.info("update "+tableName);
|
||||
return complexStringCfgDao.updateByPrimaryKeySelective(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -73,22 +53,21 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @throws Exception
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int auditStringCfg(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.audit(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
cfg.setTableName(tableName);
|
||||
logger.info("aduit "+tableName);
|
||||
public int auditStringCfg(ComplexkeywordCfg sendCfg,ComplexkeywordCfg cfg) throws Exception{
|
||||
if(Constants.AUDIT_NOT_YES==cfg.getIsAudit().intValue()||
|
||||
Constants.AUDIT_YES==cfg.getIsAudit().intValue()){//审核通过,取消审核通过需要发到maat
|
||||
if(sendToMaatConvertor(cfg.getIsAudit(),null,sendCfg)){
|
||||
return complexStringCfgDao.audit(cfg);
|
||||
}
|
||||
|
||||
}else{
|
||||
return complexStringCfgDao.audit(cfg);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -102,35 +81,7 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int deleteStringCfg(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.updateValid(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
cfg.setTableName(tableName);
|
||||
logger.info("delete "+tableName);
|
||||
return complexStringCfgDao.updateValid(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getStringCfg(根据IP与类名获取IP配置)
|
||||
* (继承ComplexkeywordCfg这个类方可使用)
|
||||
* @param clazz
|
||||
* @param id
|
||||
* @return
|
||||
*ComplexkeywordCfg
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public ComplexkeywordCfg getStringCfgById(Class<?> clazz,long id){
|
||||
String tableName=getTableName(clazz.getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
logger.info("get "+tableName);
|
||||
return complexStringCfgDao.getById(tableName, id);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -144,44 +95,16 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public ComplexkeywordCfg getStringCfgById(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.get(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
cfg.setTableName(tableName);
|
||||
logger.info("get "+tableName);
|
||||
return complexStringCfgDao.get(cfg);
|
||||
}
|
||||
|
||||
return complexStringCfgDao.getById(cfg.getTableName(),cfg.getCfgId());
|
||||
}
|
||||
public Integer getIsValid(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.getIsValid(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
cfg.setTableName(tableName);
|
||||
return complexStringCfgDao.getIsValid(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
public Integer getIsValid(String tableName, long id){
|
||||
return complexStringCfgDao.getIsValid(tableName,id);
|
||||
}
|
||||
public Integer getIsAudit(ComplexkeywordCfg cfg){
|
||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
||||
return complexStringCfgDao.getIsAudit(cfg);
|
||||
}else{
|
||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
cfg.setTableName(tableName);
|
||||
return complexStringCfgDao.getIsAudit(cfg);
|
||||
}
|
||||
|
||||
}
|
||||
public Integer getIsAudit(String tableName, long id){
|
||||
return complexStringCfgDao.getIsAudit(tableName,id);
|
||||
|
||||
@@ -1,8 +1,22 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.nis.domain.configuration.DnsIpCfg;
|
||||
import com.nis.domain.maat.DnsIpRecvData;
|
||||
import com.nis.domain.maat.FromMaatBean;
|
||||
import com.nis.domain.maat.MaatDnsIpCfg;
|
||||
import com.nis.domain.maat.ToMaatDnsIpBean;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Collections3;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.configuration.DnsIpCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
@@ -10,22 +24,76 @@ import com.nis.web.service.CrudService;
|
||||
public class DnsIpCfgService extends CrudService<DnsIpCfgDao, DnsIpCfg>{
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void save(DnsIpCfg dnsIpCfg) {
|
||||
if (dnsIpCfg.getCfgId() == null) {
|
||||
dao.insert(dnsIpCfg);
|
||||
} else {
|
||||
|
||||
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
|
||||
|
||||
//组织要发送的json
|
||||
ToMaatDnsIpBean toMaatBean = new ToMaatDnsIpBean();
|
||||
List<MaatDnsIpCfg> ipCfgList = new ArrayList<MaatDnsIpCfg>();
|
||||
MaatDnsIpCfg ipCfg = new MaatDnsIpCfg();
|
||||
List<DnsIpCfg> d1 = new ArrayList<DnsIpCfg>();
|
||||
d1.add(dnsIpCfg);
|
||||
ipCfg.setIpCfg(d1);
|
||||
ipCfgList.add(ipCfg);
|
||||
toMaatBean.setServiceCfg(ipCfgList);
|
||||
String sendJson = gson.toJson(toMaatBean);
|
||||
logger.info("准备下发配置:" + sendJson);
|
||||
//下发配置、接收结果
|
||||
String recvJson = "";
|
||||
try {
|
||||
recvJson = new ConvertTool().saveDNSIPConfig(sendJson);
|
||||
logger.info("收到结果:" + recvJson);
|
||||
} catch (Throwable e) {
|
||||
logger.error("欺骗ip配置新增下发失败,cfgId=" + dnsIpCfg.getCfgId(), e);
|
||||
throw new RuntimeException("欺骗ip配置新增下发失败:通讯异常");
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(recvJson)) {
|
||||
logger.error("新增欺骗ip配置失败:收到空的返回结果,cfgId:" + dnsIpCfg.getCfgId());
|
||||
throw new RuntimeException("新增欺骗ip配置失败:收到空的返回结果");
|
||||
}
|
||||
logger.info("结果接收成功");
|
||||
|
||||
FromMaatBean fromMaatBean = gson.fromJson(recvJson, FromMaatBean.class);
|
||||
List<DnsIpRecvData> data = fromMaatBean.getData();
|
||||
if (!Collections3.isEmpty(data)) {
|
||||
DnsIpRecvData dnsIpRecvData = data.get(0);
|
||||
if (dnsIpRecvData.getFakeId() != null && dnsIpRecvData.getCfgId() != null
|
||||
&& dnsIpRecvData.getCfgId().longValue() == dnsIpCfg.getCfgId().longValue()) {
|
||||
dnsIpCfg.setFakeId(dnsIpRecvData.getFakeId());
|
||||
dao.update(dnsIpCfg);
|
||||
}
|
||||
//TODO 下发流程
|
||||
} else {
|
||||
logger.error("新增欺骗ip配置失败:收到空的返回结果,cfgId:" + dnsIpCfg.getCfgId());
|
||||
throw new RuntimeException("新增欺骗ip配置失败:收到空的返回结果");
|
||||
}
|
||||
}
|
||||
|
||||
public void delete(String cfgIds) {
|
||||
if(cfgIds.endsWith(","))cfgIds=cfgIds.substring(0,cfgIds.lastIndexOf(","));
|
||||
String[] cfgIdsArr = cfgIds.split(",");
|
||||
for (String cfgId : cfgIdsArr) {
|
||||
DnsIpCfg d = new DnsIpCfg();
|
||||
d.setCfgId(Long.valueOf(cfgId));
|
||||
dao.delete(d);
|
||||
}
|
||||
//TODO 下发流程
|
||||
|
||||
//给配置转换层发送、接收结果
|
||||
String sendJson = "{\"fakeId\":[" + cfgIds + "]}";
|
||||
logger.info("准备下发配置:" + sendJson);
|
||||
Boolean recv = true;
|
||||
try {
|
||||
recv = new ConvertTool().invalidDNSIPConfig(sendJson);
|
||||
} catch (Throwable e) {
|
||||
logger.error("欺骗ip配置删除失败:通讯异常,cfgIds:" + cfgIds, e);
|
||||
throw new RuntimeException("欺骗ip配置删除失败:通讯失败");
|
||||
}
|
||||
if (!recv) {
|
||||
logger.error("欺骗ip配置删除失败,收到结果 " + recv + " ,cfgIds:" + cfgIds);
|
||||
throw new RuntimeException("欺骗ip配置删除失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.dao.configuration.IpCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
@@ -31,17 +30,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int addIpCfg(BaseIpCfg baseIpCfg){
|
||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
||||
return ipCfgDao.insert(baseIpCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
baseIpCfg.setTableName(tableName);
|
||||
logger.info("save "+tableName);
|
||||
return ipCfgDao.insert(baseIpCfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -55,17 +44,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int updateIpCfg(BaseIpCfg baseIpCfg){
|
||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
||||
return ipCfgDao.updateByPrimaryKeySelective(baseIpCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
baseIpCfg.setTableName(tableName);
|
||||
logger.info("update "+tableName);
|
||||
return ipCfgDao.updateByPrimaryKeySelective(baseIpCfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -74,22 +53,22 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
* @param baseIpCfg
|
||||
* @return
|
||||
*int
|
||||
* @throws Exception
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int auditIpCfg(BaseIpCfg baseIpCfg){
|
||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
||||
public int auditIpCfg(BaseIpCfg sendCfg,BaseIpCfg baseIpCfg) throws Exception{
|
||||
if(Constants.AUDIT_NOT_YES==baseIpCfg.getIsAudit().intValue()||
|
||||
Constants.AUDIT_YES==baseIpCfg.getIsAudit().intValue()){//审核通过,取消审核通过需要发到maat
|
||||
if(sendToMaatConvertor(baseIpCfg.getIsAudit(),null,sendCfg)){
|
||||
return ipCfgDao.audit(baseIpCfg);
|
||||
}
|
||||
}else{
|
||||
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
baseIpCfg.setTableName(tableName);
|
||||
logger.info("aduit "+tableName);
|
||||
return ipCfgDao.audit(baseIpCfg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -103,35 +82,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int deleteIpCfg(BaseIpCfg baseIpCfg){
|
||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
||||
return ipCfgDao.updateValid(baseIpCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
baseIpCfg.setTableName(tableName);
|
||||
logger.info("delete "+tableName);
|
||||
return ipCfgDao.updateValid(baseIpCfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getIpCfg(根据IP与类名获取IP配置)
|
||||
* (继承BaseIpCfg这个类方可使用)
|
||||
* @param clazz
|
||||
* @param id
|
||||
* @return
|
||||
*BaseIpCfg
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public BaseIpCfg getIpCfgById(Class<?> clazz,long id){
|
||||
String tableName=getTableName(clazz.getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
logger.info("get "+tableName);
|
||||
return ipCfgDao.getById(tableName, id);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -145,44 +96,16 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public BaseIpCfg getIpCfgById(BaseIpCfg baseIpCfg){
|
||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
||||
return ipCfgDao.get(baseIpCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
baseIpCfg.setTableName(tableName);
|
||||
logger.info("get "+tableName);
|
||||
return ipCfgDao.get(baseIpCfg);
|
||||
}
|
||||
|
||||
return ipCfgDao.getById(baseIpCfg.getTableName(), baseIpCfg.getCfgId());
|
||||
}
|
||||
public Integer getIsValid(BaseIpCfg baseIpCfg){
|
||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
||||
return ipCfgDao.getIsValid(baseIpCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
baseIpCfg.setTableName(tableName);
|
||||
return ipCfgDao.getIsValid(baseIpCfg);
|
||||
}
|
||||
|
||||
}
|
||||
public Integer getIsValid(String tableName, long id){
|
||||
return ipCfgDao.getIsValid(tableName,id);
|
||||
}
|
||||
public Integer getIsAudit(BaseIpCfg baseIpCfg){
|
||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
||||
return ipCfgDao.getIsAudit(baseIpCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
baseIpCfg.setTableName(tableName);
|
||||
return ipCfgDao.getIsAudit(baseIpCfg);
|
||||
}
|
||||
|
||||
}
|
||||
public Integer getIsAudit(String tableName, long id){
|
||||
return ipCfgDao.getIsAudit(tableName,id);
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||
import com.nis.domain.configuration.MultipleCfg;
|
||||
import com.nis.domain.configuration.MultipleSearchCfg;
|
||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
import com.nis.web.dao.configuration.ComplexStringCfgDao;
|
||||
import com.nis.web.dao.configuration.IpCfgDao;
|
||||
import com.nis.web.dao.configuration.MultipleCfgDao;
|
||||
import com.nis.web.dao.configuration.NumCfgDao;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
/**
|
||||
* 多域相关配置事务类
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class MultipleCfgService extends CrudService<MultipleCfgDao,MultipleSearchCfg> {
|
||||
@Autowired
|
||||
protected MultipleCfgDao multipleCfgDao;
|
||||
@Autowired
|
||||
protected IpCfgDao ipCfgDao;
|
||||
@Autowired
|
||||
protected StringCfgDao stringCfgDao;
|
||||
@Autowired
|
||||
protected ComplexStringCfgDao complexStringCfgDao;
|
||||
@Autowired
|
||||
protected NumCfgDao numCfgDao;
|
||||
/**
|
||||
*
|
||||
* addStringCfg(新增IP类配置)
|
||||
* (继承ComplexkeywordCfg这个类方可使用)
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int addCfg(MultipleCfg cfg){
|
||||
if(cfg==null) return 0;
|
||||
if(cfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
|
||||
ipCfgDao.insert(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getStringCfg()!=null){
|
||||
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
|
||||
stringCfgDao.insert(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getNumCfg()!=null){
|
||||
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
|
||||
numCfgDao.insert(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getComplexCfg()!=null){
|
||||
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
|
||||
complexStringCfgDao.insert(_cfg);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int updateCfg(MultipleCfg cfg){
|
||||
if(cfg==null) return 0;
|
||||
if(cfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
|
||||
ipCfgDao.updateByPrimaryKeySelective(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getStringCfg()!=null){
|
||||
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
|
||||
stringCfgDao.updateByPrimaryKeySelective(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getNumCfg()!=null){
|
||||
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
|
||||
numCfgDao.updateByPrimaryKeySelective(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getComplexCfg()!=null){
|
||||
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
|
||||
complexStringCfgDao.updateByPrimaryKeySelective(_cfg);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int deleteCfg(MultipleCfg cfg){
|
||||
if(cfg==null) return 0;
|
||||
if(cfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
|
||||
ipCfgDao.deleteByCompileId(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getStringCfg()!=null){
|
||||
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
|
||||
stringCfgDao.deleteByCompileId(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getNumCfg()!=null){
|
||||
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
|
||||
numCfgDao.deleteByCompileId(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getComplexCfg()!=null){
|
||||
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
|
||||
complexStringCfgDao.deleteByCompileId(_cfg);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* auditCfg(这里用一句话描述这个方法的作用)
|
||||
* (这里描述这个方法适用条件 – 可选)
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int auditCfg(MultipleCfg cfg){
|
||||
if(cfg==null) return 0;
|
||||
if(cfg.getIpCfg()!=null){
|
||||
for(BaseIpCfg _cfg:cfg.getIpCfg().values()){
|
||||
ipCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getStringCfg()!=null){
|
||||
for(BaseStringCfg _cfg:cfg.getStringCfg().values()){
|
||||
stringCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getNumCfg()!=null){
|
||||
for(NumBoundaryCfg _cfg:cfg.getNumCfg().values()){
|
||||
numCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
if(cfg.getComplexCfg()!=null){
|
||||
for(ComplexkeywordCfg _cfg:cfg.getComplexCfg().values()){
|
||||
complexStringCfgDao.audit(_cfg);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 由于mysql不支持full join,并且考虑mysql的性能问题,这里分别从各个基础表里查询数据再拼接
|
||||
*/
|
||||
@Override
|
||||
public Page<MultipleSearchCfg> findPage(Page<MultipleSearchCfg> page, MultipleSearchCfg entity) {
|
||||
return super.findPage(page, entity);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.dao.configuration.NumCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
@@ -52,13 +53,22 @@ public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
|
||||
* @param cfg
|
||||
* @return
|
||||
*int
|
||||
* @throws Exception
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int auditNumCfg(NumBoundaryCfg cfg){
|
||||
public int auditNumCfg(NumBoundaryCfg sendCfg,NumBoundaryCfg cfg) throws Exception{
|
||||
if(Constants.AUDIT_NOT_YES==cfg.getIsAudit().intValue()||
|
||||
Constants.AUDIT_YES==cfg.getIsAudit().intValue()){//审核通过,取消审核通过需要发到maat
|
||||
if(sendToMaatConvertor(cfg.getIsAudit(),null,sendCfg)){
|
||||
return numCfgDao.audit(cfg);
|
||||
}
|
||||
}else{
|
||||
return numCfgDao.audit(cfg);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* deleteNumCfg(删除IP类配置)
|
||||
@@ -99,7 +109,7 @@ public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public NumBoundaryCfg getNumCfgById(NumBoundaryCfg cfg){
|
||||
return numCfgDao.get(cfg);
|
||||
return numCfgDao.getById(cfg.getCfgId());
|
||||
}
|
||||
public Integer getIsValid(NumBoundaryCfg cfg){
|
||||
return numCfgDao.getIsValid(cfg);
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package com.nis.web.service.configuration;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
import com.nis.web.service.CrudService;
|
||||
|
||||
@@ -31,17 +30,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int addStringCfg(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.insert(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
logger.info("save "+tableName);
|
||||
return stringCfgDao.insert(baseStringCfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -55,17 +44,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int updateStringCfg(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.updateByPrimaryKeySelective(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
logger.info("update "+tableName);
|
||||
return stringCfgDao.updateByPrimaryKeySelective(baseStringCfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -74,22 +53,21 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
* @param baseStringCfg
|
||||
* @return
|
||||
*int
|
||||
* @throws Exception
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int auditStringCfg(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.audit(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
logger.info("aduit "+tableName);
|
||||
public int auditStringCfg(BaseStringCfg sendCfg,BaseStringCfg baseStringCfg) throws Exception{
|
||||
if(Constants.AUDIT_NOT_YES==baseStringCfg.getIsAudit().intValue()||
|
||||
Constants.AUDIT_YES==baseStringCfg.getIsAudit().intValue()){//审核通过,取消审核通过需要发到maat
|
||||
if(sendToMaatConvertor(baseStringCfg.getIsAudit(),null,sendCfg)){
|
||||
return stringCfgDao.audit(baseStringCfg);
|
||||
}
|
||||
|
||||
}else{
|
||||
return stringCfgDao.audit(baseStringCfg);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -103,35 +81,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int deleteStringCfg(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.updateValid(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return 0;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
logger.info("delete "+tableName);
|
||||
return stringCfgDao.updateValid(baseStringCfg);
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getStringCfg(根据IP与类名获取IP配置)
|
||||
* (继承BaseStringCfg这个类方可使用)
|
||||
* @param clazz
|
||||
* @param id
|
||||
* @return
|
||||
*BaseStringCfg
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public BaseStringCfg getStringCfgById(Class<?> clazz,long id){
|
||||
String tableName=getTableName(clazz.getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
logger.info("get "+tableName);
|
||||
return stringCfgDao.getById(tableName, id);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -145,44 +95,16 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public BaseStringCfg getStringCfgById(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.get(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
logger.info("get "+tableName);
|
||||
return stringCfgDao.get(baseStringCfg);
|
||||
}
|
||||
|
||||
return stringCfgDao.getById(baseStringCfg.getTableName(), baseStringCfg.getCfgId());
|
||||
}
|
||||
public Integer getIsValid(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.getIsValid(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
return stringCfgDao.getIsValid(baseStringCfg);
|
||||
}
|
||||
|
||||
}
|
||||
public Integer getIsValid(String tableName, long id){
|
||||
return stringCfgDao.getIsValid(tableName,id);
|
||||
}
|
||||
public Integer getIsAudit(BaseStringCfg baseStringCfg){
|
||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
||||
return stringCfgDao.getIsAudit(baseStringCfg);
|
||||
}else{
|
||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
||||
if(StringUtils.isBlank(tableName))
|
||||
return null;
|
||||
baseStringCfg.setTableName(tableName);
|
||||
return stringCfgDao.getIsAudit(baseStringCfg);
|
||||
}
|
||||
|
||||
}
|
||||
public Integer getIsAudit(String tableName, long id){
|
||||
return stringCfgDao.getIsAudit(tableName,id);
|
||||
|
||||
@@ -35,3 +35,26 @@ hasLastUpdate=true
|
||||
|
||||
#配置状态更新的字段
|
||||
updateFields=IS_VALID,OP_TIME
|
||||
#maat configurations
|
||||
#从后台服务获取compileid的url地址
|
||||
get_compileId_url=http://10.0.6.30:8080/maatRest/service/cfg/v1/getCompileId
|
||||
#从后台服务获取groupid的url地址
|
||||
get_groupId_url=http://10.0.6.30:8080/maatRest/service/cfg/v1/getCompileId
|
||||
#从后台服务获取regionid的url地址
|
||||
get_regionId_url=http://10.0.6.30:8080/maatRest/service/cfg/v1/getCompileId
|
||||
#http连接超时时间
|
||||
httpConnectTimeout=5000
|
||||
#http读超时时间
|
||||
readTimeout=5000
|
||||
#向后台提交配置的地址(post形式提交)
|
||||
saveConfigUrl=http://10.0.6.30:8080/maatRest/service/cfg/v1/configSources
|
||||
#将配置置为失效的接口地址
|
||||
invalidConfigUrl=http://10.0.6.30:8080/maatRest/service/cfg/v1/invalidConfigSource
|
||||
#保存dns欺骗ip的后台地址
|
||||
saveDnsConfigUrl=http://10.0.6.30:8080/maatRest/service/cfg/v1/dnsFakeIpSources
|
||||
#获取dns欺骗ip的主键id
|
||||
get_fakeIpId_url=http://10.0.6.30:8080/maatRest/service/cfg/v1/getCompileId
|
||||
#设置dns欺骗ip为无效的url
|
||||
invalidDnsConfigUrl=http://10.0.6.30:8080/maatRest/service/cfg/v1/dnsFakeIpSources
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="config_describe"/></label>
|
||||
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="config_describe"/></label>
|
||||
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" id="cfgDesc" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="config_describe"/></label>
|
||||
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||
</div>
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
<%@ attribute name="id" type="java.lang.String" required="true" description="编号"%>
|
||||
<%@ attribute name="name" type="java.lang.String" required="true" description="输入框名称"%>
|
||||
<%@ attribute name="value" type="java.lang.String" required="true" description="输入框值"%>
|
||||
<i id="${id}Icon" class="icon-${not empty value?value:' hide'}"></i> <label id="${id}IconLabel">${not empty value?value:'无'}</label>
|
||||
<input id="${id}" name="${name}" type="hidden" value="${value}"/><a id="${id}Button" href="javascript:" class="btn">选择</a>
|
||||
<i id="${id}Icon" class="icon-${not empty value?value:' hide'}"></i> <label id="${id}IconLabel">${not empty value?value:'null'}</label>
|
||||
<input id="${id}" name="${name}" type="hidden" value="${value}"/><a id="${id}Button" href="javascript:" class="btn"><spring:message code='select'/></a>
|
||||
<script type="text/javascript">
|
||||
$("#${id}Button").click(function(){
|
||||
top.$.jBox.open("iframe:${ctx}/tag/iconselect?value="+$("#${id}").val(), "选择图标", 700, $(top.document).height()-180, {
|
||||
buttons:{"确定":"ok", "清除":"clear", "关闭":true}, submit:function(v, h, f){
|
||||
top.$.jBox.open("iframe:${ctx}/tag/iconselect?value="+$("#${id}").val(), "<spring:message code='select_icon'/>", 700, $(top.document).height()-180, {
|
||||
buttons:{"<spring:message code='ok'/>":"ok", "<spring:message code='clear'/>":"clear", "<spring:message code='close'/>":true}, submit:function(v, h, f){
|
||||
if (v=="ok"){
|
||||
var icon = h.find("iframe")[0].contentWindow.$("#icon").val();
|
||||
$("#${id}Icon").attr("class", "icon-"+icon);
|
||||
@@ -16,7 +16,7 @@
|
||||
$("#${id}").val(icon);
|
||||
}else if (v=="clear"){
|
||||
$("#${id}Icon").attr("class", "icon- hide");
|
||||
$("#${id}IconLabel").text("无");
|
||||
$("#${id}IconLabel").text("<spring:message code='nothing'/>");
|
||||
$("#${id}").val("");
|
||||
}
|
||||
}, loaded:function(h){
|
||||
|
||||
@@ -24,12 +24,18 @@
|
||||
<%@ attribute name="dataMsgRequired" type="java.lang.String" required="false" description=""%>
|
||||
<%@ attribute name="selectDepartment" type="java.lang.String" required="false" description="不允许选择部门,自办部门,转办部门"%>
|
||||
<%@ attribute name="showParentName" type="java.lang.String" required="false" description="显示父类名称"%>
|
||||
<div class="input-append">
|
||||
<div class="input-group">
|
||||
<input id="${id}Id" name="${name}" class="${cssClass} singleClass" type="hidden" value="${value}" />
|
||||
<input id="${id}Name" name="${labelName}" ${allowInput?'':'readonly="readonly"'} type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}" placeholder="${value}"
|
||||
class="${cssClass}" style="${cssStyle} background-color:transparent"/>
|
||||
<%-- <a id="${id}Button" href="javascript:" class="btn ${disabled} ${hideBtn ? 'hide' : ''}" style="${smallBtn?'padding:4px 2px;':''}"> <i class="icon-search"></i> </a> --%>
|
||||
|
||||
<div class="input-group-btn">
|
||||
<a id="${id}Button" class="btn btn-default btn-search" href="javascript:" class="btn ${disabled} ${hideBtn ? 'hide' : ''}" style="${smallBtn?'padding:4px 2px;':''}"><i class="fa fa-search"></i></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#${id}Button, #${id}Name").click(function(){
|
||||
// 是否限制选择,如果限制,设置为disablegetQueryString d
|
||||
@@ -38,7 +44,7 @@
|
||||
}
|
||||
// 正常打开
|
||||
top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}", "选择${title}", 320, 420, {
|
||||
ajaxData:{selectIds: $("#${id}Id").val()},buttons:{"确定":"ok", ${allowClear?"\"清除\":\"clear\", ":""}"关闭":true}, submit:function(v, h, f){
|
||||
ajaxData:{selectIds: $("#${id}Id").val()},buttons:{"<spring:message code='ok'/>":"ok", ${allowClear?"\"<spring:message code='clear'/>\":\"clear\", ":""}"<spring:message code='close'/>":true}, submit:function(v, h, f){
|
||||
if (v=="ok"){
|
||||
var tree = h.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();
|
||||
var ids = [], names = [], nodes = [];
|
||||
@@ -52,22 +58,22 @@
|
||||
continue; // 如果为复选框选择,则过滤掉父节点
|
||||
}//</c:if><c:if test="${notAllowSelectRoot}">
|
||||
if (nodes[i].level == 0){
|
||||
top.$.jBox.tip("不能选择根节点("+nodes[i].name+")请重新选择。");
|
||||
top.$.jBox.tip("<spring:message code='no_root'/>("+nodes[i].name+")<spring:message code='reselect'/>");
|
||||
return false;
|
||||
}//</c:if><c:if test="${notAllowSelectParent}">
|
||||
if (nodes[i].isParent){
|
||||
top.$.jBox.tip("不能选择父节点("+nodes[i].name+")请重新选择。");
|
||||
top.$.jBox.tip("<spring:message code='no_parent'/>("+nodes[i].name+")<spring:message code='reselect'/>");
|
||||
return false;
|
||||
}//</c:if><c:if test="${not empty module && selectScopeModule}">
|
||||
if (nodes[i].module == ""){
|
||||
top.$.jBox.tip("不能选择公共模型("+nodes[i].name+")请重新选择。");
|
||||
top.$.jBox.tip("<spring:message code='no_public_model'/>("+nodes[i].name+")<spring:message code='reselect'/>");
|
||||
return false;
|
||||
}else if (nodes[i].module != "${module}"){
|
||||
top.$.jBox.tip("不能选择当前栏目以外的栏目模型,请重新选择。");
|
||||
top.$.jBox.tip("<spring:message code='no_outside_column'/>,<spring:message code='reselect'/>");
|
||||
return false;
|
||||
}//</c:if><c:if test="${selectDepartment}">
|
||||
if (nodes[i].name=="请选择下发单位" || nodes[i].name=="部门" ||nodes[i].name=="下发单位"){
|
||||
top.$.jBox.tip("不能选择节点("+nodes[i].name+")请重新选择。");
|
||||
if (nodes[i].name=="<spring:message code='send_org'/>" || nodes[i].name=="<spring:message code='department'/>" ||nodes[i].name=="<spring:message code='sendind_org'/>"){
|
||||
top.$.jBox.tip("<spring:message code='no_node'/>("+nodes[i].name+")<spring:message code='reselect'/>");
|
||||
return false;
|
||||
}//</c:if>
|
||||
ids.push(nodes[i].id);//<c:if test="${showParentName}">
|
||||
|
||||
@@ -14,9 +14,6 @@ $(function(){
|
||||
});
|
||||
$("#cfgFrom").validate({
|
||||
rules: {
|
||||
'cfgDesc':{
|
||||
required:true
|
||||
},
|
||||
'keywords':{
|
||||
required:true
|
||||
},
|
||||
@@ -34,9 +31,6 @@ $(function(){
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
'cfgDesc':{
|
||||
required:'<spring:message code="required"/>'
|
||||
},
|
||||
'keywords':{
|
||||
required:'<spring:message code="required"/>'
|
||||
},
|
||||
|
||||
@@ -5,6 +5,17 @@
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.keywords}"){
|
||||
$("#intype").val("${cfg.keywords}");
|
||||
} else if("${cfg.cfgDesc}"){
|
||||
$("#intype").val("${cfg.cfgDesc}");
|
||||
} else{
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
}
|
||||
$("#seltype").change(function(){
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
|
||||
});
|
||||
//筛选功能初始化
|
||||
filterActionInit();
|
||||
$("#isAudit").change(function(){
|
||||
@@ -24,6 +35,8 @@
|
||||
});
|
||||
//查询
|
||||
function page(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").submit();
|
||||
@@ -61,6 +74,8 @@
|
||||
<input id="audit" name="audit" type="hidden" value="${audit}"/>
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
|
||||
callback="page();" />
|
||||
<!-- 筛选按钮展开状态-->
|
||||
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
@@ -81,8 +96,8 @@
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
|
||||
<form:select path="" class="selectpicker select2 input-small" >
|
||||
<form:option value="key_word"><spring:message code="key_word"></spring:message></form:option>
|
||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||
<form:option value="keywords"><spring:message code="key_word"></spring:message></form:option>
|
||||
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||
</form:select>
|
||||
|
||||
@@ -109,7 +124,7 @@
|
||||
</div> --%>
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||
<button type="button" class="btn btn-default" onClick="resetx()"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="filter-btn"> 筛选 <i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
@@ -248,7 +263,7 @@
|
||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><spring:message code="seq"/></th>
|
||||
<%-- <th><spring:message code="seq"/></th> --%>
|
||||
<th><spring:message code="config_describe"/></th>
|
||||
<th><spring:message code="key_word"/></th>
|
||||
<th><spring:message code="block_type"/></th>
|
||||
@@ -260,18 +275,18 @@
|
||||
<th><spring:message code="valid_identifier"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th><spring:message code="config_time"/></th>
|
||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th><spring:message code="edit_time"/></th>
|
||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th><spring:message code="audit_time"/></th>
|
||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<th><spring:message code="operation"></spring:message></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||
<tr>
|
||||
<td>${status.index+1 }</td>
|
||||
<%-- <td>${status.index+1 }</td> --%>
|
||||
<td>${cfg.cfgDesc }</td>
|
||||
<%-- <td>${cfg.district }</td> --%>
|
||||
<td>${cfg.keywords }</td>
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue" onClick="page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||
<button type="button" class="btn btn-default resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="filter-btn"> 筛选 <i class="fa fa-angle-double-down"></i></button>
|
||||
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -62,9 +62,6 @@ $(function(){
|
||||
});
|
||||
$("#ipCfgFrom").validate({
|
||||
rules: {
|
||||
cfgDesc: {
|
||||
required: true,
|
||||
},
|
||||
ipType: {
|
||||
required: true,
|
||||
},
|
||||
@@ -114,9 +111,6 @@ $(function(){
|
||||
|
||||
},
|
||||
messages: {
|
||||
cfgDesc: {
|
||||
required: '<spring:message code="required"/>',
|
||||
},
|
||||
ipType: {
|
||||
required: '<spring:message code="required"/>',
|
||||
},
|
||||
|
||||
@@ -5,8 +5,18 @@
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("seltype").on("click",function(){
|
||||
alert(2333)
|
||||
//搜索框提示语初始化
|
||||
if("${ipCfg.srcIp}"){
|
||||
$("#intype").val("${ipCfg.srcIp}");
|
||||
} else if("${ipCfg.dstIp}"){
|
||||
$("#intype").val("${ipCfg.dstIp}");
|
||||
} else if("${ipCfg.cfgDesc}"){
|
||||
$("#intype").val("${ipCfg.cfgDesc}");
|
||||
} else{
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
}
|
||||
$("#seltype").change(function(){
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
|
||||
});
|
||||
//筛选功能初始化
|
||||
filterActionInit();
|
||||
@@ -26,6 +36,7 @@
|
||||
});
|
||||
//查询
|
||||
function page(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").submit();
|
||||
@@ -62,6 +73,8 @@
|
||||
<input id="audit" name="audit" type="hidden" value="${audit}"/>
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
|
||||
callback="page();" />
|
||||
<!-- 筛选按钮展开状态-->
|
||||
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${ipCfg.isFilterAction }"/>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
@@ -80,7 +93,7 @@
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
|
||||
<form:select path="" class="selectpicker select2 input-small" >
|
||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||
<form:option value="srcIp"><spring:message code="client_ip"></spring:message></form:option>
|
||||
<form:option value="dstIp"><spring:message code="server_ip"></spring:message></form:option>
|
||||
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||
@@ -153,7 +166,7 @@
|
||||
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||
<button type="button" class="btn btn-default" onClick="resetx()"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="filter-btn"> 筛选 <i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
@@ -300,7 +313,7 @@
|
||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><spring:message code="seq"/></th>
|
||||
<%-- <th><spring:message code="seq"/></th> --%>
|
||||
<th><spring:message code="config_describe"/></th>
|
||||
<th>ip<spring:message code="type"/></th>
|
||||
<th><spring:message code="client_ip"/></th>
|
||||
@@ -332,18 +345,18 @@
|
||||
<th><spring:message code="valid_identifier"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th><spring:message code="config_time"/></th>
|
||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th><spring:message code="edit_time"/></th>
|
||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th><spring:message code="audit_time"/></th>
|
||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<th><spring:message code="operation"></spring:message></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list }" var="ipCfg" varStatus="status" step="1">
|
||||
<tr pId="${status.index}">
|
||||
<td>${status.index+1 }</td>
|
||||
<%-- <td>${status.index+1 }</td> --%>
|
||||
<td>${ipCfg.cfgDesc }</td>
|
||||
<td>V${ipCfg.ipType }</td>
|
||||
<td>${ipCfg.srcIp }</td>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-9">
|
||||
<button type="submit" class="btn btn-circle green"><spring:message code="submit"></spring:message></button>
|
||||
<button type="submit" class="btn btn-circle blue"><spring:message code="submit"></spring:message></button>
|
||||
<button type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)"><spring:message code="cancel"></spring:message></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -175,7 +175,6 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th><spring:message code="seq"></spring:message></th>
|
||||
<th><spring:message code="request_number"></spring:message></th>
|
||||
<th><spring:message code="request_organization"></spring:message></th>
|
||||
<th><spring:message code="request_time"></spring:message></th>
|
||||
@@ -196,7 +195,6 @@
|
||||
<c:forEach items="${page.list}" var="requestInfo">
|
||||
<tr>
|
||||
<td><input type="checkbox" class="i-checks" id="${requestInfo.id}" value="${requestInfo.isAudit}"></td>
|
||||
<td>${requestInfo.id }</td>
|
||||
<td>${requestInfo.requestNumber }</td>
|
||||
<td>${requestInfo.requestOrg }</td>
|
||||
<td><fmt:formatDate value="${requestInfo.requestTime }" pattern="yyyy-MM-dd"/></td>
|
||||
@@ -241,7 +239,7 @@
|
||||
if("${requestInfo.requestContent}"){
|
||||
$("#intype").val("${requestInfo.requestContent}");
|
||||
}else{
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/>"+$("#seltype").find("option:selected").text());
|
||||
}
|
||||
//筛选功能初始化
|
||||
filterActionInit();
|
||||
@@ -251,7 +249,7 @@
|
||||
});
|
||||
|
||||
$("#seltype").change(function(){
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/>"+$(this).find("option:selected").text());
|
||||
});
|
||||
//全选及取消
|
||||
$("#checkAll").change(function(){
|
||||
@@ -281,7 +279,7 @@
|
||||
});
|
||||
$(".Wdate").attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+"<spring:message code='title'/>");
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/>"+"<spring:message code='title'/>");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<title>结果跳转页</title>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
setTimeout("javascript:window.location.href='${ctx}/cfg/${cfgType}/list?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}&audit=${audit}'",1000);
|
||||
setTimeout("javascript:window.location.href='${ctx}/cfg/${cfgType}/list?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}&audit=${audit}&mainTable=${mainTable}'",1000);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
$(function(){
|
||||
$("#cfgFrom").validate({
|
||||
rules: {
|
||||
'cfgDesc':{
|
||||
required:true
|
||||
},
|
||||
'cfgKeywords':{
|
||||
required:true
|
||||
},
|
||||
@@ -33,9 +30,6 @@ $(function(){
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
'cfgDesc':{
|
||||
required:'<spring:message code="required"/>'
|
||||
},
|
||||
'cfgKeywords':{
|
||||
required:'<spring:message code="required"/>'
|
||||
},
|
||||
|
||||
@@ -5,6 +5,17 @@
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.cfgKeywords}"){
|
||||
$("#intype").val("${cfg.cfgKeywords}");
|
||||
} else if("${cfg.cfgDesc}"){
|
||||
$("#intype").val("${cfg.cfgDesc}");
|
||||
} else{
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
}
|
||||
$("#seltype").change(function(){
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
|
||||
});
|
||||
//筛选功能初始化
|
||||
filterActionInit();
|
||||
$("#isAudit").change(function(){
|
||||
@@ -24,6 +35,8 @@
|
||||
});
|
||||
//查询
|
||||
function page(n,s){
|
||||
$("#intype").attr("name",$("#seltype").val());
|
||||
|
||||
$("#pageNo").val(n);
|
||||
$("#pageSize").val(s);
|
||||
$("#searchForm").submit();
|
||||
@@ -61,6 +74,8 @@
|
||||
<input id="audit" name="audit" type="hidden" value="${audit}"/>
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
|
||||
callback="page();" />
|
||||
<!-- 筛选按钮展开状态-->
|
||||
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
@@ -80,8 +95,8 @@
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
|
||||
<form:select path="" class="selectpicker select2 input-small" >
|
||||
<form:option value="key_word"><spring:message code="key_word"></spring:message></form:option>
|
||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||
<form:option value="cfgKeywords"><spring:message code="key_word"></spring:message></form:option>
|
||||
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||
</form:select>
|
||||
|
||||
@@ -110,7 +125,7 @@
|
||||
</div> --%>
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||
<button type="button" class="btn btn-default" onClick="resetx()"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="filter-btn"> 筛选 <i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
@@ -257,7 +272,7 @@
|
||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><spring:message code="seq"/></th>
|
||||
<%-- <th><spring:message code="seq"/></th> --%>
|
||||
<th><spring:message code="config_describe"/></th>
|
||||
<th><spring:message code="key_word"/></th>
|
||||
<th><spring:message code="block_type"/></th>
|
||||
@@ -275,18 +290,18 @@
|
||||
<th><spring:message code="valid_identifier"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th><spring:message code="config_time"/></th>
|
||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th><spring:message code="edit_time"/></th>
|
||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th><spring:message code="audit_time"/></th>
|
||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<th><spring:message code="operation"></spring:message></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||
<tr>
|
||||
<td>${status.index+1 }</td>
|
||||
<%-- <td>${status.index+1 }</td> --%>
|
||||
<td>${cfg.cfgDesc }</td>
|
||||
<td>${cfg.cfgKeywords }</td>
|
||||
<td>
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
<title>用户管理</title>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
$("#no").focus();
|
||||
|
||||
$("#inputForm").validate({
|
||||
@@ -175,10 +177,11 @@
|
||||
<form:option value="0">普通人员</form:option>
|
||||
<form:option value="1">管理人员</form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
<span class="help-inline"><font>管理人员需指定身份标识为“管理人员”,否则影响审核流程!</font></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">邮箱:</label>
|
||||
<div class="col-md-4">
|
||||
@@ -191,10 +194,23 @@
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">用户角色:</label>
|
||||
<div class="col-md-8">
|
||||
<form:checkboxes path="roleIdList" items="${allRoles}" itemLabel="name" itemValue="id" htmlEscape="false" class="required" style="vertical-align:middle;display:inline-block;margin-bottom:4px"/>
|
||||
|
||||
<div class="mt-checkbox-inline">
|
||||
|
||||
<c:forEach items="${allRoles}" var="role">
|
||||
<label class="mt-checkbox">
|
||||
<form:checkbox path="roleIdList" value="${role.id }" /> ${role.name }
|
||||
<span></span>
|
||||
</label>
|
||||
</c:forEach>
|
||||
|
||||
<span class="help-inline "><font color="red">*</font> </span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<c:if test="${not empty user.id}">
|
||||
<div class="form-group">
|
||||
@@ -210,8 +226,8 @@
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-9">
|
||||
<shiro:hasPermission name="sys:user:edit"></shiro:hasPermission>
|
||||
<button type="submit" class="btn btn-circle green"><spring:message code="submit"></spring:message></button>
|
||||
<button type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)"><spring:message code="cancel"></spring:message></button>
|
||||
<button type="submit" class="btn blue"><spring:message code="submit"></spring:message></button>
|
||||
<button type="button" class="btn blue btn-outline" onclick="history.go(-1)"><spring:message code="cancel"></spring:message></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,12 @@
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
top.window.scrollTo(0, 0);
|
||||
if ("${systemServiceInfo.id}") {
|
||||
$("[name=childTableFlag]").val("1");
|
||||
}
|
||||
|
||||
$("#inputForm").validate({
|
||||
ignore: [],
|
||||
rules: {
|
||||
'serviceName':{
|
||||
required:true
|
||||
@@ -24,9 +29,11 @@
|
||||
'serviceType':{
|
||||
required:true
|
||||
},
|
||||
'serviceDesc':{
|
||||
required:true
|
||||
'childTableFlag':{
|
||||
required:true,
|
||||
checkChild:true
|
||||
}
|
||||
|
||||
},
|
||||
messages: {
|
||||
'serviceName':{
|
||||
@@ -42,30 +49,42 @@
|
||||
'serviceType':{
|
||||
required:'<spring:message code="required"/>'
|
||||
},
|
||||
'serviceDesc':{
|
||||
'childTableFlag':{
|
||||
required:'<spring:message code="required"/>'
|
||||
}
|
||||
},
|
||||
submitHandler: function(form){
|
||||
$("[for=childTableFlag]").css("display", "none");
|
||||
/* $("[for=childTableFlag]").css("display", "none");
|
||||
var flag = true;
|
||||
var tables = document.getElementsByClassName("child-required");
|
||||
if (tables.length == 0) {
|
||||
$("[for=childTableFlag]").text("<spring:message code='required'/>").css("display", "inline");
|
||||
if (!$("#serviceIdInput").val()) {
|
||||
$("[for=serviceId]").css("display", "inline");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
for (var i = 0; i < tables.length; i++) {
|
||||
if (!tables[i].value || tables[i].value == '') {
|
||||
$("[for=childTableFlag]").css("display", "inline");
|
||||
$("[for=childTableFlag]").text("<spring:message code='fill_all'/>").css("display", "inline");
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
loading('LOADING...');
|
||||
|
||||
if (!$("#serviceIdInput").val()) {
|
||||
$("[for=serviceId]").css("display", "inline");
|
||||
flag = false;
|
||||
}
|
||||
|
||||
if (flag) {*/
|
||||
$("[disabled=disabled]").attr("disabled", false);
|
||||
$("#submitBtn").attr("disabled", true);//防止重复提交
|
||||
form.submit();
|
||||
} else {
|
||||
/*} else {
|
||||
flag = true;
|
||||
return false;
|
||||
}
|
||||
} */
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
errorPlacement: function(error, element) {
|
||||
@@ -78,6 +97,17 @@
|
||||
}
|
||||
});
|
||||
|
||||
$.validator.addMethod(
|
||||
"checkChild",
|
||||
function(value, element, params) {
|
||||
if (value && value == "1") {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
"<spring:message code='fill_all'/>"
|
||||
);
|
||||
changeType($("#serviceType").val(), $("#serviceType"));
|
||||
|
||||
//类型、动作不允许修改
|
||||
@@ -94,6 +124,25 @@
|
||||
});
|
||||
}
|
||||
|
||||
function childValidate() {
|
||||
var flag = true;
|
||||
var c = $(".child-required, .child-required2.selectpicker");
|
||||
if (c.length == 0) {
|
||||
return false;
|
||||
}
|
||||
c.each(function(){
|
||||
if (!$(this).val()) {
|
||||
flag = false;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (flag) {
|
||||
$("[name=childTableFlag]").val("1");
|
||||
} else {
|
||||
$("[name=childTableFlag]").val("0");
|
||||
}
|
||||
}
|
||||
|
||||
function changeType(v, obj) {
|
||||
if ($(obj).val() == '') {
|
||||
$("#addBtn").attr("disabled", true);
|
||||
@@ -156,6 +205,8 @@
|
||||
} else {
|
||||
$("#serviceIdInput").val("");
|
||||
}
|
||||
|
||||
childValidate();
|
||||
}
|
||||
|
||||
function addDatatable() {
|
||||
@@ -165,7 +216,7 @@
|
||||
'<input type="hidden" name="sciId" value="0"/>' +
|
||||
'<input type="hidden" name="sciIsValid" value="1"/>' +
|
||||
'<span class="child-label col-md-3"><font color="red">*</font>'+'<spring:message code="table_name"/>'+':</span> ' +
|
||||
'<span><input class="child-required form-control child-input" name="tableName"/></span> ' +
|
||||
'<span><input class="child-required form-control child-input" onchange="childValidate()" name="tableName"/></span> ' +
|
||||
'</div>' +
|
||||
'<div class="table-item">' +
|
||||
'<span class="child-label col-md-3"><font color="red">*</font>'+'<spring:message code="table_type"/>'+':</span> ' +
|
||||
@@ -180,11 +231,11 @@
|
||||
'</div>' +
|
||||
'<div class="table-item">' +
|
||||
'<span class="child-label col-md-3"><font color="red">*</font>MAAT '+'<spring:message code="table_name"/>'+':</span> ' +
|
||||
'<span><input class="child-required form-control child-input" name="maatTable"/></span>' +
|
||||
'<span><input class="child-required form-control child-input" onchange="childValidate()" name="maatTable"/></span>' +
|
||||
'</div>' +
|
||||
'<div class="table-item">' +
|
||||
'<span class="child-label col-md-3"><font color="red">*</font>'+'<spring:message code="table_des"/>'+':</span> ' +
|
||||
'<span><input class="child-required form-control child-input" name="tableDesc"/></span>' +
|
||||
'<span class="child-label col-md-3">' + '<spring:message code="table_des"/>'+':</span> ' +
|
||||
'<span><input class="form-control child-input" name="tableDesc"/></span>' +
|
||||
'<button type="button" class="btn btn-danger del-button" onclick="del2(this)">'+'<spring:message code="delete"/>'+'</button>' +
|
||||
'</div>' +
|
||||
'</div>'
|
||||
@@ -193,6 +244,8 @@
|
||||
if ($("#serviceType").val() == '1' || $("#serviceType").val() == '3') {
|
||||
$("#addBtn").attr("disabled", true);
|
||||
}
|
||||
|
||||
childValidate();
|
||||
}
|
||||
|
||||
function del(obj) {
|
||||
@@ -271,12 +324,13 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><spring:message code="datebase_table"/>:</label>
|
||||
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="datebase_table"/>:</label>
|
||||
<div class="col-md-8" id="datatables">
|
||||
<shiro:hasPermission name="system:service:edit">
|
||||
<div>
|
||||
<button id="addBtn" type="button" class="btn btn-default" onclick="addDatatable()"><spring:message code="add"/></button>
|
||||
<label for="childTableFlag" class="error" style="display:none"><spring:message code="fill_all"/></label>
|
||||
<input type="hidden" name="childTableFlag" value="${id }"/>
|
||||
<!-- <label for="childTableFlag" class="error" style="display:none"></label> -->
|
||||
</div>
|
||||
</shiro:hasPermission>
|
||||
<c:forEach items="${systemServiceInfo.serviceConfigInfoList }" var="serviceConfigInfo">
|
||||
@@ -286,7 +340,7 @@
|
||||
<input type="hidden" name="sciIsValid" value="1"/>
|
||||
|
||||
<span class="child-label col-md-3"><font color="red">*</font><spring:message code="table_name"/>:</span>
|
||||
<span><input class="child-required form-control child-input" name="tableName" value="${serviceConfigInfo.tableName }"/></span>
|
||||
<span><input class="child-required form-control child-input" onchange="childValidate()" name="tableName" value="${serviceConfigInfo.tableName }"/></span>
|
||||
</div>
|
||||
<div class="table-item">
|
||||
<span class="child-label col-md-3"><font color="red">*</font><spring:message code="table_type"/>:</span>
|
||||
@@ -301,11 +355,11 @@
|
||||
</div>
|
||||
<div class="table-item">
|
||||
<span class="child-label col-md-3"><font color="red">*</font>MAAT <spring:message code="table_name"/>:</span>
|
||||
<span><input class="child-required form-control child-input" name="maatTable" value="${serviceConfigInfo.maatTable }"/></span>
|
||||
<span><input class="child-required form-control child-input" onchange="childValidate()" name="maatTable" value="${serviceConfigInfo.maatTable }"/></span>
|
||||
</div>
|
||||
<div class="table-item">
|
||||
<span class="child-label col-md-3"><font color="red">*</font><spring:message code="table_des"/>:</span>
|
||||
<span><input class="child-required form-control child-input" name="tableDesc" value="${serviceConfigInfo.tableDesc }"/></span>
|
||||
<span class="child-label col-md-3"><spring:message code="table_des"/>:</span>
|
||||
<span><input class="form-control child-input child-desc" name="tableDesc" value="${serviceConfigInfo.tableDesc }"/></span>
|
||||
|
||||
<button type="button" class="btn btn-danger del-button" onclick="del(this)"><spring:message code="delete"/></button>
|
||||
</div>
|
||||
@@ -317,14 +371,15 @@
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="service_id"/>:</label>
|
||||
<div class="col-md-4">
|
||||
<input id="serviceIdInput" class="required form-control" name="serviceId" value="${systemServiceInfo.serviceId }" readonly="readonly">
|
||||
<input id="serviceIdInput" class="form-control" name="serviceId" value="${systemServiceInfo.serviceId }" readonly="readonly">
|
||||
<label for="serviceId" class="error" style="display:none"><spring:message code="required"/></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="describe"/>:</label>
|
||||
<label class="col-md-3 control-label"><spring:message code="describe"/>:</label>
|
||||
<div class="col-md-4">
|
||||
<form:textarea path="serviceDesc" htmlEscape="false" class="required form-control"/>
|
||||
<form:textarea path="serviceDesc" htmlEscape="false" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -29,6 +29,14 @@ function deleteService(id) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkNum(obj) {
|
||||
var reg = /^[0-9]*$/;
|
||||
if (!reg.test(obj.value)) {
|
||||
top.$.jBox.tip("请输入数字");
|
||||
obj.value=obj.value.replace(/[^\d]/g,'');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
@@ -78,7 +86,7 @@ function deleteService(id) {
|
||||
<input name="serviceName" class="form-control input-medium" placeholder="<spring:message code="service_name"/>" value="${systemServiceInfo.serviceName }"/>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<input name="serviceId" class="form-control input-medium" placeholder="<spring:message code="service_id"/>" value="${systemServiceInfo.serviceId }"/>
|
||||
<input name="serviceId" class="form-control input-medium" placeholder="<spring:message code="service_id"/>" value="${systemServiceInfo.serviceId }" onkeyup="checkNum(this)"/>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue" onClick="page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||
@@ -119,7 +127,7 @@ function deleteService(id) {
|
||||
<c:if test="${2 eq ssi.serviceType }"><spring:message code="multi_domain"/></c:if>
|
||||
<c:if test="${3 eq ssi.serviceType }"><spring:message code="special_service"/></c:if>
|
||||
</td>
|
||||
<td>${ssi.creator.loginId }</td>
|
||||
<td>${ssi.creator.name }</td>
|
||||
<td><fmt:formatDate value="${ssi.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${ssi.serviceDesc }</td>
|
||||
<td>
|
||||
|
||||
@@ -5065,9 +5065,10 @@ Form Layouts
|
||||
|
||||
.control-label .required,
|
||||
.form-group .required {
|
||||
color: #e02222;
|
||||
/* color: #e02222;
|
||||
font-size: 12px;
|
||||
padding-left: 2px; }
|
||||
padding-left: 2px; */
|
||||
}
|
||||
|
||||
.form {
|
||||
padding: 0 !important; }
|
||||
@@ -6157,35 +6158,11 @@ Customized Bootstrap Labels
|
||||
font-size: 75%; }
|
||||
|
||||
/* Labels variants */
|
||||
.label-default {
|
||||
background-color: #bac3d0; }
|
||||
.label-default[href]:hover, .label-default[href]:focus {
|
||||
background-color: #9ca8bb; }
|
||||
|
||||
.label-primary {
|
||||
background-color: #337ab7; }
|
||||
.label-primary[href]:hover, .label-primary[href]:focus {
|
||||
background-color: #286090; }
|
||||
|
||||
.label-success {
|
||||
background-color: #36c6d3; }
|
||||
.label-success[href]:hover, .label-success[href]:focus {
|
||||
background-color: #27a4b0; }
|
||||
|
||||
.label-info {
|
||||
background-color: #659be0; }
|
||||
.label-info[href]:hover, .label-info[href]:focus {
|
||||
background-color: #3a80d7; }
|
||||
|
||||
.label-warning {
|
||||
background-color: #F1C40F; }
|
||||
.label-warning {
|
||||
background-color: #e6911a; }
|
||||
.label-warning[href]:hover, .label-warning[href]:focus {
|
||||
background-color: #c29d0b; }
|
||||
background-color: #c88220; }
|
||||
|
||||
.label-danger {
|
||||
background-color: #ed6b75; }
|
||||
.label-danger[href]:hover, .label-danger[href]:focus {
|
||||
background-color: #e73d4a; }
|
||||
|
||||
/***
|
||||
Iconic labels
|
||||
|
||||
Reference in New Issue
Block a user