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 fcdb0eed3..fba38a2b9 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -268,8 +268,12 @@ public class AppCfgService extends CrudService { */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public int auditAppCfg(String[] cfgIds,Integer auditState) throws Exception{ + List jsonList = new ArrayList(); + Gson gson=new GsonBuilder().disableHtmlEscaping() + .excludeFieldsWithoutExposeAnnotation() + .create(); + boolean sendFlag = false; for(String id:cfgIds){ - boolean sendFlag = false; AppIdCfg appCfg = appCfgDao.getById(Long.parseLong(id)); //给需要修改的配置字段赋值 @@ -293,12 +297,6 @@ public class AppCfgService extends CrudService { List hostList =new ArrayList(); List areaList = new ArrayList(); ConfigGroupInfo group = null; - - - Gson gson=new GsonBuilder().disableHtmlEscaping() - .excludeFieldsWithoutExposeAnnotation() - .create(); - //配置审核状态即将改变后的状态 if(Constants.AUDIT_NOT_YES==auditState|| Constants.AUDIT_YES==auditState){//审核通过,取消审核通过需要发到maat @@ -427,10 +425,18 @@ public class AppCfgService extends CrudService { maatCfg.setAttribute(appCfg.getAttribute()==null?"":appCfg.getAttribute()); maatCfg.setClassify(appCfg.getClassify()==null?"":appCfg.getClassify()); maatCfg.setLable(appCfg.getLable()==null?"":appCfg.getLable()); - String json=gson.toJson(maatCfg); - //下发maat -// new ConvertTool().saveAppConfig(json); - sendFlag = true; + jsonList.add(maatCfg); + + //修改appId配置审核下发状态 + appCfgDao.audit(appCfg); + //修改特定服务IP分组下发状态 + specificServiceCfgDao.updateConfigGroupInfobyGroupId(group); + //修改特征表配置审核下发状态 + for(AppFeaturesIndex cfg:featuresTableList){ + appCfgDao.auditFeaturesTable(cfg.getFeaturesTable(), cfg.getFeaturesCompileId(), appCfg.getIsValid(), + appCfg.getIsAudit(), appCfg.getAuditorId(), appCfg.getAuditTime()); + + } }else{//取消审核通过 AppMaatCfg maatCfg = new AppMaatCfg(); @@ -483,32 +489,34 @@ public class AppCfgService extends CrudService { maatCfg.setComplexStrCfg(complexList); } - String json=gson.toJson(maatCfg); - //下发maat -// new ConvertTool().saveAppConfig(json); - sendFlag = true; + jsonList.add(maatCfg); + + //修改appId配置审核下发状态 + appCfgDao.audit(appCfg); + //修改特定服务IP分组下发状态 + specificServiceCfgDao.updateConfigGroupInfobyGroupId(group); + //修改特征表配置审核下发状态 + for(AppFeaturesIndex cfg:featuresTableList){ + appCfgDao.auditFeaturesTable(cfg.getFeaturesTable(), cfg.getFeaturesCompileId(), appCfg.getIsValid(), + appCfg.getIsAudit(), appCfg.getAuditorId(), appCfg.getAuditTime()); + + } } - }else{ - sendFlag = true; } - if(sendFlag){ - //修改appId配置审核下发状态 - appCfgDao.audit(appCfg); - //修改特定服务IP分组下发状态 - specificServiceCfgDao.updateConfigGroupInfobyGroupId(group); - //修改特征表配置审核下发状态 - for(AppFeaturesIndex cfg:featuresTableList){ - appCfgDao.auditFeaturesTable(cfg.getFeaturesTable(), cfg.getFeaturesCompileId(), appCfg.getIsValid(), - appCfg.getIsAudit(), appCfg.getAuditorId(), appCfg.getAuditTime()); - - } - }else{ - return 0; - } + } - return 1; + String json=gson.toJson(jsonList); + //下发maat +// new ConvertTool().saveConfig(json); + sendFlag = true; + if(sendFlag){ + return 1; + }else{ + return 0; + } + } /** * diff --git a/src/main/webapp/WEB-INF/views/systemService/list.jsp b/src/main/webapp/WEB-INF/views/systemService/list.jsp index bd3ea3a80..95cc19aed 100644 --- a/src/main/webapp/WEB-INF/views/systemService/list.jsp +++ b/src/main/webapp/WEB-INF/views/systemService/list.jsp @@ -69,7 +69,7 @@ function checkNum(obj) { - +