更新组状态方法修改
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user