diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index 89249478f..95581b21f 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -275,7 +275,7 @@ public class AppCfgService extends CrudService { List complexList = new ArrayList(); List hostList =new ArrayList(); List areaList = new ArrayList(); - ConfigGroupInfo group = new ConfigGroupInfo(); + ConfigGroupInfo group = null; Gson gson=new GsonBuilder().disableHtmlEscaping() @@ -289,24 +289,38 @@ public class AppCfgService extends CrudService { if(Constants.AUDIT_YES==entity.getIsAudit().intValue()){//审核通过 if(StringUtil.isEmpty(featuresTableList)){ SpecificServiceCfg protocol = specificServiceCfgDao.getBySpecServiceId(appCfg.getAppId().intValue()); - SpecificServiceHostCfg hostCfg = new SpecificServiceHostCfg(); - hostCfg.setSpecServiceId(protocol.getSpecServiceId()); - hostList = specificServiceHostCfgDao.findSpecHostList(hostCfg); + group = specificServiceCfgDao.getConfigGroupInfoByGroupId(protocol.getGroupId()); //featuresTableList为空的时候,该service只有特定服务IP一个配置表 ServiceConfigInfo serviceCfg=serviceConfigInfoDao.findSysServiceConfigInfo(appCfg.getServiceId()); - for(SpecificServiceHostCfg host:hostList){ - SpecificServiceCfg specServiceCfg = specificServiceCfgDao.getBySpecServiceId(host.getSpecServiceId()); - host.setProtocolId(0); - host.setGroupId(specServiceCfg.getGroupId()); - if(StringUtil.isEmpty(serviceCfg)){ - host.setMaatTable("DF_PROTOCOL_APP"); + if(group==null){ + throw new RuntimeException("配置审核失败,未获取社交应用服务器IP所属分组信息"); + }else{ + if(group.getIsIssued()==0){ + //如果分组信息尚未下发,则下发IP + group.setGroupId(protocol.getGroupId()); + group.setIsIssued(1); + SpecificServiceHostCfg hostCfg = new SpecificServiceHostCfg(); + hostCfg.setSpecServiceId(protocol.getSpecServiceId()); + hostList = specificServiceHostCfgDao.findSpecHostList(hostCfg); + + for(SpecificServiceHostCfg host:hostList){ + SpecificServiceCfg specServiceCfg = specificServiceCfgDao.getBySpecServiceId(host.getSpecServiceId()); + host.setProtocolId(0); + host.setGroupId(specServiceCfg.getGroupId()); + if(StringUtil.isEmpty(serviceCfg)){ + host.setMaatTable("DF_PROTOCOL_APP"); + }else{ + host.setMaatTable(serviceCfg.getMaatTable()); + } + } }else{ - host.setMaatTable(serviceCfg.getMaatTable()); + SpecificServiceHostCfg host = new SpecificServiceHostCfg(); + host.setGroupId(protocol.getGroupId()); + hostList.add(host); } - - group.setGroupId(specServiceCfg.getGroupId()); - group.setIsIssued(1); } + + //生效区域列表信息 if(appCfg.getIsAreaEffective()==1){ if(StringUtil.isEmpty(appCfg.getAreaEffectiveIds())){