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;
|
private String appId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 编译id
|
|
||||||
*/
|
|
||||||
private Integer compileId;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* appName
|
* appName
|
||||||
* @return appName
|
* @return appName
|
||||||
@@ -69,22 +64,6 @@ public class AppIdCfg extends BaseCfg<AppIdCfg> {
|
|||||||
this.appId = appId;
|
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)
|
/* (non-Javadoc)
|
||||||
* @see com.nis.domain.configuration.BaseCfg#initDefaultValue()
|
* @see com.nis.domain.configuration.BaseCfg#initDefaultValue()
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -22,7 +22,12 @@ import com.nis.domain.BaseEntity;
|
|||||||
* @version V1.0
|
* @version V1.0
|
||||||
*/
|
*/
|
||||||
public class BaseCfg<T> extends BaseEntity<T> {
|
public class BaseCfg<T> extends BaseEntity<T> {
|
||||||
|
protected String seltype;//选中类型,页面搜索用
|
||||||
protected String tableName;
|
protected String tableName;
|
||||||
|
/**
|
||||||
|
* 编译id
|
||||||
|
*/
|
||||||
|
protected Integer compileId ;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("maatTable")
|
@SerializedName("maatTable")
|
||||||
protected String 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) {
|
public void setSearch_audit_time_end(Date search_audit_time_end) {
|
||||||
this.search_audit_time_end = 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
|
@Expose
|
||||||
@SerializedName("protocolId")
|
@SerializedName("protocolId")
|
||||||
protected Integer protocolId ;
|
protected Integer protocolId ;
|
||||||
/**
|
|
||||||
* 编译id
|
|
||||||
*/
|
|
||||||
protected Long compileId ;
|
|
||||||
/**
|
/**
|
||||||
* ipType
|
* ipType
|
||||||
* @return ipType
|
* @return ipType
|
||||||
@@ -270,20 +266,6 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
|||||||
public void setProtocolId(Integer protocolId) {
|
public void setProtocolId(Integer protocolId) {
|
||||||
this.protocolId = 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
|
@Override
|
||||||
public void initDefaultValue(){
|
public void initDefaultValue(){
|
||||||
super.initDefaultValue();
|
super.initDefaultValue();
|
||||||
|
|||||||
@@ -47,10 +47,6 @@ public class BaseStringCfg extends BaseCfg<BaseStringCfg> {
|
|||||||
public void setCfgKeywords(String cfgKeywords) {
|
public void setCfgKeywords(String cfgKeywords) {
|
||||||
this.cfgKeywords = cfgKeywords;
|
this.cfgKeywords = cfgKeywords;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 编译id
|
|
||||||
*/
|
|
||||||
protected Long compileId ;
|
|
||||||
/**
|
/**
|
||||||
* 表达式类型
|
* 表达式类型
|
||||||
*/
|
*/
|
||||||
@@ -120,19 +116,5 @@ public class BaseStringCfg extends BaseCfg<BaseStringCfg> {
|
|||||||
super.initDefaultValue();
|
super.initDefaultValue();
|
||||||
this.isHexbin = 0;
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,10 +39,6 @@ public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
|
|||||||
@Expose
|
@Expose
|
||||||
@SerializedName("keywords")
|
@SerializedName("keywords")
|
||||||
protected String keywords;
|
protected String keywords;
|
||||||
/**
|
|
||||||
* 编译id
|
|
||||||
*/
|
|
||||||
protected Long compileId;
|
|
||||||
/**
|
/**
|
||||||
* 表达式类型
|
* 表达式类型
|
||||||
*/
|
*/
|
||||||
@@ -89,20 +85,6 @@ public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
|
|||||||
public void setKeywords(String keywords) {
|
public void setKeywords(String keywords) {
|
||||||
this.keywords = 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
|
* exprType
|
||||||
* 继承此类的类会覆盖该方法写自己的缺省值
|
* 继承此类的类会覆盖该方法写自己的缺省值
|
||||||
|
|||||||
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
|
@Expose
|
||||||
@SerializedName("upBoundary")
|
@SerializedName("upBoundary")
|
||||||
protected Long upBoundary;
|
protected Long upBoundary;
|
||||||
protected Long compileId;
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see com.nis.domain.configuration.BaseCfg#initDefaultValue()
|
* @see com.nis.domain.configuration.BaseCfg#initDefaultValue()
|
||||||
*/
|
*/
|
||||||
@@ -76,19 +75,4 @@ public class NumBoundaryCfg extends BaseCfg<NumBoundaryCfg> {
|
|||||||
public void setUpBoundary(Long upBoundary) {
|
public void setUpBoundary(Long upBoundary) {
|
||||||
this.upBoundary = 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
package com.nis.domain.maat;
|
package com.nis.domain.maat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
@@ -35,28 +36,28 @@ public class MaatCfg implements Serializable {
|
|||||||
private static final long serialVersionUID = -7745084076394247318L;
|
private static final long serialVersionUID = -7745084076394247318L;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("strCfg")
|
@SerializedName("strCfg")
|
||||||
private BaseStringCfg[] strCfg;
|
private List<BaseStringCfg> strCfg;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("ipCfg")
|
@SerializedName("ipCfg")
|
||||||
private BaseIpCfg[] ipCfg;
|
private List<BaseIpCfg> ipCfg;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("numCfg")
|
@SerializedName("numCfg")
|
||||||
private NumBoundaryCfg[] numCfg;
|
private List<NumBoundaryCfg> numCfg;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("complexStrCfg")
|
@SerializedName("complexStrCfg")
|
||||||
private ComplexkeywordCfg[] complexStrCfg;
|
private List<ComplexkeywordCfg> complexStrCfg;
|
||||||
/**
|
/**
|
||||||
* strCfg
|
* strCfg
|
||||||
* @return strCfg
|
* @return strCfg
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public BaseStringCfg[] getStrCfg() {
|
public List<BaseStringCfg> getStrCfg() {
|
||||||
return strCfg;
|
return strCfg;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param strCfg the strCfg to set
|
* @param strCfg the strCfg to set
|
||||||
*/
|
*/
|
||||||
public void setStrCfg(BaseStringCfg[] strCfg) {
|
public void setStrCfg(List<BaseStringCfg> strCfg) {
|
||||||
this.strCfg = strCfg;
|
this.strCfg = strCfg;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -64,13 +65,13 @@ public class MaatCfg implements Serializable {
|
|||||||
* @return ipCfg
|
* @return ipCfg
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public BaseIpCfg[] getIpCfg() {
|
public List<BaseIpCfg> getIpCfg() {
|
||||||
return ipCfg;
|
return ipCfg;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param ipCfg the ipCfg to set
|
* @param ipCfg the ipCfg to set
|
||||||
*/
|
*/
|
||||||
public void setIpCfg(BaseIpCfg[] ipCfg) {
|
public void setIpCfg(List<BaseIpCfg> ipCfg) {
|
||||||
this.ipCfg = ipCfg;
|
this.ipCfg = ipCfg;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -78,13 +79,13 @@ public class MaatCfg implements Serializable {
|
|||||||
* @return numCfg
|
* @return numCfg
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public NumBoundaryCfg[] getNumCfg() {
|
public List<NumBoundaryCfg> getNumCfg() {
|
||||||
return numCfg;
|
return numCfg;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param numCfg the numCfg to set
|
* @param numCfg the numCfg to set
|
||||||
*/
|
*/
|
||||||
public void setNumCfg(NumBoundaryCfg[] numCfg) {
|
public void setNumCfg(List<NumBoundaryCfg> numCfg) {
|
||||||
this.numCfg = numCfg;
|
this.numCfg = numCfg;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -92,13 +93,13 @@ public class MaatCfg implements Serializable {
|
|||||||
* @return complexStrCfg
|
* @return complexStrCfg
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public ComplexkeywordCfg[] getComplexStrCfg() {
|
public List<ComplexkeywordCfg> getComplexStrCfg() {
|
||||||
return complexStrCfg;
|
return complexStrCfg;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param complexStrCfg the complexStrCfg to set
|
* @param complexStrCfg the complexStrCfg to set
|
||||||
*/
|
*/
|
||||||
public void setComplexStrCfg(ComplexkeywordCfg[] complexStrCfg) {
|
public void setComplexStrCfg(List<ComplexkeywordCfg> complexStrCfg) {
|
||||||
this.complexStrCfg = complexStrCfg;
|
this.complexStrCfg = complexStrCfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class ToMaatBean implements Serializable{
|
|||||||
private static final long serialVersionUID = 5123156423588372849L;
|
private static final long serialVersionUID = 5123156423588372849L;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("serviceCfg")
|
@SerializedName("serviceCfg")
|
||||||
private List<MaatCfg[]> serviceCfg;
|
private List<List<MaatCfg>> serviceCfg;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("areaCfg")
|
@SerializedName("areaCfg")
|
||||||
private List<AreaIpCfg> areaCfg;
|
private List<AreaIpCfg> areaCfg;
|
||||||
@@ -58,7 +58,7 @@ public class ToMaatBean implements Serializable{
|
|||||||
private String lable;
|
private String lable;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("compileId")
|
@SerializedName("compileId")
|
||||||
private Long compileId;
|
private Integer compileId;
|
||||||
@Expose
|
@Expose
|
||||||
@SerializedName("isAreaEffective")
|
@SerializedName("isAreaEffective")
|
||||||
private Integer isAreaEffective;
|
private Integer isAreaEffective;
|
||||||
@@ -72,18 +72,19 @@ public class ToMaatBean implements Serializable{
|
|||||||
@SerializedName("serviceId")
|
@SerializedName("serviceId")
|
||||||
private Integer serviceId;
|
private Integer serviceId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* serviceCfg
|
* serviceCfg
|
||||||
* @return serviceCfg
|
* @return serviceCfg
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public List<MaatCfg[]> getServiceCfg() {
|
public List<List<MaatCfg>> getServiceCfg() {
|
||||||
return serviceCfg;
|
return serviceCfg;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param serviceCfg the serviceCfg to set
|
* @param serviceCfg the serviceCfg to set
|
||||||
*/
|
*/
|
||||||
public void setServiceCfg(List<MaatCfg[]> serviceCfg) {
|
public void setServiceCfg(List<List<MaatCfg>> serviceCfg) {
|
||||||
this.serviceCfg = serviceCfg;
|
this.serviceCfg = serviceCfg;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -176,13 +177,13 @@ public class ToMaatBean implements Serializable{
|
|||||||
* @return compileId
|
* @return compileId
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public Long getCompileId() {
|
public Integer getCompileId() {
|
||||||
return compileId;
|
return compileId;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param compileId the compileId to set
|
* @param compileId the compileId to set
|
||||||
*/
|
*/
|
||||||
public void setCompileId(Long compileId) {
|
public void setCompileId(Integer compileId) {
|
||||||
this.compileId = compileId;
|
this.compileId = compileId;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -242,22 +243,6 @@ public class ToMaatBean implements Serializable{
|
|||||||
this.serviceId = serviceId;
|
this.serviceId = serviceId;
|
||||||
}
|
}
|
||||||
public static void main(String[] args) {
|
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));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
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_CAPTCHA_PARAM = "captcha";
|
||||||
public static final String DEFAULT_MOBILE_PARAM = "mobileLogin";
|
public static final String DEFAULT_MOBILE_PARAM = "mobileLogin";
|
||||||
public static final String DEFAULT_MESSAGE_PARAM = "message";
|
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
|
* 词典数据key
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -13,10 +13,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.ServiceConfigInfo;
|
import com.nis.domain.ServiceConfigInfo;
|
||||||
import com.nis.domain.configuration.BaseCfg;
|
import com.nis.domain.basics.ServiceDictInfo;
|
||||||
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||||
import com.nis.domain.configuration.RequestInfo;
|
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.util.Constants;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
|
||||||
@@ -74,44 +75,39 @@ public class ComplexStringCfgController extends BaseController{
|
|||||||
model.addAttribute("serviceId", serviceId);
|
model.addAttribute("serviceId", serviceId);
|
||||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||||
logger.info("sercice id is "+serviceId);
|
logger.info("sercice id is "+serviceId);
|
||||||
if(serviceId!=null){
|
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
if(serviceConfigInfo!=null){
|
||||||
if(serviceConfigInfo!=null){
|
String tableName=serviceConfigInfo.getTableName();
|
||||||
String tableName=serviceConfigInfo.getTableName();
|
if(!StringUtils.isBlank(tableName)){
|
||||||
if(!StringUtils.isBlank(tableName)){
|
logger.info("table name is "+tableName);
|
||||||
logger.info("table name is "+tableName);
|
String className=complexStringCfgService.getClassName(tableName);
|
||||||
String className=complexStringCfgService.getClassName(tableName);
|
logger.info("class name is "+className);
|
||||||
logger.info("class name is "+className);
|
String packageName=ComplexkeywordCfg.class.getPackage().getName();
|
||||||
String packageName=ComplexkeywordCfg.class.getPackage().getName();
|
try {
|
||||||
try {
|
//通过反射获得ComplexkeywordCfg的子类的实例,并调用子类的initDefaultValue初始化默认值
|
||||||
//通过反射获得ComplexkeywordCfg的子类的实例,并调用子类的initDefaultValue初始化默认值
|
Class clazz=Class.forName(packageName+"."+className);
|
||||||
Class clazz=Class.forName(packageName+"."+className);
|
ComplexkeywordCfg cfg=(ComplexkeywordCfg)clazz.newInstance();
|
||||||
ComplexkeywordCfg cfg=(ComplexkeywordCfg)clazz.newInstance();
|
cfg.setTableName(tableName);
|
||||||
cfg.setTableName(tableName);
|
cfg.initDefaultValue();
|
||||||
cfg.initDefaultValue();
|
cfg.setAction(action);
|
||||||
cfg.setAction(action);
|
cfg.setServiceId(serviceId);
|
||||||
cfg.setServiceId(serviceId);
|
model.addAttribute("_cfg", cfg);
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("tableName", tableName);
|
||||||
model.addAttribute("tableName", tableName);
|
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
|
||||||
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
|
model.addAttribute("requestInfos", requestInfos);
|
||||||
model.addAttribute("requestInfos", requestInfos);
|
List<ServiceDictInfo> fls=serviceDictInfoService.findFlDict();
|
||||||
List<ServiceDictInfo> fls=serviceDictInfoService.findFlDict();
|
model.addAttribute("fls", fls);
|
||||||
model.addAttribute("fls", fls);
|
List<ServiceDictInfo> xzs=serviceDictInfoService.findXzDict();
|
||||||
List<ServiceDictInfo> xzs=serviceDictInfoService.findXzDict();
|
model.addAttribute("xzs", xzs);
|
||||||
model.addAttribute("xzs", xzs);
|
List<ServiceDictInfo> lables=serviceDictInfoService.findLableDict();
|
||||||
List<ServiceDictInfo> lables=serviceDictInfoService.findLableDict();
|
model.addAttribute("lables", lables);
|
||||||
model.addAttribute("lables", lables);
|
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
|
||||||
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
|
// TODO Auto-generated catch block
|
||||||
// TODO Auto-generated catch block
|
logger.error("打开新增IP窗口失败",e);
|
||||||
logger.error("打开新增IP窗口失败",e);
|
e.printStackTrace();
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
logger.error("未获取到正确的serviceId");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return "/cfg/complexCfgForm";
|
return "/cfg/complexCfgForm";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"updateForm"})
|
@RequestMapping(value = {"updateForm"})
|
||||||
@@ -121,7 +117,13 @@ public class ComplexStringCfgController extends BaseController{
|
|||||||
model.addAttribute("action", action);
|
model.addAttribute("action", action);
|
||||||
model.addAttribute("tableName", tableName);
|
model.addAttribute("tableName", tableName);
|
||||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
logger.info("table name is "+tableName);
|
logger.info("table name is "+tableName);
|
||||||
ComplexkeywordCfg searchBean=new ComplexkeywordCfg();
|
ComplexkeywordCfg searchBean=new ComplexkeywordCfg();
|
||||||
searchBean.setCfgId(cfgId);
|
searchBean.setCfgId(cfgId);
|
||||||
@@ -136,32 +138,9 @@ public class ComplexStringCfgController extends BaseController{
|
|||||||
model.addAttribute("xzs", xzs);
|
model.addAttribute("xzs", xzs);
|
||||||
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
||||||
model.addAttribute("lables", lables);
|
model.addAttribute("lables", lables);
|
||||||
}else if(serviceId!=null){
|
}catch(Exception e){
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
logger.error("发生异常", e);
|
||||||
if(serviceConfigInfo!=null){
|
|
||||||
tableName=serviceConfigInfo.getTableName();
|
|
||||||
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{
|
|
||||||
logger.error("未获取到正确的表名");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return "/cfg/complexCfgForm";
|
return "/cfg/complexCfgForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,15 +158,21 @@ public class ComplexStringCfgController extends BaseController{
|
|||||||
model.addAttribute("cfgName",cfgName);
|
model.addAttribute("cfgName",cfgName);
|
||||||
model.addAttribute("cfgType","complex");
|
model.addAttribute("cfgType","complex");
|
||||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||||
|
model.addAttribute("serviceId",cfg.getServiceId());
|
||||||
|
model.addAttribute("action",cfg.getAction());
|
||||||
logger.info("saveOrUpdateStringCfg loaded");
|
logger.info("saveOrUpdateStringCfg loaded");
|
||||||
if(cfg==null){
|
try {
|
||||||
logger.error("无法保存空的配置!");
|
String tableName=cfg.getTableName();
|
||||||
addMessage(model,"保存失败!");
|
|
||||||
}else if(!StringUtils.isBlank(cfg.getTableName())){
|
|
||||||
int serviceId=cfg.getServiceId();
|
int serviceId=cfg.getServiceId();
|
||||||
long compileId=getCompileId(cfg);
|
if(StringUtils.isBlank(cfg.getTableName())){
|
||||||
// cfg.setCreatorId(cfg.getCurrentUser().getId());
|
|
||||||
// cfg.setCreateTime(new Date());
|
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||||
|
if(serviceConfigInfo!=null){
|
||||||
|
tableName=serviceConfigInfo.getTableName();
|
||||||
|
cfg.setTableName(tableName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int compileId = new ConvertTool().getCompileId();
|
||||||
cfg.setIsValid(Constants.VALID_NO);
|
cfg.setIsValid(Constants.VALID_NO);
|
||||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
cfg.setCompileId(compileId);
|
cfg.setCompileId(compileId);
|
||||||
@@ -200,41 +185,13 @@ public class ComplexStringCfgController extends BaseController{
|
|||||||
cfg.setEditTime(new Date());
|
cfg.setEditTime(new Date());
|
||||||
complexStringCfgService.updateStringCfg(cfg);
|
complexStringCfgService.updateStringCfg(cfg);
|
||||||
}
|
}
|
||||||
model.addAttribute("serviceId",serviceId);
|
|
||||||
model.addAttribute("action",cfg.getAction());
|
|
||||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||||
}else if(cfg.getServiceId()!=null){
|
} catch (Exception e) {
|
||||||
int serviceId=cfg.getServiceId();
|
// TODO Auto-generated catch block
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
logger.error("保存失败!",e);
|
||||||
if(serviceConfigInfo!=null){
|
|
||||||
String tableName=serviceConfigInfo.getTableName();
|
|
||||||
if(!StringUtils.isBlank(tableName)){
|
|
||||||
long compileId=getCompileId(cfg);
|
|
||||||
cfg.setTableName(tableName);
|
|
||||||
// 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("action",cfg.getAction());
|
|
||||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
addMessage(model,"保存失败!");
|
addMessage(model,"保存失败!");
|
||||||
logger.error("无法确定IP配置的表名!");
|
|
||||||
}
|
}
|
||||||
return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+cfg.getServiceId()+"&action="+cfg.getAction()+"&cfgName="+cfgName);
|
return "/cfg/resultPage";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -250,53 +207,47 @@ public class ComplexStringCfgController extends BaseController{
|
|||||||
public String auditStringCfg(String cfgName,ComplexkeywordCfg cfg,Model model) {
|
public String auditStringCfg(String cfgName,ComplexkeywordCfg cfg,Model model) {
|
||||||
model.addAttribute("cfgName", cfgName);
|
model.addAttribute("cfgName", cfgName);
|
||||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||||
if(cfg==null){
|
model.addAttribute("serviceId", cfg.getServiceId());
|
||||||
logger.error("无法审核空的配置!");
|
model.addAttribute("action", cfg.getAction());
|
||||||
}else if(!StringUtils.isBlank(cfg.getTableName())){
|
try{
|
||||||
int audit=complexStringCfgService.getIsAudit(cfg);
|
String tableName=cfg.getTableName();
|
||||||
|
String maatTable=null;
|
||||||
|
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(cfg.getServiceId());
|
||||||
|
if(serviceConfigInfo!=null){
|
||||||
|
if(StringUtils.isBlank(tableName)){
|
||||||
|
tableName=serviceConfigInfo.getTableName();
|
||||||
|
cfg.setTableName(tableName);
|
||||||
|
}
|
||||||
|
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){
|
if(audit==Constants.AUDIT_YES&&cfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||||
logger.error("审核通过的配置只能取消审核通过!");
|
logger.error("审核通过的配置只能取消审核通过!");
|
||||||
}else{
|
}else{
|
||||||
cfg.setAuditorId(cfg.getCurrentUser().getId());
|
cfg.setAuditorId(cfg.getCurrentUser().getId());
|
||||||
cfg.setAuditTime(new Date());
|
cfg.setAuditTime(new Date());
|
||||||
|
bean.setIsAudit(cfg.getIsAudit());
|
||||||
if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||||
cfg.setIsValid(Constants.VALID_NO);
|
cfg.setIsValid(Constants.VALID_NO);
|
||||||
|
bean.setIsValid(Constants.VALID_NO);
|
||||||
|
bean.setMaatTable(maatTable);
|
||||||
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||||
cfg.setIsValid(Constants.VALID_YES);
|
cfg.setIsValid(Constants.VALID_YES);
|
||||||
|
bean.setIsValid(Constants.VALID_YES);
|
||||||
}
|
}
|
||||||
int result=complexStringCfgService.auditStringCfg(cfg);
|
int result=complexStringCfgService.auditStringCfg(bean,cfg);
|
||||||
model.addAttribute("serviceId", cfg.getServiceId());
|
if(result!=0){
|
||||||
model.addAttribute("action", cfg.getAction());
|
addMessage(model,"审核成功!");
|
||||||
}
|
}else{
|
||||||
|
addMessage(model,"审核失败!");
|
||||||
}else if(cfg.getServiceId()!=null){
|
|
||||||
int serviceId=cfg.getServiceId();
|
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
|
||||||
if(serviceConfigInfo!=null){
|
|
||||||
String tableName=serviceConfigInfo.getTableName();
|
|
||||||
if(!StringUtils.isBlank(tableName)){
|
|
||||||
cfg.setTableName(tableName);
|
|
||||||
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("serviceId", serviceId);
|
|
||||||
model.addAttribute("action", cfg.getAction());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}else{
|
}catch(Exception e){
|
||||||
logger.error("无法确定IP配置的表名!");
|
logger.error("发生异常",e);
|
||||||
|
addMessage(model,"审核失败!");
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/cfg/complex/list";
|
return "redirect:" + adminPath + "/cfg/complex/list";
|
||||||
}
|
}
|
||||||
@@ -316,7 +267,13 @@ public class ComplexStringCfgController extends BaseController{
|
|||||||
model.addAttribute("action", action);
|
model.addAttribute("action", action);
|
||||||
model.addAttribute("cfgType","complex");
|
model.addAttribute("cfgType","complex");
|
||||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
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);
|
int audit=complexStringCfgService.getIsAudit(tableName,cfgId);
|
||||||
//未审核时可删除
|
//未审核时可删除
|
||||||
if(audit!=Constants.AUDIT_YES){
|
if(audit!=Constants.AUDIT_YES){
|
||||||
@@ -332,29 +289,9 @@ public class ComplexStringCfgController extends BaseController{
|
|||||||
logger.error("通过审核的配置不能删除!");
|
logger.error("通过审核的配置不能删除!");
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(serviceId!=null){
|
}catch(Exception e){
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
logger.error("删除失败", e);
|
||||||
if(serviceConfigInfo!=null){
|
addMessage(model,"删除失败!");
|
||||||
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配置的表名!");
|
|
||||||
}
|
}
|
||||||
return "/cfg/resultPage";
|
return "/cfg/resultPage";
|
||||||
}
|
}
|
||||||
@@ -367,7 +304,14 @@ public class ComplexStringCfgController extends BaseController{
|
|||||||
* @exception
|
* @exception
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected long getCompileId(BaseCfg cfg){
|
protected long getCompileId(ComplexkeywordCfg cfg){
|
||||||
return 0;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import com.nis.domain.ServiceConfigInfo;
|
|||||||
import com.nis.domain.basics.ServiceDictInfo;
|
import com.nis.domain.basics.ServiceDictInfo;
|
||||||
import com.nis.domain.configuration.BaseIpCfg;
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
import com.nis.domain.configuration.RequestInfo;
|
import com.nis.domain.configuration.RequestInfo;
|
||||||
|
import com.nis.main.ConvertTool;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
|
||||||
@@ -123,7 +124,6 @@ public class IpCfgController extends BaseController{
|
|||||||
ipcfg.setAction(action);
|
ipcfg.setAction(action);
|
||||||
ipcfg.setServiceId(serviceId);
|
ipcfg.setServiceId(serviceId);
|
||||||
model.addAttribute("_cfg", ipcfg);
|
model.addAttribute("_cfg", ipcfg);
|
||||||
long compileId=this.getCompileId();
|
|
||||||
model.addAttribute("tableName", tableName);
|
model.addAttribute("tableName", tableName);
|
||||||
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
|
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
|
||||||
model.addAttribute("requestInfos", requestInfos);
|
model.addAttribute("requestInfos", requestInfos);
|
||||||
@@ -230,13 +230,21 @@ public class IpCfgController extends BaseController{
|
|||||||
model.addAttribute("cfgName",cfgName);
|
model.addAttribute("cfgName",cfgName);
|
||||||
model.addAttribute("cfgType", "ip");
|
model.addAttribute("cfgType", "ip");
|
||||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
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");
|
logger.info("saveOrUpdateIpCfg loaded");
|
||||||
if(ipCfg==null){
|
try{
|
||||||
logger.error("无法保存空的配置!");
|
String tableName=ipCfg.getTableName();
|
||||||
addMessage(model,"保存失败!");
|
|
||||||
}else if(!StringUtils.isBlank(ipCfg.getTableName())){
|
|
||||||
int serviceId=ipCfg.getServiceId();
|
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.setIsValid(Constants.VALID_NO);
|
||||||
ipCfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
ipCfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
ipCfg.setCompileId(compileId);
|
ipCfg.setCompileId(compileId);
|
||||||
@@ -249,42 +257,12 @@ public class IpCfgController extends BaseController{
|
|||||||
ipCfg.setEditTime(new Date());
|
ipCfg.setEditTime(new Date());
|
||||||
ipCfgService.updateIpCfg(ipCfg);
|
ipCfgService.updateIpCfg(ipCfg);
|
||||||
}
|
}
|
||||||
model.addAttribute("serviceId",serviceId);
|
|
||||||
model.addAttribute("action",ipCfg.getAction());
|
|
||||||
model.addAttribute("tableName", ipCfg.getTableName());
|
|
||||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||||
}else if(ipCfg.getServiceId()!=null){
|
}catch(Exception e){
|
||||||
int serviceId=ipCfg.getServiceId();
|
logger.error("保存失败",e);
|
||||||
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{
|
|
||||||
addMessage(model,"保存失败!");
|
addMessage(model,"保存失败!");
|
||||||
logger.error("无法确定IP配置的表名!");
|
|
||||||
}
|
}
|
||||||
return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+ipCfg.getServiceId()+"&action="+ipCfg.getAction()+"&cfgName="+cfgName);
|
return "/cfg/resultPage";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -300,52 +278,47 @@ public class IpCfgController extends BaseController{
|
|||||||
public String auditIpCfg(String cfgName,BaseIpCfg ipCfg,Model model) {
|
public String auditIpCfg(String cfgName,BaseIpCfg ipCfg,Model model) {
|
||||||
model.addAttribute("cfgName", cfgName);
|
model.addAttribute("cfgName", cfgName);
|
||||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||||
if(ipCfg==null){
|
model.addAttribute("serviceId", ipCfg.getServiceId());
|
||||||
logger.error("无法审核空的配置!");
|
model.addAttribute("action", ipCfg.getAction());
|
||||||
}else if(!StringUtils.isBlank(ipCfg.getTableName())){
|
try{
|
||||||
int audit=ipCfgService.getIsAudit(ipCfg);
|
String tableName=ipCfg.getTableName();
|
||||||
|
String maatTable=null;
|
||||||
|
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(ipCfg.getServiceId());
|
||||||
|
if(serviceConfigInfo!=null){
|
||||||
|
if(StringUtils.isBlank(tableName)){
|
||||||
|
tableName=serviceConfigInfo.getTableName();
|
||||||
|
ipCfg.setTableName(tableName);
|
||||||
|
}
|
||||||
|
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){
|
if(audit==Constants.AUDIT_YES&&ipCfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||||
logger.error("审核通过的配置只能取消审核通过!");
|
logger.error("审核通过的配置只能取消审核通过!");
|
||||||
}else{
|
}else{
|
||||||
ipCfg.setAuditorId(ipCfg.getCurrentUser().getId());
|
ipCfg.setAuditorId(ipCfg.getCurrentUser().getId());
|
||||||
ipCfg.setAuditTime(new Date());
|
ipCfg.setAuditTime(new Date());
|
||||||
|
bean.setIsAudit(ipCfg.getIsAudit());
|
||||||
if(ipCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
if(ipCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||||
ipCfg.setIsValid(Constants.VALID_NO);
|
ipCfg.setIsValid(Constants.VALID_NO);
|
||||||
|
bean.setIsValid(Constants.VALID_NO);
|
||||||
|
bean.setMaatTable(maatTable);
|
||||||
}else if(ipCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
}else if(ipCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||||
ipCfg.setIsValid(Constants.VALID_YES);
|
ipCfg.setIsValid(Constants.VALID_YES);
|
||||||
|
bean.setIsValid(Constants.VALID_YES);
|
||||||
}
|
}
|
||||||
int result=ipCfgService.auditIpCfg(ipCfg);
|
int result=ipCfgService.auditIpCfg(bean,ipCfg);
|
||||||
model.addAttribute("serviceId", ipCfg.getServiceId());
|
if(result!=0){
|
||||||
model.addAttribute("action", ipCfg.getAction());
|
addMessage(model,"审核成功!");
|
||||||
}
|
}else{
|
||||||
}else if(ipCfg.getServiceId()!=null){
|
addMessage(model, "审核失败");
|
||||||
int serviceId=ipCfg.getServiceId();
|
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
|
||||||
if(serviceConfigInfo!=null){
|
|
||||||
String tableName=serviceConfigInfo.getTableName();
|
|
||||||
if(!StringUtils.isBlank(tableName)){
|
|
||||||
ipCfg.setTableName(tableName);
|
|
||||||
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", serviceId);
|
|
||||||
model.addAttribute("action", ipCfg.getAction());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}else{
|
}catch(Exception e){
|
||||||
logger.error("无法确定IP配置的表名!");
|
logger.error("审核失败", e);
|
||||||
|
addMessage(model, "审核失败");
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/cfg/ip/list";
|
return "redirect:" + adminPath + "/cfg/ip/list";
|
||||||
}
|
}
|
||||||
@@ -366,7 +339,13 @@ public class IpCfgController extends BaseController{
|
|||||||
model.addAttribute("action", action);
|
model.addAttribute("action", action);
|
||||||
model.addAttribute("cfgType", "ip");
|
model.addAttribute("cfgType", "ip");
|
||||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
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);
|
int audit=ipCfgService.getIsAudit(tableName,cfgId);
|
||||||
//未审核时可删除
|
//未审核时可删除
|
||||||
if(audit!=Constants.AUDIT_YES){
|
if(audit!=Constants.AUDIT_YES){
|
||||||
@@ -381,32 +360,11 @@ public class IpCfgController extends BaseController{
|
|||||||
addMessage(model,"删除成功,正在为您跳转页面...");
|
addMessage(model,"删除成功,正在为您跳转页面...");
|
||||||
}else{
|
}else{
|
||||||
logger.error("通过审核的配置不能删除!");
|
logger.error("通过审核的配置不能删除!");
|
||||||
|
addMessage(model,"删除失败!");
|
||||||
}
|
}
|
||||||
|
}catch(Exception e){
|
||||||
}else if(serviceId!=null){
|
logger.error("删除失败", e);
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
addMessage(model,"删除失败!");
|
||||||
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配置的表名!");
|
|
||||||
}
|
}
|
||||||
return "/cfg/resultPage";
|
return "/cfg/resultPage";
|
||||||
}
|
}
|
||||||
@@ -419,7 +377,14 @@ public class IpCfgController extends BaseController{
|
|||||||
* @exception
|
* @exception
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected long getCompileId(){
|
protected long getCompileId(BaseIpCfg cfg){
|
||||||
return 0;
|
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,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.ServiceConfigInfo;
|
import com.nis.domain.ServiceConfigInfo;
|
||||||
import com.nis.domain.basics.ServiceDictInfo;
|
import com.nis.domain.basics.ServiceDictInfo;
|
||||||
import com.nis.domain.configuration.BaseCfg;
|
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||||
import com.nis.domain.configuration.RequestInfo;
|
import com.nis.domain.configuration.RequestInfo;
|
||||||
|
import com.nis.main.ConvertTool;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
|
||||||
@@ -27,7 +28,6 @@ import com.nis.web.controller.BaseController;
|
|||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/cfg/num")
|
@RequestMapping("${adminPath}/cfg/num")
|
||||||
public class NumCfgController extends BaseController{
|
public class NumCfgController extends BaseController{
|
||||||
|
|
||||||
@RequestMapping(value = {"list"})
|
@RequestMapping(value = {"list"})
|
||||||
public String cfgList(Model model,Integer audit,Integer pageNo,Integer pageSize,String cfgName,@ModelAttribute("cfg")NumBoundaryCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
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);
|
model.addAttribute("cfgName", cfgName);
|
||||||
@@ -136,16 +136,11 @@ public class NumCfgController extends BaseController{
|
|||||||
model.addAttribute("cfgType","num");
|
model.addAttribute("cfgType","num");
|
||||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||||
logger.info("saveOrUpdateStringCfg loaded");
|
logger.info("saveOrUpdateStringCfg loaded");
|
||||||
if(cfg==null){
|
try{
|
||||||
logger.error("无法保存空的配置!");
|
|
||||||
addMessage(model,"保存失败!");
|
|
||||||
}else if(cfg.getServiceId()!=null){
|
|
||||||
int serviceId=cfg.getServiceId();
|
int serviceId=cfg.getServiceId();
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||||
if(serviceConfigInfo!=null){
|
if(serviceConfigInfo!=null){
|
||||||
long compileId=getCompileId(cfg);
|
int compileId=new ConvertTool().getCompileId();
|
||||||
// cfg.setCreatorId(cfg.getCurrentUser().getId());
|
|
||||||
// cfg.setCreateTime(new Date());
|
|
||||||
cfg.setIsValid(Constants.VALID_NO);
|
cfg.setIsValid(Constants.VALID_NO);
|
||||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
cfg.setCompileId(compileId);
|
cfg.setCompileId(compileId);
|
||||||
@@ -162,11 +157,11 @@ public class NumCfgController extends BaseController{
|
|||||||
model.addAttribute("action",cfg.getAction());
|
model.addAttribute("action",cfg.getAction());
|
||||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||||
}
|
}
|
||||||
}else{
|
}catch(Exception e){
|
||||||
|
logger.error("保存失败", e);
|
||||||
addMessage(model,"保存失败!");
|
addMessage(model,"保存失败!");
|
||||||
logger.error("无法确定IP配置的表名!");
|
|
||||||
}
|
}
|
||||||
return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+cfg.getServiceId()+"&action="+cfg.getAction()+"&cfgName="+cfgName);
|
return "/cfg/resultPage";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -182,31 +177,42 @@ public class NumCfgController extends BaseController{
|
|||||||
public String auditStringCfg(String cfgName,NumBoundaryCfg cfg,Model model) {
|
public String auditStringCfg(String cfgName,NumBoundaryCfg cfg,Model model) {
|
||||||
model.addAttribute("cfgName", cfgName);
|
model.addAttribute("cfgName", cfgName);
|
||||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||||
if(cfg==null){
|
model.addAttribute("serviceId", cfg.getServiceId());
|
||||||
logger.error("无法审核空的配置!");
|
model.addAttribute("action", cfg.getAction());
|
||||||
}else if(cfg.getServiceId()!=null){
|
try{
|
||||||
int serviceId=cfg.getServiceId();
|
int serviceId=cfg.getServiceId();
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||||
if(serviceConfigInfo!=null){
|
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){
|
if(audit==Constants.AUDIT_YES&&cfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||||
logger.error("审核通过的配置只能取消审核通过!");
|
logger.error("审核通过的配置只能取消审核通过!");
|
||||||
}else{
|
}else{
|
||||||
cfg.setAuditorId(cfg.getCurrentUser().getId());
|
cfg.setAuditorId(cfg.getCurrentUser().getId());
|
||||||
cfg.setAuditTime(new Date());
|
cfg.setAuditTime(new Date());
|
||||||
|
bean.setIsAudit(cfg.getIsAudit());
|
||||||
if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
if(cfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||||
cfg.setIsValid(Constants.VALID_NO);
|
cfg.setIsValid(Constants.VALID_NO);
|
||||||
|
bean.setIsValid(Constants.VALID_NO);
|
||||||
|
bean.setMaatTable(serviceConfigInfo.getMaatTable());
|
||||||
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
}else if(cfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||||
cfg.setIsValid(Constants.VALID_YES);
|
cfg.setIsValid(Constants.VALID_YES);
|
||||||
|
bean.setIsValid(Constants.VALID_YES);
|
||||||
}
|
}
|
||||||
int result=numCfgService.auditNumCfg(cfg);
|
int result=numCfgService.auditNumCfg(bean,cfg);
|
||||||
model.addAttribute("serviceId", serviceId);
|
if(result!=0){
|
||||||
model.addAttribute("action", cfg.getAction());
|
addMessage(model, "审核成功");
|
||||||
|
}else{
|
||||||
|
addMessage(model, "审核失败");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}catch (Exception e) {
|
||||||
logger.error("无法确定IP配置的表名!");
|
// TODO: handle exception
|
||||||
|
logger.error("审核失败",e);
|
||||||
|
addMessage(model, "审核失败");
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/cfg/num/list";
|
return "redirect:" + adminPath + "/cfg/num/list";
|
||||||
}
|
}
|
||||||
@@ -257,7 +263,14 @@ public class NumCfgController extends BaseController{
|
|||||||
* @exception
|
* @exception
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected long getCompileId(BaseCfg cfg){
|
protected long getCompileId(NumBoundaryCfg cfg){
|
||||||
return 0;
|
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,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.ServiceConfigInfo;
|
import com.nis.domain.ServiceConfigInfo;
|
||||||
import com.nis.domain.basics.ServiceDictInfo;
|
import com.nis.domain.basics.ServiceDictInfo;
|
||||||
import com.nis.domain.configuration.BaseCfg;
|
|
||||||
import com.nis.domain.configuration.BaseStringCfg;
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||||
import com.nis.domain.configuration.RequestInfo;
|
import com.nis.domain.configuration.RequestInfo;
|
||||||
|
import com.nis.main.ConvertTool;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
|
||||||
@@ -121,7 +122,13 @@ public class StringCfgController extends BaseController{
|
|||||||
model.addAttribute("action", action);
|
model.addAttribute("action", action);
|
||||||
model.addAttribute("tableName", tableName);
|
model.addAttribute("tableName", tableName);
|
||||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
logger.info("table name is "+tableName);
|
logger.info("table name is "+tableName);
|
||||||
BaseStringCfg searchBean=new BaseStringCfg();
|
BaseStringCfg searchBean=new BaseStringCfg();
|
||||||
searchBean.setCfgId(cfgId);
|
searchBean.setCfgId(cfgId);
|
||||||
@@ -136,32 +143,10 @@ public class StringCfgController extends BaseController{
|
|||||||
model.addAttribute("xzs", xzs);
|
model.addAttribute("xzs", xzs);
|
||||||
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
|
||||||
model.addAttribute("lables", lables);
|
model.addAttribute("lables", lables);
|
||||||
}else if(serviceId!=null){
|
}catch (Exception e) {
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
// TODO: handle exception
|
||||||
if(serviceConfigInfo!=null){
|
logger.error("发生异常",e);
|
||||||
tableName=serviceConfigInfo.getTableName();
|
|
||||||
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{
|
|
||||||
logger.error("未获取到正确的表名");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return "/cfg/stringCfgForm";
|
return "/cfg/stringCfgForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,15 +164,20 @@ public class StringCfgController extends BaseController{
|
|||||||
model.addAttribute("cfgName",cfgName);
|
model.addAttribute("cfgName",cfgName);
|
||||||
model.addAttribute("cfgType","string");
|
model.addAttribute("cfgType","string");
|
||||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
model.addAttribute("audit", Constants.CFG_PAGE);
|
||||||
|
model.addAttribute("serviceId",stringCfg.getServiceId());
|
||||||
|
model.addAttribute("action",stringCfg.getAction());
|
||||||
logger.info("saveOrUpdateStringCfg loaded");
|
logger.info("saveOrUpdateStringCfg loaded");
|
||||||
if(stringCfg==null){
|
try{
|
||||||
logger.error("无法保存空的配置!");
|
String tableName=stringCfg.getTableName();
|
||||||
addMessage(model,"保存失败!");
|
|
||||||
}else if(!StringUtils.isBlank(stringCfg.getTableName())){
|
|
||||||
int serviceId=stringCfg.getServiceId();
|
int serviceId=stringCfg.getServiceId();
|
||||||
long compileId=getCompileId(stringCfg);
|
if(StringUtils.isBlank(stringCfg.getTableName())){
|
||||||
// stringCfg.setCreatorId(stringCfg.getCurrentUser().getId());
|
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||||
// stringCfg.setCreateTime(new Date());
|
if(serviceConfigInfo!=null){
|
||||||
|
tableName=serviceConfigInfo.getTableName();
|
||||||
|
stringCfg.setTableName(tableName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int compileId=new ConvertTool().getCompileId();
|
||||||
stringCfg.setIsValid(Constants.VALID_NO);
|
stringCfg.setIsValid(Constants.VALID_NO);
|
||||||
stringCfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
stringCfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
stringCfg.setCompileId(compileId);
|
stringCfg.setCompileId(compileId);
|
||||||
@@ -200,41 +190,13 @@ public class StringCfgController extends BaseController{
|
|||||||
stringCfg.setEditTime(new Date());
|
stringCfg.setEditTime(new Date());
|
||||||
stringCfgService.updateStringCfg(stringCfg);
|
stringCfgService.updateStringCfg(stringCfg);
|
||||||
}
|
}
|
||||||
model.addAttribute("serviceId",serviceId);
|
|
||||||
model.addAttribute("action",stringCfg.getAction());
|
|
||||||
addMessage(model,"保存成功,正在为您跳转页面...");
|
addMessage(model,"保存成功,正在为您跳转页面...");
|
||||||
}else if(stringCfg.getServiceId()!=null){
|
}catch (Exception e) {
|
||||||
int serviceId=stringCfg.getServiceId();
|
// TODO: handle exception
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
logger.error("保存失败!",e);
|
||||||
if(serviceConfigInfo!=null){
|
addMessage(model,"保存失败!");
|
||||||
String tableName=serviceConfigInfo.getTableName();
|
|
||||||
if(!StringUtils.isBlank(tableName)){
|
|
||||||
long compileId=getCompileId(stringCfg);
|
|
||||||
stringCfg.setTableName(tableName);
|
|
||||||
// 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("action",stringCfg.getAction());
|
|
||||||
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,53 +212,50 @@ public class StringCfgController extends BaseController{
|
|||||||
public String auditStringCfg(String cfgName,BaseStringCfg stringCfg,Model model) {
|
public String auditStringCfg(String cfgName,BaseStringCfg stringCfg,Model model) {
|
||||||
model.addAttribute("cfgName", cfgName);
|
model.addAttribute("cfgName", cfgName);
|
||||||
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
model.addAttribute("audit", Constants.AUDIT_PAGE);
|
||||||
if(stringCfg==null){
|
model.addAttribute("serviceId", stringCfg.getServiceId());
|
||||||
logger.error("无法审核空的配置!");
|
model.addAttribute("action", stringCfg.getAction());
|
||||||
}else if(!StringUtils.isBlank(stringCfg.getTableName())){
|
try{
|
||||||
int audit=stringCfgService.getIsAudit(stringCfg);
|
String tableName=stringCfg.getTableName();
|
||||||
|
int serviceId=stringCfg.getServiceId();
|
||||||
|
String maatTable=null;
|
||||||
|
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
||||||
|
if(serviceConfigInfo!=null){
|
||||||
|
if(StringUtils.isBlank(tableName)){
|
||||||
|
tableName=serviceConfigInfo.getTableName();
|
||||||
|
stringCfg.setTableName(tableName);
|
||||||
|
}
|
||||||
|
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){
|
if(audit==Constants.AUDIT_YES&&stringCfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
|
||||||
logger.error("审核通过的配置只能取消审核通过!");
|
logger.error("审核通过的配置只能取消审核通过!");
|
||||||
}else{
|
}else{
|
||||||
stringCfg.setAuditorId(stringCfg.getCurrentUser().getId());
|
stringCfg.setAuditorId(stringCfg.getCurrentUser().getId());
|
||||||
stringCfg.setAuditTime(new Date());
|
stringCfg.setAuditTime(new Date());
|
||||||
|
bean.setIsAudit(stringCfg.getIsAudit());
|
||||||
if(stringCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
if(stringCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过,设置有效标志为0
|
||||||
stringCfg.setIsValid(Constants.VALID_NO);
|
stringCfg.setIsValid(Constants.VALID_NO);
|
||||||
|
bean.setIsValid(Constants.VALID_NO);
|
||||||
|
bean.setMaatTable(maatTable);
|
||||||
}else if(stringCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
}else if(stringCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过,设置有效标志为1
|
||||||
stringCfg.setIsValid(Constants.VALID_YES);
|
stringCfg.setIsValid(Constants.VALID_YES);
|
||||||
|
bean.setIsValid(Constants.VALID_YES);
|
||||||
}
|
}
|
||||||
int result=stringCfgService.auditStringCfg(stringCfg);
|
int result=stringCfgService.auditStringCfg(bean,stringCfg);
|
||||||
model.addAttribute("serviceId", stringCfg.getServiceId());
|
if(result!=0){
|
||||||
model.addAttribute("action", stringCfg.getAction());
|
addMessage(model,"审核成功!");
|
||||||
}
|
}else{
|
||||||
|
addMessage(model,"审核失败!");
|
||||||
}else if(stringCfg.getServiceId()!=null){
|
|
||||||
int serviceId=stringCfg.getServiceId();
|
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
|
||||||
if(serviceConfigInfo!=null){
|
|
||||||
String tableName=serviceConfigInfo.getTableName();
|
|
||||||
if(!StringUtils.isBlank(tableName)){
|
|
||||||
stringCfg.setTableName(tableName);
|
|
||||||
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("serviceId", serviceId);
|
|
||||||
model.addAttribute("action", stringCfg.getAction());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}else{
|
}catch (Exception e) {
|
||||||
logger.error("无法确定IP配置的表名!");
|
// TODO: handle exception
|
||||||
|
logger.error("审核失败", e);
|
||||||
|
addMessage(model,"审核失败!");
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath + "/cfg/string/list";
|
return "redirect:" + adminPath + "/cfg/string/list";
|
||||||
}
|
}
|
||||||
@@ -316,7 +275,13 @@ public class StringCfgController extends BaseController{
|
|||||||
model.addAttribute("action", action);
|
model.addAttribute("action", action);
|
||||||
model.addAttribute("cfgType","string");
|
model.addAttribute("cfgType","string");
|
||||||
model.addAttribute("audit", Constants.CFG_PAGE);
|
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);
|
int audit=stringCfgService.getIsAudit(tableName,cfgId);
|
||||||
//未审核时可删除
|
//未审核时可删除
|
||||||
if(audit!=Constants.AUDIT_YES){
|
if(audit!=Constants.AUDIT_YES){
|
||||||
@@ -332,42 +297,10 @@ public class StringCfgController extends BaseController{
|
|||||||
logger.error("通过审核的配置不能删除!");
|
logger.error("通过审核的配置不能删除!");
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(serviceId!=null){
|
}catch(Exception e){
|
||||||
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
|
logger.error("删除失败",e);
|
||||||
if(serviceConfigInfo!=null){
|
addMessage(model,"删除失败!");
|
||||||
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配置的表名!");
|
|
||||||
}
|
}
|
||||||
return "/cfg/resultPage";
|
return "/cfg/resultPage";
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
*
|
|
||||||
* getCompileId(获取编译ID)
|
|
||||||
* (这里描述这个方法适用条件 – 可选)
|
|
||||||
* @return
|
|
||||||
*long
|
|
||||||
* @exception
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
protected long getCompileId(BaseCfg cfg){
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,4 +26,5 @@ public interface ComplexStringCfgDao extends CrudDao<ComplexkeywordCfg>{
|
|||||||
public int getIsValid(ComplexkeywordCfg entity);
|
public int getIsValid(ComplexkeywordCfg entity);
|
||||||
public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
||||||
public int getIsAudit(ComplexkeywordCfg entity);
|
public int getIsAudit(ComplexkeywordCfg entity);
|
||||||
|
public int deleteByCompileId(ComplexkeywordCfg entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -481,4 +481,7 @@
|
|||||||
SELECT IS_AUDIT FROM ${tableName}
|
SELECT IS_AUDIT FROM ${tableName}
|
||||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
@@ -26,4 +26,5 @@ public interface IpCfgDao extends CrudDao<BaseIpCfg>{
|
|||||||
public int getIsValid(BaseIpCfg entity);
|
public int getIsValid(BaseIpCfg entity);
|
||||||
public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
||||||
public int getIsAudit(BaseIpCfg entity);
|
public int getIsAudit(BaseIpCfg entity);
|
||||||
|
public int deleteByCompileId(BaseIpCfg entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -583,7 +583,7 @@
|
|||||||
<if test="editorId != null" >
|
<if test="editorId != null" >
|
||||||
editor_id = #{editorId,jdbcType=INTEGER},
|
editor_id = #{editorId,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="editTime != null and editTime != ''" >
|
<if test="editTime != null" >
|
||||||
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
</if>
|
||||||
<if test="auditorId != null" >
|
<if test="auditorId != null" >
|
||||||
@@ -639,4 +639,7 @@
|
|||||||
SELECT IS_AUDIT FROM ${tableName}
|
SELECT IS_AUDIT FROM ${tableName}
|
||||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||||
</select>
|
</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>
|
</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 getIsValid(NumBoundaryCfg entity);
|
||||||
public int getIsAudit(@Param("cfgId")Long id);
|
public int getIsAudit(@Param("cfgId")Long id);
|
||||||
public int getIsAudit(NumBoundaryCfg entity);
|
public int getIsAudit(NumBoundaryCfg entity);
|
||||||
|
public int deleteByCompileId(NumBoundaryCfg entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -492,4 +492,7 @@
|
|||||||
SELECT IS_AUDIT FROM NUM_BOUNDARY_CFG
|
SELECT IS_AUDIT FROM NUM_BOUNDARY_CFG
|
||||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
@@ -26,4 +26,5 @@ public interface StringCfgDao extends CrudDao<BaseStringCfg>{
|
|||||||
public int getIsValid(BaseStringCfg entity);
|
public int getIsValid(BaseStringCfg entity);
|
||||||
public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id);
|
||||||
public int getIsAudit(BaseStringCfg entity);
|
public int getIsAudit(BaseStringCfg entity);
|
||||||
|
public int deleteByCompileId(BaseStringCfg entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -491,4 +491,7 @@
|
|||||||
SELECT IS_AUDIT FROM ${tableName}
|
SELECT IS_AUDIT FROM ${tableName}
|
||||||
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
@@ -143,19 +143,6 @@ public abstract class BaseService {
|
|||||||
|
|
||||||
return scopeSql.toString();
|
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)
|
* getTableName(获取表名对应的Class)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ package com.nis.web.service;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.ibatis.session.ExecutorType;
|
import org.apache.ibatis.session.ExecutorType;
|
||||||
import org.apache.ibatis.session.SqlSession;
|
import org.apache.ibatis.session.SqlSession;
|
||||||
import org.apache.ibatis.session.SqlSessionFactory;
|
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.BaseIpCfg;
|
||||||
import com.nis.domain.configuration.BaseStringCfg;
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||||
|
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||||
import com.nis.domain.maat.MaatCfg;
|
import com.nis.domain.maat.MaatCfg;
|
||||||
import com.nis.domain.maat.ToMaatBean;
|
import com.nis.domain.maat.ToMaatBean;
|
||||||
|
import com.nis.domain.maat.ToMaatUnAuditBean;
|
||||||
|
import com.nis.domain.maat.UnAuditBean;
|
||||||
|
import com.nis.main.ConvertTool;
|
||||||
|
import com.nis.util.Constants;
|
||||||
import com.nis.web.dao.CrudDao;
|
import com.nis.web.dao.CrudDao;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -191,75 +197,132 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
|
|||||||
* @param cfg
|
* @param cfg
|
||||||
* @return
|
* @return
|
||||||
*boolean
|
*boolean
|
||||||
|
* @throws Exception
|
||||||
* @exception
|
* @exception
|
||||||
* @since 1.0.0
|
* @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){
|
if(cfg==null){
|
||||||
throw new RuntimeException("转换出错,配置为空");
|
throw new RuntimeException("转换出错,配置为空");
|
||||||
}
|
}
|
||||||
long compileId=0l;
|
|
||||||
ToMaatBean toMaatBean=new ToMaatBean();
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
if(areaCfg!=null){
|
|
||||||
AreaIpCfg[] cfgArray=new AreaIpCfg[1];
|
|
||||||
|
|
||||||
}
|
|
||||||
List<MaatCfg> serviceCfg=new ArrayList<>();
|
|
||||||
serviceCfg.add(maatCfg);
|
|
||||||
BaseCfg baseCfg=(BaseCfg)cfg[0];
|
|
||||||
if(compileId==0l){
|
|
||||||
throw new RuntimeException("转换出错,未获取到正确的compileId");
|
|
||||||
}else{
|
|
||||||
toMaatBean.setCompileId(compileId);
|
|
||||||
}
|
|
||||||
if(baseCfg.getAction()==null){
|
|
||||||
throw new RuntimeException("转换出错,未获取到正确的action");
|
|
||||||
}else{
|
|
||||||
toMaatBean.setAction(baseCfg.getAction());
|
|
||||||
}
|
|
||||||
if(baseCfg.getIsAreaEffective()==null){
|
|
||||||
throw new RuntimeException("转换出错,未获取到正确的isAreaEffective");
|
|
||||||
}else{
|
|
||||||
toMaatBean.setIsAreaEffective(baseCfg.getIsAreaEffective());
|
|
||||||
}
|
|
||||||
if(baseCfg.getIsValid()==null){
|
|
||||||
throw new RuntimeException("转换出错,未获取到正确的isValid");
|
|
||||||
}else{
|
|
||||||
toMaatBean.setIsValid(baseCfg.getIsValid());
|
|
||||||
}
|
|
||||||
if(baseCfg.getRequestId()==null){
|
|
||||||
throw new RuntimeException("转换出错,未获取到正确的requestId");
|
|
||||||
}else{
|
|
||||||
toMaatBean.setRequestId(baseCfg.getRequestId());
|
|
||||||
}
|
|
||||||
if(baseCfg.getServiceId()==null){
|
|
||||||
throw new RuntimeException("转换出错,未获取到正确的serviceId");
|
|
||||||
}else{
|
|
||||||
toMaatBean.setServiceId(baseCfg.getServiceId());
|
|
||||||
}
|
|
||||||
toMaatBean.setAreaEffectiveIds(baseCfg.getAreaEffectiveIds()==null?"":baseCfg.getAreaEffectiveIds());
|
|
||||||
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()
|
Gson gson=new GsonBuilder().disableHtmlEscaping()
|
||||||
.setDateFormat("yyyy-MM-dd HH:mm:ss")
|
.setDateFormat("yyyy-MM-dd HH:mm:ss")
|
||||||
/*.setPrettyPrinting().serializeNulls()*/
|
/*.setPrettyPrinting().serializeNulls()*/
|
||||||
.excludeFieldsWithoutExposeAnnotation()
|
.excludeFieldsWithoutExposeAnnotation()
|
||||||
.create();
|
.create();
|
||||||
String json=gson.toJson(toMaatBean);
|
if(Constants.AUDIT_NOT_YES==operation){
|
||||||
//发送至maat,待完成
|
ToMaatUnAuditBean toMaatUnAuditBean=new ToMaatUnAuditBean();
|
||||||
|
toMaatUnAuditBean.setServiceCfg(new ArrayList<UnAuditBean>());
|
||||||
return false;
|
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());
|
||||||
|
}
|
||||||
|
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<List<MaatCfg>>());
|
||||||
|
MaatCfg maatCfg=new MaatCfg();
|
||||||
|
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){
|
||||||
|
toMaatBean.setAreaCfg(areaCfg);
|
||||||
|
}
|
||||||
|
List<MaatCfg> serviceCfg=new ArrayList<>();
|
||||||
|
serviceCfg.add(maatCfg);
|
||||||
|
toMaatBean.getServiceCfg().add(serviceCfg);
|
||||||
|
BaseCfg baseCfg=(BaseCfg)cfg[0];
|
||||||
|
if(compileId==0){
|
||||||
|
throw new RuntimeException("转换出错,未获取到正确的compileId");
|
||||||
|
}else{
|
||||||
|
toMaatBean.setCompileId(compileId);
|
||||||
|
}
|
||||||
|
if(baseCfg.getAction()==null){
|
||||||
|
throw new RuntimeException("转换出错,未获取到正确的action");
|
||||||
|
}else{
|
||||||
|
toMaatBean.setAction(baseCfg.getAction());
|
||||||
|
}
|
||||||
|
if(baseCfg.getIsAreaEffective()==null){
|
||||||
|
throw new RuntimeException("转换出错,未获取到正确的isAreaEffective");
|
||||||
|
}else{
|
||||||
|
toMaatBean.setIsAreaEffective(baseCfg.getIsAreaEffective());
|
||||||
|
}
|
||||||
|
if(baseCfg.getIsValid()==null){
|
||||||
|
throw new RuntimeException("转换出错,未获取到正确的isValid");
|
||||||
|
}else{
|
||||||
|
toMaatBean.setIsValid(baseCfg.getIsValid());
|
||||||
|
}
|
||||||
|
if(baseCfg.getRequestId()==null){
|
||||||
|
throw new RuntimeException("转换出错,未获取到正确的requestId");
|
||||||
|
}else{
|
||||||
|
toMaatBean.setRequestId(baseCfg.getRequestId());
|
||||||
|
}
|
||||||
|
if(baseCfg.getServiceId()==null){
|
||||||
|
throw new RuntimeException("转换出错,未获取到正确的serviceId");
|
||||||
|
}else{
|
||||||
|
toMaatBean.setServiceId(baseCfg.getServiceId());
|
||||||
|
}
|
||||||
|
toMaatBean.setAreaEffectiveIds(baseCfg.getAreaEffectiveIds()==null?"":baseCfg.getAreaEffectiveIds());
|
||||||
|
toMaatBean.setAttribute(baseCfg.getAttribute()==null?"":baseCfg.getAttribute());
|
||||||
|
toMaatBean.setClassify(baseCfg.getClassify()==null?"":baseCfg.getClassify());
|
||||||
|
toMaatBean.setLable(baseCfg.getLable()==null?"":baseCfg.getLable());
|
||||||
|
|
||||||
|
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;
|
package com.nis.web.service.configuration;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.nis.domain.configuration.ComplexkeywordCfg;
|
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||||
|
import com.nis.util.Constants;
|
||||||
import com.nis.web.dao.configuration.ComplexStringCfgDao;
|
import com.nis.web.dao.configuration.ComplexStringCfgDao;
|
||||||
import com.nis.web.service.CrudService;
|
import com.nis.web.service.CrudService;
|
||||||
|
|
||||||
@@ -30,17 +30,7 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
|||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int addStringCfg(ComplexkeywordCfg cfg){
|
public int addStringCfg(ComplexkeywordCfg cfg){
|
||||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
return complexStringCfgDao.insert(cfg);
|
||||||
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)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int updateStringCfg(ComplexkeywordCfg cfg){
|
public int updateStringCfg(ComplexkeywordCfg cfg){
|
||||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
|
||||||
return complexStringCfgDao.updateByPrimaryKeySelective(cfg);
|
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
|
* @param cfg
|
||||||
* @return
|
* @return
|
||||||
*int
|
*int
|
||||||
|
* @throws Exception
|
||||||
* @exception
|
* @exception
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int auditStringCfg(ComplexkeywordCfg cfg){
|
public int auditStringCfg(ComplexkeywordCfg sendCfg,ComplexkeywordCfg cfg) throws Exception{
|
||||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
if(Constants.AUDIT_NOT_YES==cfg.getIsAudit().intValue()||
|
||||||
return complexStringCfgDao.audit(cfg);
|
Constants.AUDIT_YES==cfg.getIsAudit().intValue()){//审核通过,取消审核通过需要发到maat
|
||||||
|
if(sendToMaatConvertor(cfg.getIsAudit(),null,sendCfg)){
|
||||||
|
return complexStringCfgDao.audit(cfg);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
String tableName=getTableName(cfg.getClass().getSimpleName());
|
|
||||||
if(StringUtils.isBlank(tableName))
|
|
||||||
return 0;
|
|
||||||
cfg.setTableName(tableName);
|
|
||||||
logger.info("aduit "+tableName);
|
|
||||||
return complexStringCfgDao.audit(cfg);
|
return complexStringCfgDao.audit(cfg);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -102,36 +81,8 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
|||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int deleteStringCfg(ComplexkeywordCfg cfg){
|
public int deleteStringCfg(ComplexkeywordCfg cfg){
|
||||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
return complexStringCfgDao.updateValid(cfg);
|
||||||
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);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* getStringCfg(根据IP与类名获取IP配置)
|
* getStringCfg(根据IP与类名获取IP配置)
|
||||||
@@ -144,44 +95,16 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public ComplexkeywordCfg getStringCfgById(ComplexkeywordCfg cfg){
|
public ComplexkeywordCfg getStringCfgById(ComplexkeywordCfg cfg){
|
||||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
return complexStringCfgDao.getById(cfg.getTableName(),cfg.getCfgId());
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public Integer getIsValid(ComplexkeywordCfg cfg){
|
public Integer getIsValid(ComplexkeywordCfg cfg){
|
||||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
return complexStringCfgDao.getIsValid(cfg);
|
||||||
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){
|
public Integer getIsValid(String tableName, long id){
|
||||||
return complexStringCfgDao.getIsValid(tableName,id);
|
return complexStringCfgDao.getIsValid(tableName,id);
|
||||||
}
|
}
|
||||||
public Integer getIsAudit(ComplexkeywordCfg cfg){
|
public Integer getIsAudit(ComplexkeywordCfg cfg){
|
||||||
if(!StringUtils.isBlank(cfg.getTableName())){
|
return complexStringCfgDao.getIsAudit(cfg);
|
||||||
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){
|
public Integer getIsAudit(String tableName, long id){
|
||||||
return complexStringCfgDao.getIsAudit(tableName,id);
|
return complexStringCfgDao.getIsAudit(tableName,id);
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
package com.nis.web.service.configuration;
|
package com.nis.web.service.configuration;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.dao.DataAccessException;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.nis.domain.configuration.BaseIpCfg;
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
|
import com.nis.util.Constants;
|
||||||
import com.nis.web.dao.configuration.IpCfgDao;
|
import com.nis.web.dao.configuration.IpCfgDao;
|
||||||
import com.nis.web.service.CrudService;
|
import com.nis.web.service.CrudService;
|
||||||
|
|
||||||
@@ -31,17 +30,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int addIpCfg(BaseIpCfg baseIpCfg){
|
public int addIpCfg(BaseIpCfg baseIpCfg){
|
||||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
return ipCfgDao.insert(baseIpCfg);
|
||||||
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)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int updateIpCfg(BaseIpCfg baseIpCfg){
|
public int updateIpCfg(BaseIpCfg baseIpCfg){
|
||||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
return ipCfgDao.updateByPrimaryKeySelective(baseIpCfg);
|
||||||
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
|
* @param baseIpCfg
|
||||||
* @return
|
* @return
|
||||||
*int
|
*int
|
||||||
|
* @throws Exception
|
||||||
* @exception
|
* @exception
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int auditIpCfg(BaseIpCfg baseIpCfg){
|
public int auditIpCfg(BaseIpCfg sendCfg,BaseIpCfg baseIpCfg) throws Exception{
|
||||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
if(Constants.AUDIT_NOT_YES==baseIpCfg.getIsAudit().intValue()||
|
||||||
return ipCfgDao.audit(baseIpCfg);
|
Constants.AUDIT_YES==baseIpCfg.getIsAudit().intValue()){//审核通过,取消审核通过需要发到maat
|
||||||
|
if(sendToMaatConvertor(baseIpCfg.getIsAudit(),null,sendCfg)){
|
||||||
|
return ipCfgDao.audit(baseIpCfg);
|
||||||
|
}
|
||||||
}else{
|
}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 ipCfgDao.audit(baseIpCfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -103,36 +82,8 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int deleteIpCfg(BaseIpCfg baseIpCfg){
|
public int deleteIpCfg(BaseIpCfg baseIpCfg){
|
||||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
return ipCfgDao.updateValid(baseIpCfg);
|
||||||
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);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* getIpCfg(根据IP与类名获取IP配置)
|
* getIpCfg(根据IP与类名获取IP配置)
|
||||||
@@ -145,44 +96,16 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public BaseIpCfg getIpCfgById(BaseIpCfg baseIpCfg){
|
public BaseIpCfg getIpCfgById(BaseIpCfg baseIpCfg){
|
||||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
return ipCfgDao.getById(baseIpCfg.getTableName(), baseIpCfg.getCfgId());
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public Integer getIsValid(BaseIpCfg baseIpCfg){
|
public Integer getIsValid(BaseIpCfg baseIpCfg){
|
||||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
return ipCfgDao.getIsValid(baseIpCfg);
|
||||||
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){
|
public Integer getIsValid(String tableName, long id){
|
||||||
return ipCfgDao.getIsValid(tableName,id);
|
return ipCfgDao.getIsValid(tableName,id);
|
||||||
}
|
}
|
||||||
public Integer getIsAudit(BaseIpCfg baseIpCfg){
|
public Integer getIsAudit(BaseIpCfg baseIpCfg){
|
||||||
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
|
return ipCfgDao.getIsAudit(baseIpCfg);
|
||||||
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){
|
public Integer getIsAudit(String tableName, long id){
|
||||||
return ipCfgDao.getIsAudit(tableName,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 org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.nis.domain.configuration.NumBoundaryCfg;
|
import com.nis.domain.configuration.NumBoundaryCfg;
|
||||||
|
import com.nis.util.Constants;
|
||||||
import com.nis.web.dao.configuration.NumCfgDao;
|
import com.nis.web.dao.configuration.NumCfgDao;
|
||||||
import com.nis.web.service.CrudService;
|
import com.nis.web.service.CrudService;
|
||||||
|
|
||||||
@@ -52,12 +53,21 @@ public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
|
|||||||
* @param cfg
|
* @param cfg
|
||||||
* @return
|
* @return
|
||||||
*int
|
*int
|
||||||
|
* @throws Exception
|
||||||
* @exception
|
* @exception
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int auditNumCfg(NumBoundaryCfg cfg){
|
public int auditNumCfg(NumBoundaryCfg sendCfg,NumBoundaryCfg cfg) throws Exception{
|
||||||
return numCfgDao.audit(cfg);
|
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;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -99,7 +109,7 @@ public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public NumBoundaryCfg getNumCfgById(NumBoundaryCfg cfg){
|
public NumBoundaryCfg getNumCfgById(NumBoundaryCfg cfg){
|
||||||
return numCfgDao.get(cfg);
|
return numCfgDao.getById(cfg.getCfgId());
|
||||||
}
|
}
|
||||||
public Integer getIsValid(NumBoundaryCfg cfg){
|
public Integer getIsValid(NumBoundaryCfg cfg){
|
||||||
return numCfgDao.getIsValid(cfg);
|
return numCfgDao.getIsValid(cfg);
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
package com.nis.web.service.configuration;
|
package com.nis.web.service.configuration;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.dao.DataAccessException;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.nis.domain.configuration.BaseStringCfg;
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.util.Constants;
|
||||||
import com.nis.web.dao.configuration.StringCfgDao;
|
import com.nis.web.dao.configuration.StringCfgDao;
|
||||||
import com.nis.web.service.CrudService;
|
import com.nis.web.service.CrudService;
|
||||||
|
|
||||||
@@ -31,17 +30,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
|||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int addStringCfg(BaseStringCfg baseStringCfg){
|
public int addStringCfg(BaseStringCfg baseStringCfg){
|
||||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
return stringCfgDao.insert(baseStringCfg);
|
||||||
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)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int updateStringCfg(BaseStringCfg baseStringCfg){
|
public int updateStringCfg(BaseStringCfg baseStringCfg){
|
||||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
return stringCfgDao.updateByPrimaryKeySelective(baseStringCfg);
|
||||||
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
|
* @param baseStringCfg
|
||||||
* @return
|
* @return
|
||||||
*int
|
*int
|
||||||
|
* @throws Exception
|
||||||
* @exception
|
* @exception
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int auditStringCfg(BaseStringCfg baseStringCfg){
|
public int auditStringCfg(BaseStringCfg sendCfg,BaseStringCfg baseStringCfg) throws Exception{
|
||||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
if(Constants.AUDIT_NOT_YES==baseStringCfg.getIsAudit().intValue()||
|
||||||
return stringCfgDao.audit(baseStringCfg);
|
Constants.AUDIT_YES==baseStringCfg.getIsAudit().intValue()){//审核通过,取消审核通过需要发到maat
|
||||||
|
if(sendToMaatConvertor(baseStringCfg.getIsAudit(),null,sendCfg)){
|
||||||
|
return stringCfgDao.audit(baseStringCfg);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
String tableName=getTableName(baseStringCfg.getClass().getSimpleName());
|
|
||||||
if(StringUtils.isBlank(tableName))
|
|
||||||
return 0;
|
|
||||||
baseStringCfg.setTableName(tableName);
|
|
||||||
logger.info("aduit "+tableName);
|
|
||||||
return stringCfgDao.audit(baseStringCfg);
|
return stringCfgDao.audit(baseStringCfg);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -103,36 +81,8 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
|||||||
*/
|
*/
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public int deleteStringCfg(BaseStringCfg baseStringCfg){
|
public int deleteStringCfg(BaseStringCfg baseStringCfg){
|
||||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
return stringCfgDao.updateValid(baseStringCfg);
|
||||||
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);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* getStringCfg(根据IP与类名获取IP配置)
|
* getStringCfg(根据IP与类名获取IP配置)
|
||||||
@@ -145,44 +95,16 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public BaseStringCfg getStringCfgById(BaseStringCfg baseStringCfg){
|
public BaseStringCfg getStringCfgById(BaseStringCfg baseStringCfg){
|
||||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
return stringCfgDao.getById(baseStringCfg.getTableName(), baseStringCfg.getCfgId());
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public Integer getIsValid(BaseStringCfg baseStringCfg){
|
public Integer getIsValid(BaseStringCfg baseStringCfg){
|
||||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
return stringCfgDao.getIsValid(baseStringCfg);
|
||||||
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){
|
public Integer getIsValid(String tableName, long id){
|
||||||
return stringCfgDao.getIsValid(tableName,id);
|
return stringCfgDao.getIsValid(tableName,id);
|
||||||
}
|
}
|
||||||
public Integer getIsAudit(BaseStringCfg baseStringCfg){
|
public Integer getIsAudit(BaseStringCfg baseStringCfg){
|
||||||
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
|
return stringCfgDao.getIsAudit(baseStringCfg);
|
||||||
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){
|
public Integer getIsAudit(String tableName, long id){
|
||||||
return stringCfgDao.getIsAudit(tableName,id);
|
return stringCfgDao.getIsAudit(tableName,id);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<title>结果跳转页</title>
|
<title>结果跳转页</title>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(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>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
Reference in New Issue
Block a user