关键字日志转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);
}