From 49fd0be72dedc3e6899049c1bce2088012e27e37 Mon Sep 17 00:00:00 2001 From: zhangwei Date: Mon, 9 Apr 2018 17:28:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A4=9A=E6=9D=A1=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E4=B8=8B=E5=8F=91maat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/configuration/AppCfgService.java | 72 ++++++++++--------- 1 file changed, 40 insertions(+), 32 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 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; + } + } /** * From da187d17a689293d51ae297e61789dfc9581fc7e Mon Sep 17 00:00:00 2001 From: chenjinsong Date: Mon, 9 Apr 2018 17:42:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=B1=BB=E5=9E=8B=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/systemService/list.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { - +