1.基础协议添加关键字域,dolog,配置id查询
This commit is contained in:
@@ -25,6 +25,7 @@ import com.nis.domain.configuration.AppIpCfg;
|
||||
import com.nis.domain.configuration.AppPolicyCfg;
|
||||
import com.nis.domain.configuration.AppSslCertCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
@@ -102,6 +103,15 @@ public class AppCfgController extends BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
||||
String cfgType = null;
|
||||
for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){
|
||||
if(!ntc.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",ntc.getCfgType()});
|
||||
cfgType = ntc.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
|
||||
@@ -18,7 +18,9 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AppPolicyCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.exceptions.CallExternalProceduresException;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
@@ -72,7 +74,16 @@ public class BasicProtocolController extends BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
||||
String cfgType = null;
|
||||
for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){
|
||||
if(!ntc.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",ntc.getCfgType()});
|
||||
cfgType = ntc.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/basicprotocol/ipList";
|
||||
@@ -115,9 +126,16 @@ public class BasicProtocolController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
logger.error("基础协议信息保存失败",e);
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
// addMessage(redirectAttributes,e.getMessage());
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+entity.getFunctionId();
|
||||
@@ -146,10 +164,18 @@ public class BasicProtocolController extends BaseController {
|
||||
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
|
||||
try {
|
||||
appCfgService.auditAppPolicyCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("app策略配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
addMessage(redirectAttributes,"audit_success");
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("app策略配置下发失败:"+e.getMessage());;
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("auditAvAudioSignSample failed",e);
|
||||
addMessage(redirectAttributes,"audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId;
|
||||
@@ -163,8 +189,20 @@ public class BasicProtocolController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = {"updateValid"})
|
||||
@RequiresPermissions(value={"basicprotocol:config"})
|
||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId) {
|
||||
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
|
||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
|
||||
addMessage(redirectAttributes,"delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("基础协议信息保存失败",e);
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
e.printStackTrace();
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"delete_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@
|
||||
<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="do_log" property="doLog" jdbcType="INTEGER" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
||||
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
||||
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
||||
<result column="do_log" property="doLog" jdbcType="INTEGER" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="AppIpCfgMap" type="com.nis.domain.configuration.AppIpCfg" >
|
||||
@@ -71,7 +71,6 @@
|
||||
<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>
|
||||
|
||||
<resultMap id="AppHttpCfgMap" type="com.nis.domain.configuration.AppHttpCfg" >
|
||||
@@ -104,7 +103,6 @@
|
||||
<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>
|
||||
<resultMap id="AppDomainCfgMap" type="com.nis.domain.configuration.AppDomainCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
@@ -135,7 +133,6 @@
|
||||
<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>
|
||||
<resultMap id="AppByteCfgMap" type="com.nis.domain.configuration.AppByteCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
@@ -166,7 +163,6 @@
|
||||
<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>
|
||||
<resultMap id="AppInnerRuleCfgMap" type="com.nis.domain.configuration.AppInnerRuleCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
@@ -304,7 +300,7 @@
|
||||
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.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.USER_REGION1,r.USER_REGION2,
|
||||
r.USER_REGION3,r.USER_REGION4,r.USER_REGION5
|
||||
r.USER_REGION3,r.USER_REGION4,r.USER_REGION5,r.do_log
|
||||
</sql>
|
||||
|
||||
<sql id="AppIpCfg_Column" >
|
||||
@@ -313,7 +309,7 @@
|
||||
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
|
||||
r.ATTRIBUTE,r.LABLE,AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
|
||||
r.IP_TYPE, r.IP_PATTERN, r.SRC_IP_ADDRESS,r.DEST_IP_ADDRESS, r.PORT_PATTERN,r.SRC_PORT,DEST_PORT,
|
||||
r.DIRECTION,r.PROTOCOL,r.DO_LOG
|
||||
r.DIRECTION,r.PROTOCOL
|
||||
</sql>
|
||||
|
||||
<sql id="AppHttpCfg_Column" >
|
||||
@@ -321,7 +317,7 @@
|
||||
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.DISTRICT,r.CFG_KEYWORDS,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG
|
||||
r.DISTRICT,r.CFG_KEYWORDS,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN
|
||||
</sql>
|
||||
|
||||
<sql id="AppDomainCfg_Column" >
|
||||
@@ -329,7 +325,7 @@
|
||||
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.DOMAIN,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG
|
||||
r.DOMAIN,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN
|
||||
</sql>
|
||||
|
||||
<sql id="AppByteCfg_Column" >
|
||||
@@ -337,7 +333,7 @@
|
||||
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.BYTES,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG
|
||||
r.BYTES,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN
|
||||
</sql>
|
||||
|
||||
<sql id="AppInnerRuleCfg_Column" >
|
||||
@@ -481,6 +477,9 @@
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND r.COMPILE_ID=#{compileId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
@@ -619,9 +618,6 @@
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND r.compile_id=#{compileId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
@@ -744,9 +740,6 @@
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND r.compile_id=#{compileId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
@@ -847,9 +840,6 @@
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND r.compile_id=#{compileId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
@@ -947,9 +937,6 @@
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND r.compile_id=#{compileId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
@@ -1140,9 +1127,6 @@
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND r.compile_id=#{compileId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
@@ -1244,9 +1228,6 @@
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="compileId != null">
|
||||
AND r.compile_id=#{compileId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
@@ -1340,12 +1321,12 @@
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,
|
||||
CFG_TYPE,CFG_REGION_CODE,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,USER_REGION1
|
||||
,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5
|
||||
,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5,DO_LOG
|
||||
)values (
|
||||
<include refid="AppCommonCfg_Value_List" />,
|
||||
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
|
||||
,#{userRegion1,jdbcType=VARCHAR} ,#{userRegion2,jdbcType=VARCHAR} ,#{userRegion3,jdbcType=VARCHAR}
|
||||
,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR}
|
||||
,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR} ,#{doLog,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertAppIpCfg" parameterType="com.nis.domain.configuration.AppIpCfg" >
|
||||
@@ -1358,12 +1339,12 @@
|
||||
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
|
||||
IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
|
||||
DIRECTION,PROTOCOL,DO_LOG
|
||||
DIRECTION,PROTOCOL
|
||||
)values (
|
||||
<include refid="AppCommonCfg_Value_List" />,
|
||||
#{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
|
||||
#{protocol,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER}
|
||||
#{protocol,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertAppHttpCfg" parameterType="com.nis.domain.configuration.AppHttpCfg" >
|
||||
@@ -1375,11 +1356,11 @@
|
||||
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,
|
||||
DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG
|
||||
DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN
|
||||
)values (
|
||||
<include refid="AppCommonCfg_Value_List" />,
|
||||
#{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR},#{exprType,jdbcType=INTEGER},
|
||||
#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER}
|
||||
#{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR},
|
||||
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertAppDomainCfg" parameterType="com.nis.domain.configuration.AppDomainCfg" >
|
||||
@@ -1391,11 +1372,11 @@
|
||||
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,
|
||||
DOMAIN,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG
|
||||
DOMAIN,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN
|
||||
)values (
|
||||
<include refid="AppCommonCfg_Value_List" />,
|
||||
#{domain,jdbcType=VARCHAR},#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},
|
||||
#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER}
|
||||
#{domain,jdbcType=VARCHAR},
|
||||
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertAppByteCfg" parameterType="com.nis.domain.configuration.AppByteCfg" >
|
||||
@@ -1407,11 +1388,11 @@
|
||||
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,
|
||||
BYTES,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG
|
||||
BYTES,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN
|
||||
)values (
|
||||
<include refid="AppCommonCfg_Value_List" />,
|
||||
#{bytes,jdbcType=VARCHAR},#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},
|
||||
#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER}
|
||||
#{bytes,jdbcType=VARCHAR},
|
||||
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertAppInnerRuleCfg" parameterType="com.nis.domain.configuration.AppInnerRuleCfg" >
|
||||
@@ -1629,6 +1610,7 @@
|
||||
<if test="userRegion5 != null and userRegion5 != ''"> -->
|
||||
USER_REGION1 =#{userRegion5,jdbcType=VARCHAR},
|
||||
<!-- </if> -->
|
||||
DO_LOG=#{doLog,jdbcType=INTEGER}
|
||||
</trim>
|
||||
</set>
|
||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
@@ -1740,9 +1722,6 @@
|
||||
<if test="protocol != null" >
|
||||
protocol = #{protocol,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="doLog != null" >
|
||||
do_log = #{doLog,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
@@ -1841,9 +1820,6 @@
|
||||
<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}
|
||||
@@ -1939,9 +1915,6 @@
|
||||
<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}
|
||||
@@ -2037,9 +2010,6 @@
|
||||
<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}
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.dao.configuration.AppCfgDao;
|
||||
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
@@ -146,12 +147,22 @@ public class AppCfgService extends BaseService {
|
||||
entity.setIsAudit(0);
|
||||
appCfgDao.insertAppPolicyCfg(entity);
|
||||
//保存策略IP配置
|
||||
if(entity.getIpPortList()!=null){
|
||||
if(entity!=null&&entity.getIpPortList()!=null){
|
||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
appCfgDao.insertAppPolicyIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
//保存关键字配置
|
||||
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
entity.setCfgKeywords(cfg.getCfgKeywords());
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
stringcfgDao.saveSubscribeIdCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null){
|
||||
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
||||
@@ -173,6 +184,12 @@ public class AppCfgService extends BaseService {
|
||||
appCfgDao.updateAppPolicyCfg(entity);
|
||||
|
||||
appCfgDao.deleteAppPolicyIpCfg(entity);
|
||||
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null&&entity.getNtcSubscribeIdCfgList().size()>0){
|
||||
for (NtcSubscribeIdCfg ntcSubscribeIdCfg : entity.getNtcSubscribeIdCfgList()) {
|
||||
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
|
||||
stringcfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg);
|
||||
}
|
||||
}
|
||||
//删除旧的区域IP,新增新的区域IP
|
||||
AreaIpCfg area = new AreaIpCfg();
|
||||
area.setCompileId(entity.getCompileId());
|
||||
@@ -188,6 +205,15 @@ public class AppCfgService extends BaseService {
|
||||
appCfgDao.insertAppPolicyIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
entity.setCfgKeywords(cfg.getCfgKeywords());
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
stringcfgDao.saveSubscribeIdCfg(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null){
|
||||
@@ -494,7 +520,19 @@ public class AppCfgService extends BaseService {
|
||||
List<DigestCfg> digestRegionList = new ArrayList();
|
||||
List<IpCfg> areaIpRegionList = new ArrayList();
|
||||
entity.setTableName(AppPolicyCfg.getTablename());
|
||||
List <NtcSubscribeIdCfg> ntcList = new ArrayList();
|
||||
appCfgDao.auditCfg(entity);
|
||||
//更新关键字表状态
|
||||
if(entity.getCompileId()!=null){
|
||||
NtcSubscribeIdCfg ntc = new NtcSubscribeIdCfg();
|
||||
ntc.setCompileId(entity.getCompileId());
|
||||
ntc.setIsAudit(entity.getIsAudit());
|
||||
ntc.setIsValid(entity.getIsValid());
|
||||
ntc.setAuditorId(UserUtils.getUser().getId());
|
||||
ntc.setAuditTime(entity.getAuditTime());
|
||||
stringcfgDao.updateSubscribeIdCfg(ntc);
|
||||
}
|
||||
|
||||
if(isAudit==1){
|
||||
StringBuffer cfgKeywords=new StringBuffer();
|
||||
if(entity.getBehavCode()!=null){
|
||||
@@ -538,6 +576,19 @@ public class AppCfgService extends BaseService {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(entity.getCompileId()!=null){
|
||||
|
||||
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
|
||||
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
|
||||
ntcList = stringcfgDao.findSubscribeIdCfgList(ntcSubscribeIdCfg);
|
||||
}
|
||||
if(isAudit==1){
|
||||
if(!StringUtil.isEmpty(ntcList)){
|
||||
Map<String,List> ntcMap = cfgConvert(strRegionList,ntcList,2,entity,groupRelationList);
|
||||
groupRelationList=ntcMap.get("groupList");
|
||||
strRegionList=ntcMap.get("dstList");
|
||||
}
|
||||
}
|
||||
|
||||
//保存区域IP信息
|
||||
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||
@@ -1048,6 +1099,12 @@ public class AppCfgService extends BaseService {
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
appCfgDao.updateCfgValid(cfg);
|
||||
}
|
||||
//删除关键字
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null&&entity.getNtcSubscribeIdCfgList().size()>0){
|
||||
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
|
||||
BeanUtils.copyProperties(entity, ntcSubscribeIdCfg, new String[]{"cfgId"});
|
||||
stringcfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg);
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
|
||||
AreaIpCfg cfg = new AreaIpCfg();
|
||||
|
||||
Reference in New Issue
Block a user