(1)审核调用auditBatch改为直接单个audit

(2)修复IP审核去错configRegionCode导致的空指针异常
This commit is contained in:
wangxin
2018-07-03 15:54:14 +08:00
parent 100e7d84bd
commit 0c64250fa4
3 changed files with 29 additions and 9 deletions

View File

@@ -130,7 +130,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
//更新IP配置与区域IP的状态
List<BaseIpCfg> beans=new ArrayList<>();
beans.add(cfg);
this.auditBatch(beans, IpCfgDao.class);
ipCfgDao.audit(cfg);
List<BaseIpCfg> beans1=new ArrayList<>();
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(cfg.getCompileId());
for(AreaIpCfg area:areaIpCfgList){
@@ -166,12 +166,29 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
List<FunctionRegionDict> dictList = DictUtils.getFunctionRegionDictList(cfg.getFunctionId());
int maatType=0;
//判断下发类型是走maat还是callback
for(FunctionRegionDict f:dictList){
if(f.getCfgRegionCode().intValue()==cfg.getCfgRegionCode()){
maatType=f.getIsMaat();
break;
if(cfg.getCfgRegionCode()!=null){
for(FunctionRegionDict f:dictList){
if(f.getConfigRegionCode().intValue()==cfg.getCfgRegionCode()){
maatType=f.getIsMaat();
break;
}
}
}else{
List<SysDataDictionaryItem> maatServiceList = DictUtils.getDictList("MAAT_SERVICE");
for(SysDataDictionaryItem maatService:maatServiceList){
if(Integer.parseInt(maatService.getItemCode())==cfg.getServiceId().intValue()){
for(FunctionRegionDict f:dictList){
if(maatService.getItemValue().equals(f.getConfigRegionValue())){
maatType=f.getIsMaat();
break;
}
}
break;
}
}
}
if(cfg.getIsAudit()==Constants.AUDIT_YES){
if(maatType==Constants.CALLBACK_TYPE){
List<InlineIp> ipList=new ArrayList<>();
@@ -281,7 +298,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
public void auditWhiteIp(BaseIpCfg cfg) throws Exception{
List<BaseIpCfg> beans=new ArrayList<>();
beans.add(cfg);
this.auditBatch(beans, IpCfgDao.class);
ipCfgDao.audit(cfg);
List<MaatCfg> configCompileList = new ArrayList<>();
List<GroupCfg> groupRelationList = new ArrayList<>();
List<IpCfg> ipRegionList = new ArrayList<>();