①修复新增,修改,列表展示配置时分类性质标签展示的问题

②列表展示时采用遍历分类性质标签的方法展示,减少数据库查询时的压力
③取掉了一些不需要展示的列
④新增Maat转换的bean
⑤采用gson的方式对在bean上做注解做转换,禁止了htmlescape
This commit is contained in:
wangxin
2018-03-05 16:30:16 +08:00
parent 363544a443
commit 848087dbef
33 changed files with 797 additions and 218 deletions

View File

@@ -638,8 +638,10 @@
<artifactId>cglib</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
</dependency>
</dependencies>
</project>

View File

@@ -23,6 +23,24 @@ public class AreaIpCfg extends BaseIpCfg {
*/
private static final long serialVersionUID = 2367503808235405524L;
/* (是否区域gk对此表无意义直接设置0值)
* @see com.nis.domain.configuration.BaseCfg#setIsAreaEffective(java.lang.Integer)
*/
@Override
public void setIsAreaEffective(Integer isAreaEffective) {
// TODO Auto-generated method stub
this.isAreaEffective=0;
}
/* (区域生效id对此表无意义直接设置null值)
* @see com.nis.domain.configuration.BaseCfg#setAreaEffectiveIds(java.lang.String)
*/
@Override
public void setAreaEffectiveIds(String areaEffectiveIds) {
// TODO Auto-generated method stub
this.areaEffectiveIds=null;
}
/* (non-Javadoc)
* @see com.nis.domain.configuration.BaseIpCfg#initDefaultValue()

View File

@@ -10,6 +10,8 @@ package com.nis.domain.configuration;
import java.util.Date;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.nis.domain.BaseEntity;
/**
@@ -21,6 +23,9 @@ import com.nis.domain.BaseEntity;
*/
public class BaseCfg<T> extends BaseEntity<T> {
protected String tableName;
@Expose
@SerializedName("maatTable")
protected String maatTable;
/**
* @Fields serialVersionUID:TODO用一句话描述这个变量表示什么
*
@@ -519,5 +524,19 @@ public class BaseCfg<T> extends BaseEntity<T> {
public void setRequestName(String requestName) {
this.requestName = requestName;
}
/**
* maatTable
* @return maatTable
*/
public String getMaatTable() {
return maatTable;
}
/**
* @param maatTable the maatTable to set
*/
public void setMaatTable(String maatTable) {
this.maatTable = maatTable;
}
}

View File

@@ -8,6 +8,9 @@
*/
package com.nis.domain.configuration;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* @ClassName: BaseIpConfig.java
* @Description: 基础IP配置
@@ -26,50 +29,74 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
/**
* ip类型
*/
@Expose
@SerializedName("ipType")
protected Integer ipType;
/**
* 源IP地址
*/
@Expose
@SerializedName("srcIp")
protected String srcIp ;
/**
* 源地址掩码
*/
@Expose
@SerializedName("srcIpMask")
protected String srcIpMask ;
/**
* 源端口
*/
@Expose
@SerializedName("srcPort")
protected String srcPort ;
/**
* 源端口掩码
*/
@Expose
@SerializedName("srcPortMask")
protected String srcPortMask ;
/**
* 目的IP地址
*/
@Expose
@SerializedName("dstIp")
protected String dstIp ;
/**
* 目的地址掩码
*/
@Expose
@SerializedName("dstIpMask")
protected String dstIpMask ;
/**
* 目的端口
*/
@Expose
@SerializedName("dstPort")
protected String dstPort ;
/**
* 目的端口掩码
*/
@Expose
@SerializedName("dstPortMask")
protected String dstPortMask ;
/**
* 方向
*/
@Expose
@SerializedName("direction")
protected Integer direction ;
/**
* 方向
*/
@Expose
@SerializedName("protocol")
protected Integer protocol ;
/**
* 协议ID
*/
@Expose
@SerializedName("protocolId")
protected Integer protocolId ;
/**
* 编译id

View File

@@ -8,6 +8,9 @@
*/
package com.nis.domain.configuration;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* @ClassName: BaseStringConfig.java
* @Description: 基础字符串类配置
@@ -27,6 +30,8 @@ public class BaseStringCfg extends BaseCfg<BaseStringCfg> {
/**
* 配置关键字
*/
@Expose
@SerializedName("keywords")
protected String cfgKeywords;
/**
* cfgKeywords
@@ -49,14 +54,20 @@ public class BaseStringCfg extends BaseCfg<BaseStringCfg> {
/**
* 表达式类型
*/
@Expose
@SerializedName("exprType")
protected Integer exprType ;
/**
* 匹配方式
*/
@Expose
@SerializedName("matchMethod")
protected Integer matchMethod ;
/**
* 是否hex二进制
*/
@Expose
@SerializedName("isHexbin")
protected Integer isHexbin;
/**

View File

@@ -8,6 +8,9 @@
*/
package com.nis.domain.configuration;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* @ClassName: BaseEnhancedStringConfig.java
* @Description: 基础增强字符串类配置
@@ -27,10 +30,14 @@ public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
/**
* 匹配区域
*/
@Expose
@SerializedName("district")
protected String district ;
/**
* 关键字
*/
@Expose
@SerializedName("keywords")
protected String keywords;
/**
* 编译id
@@ -39,14 +46,20 @@ public class ComplexkeywordCfg extends BaseCfg<ComplexkeywordCfg>{
/**
* 表达式类型
*/
@Expose
@SerializedName("exprType")
protected Integer exprType ;
/**
* 匹配方式
*/
@Expose
@SerializedName("matchMethod")
protected Integer matchMethod ;
/**
* 是否hex二进制
*/
@Expose
@SerializedName("isHexbin")
protected Integer isHexbin ;
/**
* district

View File

@@ -34,5 +34,13 @@ public class IpPortCfg extends BaseIpCfg {
super.initDefaultValue();
this.protocolId = 0;
}
/**
* 此表固定写0
*/
@Override
public void setProtocolId(Integer protocolId) {
// TODO Auto-generated method stub
super.setProtocolId(0);
}
}

View File

@@ -8,6 +8,9 @@
*/
package com.nis.domain.configuration;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* @ClassName: NumBoundaryConfig.java
* @Description: TODO
@@ -27,23 +30,15 @@ public class NumBoundaryCfg extends BaseCfg<NumBoundaryCfg> {
/**
* 数值下界
*/
@Expose
@SerializedName("lowBounadry")
protected Long lowBounadry;
/**
* 数值上界
*/
@Expose
@SerializedName("upBoundary")
protected Long upBoundary;
/**
* 数值上界
*/
protected Integer exprType ;
/**
* 数值上界
*/
protected Integer matchMethod ;
/**
* 数值上界
*/
protected Integer isHexbin ;
protected Long compileId;
/* (non-Javadoc)
* @see com.nis.domain.configuration.BaseCfg#initDefaultValue()
@@ -52,9 +47,6 @@ public class NumBoundaryCfg extends BaseCfg<NumBoundaryCfg> {
public void initDefaultValue() {
// TODO Auto-generated method stub
super.initDefaultValue();
this.exprType = 3;
this.matchMethod = 0;
this.isHexbin = 0;
}
/**
* lowBounadry
@@ -84,48 +76,6 @@ public class NumBoundaryCfg extends BaseCfg<NumBoundaryCfg> {
public void setUpBoundary(Long upBoundary) {
this.upBoundary = upBoundary;
}
/**
* exprType
* @return exprType
*/
public Integer getExprType() {
return exprType;
}
/**
* @param exprType the exprType to set
*/
public void setExprType(Integer exprType) {
this.exprType = exprType;
}
/**
* matchMethod
* @return matchMethod
*/
public Integer getMatchMethod() {
return matchMethod;
}
/**
* @param matchMethod the matchMethod to set
*/
public void setMatchMethod(Integer matchMethod) {
this.matchMethod = matchMethod;
}
/**
* isHexbin
* @return isHexbin
*/
public Integer getIsHexbin() {
return isHexbin;
}
/**
* @param isHexbin the isHexbin to set
*/
public void setIsHexbin(Integer isHexbin) {
this.isHexbin = isHexbin;
}
/**
* compileId
* @return compileId

View File

@@ -0,0 +1,105 @@
/**
*@Title: MaatCfg.java
*@Package com.nis.domain.maat
*@Description TODO
*@author dell
*@date 2018年3月1日 上午10:29:29
*@version 版本号
*/
package com.nis.domain.maat;
import java.io.Serializable;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.ComplexkeywordCfg;
import com.nis.domain.configuration.NumBoundaryCfg;
/**
* @ClassName: MaatCfg.java
* @Description: TODO
* @author (dell)
* @date 2018年3月1日 上午10:29:29
* @version V1.0
*/
public class MaatCfg implements Serializable {
/**
* @Fields serialVersionUID:TODO用一句话描述这个变量表示什么
*
* @since 1.0.0
*/
private static final long serialVersionUID = -7745084076394247318L;
@Expose
@SerializedName("strCfg")
private BaseStringCfg[] strCfg;
@Expose
@SerializedName("ipCfg")
private BaseIpCfg[] ipCfg;
@Expose
@SerializedName("numCfg")
private NumBoundaryCfg[] numCfg;
@Expose
@SerializedName("complexStrCfg")
private ComplexkeywordCfg[] complexStrCfg;
/**
* strCfg
* @return strCfg
*/
public BaseStringCfg[] getStrCfg() {
return strCfg;
}
/**
* @param strCfg the strCfg to set
*/
public void setStrCfg(BaseStringCfg[] strCfg) {
this.strCfg = strCfg;
}
/**
* ipCfg
* @return ipCfg
*/
public BaseIpCfg[] getIpCfg() {
return ipCfg;
}
/**
* @param ipCfg the ipCfg to set
*/
public void setIpCfg(BaseIpCfg[] ipCfg) {
this.ipCfg = ipCfg;
}
/**
* numCfg
* @return numCfg
*/
public NumBoundaryCfg[] getNumCfg() {
return numCfg;
}
/**
* @param numCfg the numCfg to set
*/
public void setNumCfg(NumBoundaryCfg[] numCfg) {
this.numCfg = numCfg;
}
/**
* complexStrCfg
* @return complexStrCfg
*/
public ComplexkeywordCfg[] getComplexStrCfg() {
return complexStrCfg;
}
/**
* @param complexStrCfg the complexStrCfg to set
*/
public void setComplexStrCfg(ComplexkeywordCfg[] complexStrCfg) {
this.complexStrCfg = complexStrCfg;
}
}

View File

@@ -0,0 +1,263 @@
/**
*@Title: ToMaatBean.java
*@Package com.nis.domain.configuration
*@Description TODO
*@author dell
*@date 2018年2月28日 下午2:03:08
*@version 版本号
*/
package com.nis.domain.maat;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.IpPortCfg;
/**
* @ClassName: ToMaatBean.java
* @Description: TODO
* @author (dell)
* @date 2018年2月28日 下午2:03:08
* @version V1.0
*/
public class ToMaatBean implements Serializable{
/**
* @Fields serialVersionUID:TODO转换为maat格式的java bean
*
* @since 1.0.0
*/
private static final long serialVersionUID = 5123156423588372849L;
@Expose
@SerializedName("serviceCfg")
private List<MaatCfg[]> serviceCfg;
@Expose
@SerializedName("areaCfg")
private List<AreaIpCfg> areaCfg;
@Expose
@SerializedName("action")
private Integer action;
@Expose
@SerializedName("areaEffectiveIds")
private String areaEffectiveIds;
@Expose
@SerializedName("attribute")
private String attribute;
@Expose
@SerializedName("classify")
private String classify;
@Expose
@SerializedName("lable")
private String lable;
@Expose
@SerializedName("compileId")
private Long compileId;
@Expose
@SerializedName("isAreaEffective")
private Integer isAreaEffective;
@Expose
@SerializedName("isValid")
private Integer isValid;
@Expose
@SerializedName("requestId")
private Integer requestId;
@Expose
@SerializedName("serviceId")
private Integer serviceId;
/**
* serviceCfg
* @return serviceCfg
*/
public List<MaatCfg[]> getServiceCfg() {
return serviceCfg;
}
/**
* @param serviceCfg the serviceCfg to set
*/
public void setServiceCfg(List<MaatCfg[]> serviceCfg) {
this.serviceCfg = serviceCfg;
}
/**
* areaCfg
* @return areaCfg
*/
public List<AreaIpCfg> getAreaCfg() {
return areaCfg;
}
/**
* @param areaCfg the areaCfg to set
*/
public void setAreaCfg(List<AreaIpCfg> areaCfg) {
this.areaCfg = areaCfg;
}
/**
* action
* @return action
*/
public Integer getAction() {
return action;
}
/**
* @param action the action to set
*/
public void setAction(Integer action) {
this.action = action;
}
/**
* areaEffectiveIds
* @return areaEffectiveIds
*/
public String getAreaEffectiveIds() {
return areaEffectiveIds;
}
/**
* @param areaEffectiveIds the areaEffectiveIds to set
*/
public void setAreaEffectiveIds(String areaEffectiveIds) {
this.areaEffectiveIds = areaEffectiveIds;
}
/**
* attribute
* @return attribute
*/
public String getAttribute() {
return attribute;
}
/**
* @param attribute the attribute to set
*/
public void setAttribute(String attribute) {
this.attribute = attribute;
}
/**
* classify
* @return classify
*/
public String getClassify() {
return classify;
}
/**
* @param classify the classify to set
*/
public void setClassify(String classify) {
this.classify = classify;
}
/**
* lable
* @return lable
*/
public String getLable() {
return lable;
}
/**
* @param lable the lable to set
*/
public void setLable(String lable) {
this.lable = lable;
}
/**
* compileId
* @return compileId
*/
public Long getCompileId() {
return compileId;
}
/**
* @param compileId the compileId to set
*/
public void setCompileId(Long compileId) {
this.compileId = compileId;
}
/**
* isAreaEffective
* @return isAreaEffective
*/
public Integer getIsAreaEffective() {
return isAreaEffective;
}
/**
* @param isAreaEffective the isAreaEffective to set
*/
public void setIsAreaEffective(Integer isAreaEffective) {
this.isAreaEffective = isAreaEffective;
}
/**
* isValid
* @return isValid
*/
public Integer getIsValid() {
return isValid;
}
/**
* @param isValid the isValid to set
*/
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
/**
* requestId
* @return requestId
*/
public Integer getRequestId() {
return requestId;
}
/**
* @param requestId the requestId to set
*/
public void setRequestId(Integer requestId) {
this.requestId = requestId;
}
/**
* serviceId
* @return serviceId
*/
public Integer getServiceId() {
return serviceId;
}
/**
* @param serviceId the serviceId to set
*/
public void setServiceId(Integer serviceId) {
this.serviceId = serviceId;
}
public static void main(String[] args) {
Gson gson=new GsonBuilder().disableHtmlEscaping()
.setDateFormat("yyyy-MM-dd HH:mm:ss")
.setPrettyPrinting()/*.serializeNulls()*/
.excludeFieldsWithoutExposeAnnotation()
.create();
ToMaatBean bean=new ToMaatBean();
List<MaatCfg[]> cfg=new ArrayList<>();
MaatCfg[] ma=new MaatCfg[1];
MaatCfg mc=new MaatCfg();
IpPortCfg[] a=new IpPortCfg[1];
a[0]=new IpPortCfg();
mc.setIpCfg(a);
ma[0]=mc;
cfg.add(ma);
bean.setServiceCfg(cfg);
System.out.println(gson.toJson(bean));
}
}

View File

@@ -2,6 +2,8 @@ package com.nis.util;
import java.util.Date;
import com.google.gson.GsonBuilder;
public final class Constants {
public static final String DEFAULT_CAPTCHA_PARAM = "captcha";
@@ -222,5 +224,5 @@ public final class Constants {
* 数据中心B版数据库名称,程序中每次查询时使用的数据库名称 use HIVEBDBNAME
*/
public static final String HIVEBDBNAME = Configurations.getStringProperty("jdbc.hive.BName", "xa_z2_mesalog_hive");
public static final GsonBuilder gsonbuilder=new GsonBuilder();
}

View File

@@ -57,11 +57,11 @@ public class ComplexStringCfgController extends BaseController{
model.addAttribute("tableName", tableName);
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
model.addAttribute("requestInfos", requestInfos);
List<ServiceDictInfo> fls=serviceDictInfoService.findFlDict();
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
model.addAttribute("fls", fls);
List<ServiceDictInfo> xzs=serviceDictInfoService.findXzDict();
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
model.addAttribute("xzs", xzs);
List<ServiceDictInfo> lables=serviceDictInfoService.findLableDict();
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
model.addAttribute("lables", lables);
}
}else{

View File

@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import com.nis.domain.Page;
import com.nis.domain.ServiceConfigInfo;
import com.nis.domain.configuration.BaseCfg;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.RequestInfo;
import com.nis.domain.configuration.ServiceDictInfo;
@@ -68,11 +67,11 @@ public class IpCfgController extends BaseController{
model.addAttribute("tableName", tableName);
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
model.addAttribute("requestInfos", requestInfos);
List<ServiceDictInfo> fls=serviceDictInfoService.findFlDict();
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
model.addAttribute("fls", fls);
List<ServiceDictInfo> xzs=serviceDictInfoService.findXzDict();
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
model.addAttribute("xzs", xzs);
List<ServiceDictInfo> lables=serviceDictInfoService.findLableDict();
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
model.addAttribute("lables", lables);
}
}else{
@@ -109,6 +108,7 @@ public class IpCfgController extends BaseController{
ipcfg.setAction(action);
ipcfg.setServiceId(serviceId);
model.addAttribute("_cfg", ipcfg);
long compileId=this.getCompileId();
model.addAttribute("tableName", tableName);
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
model.addAttribute("requestInfos", requestInfos);
@@ -201,7 +201,7 @@ public class IpCfgController extends BaseController{
addMessage(model,"保存失败!");
}else if(!StringUtils.isBlank(ipCfg.getTableName())){
int serviceId=ipCfg.getServiceId();
long compileId=getCompileId(ipCfg);
long compileId=getCompileId();
ipCfg.setIsValid(Constants.VALID_NO);
ipCfg.setIsAudit(Constants.AUDIT_NOT_YET);
ipCfg.setCompileId(compileId);
@@ -225,7 +225,7 @@ public class IpCfgController extends BaseController{
if(serviceConfigInfo!=null){
String tableName=serviceConfigInfo.getTableName();
if(!StringUtils.isBlank(tableName)){
long compileId=getCompileId(ipCfg);
long compileId=getCompileId();
ipCfg.setTableName(tableName);
ipCfg.setCreatorId(ipCfg.getCurrentUser().getId());
ipCfg.setCreateTime(new Date());
@@ -235,7 +235,6 @@ public class IpCfgController extends BaseController{
if(ipCfg.getCfgId()==null){
ipCfg.setCreatorId(ipCfg.getCurrentUser().getId());
ipCfg.setCreateTime(new Date());
ipCfgService.addIpCfg(ipCfg);
}else{
ipCfg.setEditorId(ipCfg.getCurrentUser().getId());
ipCfg.setEditTime(new Date());
@@ -379,7 +378,7 @@ public class IpCfgController extends BaseController{
* @exception
* @since 1.0.0
*/
protected long getCompileId(BaseCfg cfg){
protected long getCompileId(){
return 0;
}
}

View File

@@ -52,11 +52,11 @@ public class NumCfgController extends BaseController{
model.addAttribute("action", cfg.getAction());
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
model.addAttribute("requestInfos", requestInfos);
List<ServiceDictInfo> fls=serviceDictInfoService.findFlDict();
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
model.addAttribute("fls", fls);
List<ServiceDictInfo> xzs=serviceDictInfoService.findXzDict();
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
model.addAttribute("xzs", xzs);
List<ServiceDictInfo> lables=serviceDictInfoService.findLableDict();
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
model.addAttribute("lables", lables);
}else{
logger.error("未获取到正确的serviceId");

View File

@@ -57,11 +57,11 @@ public class StringCfgController extends BaseController{
model.addAttribute("tableName", tableName);
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
model.addAttribute("requestInfos", requestInfos);
List<ServiceDictInfo> fls=serviceDictInfoService.findFlDict();
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
model.addAttribute("fls", fls);
List<ServiceDictInfo> xzs=serviceDictInfoService.findXzDict();
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
model.addAttribute("xzs", xzs);
List<ServiceDictInfo> lables=serviceDictInfoService.findLableDict();
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
model.addAttribute("lables", lables);
}
}else{

View File

@@ -159,8 +159,7 @@
</choose> -->
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,sdic.item_value as classifyName,sdia.item_value as attributeName
,sdil.item_value as lableName
,ri.request_title as requestName
</trim>
from ${tableName} r
left join sys_user s on r.creator_id=s.id

View File

@@ -239,8 +239,7 @@
</choose> -->
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,sdic.item_value as classifyName,sdia.item_value as attributeName
,sdil.item_value as lableName
,ri.request_title as requestName
</trim>
from ${tableName} r
left join sys_user s on r.creator_id=s.id

View File

@@ -162,8 +162,7 @@
</choose> -->
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,sdic.item_value as classifyName,sdia.item_value as attributeName
,sdil.item_value as lableName
,ri.request_title as requestName
</trim>
from num_boundary_cfg r
left join sys_user s on r.creator_id=s.id

View File

@@ -34,7 +34,15 @@
<result property="name" column="name"/>
</association>
</resultMap>
<resultMap id="dictResultSimpleMap" type="com.nis.domain.configuration.ServiceDictInfo" >
<id column="service_dict_id" property="serviceDictId" jdbcType="INTEGER" />
<result column="item_type" property="itemType" jdbcType="INTEGER" />
<result column="item_code" property="itemCode" jdbcType="INTEGER" />
<result column="item_value" property="itemValue" jdbcType="VARCHAR" />
<result column="item_desc" property="itemDesc" jdbcType="VARCHAR" />
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
</resultMap>
<sql id="serviceDictInfoColumns">
s.service_dict_id AS serviceDictId,
s.item_type AS itemType,
@@ -49,6 +57,15 @@
s.editor_id AS "serviceDictEditor.id",
s.edit_time AS editTime
</sql>
<sql id="serviceDictInfoColumnsSimple">
s.service_dict_id AS serviceDictId,
s.item_type AS itemType,
s.item_code AS itemCode,
s.item_value AS itemValue,
s.item_desc AS itemDesc,
s.is_leaf AS isLeaf,
s.is_valid AS isValid
</sql>
@@ -262,14 +279,14 @@
UPDATE service_dict_info s set s.is_valid = #{isValid} where s.service_dict_id = #{serviceDictId}
</update>
<select id="findItemDict" resultMap="dictResultMap">
<select id="findItemDict" resultMap="dictResultSimpleMap">
select
<include refid="serviceDictInfoColumns" />
<include refid="serviceDictInfoColumnsSimple" />
from service_dict_info s where s.is_leaf = 0 and s.item_type=#{itemType} and s.is_valid=#{isValid};
</select>
<select id="findAllItemDict" resultMap="dictResultMap">
<select id="findAllItemDict" resultMap="dictResultSimpleMap">
select
<include refid="serviceDictInfoColumns" />
<include refid="serviceDictInfoColumnsSimple" />
from service_dict_info s where s.is_leaf = 0 and s.item_type=#{itemType};
</select>

View File

@@ -178,8 +178,7 @@
</choose> -->
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,sdic.item_value as classifyName,sdia.item_value as attributeName
,sdil.item_value as lableName
,ri.request_title as requestName
</trim>
from ${tableName} r
left join sys_user s on r.creator_id=s.id

View File

@@ -3,6 +3,7 @@
*/
package com.nis.web.service;
import java.util.ArrayList;
import java.util.List;
import org.apache.ibatis.session.ExecutorType;
@@ -10,8 +11,17 @@ import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.nis.domain.BaseEntity;
import com.nis.domain.Page;
import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.BaseCfg;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.ComplexkeywordCfg;
import com.nis.domain.maat.MaatCfg;
import com.nis.domain.maat.ToMaatBean;
import com.nis.web.dao.CrudDao;
/**
@@ -174,5 +184,82 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
}
}
}
/**
*
* sendToMaatConvertor(转换配置为Maat格式)
* (所有的配置需拥有一样的编译IDaction,serviceId,等属性)
* @param cfg
* @return
*boolean
* @exception
* @since 1.0.0
*/
public boolean sendToMaatConvertor(AreaIpCfg[] areaCfg,T ... cfg){
if(cfg==null){
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()
.setDateFormat("yyyy-MM-dd HH:mm:ss")
/*.setPrettyPrinting().serializeNulls()*/
.excludeFieldsWithoutExposeAnnotation()
.create();
String json=gson.toJson(toMaatBean);
//发送至maat,待完成
return false;
}
}

View File

@@ -2,7 +2,6 @@ package com.nis.web.service.configuration;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -29,7 +28,7 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int addStringCfg(ComplexkeywordCfg cfg){
if(!StringUtils.isBlank(cfg.getTableName())){
return complexStringCfgDao.insert(cfg);
@@ -53,7 +52,7 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int updateStringCfg(ComplexkeywordCfg cfg){
if(!StringUtils.isBlank(cfg.getTableName())){
return complexStringCfgDao.updateByPrimaryKeySelective(cfg);
@@ -77,7 +76,7 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int auditStringCfg(ComplexkeywordCfg cfg){
if(!StringUtils.isBlank(cfg.getTableName())){
return complexStringCfgDao.audit(cfg);
@@ -101,7 +100,7 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int deleteStringCfg(ComplexkeywordCfg cfg){
if(!StringUtils.isBlank(cfg.getTableName())){
return complexStringCfgDao.updateValid(cfg);

View File

@@ -29,7 +29,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int addIpCfg(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.insert(baseIpCfg);
@@ -53,7 +53,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int updateIpCfg(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.updateByPrimaryKeySelective(baseIpCfg);
@@ -77,7 +77,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int auditIpCfg(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.audit(baseIpCfg);
@@ -101,7 +101,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int deleteIpCfg(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.updateValid(baseIpCfg);

View File

@@ -1,7 +1,6 @@
package com.nis.web.service.configuration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -28,7 +27,7 @@ public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int addNumCfg(NumBoundaryCfg cfg){
return numCfgDao.insert(cfg);
}
@@ -42,7 +41,7 @@ public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int updateNumCfg(NumBoundaryCfg cfg){
return numCfgDao.updateByPrimaryKeySelective(cfg);
}
@@ -56,7 +55,7 @@ public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int auditNumCfg(NumBoundaryCfg cfg){
return numCfgDao.audit(cfg);
}
@@ -70,7 +69,7 @@ public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int deleteNumCfg(NumBoundaryCfg cfg){
return numCfgDao.updateValid(cfg);
}

View File

@@ -29,7 +29,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int addStringCfg(BaseStringCfg baseStringCfg){
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
return stringCfgDao.insert(baseStringCfg);
@@ -53,7 +53,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int updateStringCfg(BaseStringCfg baseStringCfg){
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
return stringCfgDao.updateByPrimaryKeySelective(baseStringCfg);
@@ -77,7 +77,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int auditStringCfg(BaseStringCfg baseStringCfg){
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
return stringCfgDao.audit(baseStringCfg);
@@ -101,7 +101,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public int deleteStringCfg(BaseStringCfg baseStringCfg){
if(!StringUtils.isBlank(baseStringCfg.getTableName())){
return stringCfgDao.updateValid(baseStringCfg);

View File

@@ -24,10 +24,25 @@
<div class="col-md-8">
<select name="classify" multiple class="selectpicker form-control" title="--请选择--">
<c:forEach items="${fls}" var="fl">
<option value="${fl.item_code}"
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
<c:if test="${fl.item_code==_cfg.classify}">selected</c:if>
>${fl.item_value}</option>
<c:choose>
<c:when test="${_cfg.classify==null or _cfg.classify==''}">
<option value="${fl.itemCode}">${fl.itemValue}</option>
</c:when>
<c:when test="${fn:contains(_cfg.classify,',')}">
<option value="${fl.itemCode}"
<c:forEach items="${fn:split(_cfg.classify,',')}" var="_classify">
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
<c:if test="${fl.itemCode==_classify}">selected</c:if>
</c:forEach>
>${fl.itemValue}</option>
</c:when>
<c:otherwise>
<option value="${fl.itemCode}"
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
<c:if test="${fl.itemCode==_classify}">selected</c:if>
>${fl.itemValue}</option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
@@ -43,10 +58,19 @@
<div class="col-md-8">
<select name="attribute" multiple class="selectpicker form-control" title="--请选择--">
<c:forEach items="${xzs}" var="xz">
<option value="${xz.item_code}"
<c:if test="${xz.isValid==0}">disabled="disabled"</c:if>
<c:if test="${xz.item_code==_cfg.attribute}">selected</c:if>
>${xz.item_value}</option>
<c:choose>
<c:when test="${_cfg.attribute==null or _cfg.attribute==''}">
<option value="${xz.itemCode}">${xz.itemValue}</option>
</c:when>
<c:otherwise>
<c:forEach items="${fn:split(_cfg.attribute,',')}" var="_attribute">
<option value="${xz.itemCode}"
<c:if test="${xz.isValid==0}">disabled="disabled"</c:if>
<c:if test="${xz.itemCode==_attribute}">selected</c:if>
>${xz.itemValue}</option>
</c:forEach>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
@@ -58,11 +82,21 @@
<div class="col-md-8">
<select name="lable" multiple class="selectpicker form-control" title="--请选择--">
<c:forEach items="${lables}" var="lable">
<option value="${lable.item_code}"
<c:if test="${lable.isValid==0}">disabled="disabled"</c:if>
<c:if test="${lable.item_code==_cfg.lable}">selected</c:if>
>${lable.item_value}</option>
</c:forEach>
<c:choose>
<c:when test="${_cfg.lable==null or _cfg.lable==''}">
<option value="${lable.itemCode}">${lable.itemValue}</option>
</c:when>
<c:otherwise>
<c:forEach items="${fn:split(_cfg.lable,',')}" var="_lable">
<option value="${lable.itemCode}"
<c:if test="${lable.isValid==0}">disabled="disabled"</c:if>
<c:if test="${lable.itemCode==_lable}">selected</c:if>
>${lable.itemValue}</option>
</c:forEach>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
</div>

View File

@@ -122,7 +122,7 @@
</div>
</div>
</div>
<div class="row">
<%-- <div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">协议ID</label>
@@ -143,34 +143,7 @@
<option value="7" <c:if test="${_cfg.action==7}">selected</c:if><c:if test="${_cfg.action!=7}">disabled="disabled"</c:if> >封堵监测都白名单</option>
<option value="8" <c:if test="${_cfg.action==8}">selected</c:if><c:if test="${_cfg.action!=8}">disabled="disabled"</c:if> >灰名单</option>
</select>
<%-- <input class="form-control" type="hidden" name="action" value="${_cfg.action}"> --%>
</div>
</div>
</div>
</div>
<%-- <div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">有效标识</label>
<div class="col-md-8">
<input class="form-control" type="text" name="isValid" value="${_cfg.isValid}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3">是否审核</label>
<div class="col-md-8">
<label class="radio-inline">
<input type="radio" name="isAudit" value="1"
<c:if test="${_cfg.isAudit==1}"></c:if>
>是
</label>
<label class="radio-inline">
<input type="radio" name="isAudit" value="0"
<c:if test="${_cfg.isAudit==0}"></c:if>
>否
</label>
<input class="form-control" type="hidden" name="action" value="${_cfg.action}">
</div>
</div>
</div>

View File

@@ -23,8 +23,6 @@ $(function(){
<h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>
<c:if test="${empty _cfg.cfgId}">新增</c:if>
<c:if test="${not empty _cfg.cfgId}">修改</c:if>
</h3>
<div class="row">
@@ -32,9 +30,9 @@ $(function(){
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i><spring:message code="${cfgName}"></spring:message>
<c:if test="${empty _cfg.cfgId}">新增</c:if>
<c:if test="${not empty _cfg.cfgId}">修改</c:if>
<i class="fa fa-gift"></i>
<c:if test="${empty _cfg.cfgId}"><spring:message code="新增"></spring:message></c:if>
<c:if test="${not empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
</div>
<!-- <div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""> </a>

View File

@@ -25,11 +25,11 @@
<div class="theme-panel hidden-xs hidden-sm">
<button type="button" class="btn btn-default" onclick="location='${ctx}/cfg/complex/list?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'"><spring:message code="refresh"></spring:message></button>
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/cfg/complex/form?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'">新增<spring:message code="${cfgName}"></spring:message></button>
onClick="javascript:window.location='${ctx}/cfg/complex/form?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'"><spring:message code="新增"></spring:message></button>
</div>
<h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>详情
<spring:message code="${cfgName}"></spring:message>
</h3>
<div class="row">
@@ -37,7 +37,7 @@
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i><spring:message code="${cfgName}"></spring:message>详情
<i class="fa fa-cogs"></i><spring:message code="列表"></spring:message>
</div>
<div class="tools">
<!-- <a href="javascript:;" class="collapse" data-original-title=""
@@ -85,7 +85,7 @@
</form:form>
</div>
<div class="table-responsive">
<table class="table table-bordered text-nowrap">
<table class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th>配置ID</th>
@@ -93,14 +93,14 @@
<th>匹配区域</th>
<th>关键字</th>
<th>管控类型</th>
<th>业务id</th>
<!-- <th>业务id</th> -->
<th>来函</th>
<th>编译id</th>
<!-- <th>编译id</th> -->
<th>是否区域管控</th>
<th>分类</th>
<th>性质</th>
<th>标签</th>
<th>区域生效id</th>
<!-- <th>区域生效id</th> -->
<th>有效标识</th>
<th>是否审核</th>
<th>创建人员</th>
@@ -127,17 +127,38 @@
<c:if test="${7 eq cfg.action }">封堵监测白名单</c:if>
<c:if test="${8 eq cfg.action }">灰名单</c:if>
</td>
<td>${cfg.serviceId }</td>
<%-- <td>${cfg.serviceId }</td> --%>
<td>${cfg.requestName }</td>
<td>${cfg.compileId }</td>
<%-- <td>${cfg.compileId }</td> --%>
<td>
<c:if test="${cfg.isAreaEffective==0}">否</c:if>
<c:if test="${cfg.isAreaEffective==1}">是</c:if>
</td>
<td>${cfg.classifyName }</td>
<td>${cfg.attributeName }</td>
<td>${cfg.lableName }</td>
<td>${cfg.areaEffectiveIds }</td>
<td>
<c:forEach items="${fn:split(cfg.classify,',')}" var="classifyId">
<c:forEach items="${fls}" var="fl">
<c:if test="${classifyId==fl.itemCode}">
${fl.itemValue},
</c:if>
</c:forEach>
</c:forEach>
${classifyName[status]}
</td>
<td>
<c:forEach items="${fn:split(cfg.attribute,',')}" var="attributeId">
<c:forEach items="${xzs}" var="xz">
<c:if test="${attributeId==xz.itemCode}">${xz.itemValue},</c:if>
</c:forEach>
</c:forEach>
</td>
<td>
<c:forEach items="${fn:split(cfg.lable,',')}" var="lableId">
<c:forEach items="${lables}" var="lable">
<c:if test="${lableId==lable.itemCode}">${lable.itemValue},</c:if>
</c:forEach>
</c:forEach>
</td>
<%-- <td>${cfg.areaEffectiveIds }</td> --%>
<td>
<c:if test="${cfg.isValid==0}">否</c:if>
<c:if test="${cfg.isValid==1}">是</c:if>
@@ -172,7 +193,7 @@
<li><a href="${ctx}/cfg/complex/deleteCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&tableName=${cfg.tableName}&cfgId=${cfg.cfgId}&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
</c:when>
<c:when test="${cfg.isAudit eq '2'}">
<li><a href="${ctx}/cfg/complex/updateForm?serviceId=${cfg.serviceId}&action=${cfg.action}&tableName=${cfg.tableName}&cfgId=${cfg.cfgId}&cfgName=${cfgName}" onclick="javascript:return confirm('sure', this.href)"><spring:message code="修改配置"></spring:message></a></li>
<li><a href="${ctx}/cfg/complex/updateForm?serviceId=${cfg.serviceId}&action=${cfg.action}&tableName=${cfg.tableName}&cfgId=${cfg.cfgId}&cfgName=${cfgName}" onclick="javascript:return confirm('sure', this.href)"><spring:message code="edit"></spring:message></a></li>
<li><a href="${ctx}/cfg/complex/auditCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&tableName=${cfg.tableName}&cfgId=${cfg.cfgId}&isAudit=1&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="approved"></spring:message></a></li>
<li><a href="${ctx}/cfg/complex/deleteCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&tableName=${cfg.tableName}&cfgId=${cfg.cfgId}&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
</c:when>

View File

@@ -70,8 +70,6 @@ $(function(){
<h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>
<c:if test="${empty _cfg.cfgId}">新增</c:if>
<c:if test="${not empty _cfg.cfgId}">修改</c:if>
</h3>
<div class="row">
@@ -79,9 +77,9 @@ $(function(){
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i><spring:message code="${cfgName}"></spring:message>
<c:if test="${empty _cfg.cfgId}">新增</c:if>
<c:if test="${not empty _cfg.cfgId}">修改</c:if>
<i class="fa fa-gift"></i>
<c:if test="${empty _cfg.cfgId}"><spring:message code="新增"></spring:message></c:if>
<c:if test="${not empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
</div>
<!-- <div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""> </a>

View File

@@ -25,11 +25,11 @@
<div class="theme-panel hidden-xs hidden-sm">
<button type="button" class="btn btn-default" onclick="location='${ctx}/cfg/ip/list?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'"><spring:message code="refresh"></spring:message></button>
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/cfg/ip/form?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'">新增<spring:message code="${cfgName}"></spring:message></button>
onClick="javascript:window.location='${ctx}/cfg/ip/form?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'"><spring:message code="新增"></spring:message></button>
</div>
<h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>详情
<spring:message code="${cfgName}"></spring:message>
</h3>
<div class="row">
@@ -37,7 +37,7 @@
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i><spring:message code="${cfgName}"></spring:message>详情
<i class="fa fa-cogs"></i><spring:message code="详情"></spring:message>
</div>
<div class="tools">
<!-- <a href="javascript:;" class="collapse" data-original-title=""
@@ -85,10 +85,10 @@
</form:form>
</div>
<div class="table-responsive">
<table class="table table-bordered text-nowrap">
<table class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th>配置ID</th>
<th>序列</th>
<th>配置描述</th>
<th>ip类型</th>
<th>源IP地址</th>
@@ -101,16 +101,16 @@
<th>目的端口掩码</th>
<th>方向</th>
<th>协议</th>
<th>协议ID</th>
<!-- <th>协议ID</th> -->
<th>管控类型</th>
<th>业务id</th>
<!-- <th>业务id</th> -->
<th>来函</th>
<th>编译id</th>
<!-- <th>编译id</th> -->
<th>是否区域管控</th>
<th>分类</th>
<th>性质</th>
<th>标签</th>
<th>区域生效id</th>
<!-- <th>区域生效id</th> -->
<th>有效标识</th>
<th>是否审核</th>
<th>创建人员</th>
@@ -123,9 +123,9 @@
</tr>
</thead>
<tbody>
<c:forEach items="${page.list }" var="ipCfg">
<tr>
<td>${ipCfg.cfgId }</td>
<c:forEach items="${page.list }" var="ipCfg" varStatus="status" step="1">
<tr pId="${status.index}">
<td>${status.index+1 }</td>
<td>${ipCfg.cfgDesc }</td>
<td>V${ipCfg.ipType }</td>
<td>${ipCfg.srcIp }</td>
@@ -138,7 +138,7 @@
<td>${ipCfg.dstPortMask }</td>
<td>${ipCfg.direction }</td>
<td>${ipCfg.protocol }</td>
<td>${ipCfg.protocolId }</td>
<%-- <td>${ipCfg.protocolId }</td> --%>
<td>
<c:if test="${1 eq ipCfg.action }">阻断</c:if>
<c:if test="${2 eq ipCfg.action }">监测</c:if>
@@ -147,17 +147,38 @@
<c:if test="${7 eq ipCfg.action }">封堵监测白名单</c:if>
<c:if test="${8 eq ipCfg.action }">灰名单</c:if>
</td>
<td>${ipCfg.serviceId }</td>
<%-- <td>${ipCfg.serviceId }</td> --%>
<td>${ipCfg.requestName }</td>
<td>${ipCfg.compileId }</td>
<%-- <td>${ipCfg.compileId }</td> --%>
<td>
<c:if test="${ipCfg.isAreaEffective==0}">否</c:if>
<c:if test="${ipCfg.isAreaEffective==1}">是</c:if>
</td>
<td>${ipCfg.classifyName }</td>
<td>${ipCfg.attributeName }</td>
<td>${ipCfg.lableName }</td>
<td>${ipCfg.areaEffectiveIds }</td>
<td>
<c:forEach items="${fn:split(ipCfg.classify,',')}" var="classifyId">
<c:forEach items="${fls}" var="fl">
<c:if test="${classifyId==fl.itemCode}">
${fl.itemValue},
</c:if>
</c:forEach>
</c:forEach>
${classifyName[status]}
</td>
<td>
<c:forEach items="${fn:split(ipCfg.attribute,',')}" var="attributeId">
<c:forEach items="${xzs}" var="xz">
<c:if test="${attributeId==xz.itemCode}">${xz.itemValue},</c:if>
</c:forEach>
</c:forEach>
</td>
<td>
<c:forEach items="${fn:split(ipCfg.lable,',')}" var="lableId">
<c:forEach items="${lables}" var="lable">
<c:if test="${lableId==lable.itemCode}">${lable.itemValue},</c:if>
</c:forEach>
</c:forEach>
</td>
<%-- <td>${ipCfg.areaEffectiveIds }</td> --%>
<td>
<c:if test="${ipCfg.isValid==0}">否</c:if>
<c:if test="${ipCfg.isValid==1}">是</c:if>
@@ -192,7 +213,7 @@
<li><a href="${ctx}/cfg/ip/deleteCfg?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
</c:when>
<c:when test="${ipCfg.isAudit eq '2'}">
<li><a href="${ctx}/cfg/ip/updateForm?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&cfgName=${cfgName}" onclick="javascript:return confirm('sure', this.href)"><spring:message code="修改配置"></spring:message></a></li>
<li><a href="${ctx}/cfg/ip/updateForm?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&cfgName=${cfgName}" onclick="javascript:return confirm('sure', this.href)"><spring:message code="edit"></spring:message></a></li>
<li><a href="${ctx}/cfg/ip/auditCfg?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&isAudit=1&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="approved"></spring:message></a></li>
<li><a href="${ctx}/cfg/ip/deleteCfg?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
</c:when>

View File

@@ -23,8 +23,6 @@ $(function(){
<h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>
<c:if test="${empty _cfg.cfgId}">新增</c:if>
<c:if test="${not empty _cfg.cfgId}">修改</c:if>
</h3>
<div class="row">
@@ -32,9 +30,9 @@ $(function(){
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i><spring:message code="${cfgName}"></spring:message>
<c:if test="${empty _cfg.cfgId}">新增</c:if>
<c:if test="${not empty _cfg.cfgId}">修改</c:if>
<i class="fa fa-gift"></i>
<c:if test="${empty _cfg.cfgId}"><spring:message code="新增"></spring:message></c:if>
<c:if test="${not empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
</div>
<!-- <div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""> </a>

View File

@@ -25,11 +25,11 @@
<div class="theme-panel hidden-xs hidden-sm">
<button type="button" class="btn btn-default" onclick="location='${ctx}/cfg/string/list?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'"><spring:message code="refresh"></spring:message></button>
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/cfg/string/form?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'">新增<spring:message code="${cfgName}"></spring:message></button>
onClick="javascript:window.location='${ctx}/cfg/string/form?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'"><spring:message code="新增"></spring:message></button>
</div>
<h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>详情
<spring:message code="${cfgName}"></spring:message>
</h3>
<div class="row">
@@ -37,7 +37,7 @@
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i><spring:message code="${cfgName}"></spring:message>详情
<i class="fa fa-cogs"></i><spring:message code="详情"></spring:message>
</div>
<div class="tools">
<!-- <a href="javascript:;" class="collapse" data-original-title=""
@@ -85,21 +85,21 @@
</form:form>
</div>
<div class="table-responsive">
<table class="table table-bordered text-nowrap">
<table class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th>配置ID</th>
<th>序列</th>
<th>配置描述</th>
<th>配置关键词</th>
<th>管控类型</th>
<th>业务id</th>
<!-- <th>业务id</th> -->
<th>来函</th>
<th>编译id</th>
<!-- <th>编译id</th> -->
<th>是否区域管控</th>
<th>分类</th>
<th>性质</th>
<th>标签</th>
<th>区域生效id</th>
<!-- <th>区域生效id</th> -->
<th>有效标识</th>
<th>是否审核</th>
<th>创建人员</th>
@@ -112,9 +112,9 @@
</tr>
</thead>
<tbody>
<c:forEach items="${page.list }" var="cfg">
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
<tr>
<td>${cfg.cfgId }</td>
<td>${status.index+1 }</td>
<td>${cfg.cfgDesc }</td>
<td>${cfg.cfgKeywords }</td>
<td>
@@ -125,17 +125,38 @@
<c:if test="${7 eq cfg.action }">封堵监测白名单</c:if>
<c:if test="${8 eq cfg.action }">灰名单</c:if>
</td>
<td>${cfg.serviceId }</td>
<%-- <td>${cfg.serviceId }</td> --%>
<td>${cfg.requestName }</td>
<td>${cfg.compileId }</td>
<%-- <td>${cfg.compileId }</td> --%>
<td>
<c:if test="${cfg.isAreaEffective==0}">否</c:if>
<c:if test="${cfg.isAreaEffective==1}">是</c:if>
</td>
<td>${cfg.classifyName }</td>
<td>${cfg.attributeName }</td>
<td>${cfg.lableName }</td>
<td>${cfg.areaEffectiveIds }</td>
<td>
<c:forEach items="${fn:split(cfg.classify,',')}" var="classifyId">
<c:forEach items="${fls}" var="fl">
<c:if test="${classifyId==fl.itemCode}">
${fl.itemValue},
</c:if>
</c:forEach>
</c:forEach>
${classifyName[status]}
</td>
<td>
<c:forEach items="${fn:split(cfg.attribute,',')}" var="attributeId">
<c:forEach items="${xzs}" var="xz">
<c:if test="${attributeId==xz.itemCode}">${xz.itemValue},</c:if>
</c:forEach>
</c:forEach>
</td>
<td>
<c:forEach items="${fn:split(cfg.lable,',')}" var="lableId">
<c:forEach items="${lables}" var="lable">
<c:if test="${lableId==lable.itemCode}">${lable.itemValue},</c:if>
</c:forEach>
</c:forEach>
</td>
<%-- <td>${cfg.areaEffectiveIds }</td> --%>
<td>
<c:if test="${cfg.isValid==0}">否</c:if>
<c:if test="${cfg.isValid==1}">是</c:if>
@@ -170,7 +191,7 @@
<li><a href="${ctx}/cfg/string/deleteCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&tableName=${cfg.tableName}&cfgId=${cfg.cfgId}&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
</c:when>
<c:when test="${cfg.isAudit eq '2'}">
<li><a href="${ctx}/cfg/string/updateForm?serviceId=${cfg.serviceId}&action=${cfg.action}&tableName=${cfg.tableName}&cfgId=${cfg.cfgId}&cfgName=${cfgName}" onclick="javascript:return confirm('sure', this.href)"><spring:message code="修改配置"></spring:message></a></li>
<li><a href="${ctx}/cfg/string/updateForm?serviceId=${cfg.serviceId}&action=${cfg.action}&tableName=${cfg.tableName}&cfgId=${cfg.cfgId}&cfgName=${cfgName}" onclick="javascript:return confirm('sure', this.href)"><spring:message code="edit"></spring:message></a></li>
<li><a href="${ctx}/cfg/string/auditCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&tableName=${cfg.tableName}&cfgId=${cfg.cfgId}&isAudit=1&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="approved"></spring:message></a></li>
<li><a href="${ctx}/cfg/string/deleteCfg?serviceId=${cfg.serviceId}&action=${cfg.action}&tableName=${cfg.tableName}&cfgId=${cfg.cfgId}&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
</c:when>