diff --git a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java index 5d849ba57..e8f263ab3 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java @@ -641,7 +641,6 @@ public class CheckIpFormatThread implements Callable{ baseIpCfg.setSrcPort("0"); baseIpCfg.setPortPattern(1); } - baseIpCfg.setDestPort(baseIpCfg.getSrcPort().trim()); } else { if (baseIpCfg.getSrcPort().indexOf("/") > -1) { baseIpCfg.setPortPattern(2); @@ -649,9 +648,8 @@ public class CheckIpFormatThread implements Callable{ baseIpCfg.setPortPattern(1); } baseIpCfg.setSrcPort(baseIpCfg.getSrcPort().trim()); - baseIpCfg.setDestPort(baseIpCfg.getDestPort().trim()); - } + baseIpCfg.setDestPort(baseIpCfg.getDestPort().trim()); } // TODO 判断源端口和目的端口格式 // TODO 判断源和目的端口的值 diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index f4902b221..455a5d675 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -1636,9 +1636,9 @@ public abstract class BaseService { }else if("AsnIpCfg".equals(type)) { List listPage = (List) list; this.saveAsnIpBatch(listPage); - }else if("AppComplexFeature".equals(type)) { + }else if("AppComplexFeature".equals(type)) {// APP Payload List listPage = (List) list; - this.saveAppComplexFeatureBatch(listPage); + this.saveAppComplexFeatureBatch(regionDict,serviceDict,listPage,send); }else if("BaseStringCfg".equals(type)) { List> listPage = (List>) list; // 调用对应配置的service @@ -1823,27 +1823,68 @@ public abstract class BaseService { /** * APP Payload导入配置时数据批量入库 + * @param serviceDict + * @param regionDict * @param data + * @param send */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void saveAppComplexFeatureBatch(List data) { - SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); - SqlSession batchSqlSession = null; - try{ - batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); - for(int index = 0; index < data.size();index++){ - AppComplexFeatureCfg cfg = data.get(index); - ((AppMultiFeatureCfgDao) batchSqlSession.getMapper(AppMultiFeatureCfgDao.class)).insertAppComplexFeatureCfgBatch(cfg); - } - batchSqlSession.commit(); - }finally { - if(batchSqlSession != null){ - batchSqlSession.close(); - } + public void saveAppComplexFeatureBatch(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List data, boolean send) { + if (regionDict != null) { + Integer regionType = regionDict.getRegionType(); + if (3 == regionType.intValue()) { + SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); + List configCompileList = new ArrayList(); + SqlSession batchSqlSession = null; + try{ + batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); + for(int index = 0; index < data.size();index++){ + AppComplexFeatureCfg cfg = data.get(index); + ((AppMultiFeatureCfgDao) batchSqlSession.getMapper(AppMultiFeatureCfgDao.class)).insertAppComplexFeatureCfgBatch(cfg); + if (send) { + if(regionDict.getIsMaat().intValue()==1) { + MaatCfg maatCfg=convertMaatCfg(cfg,3); + //userRegion处理 + if(regionDict.getFunctionId()==563) { + maatCfg.setUserRegion(Constants.APP_ID_REGION+"="+cfg.getAppCode()); + } + configCompileList.add(maatCfg); + } + } + + } + if (send && configCompileList.size() > 0) { + ToMaatBean maatBean = new ToMaatBean(); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(new Date()); + maatBean.setCreatorName(UserUtils.getUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + // 调用服务接口下发配置数据 + String json = BaseService.gsonToJson(maatBean); + if(configCompileList.size()>10) { + logger.info("APP Feature增强字符串配置下发配置条数:" + configCompileList.size()); + }else { + logger.info("APP Feature增强字符串配置下发配置参数:" + json); + } + // 调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("APP Feature增强字符串配置下发响应信息:" + result.getMsg()); + + } + batchSqlSession.commit(); + + }finally { + if(batchSqlSession != null){ + batchSqlSession.close(); + } + + } + } } - + } - + /** * 同一个app下的ip批量保存 * @param cfgs @@ -2211,6 +2252,8 @@ public abstract class BaseService { userRegion = Constants.REPLACE_ZONE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute; } maatCfg.setUserRegion(userRegion); + }else if(regionDict.getFunctionId()==563 || regionDict.getFunctionId()==565 || regionDict.getFunctionId()==566) {// APP Payload、HTTP、SSL Admin + maatCfg.setUserRegion(Constants.APP_ID_REGION+"="+_cfg.getAppCode()); } configCompileList.add(maatCfg); @@ -2417,6 +2460,8 @@ public abstract class BaseService { userRegion = Constants.REPLACE_ZONE_KEY+"="+cfg.getUserRegion1()+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute; } maatCfg.setUserRegion(userRegion); + }else if(regionDict.getFunctionId()==564 || regionDict.getFunctionId()==565 || regionDict.getFunctionId()==566) {// APP HTTP、DNS、SSL Admin + maatCfg.setUserRegion(Constants.APP_ID_REGION+"="+cfg.getAppCode()); } configCompileList.add(maatCfg); } diff --git a/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp b/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp index 862b67008..ccc773417 100644 --- a/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp +++ b/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp @@ -145,9 +145,8 @@ <%-- value="${log.searchFoundStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> - + value="${log.searchFoundStartTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setStartTime('#searchFoundStartTime','#searchFoundEndTime',1,'d','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -158,7 +157,7 @@ <%-- value="${log.searchFoundEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + value="${log.searchFoundEndTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setEndTime('#searchFoundStartTime','#searchFoundEndTime',1,'d','yyyy-MM-dd hh:mm:ss',false)"/>
diff --git a/src/main/webapp/WEB-INF/views/report/urlReportList.jsp b/src/main/webapp/WEB-INF/views/report/urlReportList.jsp index b2d7e9cd4..b419adc36 100644 --- a/src/main/webapp/WEB-INF/views/report/urlReportList.jsp +++ b/src/main/webapp/WEB-INF/views/report/urlReportList.jsp @@ -145,7 +145,7 @@ <%-- value="${log.searchReportStartTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + value="${log.searchReportStartTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setStartTime('#searchReportStartTime','#searchReportEndTime',1,'d','yyyy-MM-dd hh:mm:ss',false)"/>
@@ -156,7 +156,7 @@ <%-- value="${log.searchReportEndTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> --%> + value="${log.searchReportEndTime}" onclick="WdatePicker({onpicked:function(){this.onchange()},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{\'new Date()\'}'});" onchange="setEndTime('#searchReportStartTime','#searchReportEndTime',1,'d','yyyy-MM-dd hh:mm:ss',false)"/>