(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

@@ -660,13 +660,16 @@ public class BaseController {
if(protocol==null){ if(protocol==null){
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("direction"))+";"); errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("direction"))+";");
} }
//direction check end //protocol check end
if(StringUtils.isNotBlank(errInfo.toString())){ if(StringUtils.isNotBlank(errInfo.toString())){
msg.append(lineStart).append(errInfo); msg.append(lineStart).append(errInfo);
if(line<list.size()){ if(line<list.size()){
msg.append("<br/>"); msg.append("<br/>");
} }
} }
// requestId check start
Integer requestId=value.getRequestId();
// requestId check end
line++; line++;
} }
if(StringUtils.isNotBlank(msg.toString())){ if(StringUtils.isNotBlank(msg.toString())){

View File

@@ -114,7 +114,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
public void auditWhiteDomain(HttpUrlCfg cfg) throws Exception{ public void auditWhiteDomain(HttpUrlCfg cfg) throws Exception{
List<HttpUrlCfg> beans=new ArrayList<>(); List<HttpUrlCfg> beans=new ArrayList<>();
beans.add(cfg); beans.add(cfg);
this.auditBatch(beans, DomainDao.class); domainDao.audit(cfg);
List<MaatCfg> configCompileList = new ArrayList<>(); List<MaatCfg> configCompileList = new ArrayList<>();
List<GroupCfg> groupRelationList = new ArrayList<>(); List<GroupCfg> groupRelationList = new ArrayList<>();
List<IpCfg> ipRegionList = new ArrayList<>(); List<IpCfg> ipRegionList = new ArrayList<>();
@@ -185,7 +185,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
public void auditDomain(HttpUrlCfg cfg) throws Exception{ public void auditDomain(HttpUrlCfg cfg) throws Exception{
List<HttpUrlCfg> beans=new ArrayList<>(); List<HttpUrlCfg> beans=new ArrayList<>();
beans.add(cfg); beans.add(cfg);
this.auditBatch(beans, DomainDao.class); domainDao.audit(cfg);
List<BaseIpCfg> beans1=new ArrayList<>(); List<BaseIpCfg> beans1=new ArrayList<>();
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(cfg.getCompileId()); List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(cfg.getCompileId());
for(AreaIpCfg area:areaIpCfgList){ for(AreaIpCfg area:areaIpCfgList){

View File

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