清空配置增加策略分组处理
This commit is contained in:
@@ -33,4 +33,8 @@ public interface CommonGroupManageDao extends CrudDao<CommonGroupInfo> {
|
|||||||
Integer getGroupIdByGroupName(@Param("groupName")String groupName, @Param("groupType")Integer groupType);
|
Integer getGroupIdByGroupName(@Param("groupName")String groupName, @Param("groupType")Integer groupType);
|
||||||
|
|
||||||
int insertBatch(List<CommonGroupInfo> list);
|
int insertBatch(List<CommonGroupInfo> list);
|
||||||
|
|
||||||
|
void reLoadGroupInfo(@Param("groupType")String groupType);
|
||||||
|
|
||||||
|
void deleteGroupRegionInfo(@Param("tableName")String tableName);
|
||||||
}
|
}
|
||||||
@@ -258,4 +258,17 @@
|
|||||||
</trim>
|
</trim>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="reLoadGroupInfo" parameterType="java.lang.String">
|
||||||
|
UPDATE
|
||||||
|
policy_group_info
|
||||||
|
SET
|
||||||
|
ud_flag = 0
|
||||||
|
WHERE
|
||||||
|
is_valid != 0 AND group_type IN(${groupType})
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteGroupRegionInfo" parameterType="java.lang.String">
|
||||||
|
DELETE FROM ${tableName}
|
||||||
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -44,6 +44,7 @@ import com.nis.web.security.CacheSessionDAO;
|
|||||||
import com.nis.web.security.Servlets;
|
import com.nis.web.security.Servlets;
|
||||||
import com.nis.web.security.UserUtils;
|
import com.nis.web.security.UserUtils;
|
||||||
import com.nis.web.service.basics.AsnGroupInfoService;
|
import com.nis.web.service.basics.AsnGroupInfoService;
|
||||||
|
import com.nis.web.service.basics.CommonGroupManageService;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class SystemService extends BaseService{
|
public class SystemService extends BaseService{
|
||||||
@@ -61,6 +62,9 @@ public class SystemService extends BaseService{
|
|||||||
@Autowired
|
@Autowired
|
||||||
private AsnGroupInfoService asnGroupInfoService;
|
private AsnGroupInfoService asnGroupInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CommonGroupManageService commonGroupManageService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CommonPolicyDao commonPolicyDao;
|
private CommonPolicyDao commonPolicyDao;
|
||||||
|
|
||||||
@@ -198,7 +202,9 @@ public class SystemService extends BaseService{
|
|||||||
for (String tableName : tableNameSet) {
|
for (String tableName : tableNameSet) {
|
||||||
commonPolicyDao.clearPolicies(tableName);
|
commonPolicyDao.clearPolicies(tableName);
|
||||||
}
|
}
|
||||||
// 初始化分组
|
// 初始化策略分组
|
||||||
|
commonGroupManageService.reLoadGroupInfo();
|
||||||
|
// 初始化ASN分组
|
||||||
asnGroupInfoService.reLoadGroupInfo();
|
asnGroupInfoService.reLoadGroupInfo();
|
||||||
// 失效定时任务
|
// 失效定时任务
|
||||||
schedulerDao.inValidAllSchedule();
|
schedulerDao.inValidAllSchedule();
|
||||||
|
|||||||
@@ -347,6 +347,23 @@ public class CommonGroupManageService extends BaseService{
|
|||||||
return flag;
|
return flag;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void reLoadGroupInfo() {
|
||||||
|
// 初始化策略分组信息
|
||||||
|
String groupType = Constants.IP_OBJ_GROUP_TYPE + "," + Constants.URL_OBJ_GROUP_TYPE + ","
|
||||||
|
+ Constants.DOMAIN_OBJ_GROUP_TYPE + "," + Constants.SUBID_OBJ_GROUP_TYPE;
|
||||||
|
commonGroupManageDao.reLoadGroupInfo(groupType);
|
||||||
|
|
||||||
|
// 清空分组域配置信息
|
||||||
|
List<String> tableList = new ArrayList<String>();
|
||||||
|
tableList.add(IpCommCfg.getIndexTable());
|
||||||
|
tableList.add(UrlCommCfg.getTablename());
|
||||||
|
tableList.add(DomainCommCfg.getTablename());
|
||||||
|
tableList.add(ScriberIdCommCfg.getTablename());
|
||||||
|
for (String tableName : tableList) {
|
||||||
|
commonGroupManageDao.deleteGroupRegionInfo(tableName);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user