关键字日志转url配置bug更改

批量失效时http关键字配置失效,同时失效相关的httpurl配置
刘梦严要求行为只保留pptp openvpn ipsec l2tp
This commit is contained in:
段冬梅
2018-12-10 20:23:19 +08:00
parent e19b168af9
commit a09341f8d7
5 changed files with 78 additions and 20 deletions

View File

@@ -31,8 +31,12 @@ public interface CommonPolicyDao {
public void deleteComplexStringCfg(CfgIndexInfo entity);
public void updateCfgValid(BaseCfg entity);
public void auditCfg(BaseCfg entity);
public List<CfgIndexInfo> getHttpUrlCfgBySourceCompileId(@Param("compileIds")List compileIds);
public void auditCfgBatch(@Param("tableName")String tableName,
@Param("entity")BaseCfg baseCfg,
@Param("compileIds")List compileIds,
@Param("requestId")Integer requestId);
public void deleteHttpUrlCfg(@Param("tableName")String tableName,
@Param("entity")BaseCfg baseCfg,
@Param("compileIds")List compileIds);
}

View File

@@ -784,4 +784,27 @@
</where>
</if>
</update>
<update id="deleteHttpUrlCfg">
update ${tableName} set is_valid =-1,is_audit = 0,
editor_id = #{entity.auditorId,jdbcType=INTEGER},
edit_time = #{entity.auditTime,jdbcType=TIMESTAMP}
<where>
and compile_id in
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
#{compileId}
</foreach>
</where>
</update>
<select id="getHttpUrlCfgBySourceCompileId" resultMap="CfgIndexInfoMap">
SELECT
<include refid="ConfigIndex_Column" />
FROM cfg_index_info a
<where>
and source_compile_id in
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
#{compileId}
</foreach>
</where>
</select>
</mapper>

View File

@@ -100,6 +100,37 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
}
if(!StringUtil.isEmpty(compileIds) && !StringUtil.isEmpty(entity.getTableName())) {
List auditHttpCompileIds= new ArrayList();
List deleteHttpCompileIds= new ArrayList();
//http关键字配置失效获取与其匹配的http url配置
if(entity.getServiceId().equals(152) || entity.getServiceId().equals(40)) {
List<CfgIndexInfo> httpUrlCfgs=commonPolicyDao.getHttpUrlCfgBySourceCompileId(compileIds);
if(!StringUtil.isEmpty(httpUrlCfgs)) {
for (CfgIndexInfo httpUrlCfg: httpUrlCfgs) {
//审核通过的
if(httpUrlCfg.getIsValid().equals(1) && httpUrlCfg.getIsAudit().equals(1)) {
auditHttpCompileIds.add(httpUrlCfg.getCompileId());
maatCfg = new MaatCfg();
maatCfg.setCompileId(httpUrlCfg.getCompileId());
maatCfg.setServiceId(httpUrlCfg.getServiceId());
maatCfg.setIsValid(0);//无效
configCompileList.add(maatCfg);
}
//未审核或者审核未通过的
if(httpUrlCfg.getIsValid().equals(0) && (httpUrlCfg.getIsAudit().equals(0) || httpUrlCfg.getIsAudit().equals(2))) {
deleteHttpCompileIds.add(httpUrlCfg.getCompileId());
}
}
}
}
if(!StringUtil.isEmpty(auditHttpCompileIds)) {
commonPolicyDao.auditCfgBatch("cfg_index_info", entity,auditHttpCompileIds,null);
commonPolicyDao.auditCfgBatch("http_url_cfg", entity,auditHttpCompileIds,null);
}
if(!StringUtil.isEmpty(deleteHttpCompileIds)) {
commonPolicyDao.deleteHttpUrlCfg("cfg_index_info", entity,deleteHttpCompileIds);
commonPolicyDao.deleteHttpUrlCfg("http_url_cfg", entity,deleteHttpCompileIds);
}
commonPolicyDao.auditCfgBatch( entity.getTableName(), entity,compileIds,null);
}

View File

@@ -0,0 +1 @@
update specific_service_cfg set is_valid=0 where cfg_type=2 and is_Valid=1 and is_leaf = 0 and spec_service_code not in(10015,10019,10061,10013);

View File

@@ -50,73 +50,72 @@ $(function () {
$("#httpUrl tbody tr").eq(i).find("td").eq(1).attr("title",urls[i]);
$("#httpUrl tbody tr").eq(i).find("td").eq(1)
.append(url);
$("#httpUrl tbody tr").eq(i).find("td").eq(2).append(
$("select[name='service']").clone()
$("#http_url_modal").find("select[name='service']").clone()
.attr("name",prefixName+"action")
.removeClass("hidden")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(2).append(
$("input[name='serviceId']").clone()
$("#http_url_modal").find("input[name='serviceId']").clone()
.attr("name",prefixName+"serviceId")
.attr("value","6")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(2).append(
$("input[name='cfgType']").clone()
$("#http_url_modal").find("input[name='cfgType']").clone()
.attr("name",prefixName+"cfgType")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(2).append(
$("input[name='cfgRegionCode']").clone()
$("#http_url_modal").find("input[name='cfgRegionCode']").clone()
.attr("name",prefixName+"cfgRegionCode")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(2).append(
$("input[name='serviceId']").clone()
$("#http_url_modal").find("input[name='serviceId']").clone()
.attr("name",prefixName+"functionId")
.attr("value","6")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(3).append(
$("select[name='doLog']").clone()
$("#http_url_modal").find("select[name='doLog']").clone()
.attr("name",prefixName+"doLog")
.removeClass("hidden")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(4).append(
$("select[name='exprType']").clone()
$("#http_url_modal").find("select[name='exprType']").clone()
.attr("name",prefixName+"exprType")
.removeClass("hidden")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(5).append(
$("select[name='matchMethod']").clone()
$("#http_url_modal").find("select[name='matchMethod']").clone()
.attr("name",prefixName+"matchMethod")
.removeClass("hidden")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(6).append(
$("input[name='isHexbin']").clone()
$("#http_url_modal").find("input[name='isHexbin']").clone()
.attr("name",prefixName+"isHexbin")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(7).append(
$("input[name='requestId']").clone()
$("#http_url_modal").find("input[name='requestId']").clone()
.attr("name",prefixName+"requestId")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(7).append(
$("input[name='classify']").clone()
$("#http_url_modal").find("input[name='classify']").clone()
.attr("name",prefixName+"classify")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(7).append(
$("input[name='attribute']").clone()
$("#http_url_modal").find("input[name='attribute']").clone()
.attr("name",prefixName+"attribute")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(7).append(
$("input[name='lable']").clone()
$("#http_url_modal").find("input[name='lable']").clone()
.attr("name",prefixName+"lable")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(8).append(
$("input[name='isAreaEffective']").clone()
$("#http_url_modal").find("input[name='isAreaEffective']").clone()
.attr("name",prefixName+"isAreaEffective")
);
$("#httpUrl tbody tr").eq(i).find("td").eq(9).append(
$("input[name='sourceCompileId']").clone()
$("#http_url_modal").find("input[name='sourceCompileId']").clone()
.attr("name",prefixName+"sourceCompileId")
.attr("value",compileIds[i])
);
@@ -128,9 +127,9 @@ $(function () {
});
}
$("select").selectpicker("refresh");
$("#http_url_modal").find("select").selectpicker("refresh");
$("select[name$='.action']").each(function(){
$("#http_url_modal").find("select[name$='.action']").each(function(){
var action=$(this).val();
var objNamePrefix=$(this).attr("name").split("action")[0];
$(this).on("change", function() {
@@ -142,7 +141,7 @@ $(function () {
$("input[name='"+objNamePrefix+"cfgType']").attr("value",$("#httpUrlRegion").val());
$("input[name='"+objNamePrefix+"cfgRegionCode']").attr("value",$("#httpUrlRegion").attr("cfgRegionCode"));
}
if(action == 1){ //白名单
if(action == 1){
$("select[name='"+objNamePrefix+"doLog']").attr("value",1);
$("select[name='"+objNamePrefix+"doLog']").attr("disabled",true);
$("select[name='"+objNamePrefix+"doLog']").selectpicker("refresh");
@@ -159,7 +158,7 @@ $(function () {
$("input[name='"+objNamePrefix+"cfgType']").attr("value",$("#httpUrlRegion").val());
$("input[name='"+objNamePrefix+"cfgRegionCode']").attr("value",$("#httpUrlRegion").attr("cfgRegionCode"));
}
if(action == 1){ //白名单
if(action == 1){
$("select[name='"+objNamePrefix+"doLog']").attr("value",1);
$("select[name='"+objNamePrefix+"doLog']").attr("disabled",true);
$("select[name='"+objNamePrefix+"doLog']").selectpicker("refresh");