From 420be8558fa21040adb4c5f33f8eba1f6143e659 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Tue, 3 Apr 2018 13:54:05 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A4=BE=E4=BA=A4=E5=BA=94=E7=94=A8=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8IP=E6=89=80=E5=B1=9E=E5=88=86=E7=BB=84?= =?UTF-8?q?=E9=9D=9E=E7=AC=AC=E4=B8=80=E6=AC=A1=E4=B8=8B=E5=8F=91=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=97=A0=E9=9C=80=E5=86=8D=E6=AC=A1=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E5=85=B7=E4=BD=93IP=E5=88=97=E8=A1=A8=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E4=B8=8B=E5=8F=91groupId=E4=B8=8EcompileId?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E5=8F=8A=E4=B8=9A=E5=8A=A1=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E5=8D=B3?= =?UTF-8?q?=E5=8F=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/configuration/AppCfgService.java | 42 ++++++++++++------- 1 file changed, 28 insertions(+), 14 deletions(-) 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())){