编译配置生效时,校验编译下是否存在已经被删除的asn域配置。如果存在,提示用户重新编辑。
This commit is contained in:
@@ -22,6 +22,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.configuration.AsnKeywordCfg;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.StringUtil;
|
||||
@@ -230,4 +231,64 @@ public class AsnGroupController extends BaseController {
|
||||
}
|
||||
return orgaList;
|
||||
}
|
||||
/**
|
||||
* 校验是否有配置的ASN域已被删除
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="checkAsnRegionIsDeleted")
|
||||
@ResponseBody
|
||||
public Map<Integer,String> checkAsnRegionIsDeleted(@RequestParam(required=true,value="compileIds")String compileIds,Model model){
|
||||
Map<Integer,String> resultMap=new HashMap<>();
|
||||
try {
|
||||
if(!StringUtil.isEmpty(compileIds)){
|
||||
compileIds=compileIds.substring(0,compileIds.length()-1);
|
||||
Map<Integer, List<String>> compileWithGroupMap=new HashMap<>();
|
||||
Map<String, String> groupIdWithAsn=new HashMap<>();
|
||||
//先查询此compileId下是否有is_valid=0和is_audit=0的asn_keyword_cfgs
|
||||
List<AsnKeywordCfg> asnList=asnGroupInfoService.findAsnKeywordCfgByCompileId(compileIds);
|
||||
String groupIds="";
|
||||
for (AsnKeywordCfg asnKeywordCfg : asnList) {
|
||||
//根据asnKeyword的userRegion2[asn group Id]
|
||||
groupIds+=asnKeywordCfg.getUserRegion2()+",";
|
||||
|
||||
if(compileWithGroupMap.keySet().contains(asnKeywordCfg.getCompileId())){
|
||||
List<String> groupList=compileWithGroupMap.get(asnKeywordCfg.getCompileId());
|
||||
groupList.add(asnKeywordCfg.getUserRegion2());
|
||||
compileWithGroupMap.put(asnKeywordCfg.getCompileId(), groupList);
|
||||
}else{
|
||||
List<String> groupList=new ArrayList<>();
|
||||
groupList.add(asnKeywordCfg.getUserRegion2());
|
||||
compileWithGroupMap.put(asnKeywordCfg.getCompileId(), groupList);
|
||||
}
|
||||
groupIdWithAsn.put(asnKeywordCfg.getUserRegion2(), asnKeywordCfg.getCfgKeywords());
|
||||
}
|
||||
if(!StringUtil.isEmpty(groupIds)){
|
||||
Properties prop=this.getMsgProp();
|
||||
groupIds=groupIds.substring(0,groupIds.length()-1);
|
||||
List<String> groupIdList=asnGroupInfoService.findAsnGroupIdByGroupIds(groupIds);
|
||||
for (Integer compileId : compileWithGroupMap.keySet()) {
|
||||
for (String groupIdOld : compileWithGroupMap.get(compileId)) {
|
||||
if(!groupIdList.contains(groupIdOld)){
|
||||
String tip=prop.getProperty("deletedAsnTip").replace("asnId", groupIdWithAsn.get(groupIdOld));
|
||||
tip=tip.replace("cfgId", compileId+"");
|
||||
resultMap.put(compileId, tip);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("校验编译下的asn是否被删除失败",e);
|
||||
return resultMap;
|
||||
}
|
||||
/*List<AsnGroupInfo> orgaList=new ArrayList<>();
|
||||
try {
|
||||
orgaList=asnGroupInfoService.findAsnGroupList(asnGroup);
|
||||
} catch (Exception e) {
|
||||
logger.error("异步获取ASN NO信息失败",e);
|
||||
return orgaList;
|
||||
}*/
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user