更新组状态方法修改
This commit is contained in:
@@ -21,7 +21,7 @@ public class IpCommCfg extends BaseCfg<IpCommCfg> {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
private String indexTable="ip_comm_cfg";
|
||||
private static String indexTable="ip_comm_cfg";
|
||||
/**
|
||||
* ip类型
|
||||
*/
|
||||
|
||||
@@ -8,6 +8,13 @@ import java.util.regex.Pattern;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
public final class Constants {
|
||||
/**
|
||||
* obj group list group type
|
||||
*/
|
||||
public static Integer IP_OBJ_GROUP_TYPE=Configurations.getIntProperty("ip_obj_group_type", 5);
|
||||
public static Integer URL_OBJ_GROUP_TYPE=Configurations.getIntProperty("url_obj_group_type", 7);
|
||||
public static Integer SUBID_OBJ_GROUP_TYPE=Configurations.getIntProperty("subid_obj_group_type", 8);
|
||||
public static Integer DOMAIN_OBJ_GROUP_TYPE=Configurations.getIntProperty("domain_obj_group_type", 9);
|
||||
/**
|
||||
* 导入条数限制
|
||||
*/
|
||||
@@ -837,6 +844,6 @@ public final class Constants {
|
||||
* HTTP(S)操控日志接口
|
||||
*/
|
||||
public static final String POLICY_EVENT=Configurations.getStringProperty("policyevent","policyevent");
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -522,4 +522,138 @@
|
||||
WHERE group_id= #{groupId}
|
||||
and is_valid=1
|
||||
</select>
|
||||
<select id="findAllList" resultMap="IpCommGroupCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from ip_comm_cfg r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<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="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE like concat(concat('%',#{CFG_TYPE,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destPort != null and destPort !=''">
|
||||
AND r.DEST_PORT=#{destPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="direction != null">
|
||||
AND r.DIRECTION=#{direction,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocol != null">
|
||||
AND r.PROTOCOL=#{protocol,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocolId != null">
|
||||
AND r.PROTOCOL_ID=#{protocolId,jdbcType=INTEGER}
|
||||
</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="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</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="regionId != null">
|
||||
AND r.region_id=#{regionId,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>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="userRegion1 != null">
|
||||
AND r.user_region1 like concat(concat('%',#{userRegion1,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="userRegion2 != null">
|
||||
AND r.user_region2 like concat(concat('%',#{userRegion2,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="userRegion3 != null">
|
||||
AND r.user_region3 like concat(concat('%',#{userRegion3,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="userRegion4 != null">
|
||||
AND r.user_region4 like concat(concat('%',#{userRegion4,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="userRegion5 != null">
|
||||
AND r.user_region5 like concat(concat('%',#{userRegion5,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND r.group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="commonGroupIds != null">
|
||||
AND r.group_id in(${commonGroupIds})
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
</trim>
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY r.CFG_ID desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -26,4 +26,10 @@ public interface PolicyGroupInfoDao extends CrudDao<PolicyGroupInfo> {
|
||||
PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo);
|
||||
|
||||
List<PolicyGroupInfo> findPolicyByGroupInfoList(@Param("ids")String ids);
|
||||
List<PolicyGroupInfo> findPolicyByGroupInfoListByGroupIds(@Param("serviceGroupIds")String ids);
|
||||
List<PolicyGroupInfo> findPolicyGroupInfosByTypeForUD(@Param("groupType")Integer groupType,@Param("flag")Integer flag);
|
||||
List<PolicyGroupInfo> findLimitedPolicyGroupInfosByTypeForUD(@Param("groupType")Integer groupType,@Param("flag")Integer flag,@Param("limit")Integer limit);
|
||||
void updateUdFlag(@Param("groupIds")String groupIds,@Param("udFlag")int udFlag,@Param("groupType")Integer groupType);
|
||||
List<PolicyGroupInfo> findPolicyByServiceGroupInfoList(@Param("ids")String ids);
|
||||
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
</resultMap>
|
||||
<sql id="PolicyGroupInfoColumns">
|
||||
r.group_id,r.group_name,r.group_type,r.is_valid,r.create_time,r.edit_time,
|
||||
r.creator_id,r.editor_id,r.service_group_id,r.asn_no,r.description
|
||||
r.creator_id,r.editor_id,r.service_group_id,r.asn_no,r.description,r.ud_flag
|
||||
</sql>
|
||||
|
||||
<!-- 查出所有 有效数据-->
|
||||
@@ -266,6 +266,64 @@
|
||||
WHERE
|
||||
r.group_id IN (${ids})
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 查出所有 有效数据-->
|
||||
<select id="findPolicyByGroupInfoListByGroupIds" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
, s.name as creator_name
|
||||
,e.name as editor_name
|
||||
</trim>
|
||||
FROM
|
||||
policy_group_info r
|
||||
left join sys_user s on r.creator_id=s.id
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
WHERE
|
||||
r.group_id IN (${serviceGroupIds})
|
||||
</select>
|
||||
<select id="findPolicyByServiceGroupInfoList" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
, s.name as creator_name
|
||||
,e.name as editor_name
|
||||
</trim>
|
||||
FROM
|
||||
policy_group_info r
|
||||
left join sys_user s on r.creator_id=s.id
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
WHERE
|
||||
r.service_group_id IN (${ids})
|
||||
</select>
|
||||
|
||||
<select id="findPolicyGroupInfosByTypeForUD" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM policy_group_info r
|
||||
where r.is_valid=1 and r.group_type=#{groupType,jdbcType=INTEGER}
|
||||
<if test="flag!=null">
|
||||
and ud_flag=#{flag}
|
||||
</if>
|
||||
</select>
|
||||
<select id="findLimitedPolicyGroupInfosByTypeForUD" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM policy_group_info r
|
||||
where r.is_valid=1 and r.group_type=#{groupType,jdbcType=INTEGER}
|
||||
<if test="flag!=null">
|
||||
and ud_flag=#{flag}
|
||||
</if>
|
||||
<if test="flag!=null">
|
||||
limit #{limit}
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateUdFlag">
|
||||
UPDATE policy_group_info SET ud_flag =#{udFlag}
|
||||
WHERE service_group_id in (${groupIds})
|
||||
<if test="groupType!=null">
|
||||
and group_type=#{groupType}
|
||||
</if>
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -393,4 +393,84 @@
|
||||
WHERE user_region3= #{groupId}
|
||||
and is_valid=1
|
||||
</select>
|
||||
<select id="findAllList" parameterType="com.nis.domain.basics.UrlCommCfg" resultMap="urlCommGroupCfgMap">
|
||||
SELECT
|
||||
<include refid="columns"></include>
|
||||
FROM
|
||||
url_comm_cfg r
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
AND ${page.where}
|
||||
</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="cfgKeywords != null and cfgKeywords != ''">
|
||||
AND r.cfg_keywords like concat(concat('%',#{cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,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="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</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="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>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="groupId != null">
|
||||
AND r.group_id = #{groupId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="commonGroupIds != null">
|
||||
AND r.group_id in(${commonGroupIds})
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
</trim>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -110,28 +111,39 @@ public class CommonGroupManageService extends BaseService{
|
||||
|
||||
/**
|
||||
* 更新分组状态 policy_group_info ud_flag:0(无有效的域配置) 1(存在有效的域配置)
|
||||
* @param serviceGroupId
|
||||
* @param policyGroupInfos
|
||||
* @param groupType
|
||||
*/
|
||||
public void updateGroupStatus(String serviceGroupId, Integer groupType) {
|
||||
public void updateGroupStatus(List<PolicyGroupInfo> policyGroupInfos, Integer groupType) {
|
||||
/**
|
||||
* void updateUdFlag(String groupIds, Integer udFlag, Integer groupType);
|
||||
*/
|
||||
|
||||
Integer udFlag = 0;
|
||||
if(groupType == 5) { // IP
|
||||
List<IpCommCfg> list = ipCommGroupCfgDao.getCfgInfoByGroupIds(serviceGroupId);
|
||||
if(list.size() > 0) {
|
||||
udFlag = 1; // 可用
|
||||
for(PolicyGroupInfo info:policyGroupInfos){
|
||||
boolean update=false;
|
||||
Integer udFlag = 0;
|
||||
if(groupType == 5) { // IP
|
||||
List<IpCommCfg> list = ipCommGroupCfgDao.getCfgInfoByGroupIds(info.getServiceGroupId().toString());
|
||||
if(list.size() > 0&&info.getUdFlag().equals(0)) {
|
||||
update=true;
|
||||
udFlag = 1; // 可用
|
||||
}else if(list.size()==0&&info.getUdFlag().equals(2)){
|
||||
update=true;
|
||||
}
|
||||
}else if(groupType == 7) { // URL
|
||||
List<UrlCommCfg> list = urlCommGroupDao.getCfgInfoByGroupIds(info.getServiceGroupId().toString());
|
||||
if(list.size() > 0&&info.getUdFlag().equals(0)) {
|
||||
update=true;
|
||||
udFlag = 1;
|
||||
}else if(list.size()==0&&info.getUdFlag().equals(2)){
|
||||
update=true;
|
||||
}
|
||||
}
|
||||
}else if(groupType == 7) { // URL
|
||||
List<UrlCommCfg> list = urlCommGroupDao.getCfgInfoByGroupIds(serviceGroupId);
|
||||
if(list.size() > 0) {
|
||||
udFlag = 1;
|
||||
if(update){
|
||||
commonGroupManageDao.updateGroupStatus(info.getServiceGroupId().toString(), udFlag, groupType);
|
||||
}
|
||||
}
|
||||
commonGroupManageDao.updateGroupStatus(serviceGroupId, udFlag, groupType);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
@@ -32,9 +34,11 @@ public class IpCommGroupCfgService extends BaseService {
|
||||
|
||||
@Autowired
|
||||
private IpCommGroupCfgDao ipCommGroupCfgDao;
|
||||
|
||||
@Autowired
|
||||
private PolicyGroupInfoDao policyGroupInfoDao;
|
||||
|
||||
private CommonGroupManageService groupManageService = SpringContextHolder.getBean(CommonGroupManageService.class);
|
||||
|
||||
|
||||
/**
|
||||
* @param page
|
||||
* @param entity
|
||||
@@ -69,11 +73,13 @@ public class IpCommGroupCfgService extends BaseService {
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void update(IpCommCfg entity){
|
||||
List<PolicyGroupInfo> policyGroupInfosOld=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getUserRegion1());
|
||||
List<PolicyGroupInfo> policyGroupInfosNew=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
||||
ipCommGroupCfgDao.update(entity);
|
||||
// 更新分组状态
|
||||
groupManageService.updateGroupStatus(entity.getUserRegion1(), 5); // old
|
||||
groupManageService.updateGroupStatus(entity.getGroupId()+"", 5); // new
|
||||
|
||||
groupManageService.updateGroupStatus(policyGroupInfosOld, 5); // old
|
||||
groupManageService.updateGroupStatus(policyGroupInfosNew, 5); // new
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -87,10 +93,10 @@ public class IpCommGroupCfgService extends BaseService {
|
||||
//新增
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveIpCommGroupCfg(CfgIndexInfo entity) {
|
||||
//TODO 组配置更新时 需检索是否被其它配置引用,若被引用需调用相应服务接口更新配置
|
||||
|
||||
|
||||
Date createTime=new Date();
|
||||
if(CollectionUtils.isNotEmpty(entity.getIpCommGroupCfgList())) {
|
||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
||||
for (int i = 0; i < entity.getIpCommGroupCfgList().size(); i++) {
|
||||
BeanUtils.copyProperties(entity, entity.getIpCommGroupCfgList().get(i), new String[]{"cfgId","userregion3"});
|
||||
Integer regionId = 0;
|
||||
@@ -113,19 +119,22 @@ public class IpCommGroupCfgService extends BaseService {
|
||||
ipCommGroupCfgDao.insertForBatch(entity.getIpCommGroupCfgList().get(i));
|
||||
}
|
||||
// 更新分组状态
|
||||
groupManageService.updateGroupStatus(entity.getGroupId()+"", 5);
|
||||
|
||||
groupManageService.updateGroupStatus(policyGroupInfos, 5);
|
||||
//TODO 组配置更新时 需检索是否被其它配置引用,若被引用需调用相应服务接口更新配置
|
||||
//transObjGroupToMaat(policyGroupInfos);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void delete(String ids, String compileIds) {
|
||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(compileIds);
|
||||
if(ids==null) {
|
||||
throw new RuntimeException("ids is null!");
|
||||
}
|
||||
ipCommGroupCfgDao.delete(ids);
|
||||
// 更新分组状态
|
||||
groupManageService.updateGroupStatus(compileIds, 5);
|
||||
groupManageService.updateGroupStatus(policyGroupInfos, 5);
|
||||
//transObjGroupToMaat(policyGroupInfos);
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
@@ -174,5 +183,4 @@ public class IpCommGroupCfgService extends BaseService {
|
||||
cfgs.clear();
|
||||
cfgs=null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -173,5 +173,19 @@ public class PolicyGroupInfoService extends BaseService{
|
||||
public PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo){
|
||||
return policyGroupInfoDao.getGroupInfo(policyGroupInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公共组相关功能使用
|
||||
*/
|
||||
public List<PolicyGroupInfo> findPolicyGroupInfosByTypeforUD(Integer type,Integer flag) {
|
||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyGroupInfosByTypeForUD(type,flag);
|
||||
return list;
|
||||
}
|
||||
public List<PolicyGroupInfo> findPolicyGroupInfosByTypeforUD(Integer type,Integer flag,Integer limit) {
|
||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findLimitedPolicyGroupInfosByTypeForUD(type,flag,limit);
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<PolicyGroupInfo> findPolicyByServiceGroupInfoList(String serviceGroupIds) {
|
||||
return policyGroupInfoDao.findPolicyByServiceGroupInfoList(serviceGroupIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.nis.web.service.basics;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -24,7 +26,8 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
||||
|
||||
@Autowired
|
||||
private UrlCommGroupDao urlCommGroupDao;
|
||||
|
||||
@Autowired
|
||||
private PolicyGroupInfoDao policyGroupInfoDao;
|
||||
private CommonGroupManageService groupManageService = SpringContextHolder.getBean(CommonGroupManageService.class);
|
||||
|
||||
public Page<UrlCommCfg> findPage(Page<UrlCommCfg> page, UrlCommCfg entity) {
|
||||
@@ -52,6 +55,7 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveUrlCommGroupCfg(CfgIndexInfo entity) {
|
||||
Date createTime=new Date();
|
||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
||||
if(entity.getUrlCommGroupList()!=null) {
|
||||
for (int i = 0; i < entity.getUrlCommGroupList().size(); i++) {
|
||||
BeanUtils.copyProperties(entity, entity.getUrlCommGroupList().get(i), new String[]{"cfgId"});
|
||||
@@ -82,7 +86,7 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
||||
urlCommGroupDao.insertUrlCommGroupCfg(entity.getUrlCommGroupList().get(i));
|
||||
}
|
||||
// 更新分组状态
|
||||
groupManageService.updateGroupStatus(entity.getGroupId()+"", 7);
|
||||
groupManageService.updateGroupStatus(policyGroupInfos, 7);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -100,10 +104,11 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
||||
entity.setExprType(0);
|
||||
}
|
||||
urlCommGroupDao.update(entity);
|
||||
|
||||
List<PolicyGroupInfo> policyGroupInfosOld=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getUserRegion1());
|
||||
List<PolicyGroupInfo> policyGroupInfosNew=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
||||
// 更新分组状态
|
||||
groupManageService.updateGroupStatus(entity.getUserRegion1(), 7); // old
|
||||
groupManageService.updateGroupStatus(entity.getGroupId()+"", 7); // new
|
||||
groupManageService.updateGroupStatus(policyGroupInfosOld, 7); // old
|
||||
groupManageService.updateGroupStatus(policyGroupInfosNew, 7); // new
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +116,8 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
||||
public void delete(String ids, String groupIds) {
|
||||
urlCommGroupDao.delete(ids);
|
||||
// 更新分组状态
|
||||
groupManageService.updateGroupStatus(groupIds, 7);
|
||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
||||
groupManageService.updateGroupStatus(policyGroupInfos, 7);
|
||||
}
|
||||
|
||||
public List<UrlCommCfg> getByIds(String ids) {
|
||||
|
||||
@@ -76,8 +76,6 @@ import com.nis.web.dao.specific.ConfigGroupInfoDao;
|
||||
import com.nis.web.dao.specific.SpecificServiceCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
import com.sun.xml.internal.rngom.util.Utf16;
|
||||
|
||||
/**
|
||||
* 配置全量同步事务类
|
||||
* @author zhangwei
|
||||
|
||||
Reference in New Issue
Block a user