增加APP session Feature

This commit is contained in:
leijun
2018-08-24 10:25:01 +08:00
parent 62549388fb
commit 295d92fe79
9 changed files with 2496 additions and 987 deletions

View File

@@ -0,0 +1,176 @@
/**
*@Title: BaseStringConfig.java
*@Package com.nis.domain.restful
*@Description TODO
*@author dell
*@date 2018年2月5日 下午5:26:02
*@version 版本号
*/
package com.nis.domain.configuration;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.nis.util.excel.ExcelField;
/**
* APP TCP会话字节数特征
* @author dell
*
*/
public class AppTcpCfg extends BaseCfg<AppTcpCfg> {
/**
*
*/
private static final long serialVersionUID = -4366457794248757698L;
private static final String tableName="app_session_cfg";
@Expose
private Integer compileId;
@Expose
private Integer ratelimit;
private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code
private Integer specServiceId;
private String district;
private String cfgKeywords;
private String appName;
/**
* 数值下界
*/
protected Integer lowBoundary;
/**
* 数值上界
*/
protected Integer upBoundary;
@Expose
@ExcelField(title="expression_type")
@SerializedName("exprType")
protected Integer exprType ;
@Expose
@ExcelField(title="match_method")
@SerializedName("matchMethod")
protected Integer matchMethod ;
@Expose
@ExcelField(title="whether_hexbinary")
@SerializedName("isHexbin")
protected Integer isHexbin;
public Integer getLowBoundary() {
return lowBoundary;
}
public void setLowBoundary(Integer lowBoundary) {
this.lowBoundary = lowBoundary;
}
public Integer getUpBoundary() {
return upBoundary;
}
public void setUpBoundary(Integer upBoundary) {
this.upBoundary = upBoundary;
}
public Integer getExprType() {
return exprType;
}
public void setExprType(Integer exprType) {
this.exprType = exprType;
}
public Integer getMatchMethod() {
return matchMethod;
}
public void setMatchMethod(Integer matchMethod) {
this.matchMethod = matchMethod;
}
public Integer getIsHexbin() {
return isHexbin;
}
public void setIsHexbin(Integer isHexbin) {
this.isHexbin = isHexbin;
}
@Override
public void initDefaultValue() {
// TODO Auto-generated method stub
super.initDefaultValue();
this.isHexbin = 0;
}
public Integer getCompileId() {
return compileId;
}
public void setCompileId(Integer compileId) {
this.compileId = compileId;
}
public static String getTablename() {
return tableName;
}
public Integer getRatelimit() {
return ratelimit;
}
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
public Integer getAppCode() {
return appCode;
}
public void setAppCode(Integer appCode) {
this.appCode = appCode;
}
public Integer getSpecServiceId() {
return specServiceId;
}
public void setSpecServiceId(Integer specServiceId) {
this.specServiceId = specServiceId;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getCfgKeywords() {
return cfgKeywords;
}
public void setCfgKeywords(String cfgKeywords) {
this.cfgKeywords = cfgKeywords;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public Integer getBehavCode() {
return behavCode;
}
public void setBehavCode(Integer behavCode) {
this.behavCode = behavCode;
}
}

View File

@@ -24,6 +24,7 @@ import com.nis.domain.configuration.AppHttpCfg;
import com.nis.domain.configuration.AppIpCfg;
import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AppSslCertCfg;
import com.nis.domain.configuration.AppTcpCfg;
import com.nis.domain.configuration.AppTopicDomainCfg;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
@@ -759,6 +760,126 @@ public class AppCfgController extends BaseController {
appCfgService.updateAppSslCfgValid(isValid,ids,functionId);
return "redirect:" + adminPath +"/app/sslCfgList?functionId="+functionId;
}
/**
* APP TCP会话字节数特征 列表
* @param model
* @param cfg
* @param request
* @param response
* @return
*/
@RequestMapping(value = {"tcpCfgList"})
public String tcpCfgList(Model model,@ModelAttribute("cfg")AppTcpCfg cfg,HttpServletRequest request,HttpServletResponse response) {
Page<AppTcpCfg> searchPage=new Page<AppTcpCfg>(request,response,"r");
Page<AppTcpCfg> page = appCfgService.findAppTcpList(searchPage, cfg);
for(AppTcpCfg entity:page.getList()){
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
entity.setAppName(app.getSpecServiceName());
}
model.addAttribute("page", page);
initPageCondition(model,cfg);
return "/cfg/app/appTcpCfgList";
}
/**
* APP TCP会话字节数特征表单新增/修改)
* @param model
* @param ids
* @param entity
* @return
*/
@RequestMapping(value = {"tcpCfgForm"})
@RequiresPermissions(value={"app:tcp:config"})
public String tcpCfgForm(Model model,String ids,AppTcpCfg entity) {
if(StringUtils.isNotBlank(ids)){
entity = appCfgService.getAppTcpCfg(Long.parseLong(ids));
initUpdateFormCondition(model,entity);
}else{
initFormCondition(model,entity);
}
model.addAttribute("_cfg", entity);
return "/cfg/app/appTcpCfgForm";
}
/**
* APP TCP会话字节数特征配置新增/修改)提交
* @param model
* @param request
* @param response
* @param entity
* @param redirectAttributes
* @return
*/
@RequestMapping(value = {"saveAppTcpCfg"})
@RequiresPermissions(value={"app:tcp:config"})
public String saveAppTcpCfg(Model model,HttpServletRequest request,HttpServletResponse response,
AppTcpCfg entity,RedirectAttributes redirectAttributes) {
try {
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
if(specificService!=null){
entity.setAppCode(specificService.getSpecServiceCode());
}
appCfgService.saveOrUpdateAppTcpeCfg(entity);
} catch (Exception e) {
e.printStackTrace();
addMessage(redirectAttributes, e.getMessage());
}
return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+entity.getFunctionId();
}
/**
* APP TCP会话字节数特征配置删除
* @param isValid
* @param ids
* @param functionId
* @return
*/
@RequestMapping(value = {"updateAppTcpCfgValid"})
@RequiresPermissions(value={"app:tcp:config"})
public String updateAppTcpCfgValid(Integer isValid,String ids,Integer functionId) {
appCfgService.updateAppTcpCfgValid(isValid,ids,functionId);
return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+functionId;
}
/**
* APP TCP会话字节数特征配置 审核
* @param isAudit
* @param isValid
* @param ids
* @param functionId
* @param redirectAttributes
* @return
*/
@RequestMapping(value = {"auditAppTcpCfg"})
@RequiresPermissions(value={"app:tcp:confirm"})
public String auditAppTcpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
AppTcpCfg entity = new AppTcpCfg();
String[] idArray = ids.split(",");
for(String id :idArray){
entity = appCfgService.getAppTcpCfg(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
try {
appCfgService.auditAppTcpCfg(entity,isAudit);
} catch (MaatConvertException e) {
e.printStackTrace();
logger.info("app SSL配置下发失败"+e.getMessage());
addMessage(redirectAttributes, e.getMessage());
}
}
return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+functionId;
}
/**
* APP header特征配置 列表
* @param model

View File

@@ -17,6 +17,7 @@ import com.nis.domain.configuration.AppIpCfg;
import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AppSslCertCfg;
import com.nis.domain.configuration.AppStringCfg;
import com.nis.domain.configuration.AppTcpCfg;
import com.nis.domain.configuration.AppTopicDomainCfg;
import com.nis.domain.configuration.BaseCfg;
import com.nis.domain.configuration.BaseStringCfg;
@@ -83,7 +84,11 @@ public interface AppCfgDao {
public AppHeaderCfg getAppHeaderCfg(Long cfgId);
public int insertAppHeaderCfg(AppHeaderCfg entity);
public int updateAppHeaderCfg(AppHeaderCfg entity);
//APP TCP会话字节数特征
public List<AppTcpCfg> findAppTcpList(AppTcpCfg entity);
public AppTcpCfg getAppTcpCfg(Long cfgId);
public int insertAppTcpCfg(AppTcpCfg entity);
public int updateAppTcpCfg(AppTcpCfg entity);
//审核配置
public void auditCfg(BaseCfg entity);
//修改配置状态

View File

@@ -328,6 +328,47 @@
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<resultMap id="AppTcpCfgMap" type="com.nis.domain.configuration.AppTcpCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="low_boundary" property="lowBoundary" jdbcType="BIGINT" />
<result column="up_boundary" property="upBoundary" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="request_id" property="requestId" jdbcType="INTEGER" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
<result column="classify" property="classify" jdbcType="VARCHAR" />
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="expr_type" property="exprType" jdbcType="INTEGER" />
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<sql id="AppTcpCfg_Column" >
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
r.low_boundary,r.up_boundary as upBoundary,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.do_log
</sql>
<sql id="AppPolicyCfg_Column" >
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
@@ -519,6 +560,113 @@
FROM app_layer_header_cfg r
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<select id="getAppTcpCfg" resultMap="AppTcpCfgMap" parameterType="java.lang.Long" >
SELECT
<include refid="AppTcpCfg_Column" />
FROM app_session_cfg r
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<select id="findAppTcpList" resultMap="AppTcpCfgMap">
select
<include refid="AppTcpCfg_Column"/>
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName
</trim>
from app_session_cfg r
left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
<if test="lowBoundary != null">
AND r.low_boundary=#{lowBoundary,jdbcType=INTEGER}
</if>
<if test="upBoundary != null">
AND r.up_boundary=#{upBoundary,jdbcType=INTEGER}
</if>
<if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="specServiceId != null">
AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER}
</if>
<if test="cfgType != null and cfgType != ''">
AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%')
</if>
<if test="action != null">
AND r.ACTION=#{action,jdbcType=INTEGER}
</if>
<if test="isValid != null">
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND r.IS_VALID != -1
</if>
<if test="isAudit != null">
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test="creatorName != null and creatorName != ''">
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<if test="createTime != null and createTime != ''">
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
</if>
<if test="editorName != null and editorName != ''">
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<if test="editTime != null and editTime != ''">
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
</if>
<if test="auditorName != null and auditorName != ''">
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test="auditTime != null and auditTime != ''">
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
</if>
<if test="serviceId != null">
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="compileId != null">
AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null and classify != ''">
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test="attribute != null and attribute != ''">
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test="lable != null and lable != ''">
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
<!-- 数据范围过滤 -->
${sqlMap.dsf}
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY CFG_ID desc
</otherwise>
</choose>
</select>
<select id="findAppPolicyList" resultMap="AppPolicyCfgMap" parameterType="com.nis.domain.configuration.AppPolicyCfg" >
select
@@ -1493,6 +1641,22 @@
</choose>
</select>
<insert id="insertAppTcpCfg" parameterType="com.nis.domain.configuration.AppTcpCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
</selectKey>
insert into app_session_cfg (
APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
low_boundary,up_boundary,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG
)values (
<include refid="AppCommonCfg_Value_List" />,
#{lowBoundary,jdbcType=INTEGER},#{upBoundary,jdbcType=INTEGER},
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER}
)
</insert>
<insert id="insertAppPolicyCfg" parameterType="com.nis.domain.configuration.AppPolicyCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
@@ -2562,6 +2726,108 @@
</update>
<update id="updateAppTcpCfg" parameterType="com.nis.domain.configuration.AppTcpCfg" >
update app_session_cfg
<set >
<trim suffixOverrides=",">
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="appCode != null">
APP_CODE = #{appCode,jdbcType=INTEGER},
</if>
<if test="behavCode != null">
BEHAV_CODE = #{behavCode,jdbcType=INTEGER},
</if>
<if test="specServiceId != null">
SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER},
</if>
<if test="action != null" >
action = #{action,jdbcType=INTEGER},
</if>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<if test="isAudit != null" >
is_audit = #{isAudit,jdbcType=INTEGER},
</if>
<if test="creatorId != null" >
creator_id = #{creatorId,jdbcType=INTEGER},
</if>
<if test="createTime != null and createTime != ''" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="editorId != null" >
editor_id = #{editorId,jdbcType=INTEGER},
</if>
<if test="editTime != null and editTime != ''" >
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="auditorId != null" >
auditor_id = #{auditorId,jdbcType=INTEGER},
</if>
<if test="auditTime != null and auditTime != ''" >
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="requestId != null" >
request_id = #{requestId,jdbcType=INTEGER},
</if>
<if test="compileId != null" >
compile_id = #{compileId,jdbcType=INTEGER},
</if>
<if test="isAreaEffective != null" >
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
</if>
<if test="classify != null and classify != ''" >
classify = #{classify,jdbcType=VARCHAR},
</if>
<if test="attribute != null and attribute != ''" >
attribute = #{attribute,jdbcType=VARCHAR},
</if>
<if test="lable != null and lable != ''" >
lable = #{lable,jdbcType=VARCHAR},
</if>
<if test="areaEffectiveIds != null" >
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="ratelimit != null">
RATELIMIT=#{ratelimit,jdbcType=INTEGER},
</if>
<if test="cfgRegionCode != null">
CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER},
</if>
<if test="cfgType != null and cfgType != ''">
CFG_TYPE =#{cfgType,jdbcType=VARCHAR},
</if>
<if test="lowBoundary != null and lowBoundary != ''">
low_boundary=#{lowBoundary,jdbcType=INTEGER},
</if>
<if test="upBoundary != null and upBoundary != ''">
up_boundary=#{upBoundary,jdbcType=INTEGER},
</if>
<if test="exprType != null">
expr_type=#{exprType,jdbcType=INTEGER},
</if>
<if test="matchMethod != null">
match_method=#{matchMethod,jdbcType=INTEGER},
</if>
<if test="isHexbin != null">
is_hexbin=#{isHexbin,jdbcType=INTEGER},
</if>
<if test="doLog != null">
do_log=#{doLog,jdbcType=INTEGER},
</if>
</trim>
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<!-- 删除APP策略IP子配置 -->
<delete id="deleteAppPolicyIpCfg" >
delete from ip_port_cfg where compile_id=#{compileId} and function_id=#{functionId}

View File

@@ -18,6 +18,7 @@ import com.nis.domain.configuration.AppHttpCfg;
import com.nis.domain.configuration.AppIpCfg;
import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AppSslCertCfg;
import com.nis.domain.configuration.AppTcpCfg;
import com.nis.domain.configuration.AppTopicDomainCfg;
import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.IpPortCfg;
@@ -108,6 +109,21 @@ public class AppCfgService extends BaseService {
page.setList(list);
return page;
}
public Page<AppTcpCfg> findAppTcpList(Page<AppTcpCfg> page, AppTcpCfg entity) {
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
entity.setPage(page);
List<AppTcpCfg> list = appCfgDao.findAppTcpList(entity);
page.setList(list);
return page;
}
public AppTcpCfg getAppTcpCfg(Long cfgId){
return appCfgDao.getAppTcpCfg(cfgId);
}
public AppPolicyCfg getAppPolicyCfg(Long cfgId){
AppPolicyCfg policy = appCfgDao.getAppPolicyCfg(cfgId);
List<IpPortCfg> ipPortList = appCfgDao.getAppPolicyIpList(policy);
@@ -577,6 +593,142 @@ public class AppCfgService extends BaseService {
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAppTcpeCfg(AppTcpCfg entity) throws Exception{
//设置区域运营商信息
setAreaEffectiveIds(entity);
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
entity.setIsValid(0);
entity.setIsAudit(0);
appCfgDao.insertAppTcpCfg(entity);
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
}catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException(e.getMessage());
}
}else{
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
entity.setIsValid(0);
entity.setIsAudit(0);
appCfgDao.updateAppTcpCfg(entity);
//删除旧的区域IP新增新的区域IP
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
areaIpCfgDao.deleteAreaIpCfg(area);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
}
}
public void auditAppTcpCfg(AppTcpCfg entity,Integer isAudit){
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
List<GroupCfg> groupRelationList = new ArrayList();
List<IpCfg> ipRegionList = new ArrayList();
List<StringCfg> strRegionList = new ArrayList();
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
entity.setTableName(AppTcpCfg.getTablename());
appCfgDao.auditCfg(entity);
if(isAudit==1){
List<AppTcpCfg> list = new ArrayList();
list.add(entity);
Map<String,List> map = cfgConvert(numRegionList,list,4,entity,groupRelationList);
groupRelationList=map.get("groupList");
numRegionList=map.get("dstList");
}
/* //保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
appCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,4,entity,groupRelationList);
groupRelationList=map.get("groupList");
areaIpRegionList=map.get("dstList");
}
}*/
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
BeanUtils.copyProperties(entity, maatCfg);
maatCfg.setAction(entity.getAction());
maatCfg.setAuditTime(entity.getAuditTime());
maatCfg.setIpRegionList(ipRegionList);
maatCfg.setStrRegionList(strRegionList);
maatCfg.setNumRegionList(numRegionList);
maatCfg.setDigestRegionList(digestRegionList);
maatCfg.setGroupRelationList(groupRelationList);
maatCfg.setGroupNum(groupRelationList.size());
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//设置APP自定义域
String userRegion = "APP_ID="+entity.getAppCode();
maatCfg.setUserRegion(userRegion);
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("app SSL配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("app TCP配置下发响应信息"+result.getMsg());
}else if(isAudit==3){
maatCfg.setCompileId(entity.getCompileId());
maatCfg.setServiceId(entity.getServiceId());
maatCfg.setIsValid(0);//无效
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("app TCP配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("app TCP配置取消配置响应信息"+result.getMsg());
}
}
public void auditAppPolicyCfg(AppPolicyCfg entity,Integer isAudit){
String configType=entity.getConfigType();
ToMaatBean maatBean = new ToMaatBean();
@@ -1293,6 +1445,30 @@ public class AppCfgService extends BaseService {
}
}
public void updateAppTcpCfgValid(Integer isValid,String ids,Integer functionId){
AppTcpCfg entity = new AppTcpCfg();
String[] idArray = ids.split(",");
for(String id :idArray){
entity.setCfgId(Long.parseLong(id));
entity.setIsValid(isValid);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
entity.setTableName(AppTcpCfg.getTablename());
entity.setFunctionId(functionId);
appCfgDao.updateCfgValid(entity);
//保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
AreaIpCfg cfg = new AreaIpCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AreaIpCfg.getTablename());
appCfgDao.updateCfgValid(cfg);
}
}
}
public void updateAppHttpCfgValid(Integer isValid,String ids,Integer functionId){
AppHttpCfg entity = new AppHttpCfg();
String[] idArray = ids.split(",");

View File

@@ -617,7 +617,7 @@ val_dst_ip=Server IP format is incorrect or inconsistent with IP type
val_dst_mask=Server IP mask format is incorrect or inconsistent with IP type
val_dst_port=Server port is empty or incorrectly formatting(0-65535)
val_dst_port_mask=Server port mask format is incorrect(0-65535)
val_protocol=Protocol Can't be empty,and should be 6(TCP),17(UDP),0(\u4EFB\u610F)
val_protocol=Protocol Can't be empty,and should be 6(TCP),17(UDP),0(\u4efb\u610f)
val_direction=Direction should be 0(bidirectional) or 1(unidirectional)
#===============protocol IP Import end=================
@@ -1094,4 +1094,10 @@ content_length=Content Length
response_file=Response File
APP_SUBSCRIBE_ID=Certification Mark Configuration
reply_file=Reply File
app_topic_domain_cfg=Topic Website
app_topic_domain_cfg=Topic Website
#=====================about app Tcp=================================
min_tcp=Minimum Session Number
max_tcp=Maximum Session Number
tcp_unit=Unit / byte
app_tcp_config=APP TCP Session Feature
app_tcp_max_min=Maximum Session Should Not Exceed 4294967295

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,400 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#cfgFrom").validate({
errorPlacement: function(error,element){
if($(element).parents().hasClass("tagsinput")){
$(element).parents(".col-md-6").next("div").append(error);
}else{
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
}
},
submitHandler: function(form){
var flag = true;
if(flag){
var maxTtl=$("[name=upBoundary]").val();
maxTtl = parseInt(maxTtl);
var minTtl=$("[name=lowBoundary]").val();
minTtl = parseInt(minTtl);
if(maxTtl > 4294967295){
message="<spring:message code='app_tcp_max_min'/>";
$("div[for=upBoundary]").html("<label for=\"upBoundary\" class=\"error\" id=\"upBoundary-error\">"+message+"</label>");
flag=false;
}
if(minTtl>maxTtl){
message="<spring:message code='max_shouldnot_less_than_min'/>";
$("div[for=upBoundary]").html("<label for=\"upBoundary\" class=\"error\" id=\"upBoundary-error\">"+message+"</label>");
flag=false;
}
}
if(flag){
$("input[name$='exprType']").attr("disabled",false);
$("#appCode").val($("#specServiceIdId").val());
loading('onloading...');
form.submit();
}else{
return;
}
},
errorContainer: "#messageBox",
});
});
</script>
</head>
<body>
<div class="page-content">
<c:forEach items="${fns:getDictList('SPECIFIC_SERVICE_CFG_TYPE') }" var="dict">
<c:if test="${dict.itemValue eq 'social_app'}"><c:set var="app" value="${dict.itemCode}"/></c:if>
</c:forEach>
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<h3 class="page-title">
<spring:message code="app_tcp_config"></spring:message>
</h3>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i>
<c:if test="${empty _cfg.cfgId}"><spring:message code="add"></spring:message></c:if>
<c:if test="${not empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
</div>
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="cfgFrom" action="${ctx}/app/saveAppTcpCfg" method="post" class="form-horizontal">
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}">
<input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}">
<!-- 配置域类型 -->
<div class="form-body">
<div class="row">
<!-- desc and action -->
<div class="row">
<div class="col-md-6">
<div class="form-group">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/>
</div>
<div for="parent.specServiceName"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">
<spring:message code="config_describe" /></label>
<div class="col-md-6">
<input class="form-control" type="text"
name="cfgDesc"
value="${_cfg.cfgDesc}">
</div>
<div for="cfgDesc"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 hidden">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="action"/></label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<label class="radio-inline"> <c:if
test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="min_tcp"/></label>
<div class="col-md-6">
<input class="form-control required number" placeholder="<spring:message code="tcp_unit" />" type="text" name="lowBoundary" value="${_cfg.lowBoundary}" min="0">
</div>
<div for="lowBoundary"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="max_tcp"/></label>
<div class="col-md-6">
<input class="form-control required number" placeholder="<spring:message code="tcp_unit" />" type="text" name="upBoundary" value="${_cfg.upBoundary}" min="0">
</div>
<div for="upBoundary"></div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
<input type="hidden" name="cfgRegionCode" value="${region.configRegionCode}">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="expression_type" /></label>
<div class="col-md-6">
<c:if test="${!empty region.configExprType}">
<c:forEach var="exprType" items="${fn:split(region.configExprType,',')}">
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
<c:if test="${exprTypeC.itemCode eq exprType}">
<label class="radio-inline">
<input type="radio"
name="exprType" value="${exprType }"
class="required"
<c:if test="${_cfg.exprType eq exprType || (empty _cfg.exprType && exprType eq 0)}">
checked
</c:if>
>
<spring:message code="${exprTypeC.itemValue }" />
</label>
</c:if>
</c:forEach>
</c:forEach>
</c:if>
<c:if test="${empty region.configExprType}">
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
<c:if test="${exprTypeC.itemCode eq 0}">
<label class="radio-inline">
<input type="radio"
name="exprType" value="${exprTypeC.itemCode }"
class="required" checked >
<spring:message code="${exprTypeC.itemValue }" />
</label>
</c:if>
</c:forEach>
</c:if>
</div>
<div for="exprType"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="match_method" /></label>
<div class="col-md-6">
<select name="matchMethod"
class="selectpicker select2 form-control required">
<c:if test="${!empty region.configMatchMethod}">
<c:forEach var="matchMethod" items="${fn:split(region.configMatchMethod,',')}">
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${matchMethodC.itemCode eq matchMethod}">
<option value="${matchMethodC.itemCode}"
<c:if test="${_cfg.matchMethod eq matchMethod || (empty _cfg.matchMethod && matchMethod eq 0)}">
selected
</c:if>
>
<spring:message code="${matchMethodC.itemValue}"/>
</option>
</c:if>
</c:forEach>
</c:forEach>
</c:if>
<c:if test="${empty region.configMatchMethod}">
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${matchMethodC.itemCode eq 0}">
<option value="${matchMethodC.itemCode}"
selected
>
<spring:message code="${matchMethodC.itemValue}"/>
</option>
</c:if>
</c:forEach>
</c:if>
</select>
</div>
<div for="matchMethod"></div>
</div>
</div>
</div>
<div class="row">
<c:if test="${!empty region.configHex}">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_hex"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isHex" value="1" class="required"
><spring:message code="hex"/>
</label>
<label class="radio-inline">
<input type="radio" name="isHex" value="0" class="required"
><spring:message code="not_hex"/>
</label>
</div>
<div for="isHex"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_case_insenstive"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="1" class="required"
><spring:message code="case_senstive"/>
</label>
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="0" class="required"
><spring:message code="case_insenstive"/>
</label>
</div>
<div for="isCaseInsenstive"></div>
</div>
</div>
</c:if>
<c:if test="${empty region.configHex}">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_hex"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isHex" value="0" class="required" checked
><spring:message code="not_hex"/>
</label>
</div>
<div for="isHex"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_case_insenstive"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="0" class="required"
checked
><spring:message code="case_insenstive"/>
</label>
</div>
<div for="isCaseInsenstive"></div>
</div>
</div>
</c:if>
</div>
<div class="row hidden">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="whether_hexbinary" /></label>
<div class="col-md-6">
<select name="isHexbin"
class="selectpicker select2 form-control required">
<c:if test="${!empty region.configHex}">
<c:forEach var="isHexbin" items="${fn:split(region.configHex,',')}">
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${isHexbinC.itemCode eq isHexbin}">
<option value="${isHexbinC.itemCode}"
<c:if test="${_cfg.isHexbin eq isHexbin || (empty _cfg.isHexbin && isHexbin eq 0)}">
selected
</c:if>
>
<spring:message code="${isHexbinC.itemValue}"/>
</option>
</c:if>
</c:forEach>
</c:forEach>
</c:if>
<c:if test="${empty region.configHex}">
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${isHexbinC.itemCode eq 0}">
<option value="${isHexbinC.itemCode}" selected >
<spring:message code="${isHexbinC.itemValue}"/>
</option>
</c:if>
</c:forEach>
</c:if>
</select>
</div>
<div for="isHexbin"></div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</div>
<input name="isAreaEffective" type="hidden" value="0">
<input name="requestId" value="0" type="hidden">
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
</div>
<div class="col-md-6"> </div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,353 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<script>
$(document).ready(function() {
$(".tooltips").tooltip();
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
$("#seltype").change(function(){
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
});
//筛选功能初始化
filterActionInit();
$("#isAudit").change(function(){
page();
});
//reset
$("#resetBtn").on("click",function(){
$("select.selectpicker").each(function(){
$(this).selectpicker('val',$(this).find('option:first').val());
$(this).find("option").attr("selected",false);
$(this).find("option:first").attr("selected",true);
});
$(".Wdate").attr("value",'');
$("#level").attr("value",'');
$("#searchForm")[0].reset();
});
});
</script>
</head>
<body>
<div class="page-content">
<c:forEach items="${fns:getDictList('SPECIFIC_SERVICE_CFG_TYPE') }" var="dict">
<c:if test="${dict.itemValue eq 'social_app'}"><c:set var="app" value="${dict.itemCode}"/></c:if>
</c:forEach>
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="app:tcp:config">
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/app/tcpCfgForm?functionId=${cfg.functionId}'">
<i class="fa fa-plus"></i>
<spring:message code="add"></spring:message></button>
</shiro:hasPermission>
</div>
<h3 class="page-title">
<spring:message code="app_tcp_config"></spring:message>
<small><spring:message code="date_list"/></small>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<sys:message content="${message}"/>
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/app/tcpCfgList?functionId=${cfg.functionId}" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
<input id="audit" name="audit" type="hidden" value="${audit}"/>
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
callback="page();" />
<!-- 筛选按钮展开状态-->
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
<!-- 搜索内容与操作按钮栏 -->
<div class="col-md-12">
<div class="pull-left">
<c:set var="state"><spring:message code='state'/></c:set>
<form:select path="isAudit" class="selectpicker select2 input-small">
<form:option value=""><spring:message code="all_states"/></form:option>
<form:option value="0"><spring:message code="created"></spring:message></form:option>
<form:option value="1"><spring:message code="approved"></spring:message></form:option>
<form:option value="2"><spring:message code="unapproved"></spring:message></form:option>
<form:option value="3"><spring:message code="cancel_approved"></spring:message></form:option>
</form:select>
</div>
<div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/>
</div>
<div class="pull-left">
<div class="input-group">
<div class="input-group-btn">
<form:select path="seltype" class="selectpicker select2 input-small" >
<%-- <form:option value="bytes"><spring:message code="bytes"></spring:message></form:option>
--%> <form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select>
</div>
<input id="intype" class="form-control input-medium" type="text" value="">
</div>
</div>
<div class="pull-left">
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<shiro:hasPermission name="app:tcp:config">
<sys:delRow url="${ctx}/app/tcpCfgForm" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/app/updateAppTcpCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>
<shiro:hasPermission name="app:tcp:confirm">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu pull-right">
<li><sys:delRow url="${ctx}/app/auditAppTcpCfg?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/app/auditAppTcpCfg?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/app/auditAppTcpCfg?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
</ul>
</div>
</shiro:hasPermission>
<a class="btn btn-icon-only btn-default setfields tooltips"
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
<i class="icon-wrench"></i>
</a>
</div>
</div>
<!-- /搜索内容与操作按钮栏 -->
<!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" >
<div class="row hidden">
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='request_number'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="requestId" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${requestInfos}" var="requestInfo" >
<form:option value="${requestInfo.id}"><spring:message code="${requestInfo.requestTitle}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='type'/></label>
<form:select path="classify" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${fls}" var="fl" >
<form:option value="${fl.serviceDictId}"><spring:message code="${fl.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='attribute'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="attribute" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${xzs}" var="xz" >
<form:option value="${xz.serviceDictId}"><spring:message code="${xz.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='label'/></label>
<form:select path="lable" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${lables}" var="lable" >
<form:option value="${lable.serviceDictId}"><spring:message code="${lable.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="config_time"/></label>
<input name="search_create_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value='${cfg.search_create_time_start}' pattern='yyyy-MM-dd HH:mm:ss'/>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_create_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_create_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="edit_time"/></label>
<input name="search_edit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_edit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_edit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_edit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="audit_time"/></label>
<input name="search_audit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_audit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_audit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_audit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<div class="table-responsive">
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="social_app"/></th>
<th><spring:message code="whether_hexbinary"/></th>
<th><spring:message code="expression_type"/></th>
<th><spring:message code="match_method"/></th>
<th><spring:message code="do_log"/></th>
<%-- <th><spring:message code="block_type"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
<th><spring:message code="attribute"/></th>
<th><spring:message code="label"/></th> --%>
<th><spring:message code="valid_identifier"/></th>
<th><spring:message code="is_audit"/></th>
<th><spring:message code="log_total"/></th>
<th><spring:message code="creator"/></th>
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
<th><spring:message code="editor"/></th>
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
<th><spring:message code="auditor"/></th>
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
</tr>
</thead>
<tbody>
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
<tr>
<td>
<input type="checkbox" class="i-checks child-checks" id="${cfg.cfgId}" value="${cfg.isAudit}">
</td>
<td>${cfg.cfgDesc }</td>
<td>${cfg.appName }</td>
<td>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:if test="${cfg.exprType==1}"><spring:message code="and_expression"/></c:if>
<c:if test="${cfg.exprType==0}"><spring:message code="null_expression"/></c:if>
</td>
<td>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG')}" var="dict">
<c:if test="${cfg.doLog==dict.itemCode }"><spring:message code="${dict.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:if test="${cfg.isValid==0}"><spring:message code="no"/></c:if>
<c:if test="${cfg.isValid==1}"><spring:message code="yes"/></c:if>
<c:if test="${cfg.isValid==-1}"><spring:message code="deleted"/></c:if>
</td>
<td>
<c:choose>
<c:when test="${cfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
<c:when test="${cfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
<c:when test="${cfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
<c:when test="${cfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
</c:choose>
</td>
<td functionId="${cfg.functionId}" compileId="${cfg.compileId}" action="${cfg.action}"><div class="loading-total"></div></td>
<td>${cfg.creatorName }</td>
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${cfg.editorName }</td>
<td><fmt:formatDate value="${cfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${cfg.auditorName }</td>
<td><fmt:formatDate value="${cfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page" style="margin-top:40px">${page}</div>
</div>
</div>
</div>
</div>
</body>
</html>