更新组状态方法修改
This commit is contained in:
@@ -21,7 +21,7 @@ public class IpCommCfg extends BaseCfg<IpCommCfg> {
|
|||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
private String indexTable="ip_comm_cfg";
|
private static String indexTable="ip_comm_cfg";
|
||||||
/**
|
/**
|
||||||
* ip类型
|
* ip类型
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -8,6 +8,13 @@ import java.util.regex.Pattern;
|
|||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
|
||||||
public final class Constants {
|
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);
|
||||||
/**
|
/**
|
||||||
* 导入条数限制
|
* 导入条数限制
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -522,4 +522,138 @@
|
|||||||
WHERE group_id= #{groupId}
|
WHERE group_id= #{groupId}
|
||||||
and is_valid=1
|
and is_valid=1
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
@@ -26,4 +26,10 @@ public interface PolicyGroupInfoDao extends CrudDao<PolicyGroupInfo> {
|
|||||||
PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo);
|
PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo);
|
||||||
|
|
||||||
List<PolicyGroupInfo> findPolicyByGroupInfoList(@Param("ids")String ids);
|
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>
|
</resultMap>
|
||||||
<sql id="PolicyGroupInfoColumns">
|
<sql id="PolicyGroupInfoColumns">
|
||||||
r.group_id,r.group_name,r.group_type,r.is_valid,r.create_time,r.edit_time,
|
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>
|
</sql>
|
||||||
|
|
||||||
<!-- 查出所有 有效数据-->
|
<!-- 查出所有 有效数据-->
|
||||||
@@ -266,6 +266,64 @@
|
|||||||
WHERE
|
WHERE
|
||||||
r.group_id IN (${ids})
|
r.group_id IN (${ids})
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
@@ -393,4 +393,84 @@
|
|||||||
WHERE user_region3= #{groupId}
|
WHERE user_region3= #{groupId}
|
||||||
and is_valid=1
|
and is_valid=1
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -110,27 +111,38 @@ public class CommonGroupManageService extends BaseService{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新分组状态 policy_group_info ud_flag:0(无有效的域配置) 1(存在有效的域配置)
|
* 更新分组状态 policy_group_info ud_flag:0(无有效的域配置) 1(存在有效的域配置)
|
||||||
* @param serviceGroupId
|
* @param policyGroupInfos
|
||||||
* @param groupType
|
* @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);
|
* void updateUdFlag(String groupIds, Integer udFlag, Integer groupType);
|
||||||
*/
|
*/
|
||||||
|
for(PolicyGroupInfo info:policyGroupInfos){
|
||||||
Integer udFlag = 0;
|
boolean update=false;
|
||||||
if(groupType == 5) { // IP
|
Integer udFlag = 0;
|
||||||
List<IpCommCfg> list = ipCommGroupCfgDao.getCfgInfoByGroupIds(serviceGroupId);
|
if(groupType == 5) { // IP
|
||||||
if(list.size() > 0) {
|
List<IpCommCfg> list = ipCommGroupCfgDao.getCfgInfoByGroupIds(info.getServiceGroupId().toString());
|
||||||
udFlag = 1; // 可用
|
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
|
if(update){
|
||||||
List<UrlCommCfg> list = urlCommGroupDao.getCfgInfoByGroupIds(serviceGroupId);
|
commonGroupManageDao.updateGroupStatus(info.getServiceGroupId().toString(), udFlag, groupType);
|
||||||
if(list.size() > 0) {
|
|
||||||
udFlag = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
commonGroupManageDao.updateGroupStatus(serviceGroupId, udFlag, groupType);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
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.commons.collections.CollectionUtils;
|
||||||
import org.apache.ibatis.session.ExecutorType;
|
import org.apache.ibatis.session.ExecutorType;
|
||||||
import org.apache.ibatis.session.SqlSession;
|
import org.apache.ibatis.session.SqlSession;
|
||||||
@@ -32,6 +34,8 @@ public class IpCommGroupCfgService extends BaseService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IpCommGroupCfgDao ipCommGroupCfgDao;
|
private IpCommGroupCfgDao ipCommGroupCfgDao;
|
||||||
|
@Autowired
|
||||||
|
private PolicyGroupInfoDao policyGroupInfoDao;
|
||||||
|
|
||||||
private CommonGroupManageService groupManageService = SpringContextHolder.getBean(CommonGroupManageService.class);
|
private CommonGroupManageService groupManageService = SpringContextHolder.getBean(CommonGroupManageService.class);
|
||||||
|
|
||||||
@@ -69,10 +73,12 @@ public class IpCommGroupCfgService extends BaseService {
|
|||||||
}
|
}
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void update(IpCommCfg entity){
|
public void update(IpCommCfg entity){
|
||||||
|
List<PolicyGroupInfo> policyGroupInfosOld=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getUserRegion1());
|
||||||
|
List<PolicyGroupInfo> policyGroupInfosNew=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
||||||
ipCommGroupCfgDao.update(entity);
|
ipCommGroupCfgDao.update(entity);
|
||||||
// 更新分组状态
|
// 更新分组状态
|
||||||
groupManageService.updateGroupStatus(entity.getUserRegion1(), 5); // old
|
groupManageService.updateGroupStatus(policyGroupInfosOld, 5); // old
|
||||||
groupManageService.updateGroupStatus(entity.getGroupId()+"", 5); // new
|
groupManageService.updateGroupStatus(policyGroupInfosNew, 5); // new
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,10 +93,10 @@ public class IpCommGroupCfgService extends BaseService {
|
|||||||
//新增
|
//新增
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void saveIpCommGroupCfg(CfgIndexInfo entity) {
|
public void saveIpCommGroupCfg(CfgIndexInfo entity) {
|
||||||
//TODO 组配置更新时 需检索是否被其它配置引用,若被引用需调用相应服务接口更新配置
|
|
||||||
|
|
||||||
Date createTime=new Date();
|
Date createTime=new Date();
|
||||||
if(CollectionUtils.isNotEmpty(entity.getIpCommGroupCfgList())) {
|
if(CollectionUtils.isNotEmpty(entity.getIpCommGroupCfgList())) {
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
||||||
for (int i = 0; i < entity.getIpCommGroupCfgList().size(); i++) {
|
for (int i = 0; i < entity.getIpCommGroupCfgList().size(); i++) {
|
||||||
BeanUtils.copyProperties(entity, entity.getIpCommGroupCfgList().get(i), new String[]{"cfgId","userregion3"});
|
BeanUtils.copyProperties(entity, entity.getIpCommGroupCfgList().get(i), new String[]{"cfgId","userregion3"});
|
||||||
Integer regionId = 0;
|
Integer regionId = 0;
|
||||||
@@ -113,19 +119,22 @@ public class IpCommGroupCfgService extends BaseService {
|
|||||||
ipCommGroupCfgDao.insertForBatch(entity.getIpCommGroupCfgList().get(i));
|
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) {
|
public void delete(String ids, String compileIds) {
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(compileIds);
|
||||||
if(ids==null) {
|
if(ids==null) {
|
||||||
throw new RuntimeException("ids is null!");
|
throw new RuntimeException("ids is null!");
|
||||||
}
|
}
|
||||||
ipCommGroupCfgDao.delete(ids);
|
ipCommGroupCfgDao.delete(ids);
|
||||||
// 更新分组状态
|
// 更新分组状态
|
||||||
groupManageService.updateGroupStatus(compileIds, 5);
|
groupManageService.updateGroupStatus(policyGroupInfos, 5);
|
||||||
|
//transObjGroupToMaat(policyGroupInfos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
@@ -174,5 +183,4 @@ public class IpCommGroupCfgService extends BaseService {
|
|||||||
cfgs.clear();
|
cfgs.clear();
|
||||||
cfgs=null;
|
cfgs=null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -173,5 +173,19 @@ public class PolicyGroupInfoService extends BaseService{
|
|||||||
public PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo){
|
public PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo){
|
||||||
return policyGroupInfoDao.getGroupInfo(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.Date;
|
||||||
import java.util.List;
|
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.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -24,7 +26,8 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UrlCommGroupDao urlCommGroupDao;
|
private UrlCommGroupDao urlCommGroupDao;
|
||||||
|
@Autowired
|
||||||
|
private PolicyGroupInfoDao policyGroupInfoDao;
|
||||||
private CommonGroupManageService groupManageService = SpringContextHolder.getBean(CommonGroupManageService.class);
|
private CommonGroupManageService groupManageService = SpringContextHolder.getBean(CommonGroupManageService.class);
|
||||||
|
|
||||||
public Page<UrlCommCfg> findPage(Page<UrlCommCfg> page, UrlCommCfg entity) {
|
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)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void saveUrlCommGroupCfg(CfgIndexInfo entity) {
|
public void saveUrlCommGroupCfg(CfgIndexInfo entity) {
|
||||||
Date createTime=new Date();
|
Date createTime=new Date();
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
||||||
if(entity.getUrlCommGroupList()!=null) {
|
if(entity.getUrlCommGroupList()!=null) {
|
||||||
for (int i = 0; i < entity.getUrlCommGroupList().size(); i++) {
|
for (int i = 0; i < entity.getUrlCommGroupList().size(); i++) {
|
||||||
BeanUtils.copyProperties(entity, entity.getUrlCommGroupList().get(i), new String[]{"cfgId"});
|
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));
|
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);
|
entity.setExprType(0);
|
||||||
}
|
}
|
||||||
urlCommGroupDao.update(entity);
|
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(policyGroupInfosOld, 7); // old
|
||||||
groupManageService.updateGroupStatus(entity.getGroupId()+"", 7); // new
|
groupManageService.updateGroupStatus(policyGroupInfosNew, 7); // new
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -111,7 +116,8 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
|||||||
public void delete(String ids, String groupIds) {
|
public void delete(String ids, String groupIds) {
|
||||||
urlCommGroupDao.delete(ids);
|
urlCommGroupDao.delete(ids);
|
||||||
// 更新分组状态
|
// 更新分组状态
|
||||||
groupManageService.updateGroupStatus(groupIds, 7);
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<UrlCommCfg> getByIds(String ids) {
|
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.dao.specific.SpecificServiceCfgDao;
|
||||||
import com.nis.web.security.UserUtils;
|
import com.nis.web.security.UserUtils;
|
||||||
import com.nis.web.service.BaseService;
|
import com.nis.web.service.BaseService;
|
||||||
import com.sun.xml.internal.rngom.util.Utf16;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配置全量同步事务类
|
* 配置全量同步事务类
|
||||||
* @author zhangwei
|
* @author zhangwei
|
||||||
|
|||||||
Reference in New Issue
Block a user