diff --git a/src/main/java/com/nis/web/controller/basics/AsnIpController.java b/src/main/java/com/nis/web/controller/basics/AsnIpController.java index f69626e38..15511776c 100644 --- a/src/main/java/com/nis/web/controller/basics/AsnIpController.java +++ b/src/main/java/com/nis/web/controller/basics/AsnIpController.java @@ -79,15 +79,19 @@ public class AsnIpController extends BaseController{ public String save(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){ try{ asnIpCfgService.saveAsnIpCfg(cfg); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - logger.error("信息保存失败",e); - e.printStackTrace(); - if(e instanceof MaatConvertException) { - addMessage(redirectAttributes,"error",e.getMessage()); + //配置仅保存 + if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); }else { - addMessage(redirectAttributes,"error","save_failed"); + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); } + } catch (MaatConvertException e) { + logger.error("ASN IP配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + logger.error("ASN IP配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } return "redirect:" + adminPath +"/basics/asn/list?functionId="+cfg.getFunctionId(); @@ -98,11 +102,19 @@ public class AsnIpController extends BaseController{ try{ asnIpCfgService.update(cfg); - addMessage(redirectAttributes,"success","save_success"); - }catch(Exception e){ - logger.error("信息保存失败",e); - e.printStackTrace(); - addMessage(redirectAttributes,"error","save_failed"); + //配置仅保存 + if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); + } + } catch (MaatConvertException e) { + logger.error("ASN IP配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + logger.error("ASN IP配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } return "redirect:" + adminPath +"/basics/asn/list?functionId="+cfg.getFunctionId(); diff --git a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java index 770b397c0..9f29268e3 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -219,15 +219,19 @@ public class AppCfgController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppPolicyCfg(entity); - addMessage(redirectAttributes, "success", "save_success"); - } catch (Exception e) { - logger.error("saveAppPolicyCfg failed", e); - e.printStackTrace(); - if (e instanceof MaatConvertException) { - addMessage(redirectAttributes, "error", "request_service_failed"); - } else { - addMessage(redirectAttributes, "error", "save_failed"); + //配置仅保存 + if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); } + } catch (MaatConvertException e) { + logger.error("app 协议配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + logger.error("app 协议配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } return "redirect:" + adminPath + "/app/policyCfgList?functionId=" + entity.getFunctionId(); @@ -255,12 +259,10 @@ public class AppCfgController extends BaseController { entity = appCfgService.getAppPolicyCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); - entity.setAuditorId(UserUtils.getUser().getId()); - entity.setAuditTime(new Date()); entity.setFunctionId(functionId); entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP); try { - appCfgService.auditAppPolicyCfg(entity, isAudit); + appCfgService.auditAppPolicyCfg(entity, isAudit,Constants.INSERT_ACTION); addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { e.printStackTrace(); @@ -394,15 +396,19 @@ public class AppCfgController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppIpCfg(entity); - addMessage(redirectAttributes, "success", "save_success"); - } catch (Exception e) { - e.printStackTrace(); - logger.error("saveAppIpCfg failed", e); - if (e instanceof MaatConvertException) { - addMessage(redirectAttributes, "error", "request_service_failed"); - } else { - addMessage(redirectAttributes, "error", "save_failed"); + //配置仅保存 + if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); } + }catch (MaatConvertException e) { + logger.error("APP IP配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + logger.error("APP IP配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } return "redirect:" + adminPath + "/app/ipCfgList?functionId=" + entity.getFunctionId(); @@ -432,10 +438,7 @@ public class AppCfgController extends BaseController { entity = appCfgService.getAppIpCfg(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); - entity.setAuditorId(UserUtils.getUser().getId()); - entity.setAuditTime(new Date()); entity.setFunctionId(functionId); - entity.setTableName(AppIpCfg.getTablename()); if (dataMap.containsKey(entity.getCompileId())) { dataMap.get(entity.getCompileId()).add(entity); } else { @@ -737,14 +740,19 @@ public class AppCfgController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppDomainCfg(entity); - addMessage(redirectAttributes, "success", "save_success"); - } catch (Exception e) { - e.printStackTrace(); - if (e instanceof MaatConvertException) { - addMessage(redirectAttributes, "error", "request_service_failed"); - } else { - addMessage(redirectAttributes, "error", "save_failed"); + //配置仅保存 + if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); } + } catch (MaatConvertException e) { + logger.error("APP域名配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + logger.error("APP域名配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } return "redirect:" + adminPath + "/app/domainCfgList?functionId=" + entity.getFunctionId(); @@ -772,11 +780,9 @@ public class AppCfgController extends BaseController { entity = appCfgService.getAppDomainCfg(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); - entity.setAuditorId(UserUtils.getUser().getId()); - entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - appCfgService.auditAppDomainCfg(entity, isAudit); + appCfgService.auditAppDomainCfg(entity, isAudit,Constants.INSERT_ACTION); addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { e.printStackTrace(); @@ -1507,18 +1513,19 @@ public class AppCfgController extends BaseController { entity.setCfgKeywords(entity.getCfgKeywords()); } appCfgService.saveOrUpdateAppTopicDomainCfg(entity); - addMessage(redirectAttributes, "success", "save_success"); - } catch (Exception e) { - if (e instanceof MaatConvertException) { - e.printStackTrace(); - logger.info("app主题网站配置下发失败:" + e.getMessage()); - ; - addMessage(redirectAttributes, "error", "request_service_failed"); - } else { - e.printStackTrace(); - logger.error("app主题网站配置下发失败", e); - addMessage(redirectAttributes, "error", "save_failed"); + //配置仅保存 + if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); } + } catch (MaatConvertException e) { + logger.error("APP主题网站配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + logger.error("APP主题网站配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } return "redirect:" + adminPath + "/app/topicDomainCfgList?functionId=" + entity.getFunctionId(); @@ -1546,11 +1553,9 @@ public class AppCfgController extends BaseController { entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); - entity.setAuditorId(UserUtils.getUser().getId()); - entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - appCfgService.auditAppTopicDomainCfg(entity, isAudit); + appCfgService.auditAppTopicDomainCfg(entity, isAudit,Constants.INSERT_ACTION); addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { logger.error("app主题网站配置下发失败", e); diff --git a/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java index 7531e8e14..bd7229327 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java @@ -142,14 +142,19 @@ public class AppFeatureCfgController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode()); } appMultiFeatureCfgService.saveOrUpdateAppFeatureCfg(entity); - addMessage(redirectAttributes, "success", "save_success"); - } catch (Exception e) { - e.printStackTrace(); - if (e instanceof MaatConvertException) { - addMessage(redirectAttributes, "error", "request_service_failed"); - } else { - addMessage(redirectAttributes, "error", "save_failed"); + //配置仅保存 + if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); } + } catch (MaatConvertException e) { + logger.error("APP 特征配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + logger.error("APP 特征配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + entity.getFunctionId(); @@ -176,11 +181,9 @@ public class AppFeatureCfgController extends BaseController { entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(id)); entity.setIsAudit(isAudit); entity.setIsValid(isValid); - entity.setAuditorId(UserUtils.getUser().getId()); - entity.setAuditTime(new Date()); entity.setFunctionId(functionId); try { - appMultiFeatureCfgService.auditAppFeatureCfg(entity, isAudit); + appMultiFeatureCfgService.auditAppFeatureCfg(entity, isAudit,Constants.INSERT_ACTION); addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { e.printStackTrace(); diff --git a/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java b/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java index 1c9f6df58..f71d2711a 100644 --- a/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java +++ b/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java @@ -158,18 +158,22 @@ public class BasicProtocolController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppPolicyCfg(entity); - addMessage(redirectAttributes, "success", "save_success"); - } catch (Exception e) { - e.printStackTrace(); - logger.error("基础协议信息保存失败", e); - if (e instanceof MaatConvertException) { - // addMessage(redirectAttributes,e.getMessage()); - addMessage(redirectAttributes, "error", "request_service_failed"); - } else if (e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes, "error", "call_external_procedures_failed"); - } else { - addMessage(redirectAttributes, "error", "save_failed"); + //配置仅保存 + if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); } + } catch (MaatConvertException e) { + logger.error("基础协议配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (CallExternalProceduresException e) { + logger.error("调用外部程序出错:",e); + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } catch (Exception e) { + logger.error("基础协议配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + entity.getFunctionId(); @@ -197,12 +201,10 @@ public class BasicProtocolController extends BaseController { entity = appCfgService.getAppPolicyCfg(Long.parseLong(id), null); entity.setIsAudit(isAudit); entity.setIsValid(isValid); - entity.setAuditorId(UserUtils.getUser().getId()); - entity.setAuditTime(new Date()); entity.setFunctionId(functionId); entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL); try { - appCfgService.auditAppPolicyCfg(entity, isAudit); + appCfgService.auditAppPolicyCfg(entity, isAudit,Constants.INSERT_ACTION); addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { if (e instanceof MaatConvertException) { diff --git a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java index cc29faeaa..a39221b38 100644 --- a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java +++ b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java @@ -178,17 +178,22 @@ public class EncryptedTunnelBehaviorController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppPolicyCfg(entity); - addMessage(redirectAttributes, "success", "save_success"); - } catch (Exception e) { - e.printStackTrace(); - logger.error("加密隧道信息保存失败", e); - if (e instanceof MaatConvertException) { - addMessage(redirectAttributes, "error", "request_service_failed"); - } else if (e instanceof CallExternalProceduresException) { - addMessage(redirectAttributes, "error", "call_external_procedures_failed"); - } else { - addMessage(redirectAttributes, "error", "save_failed"); + //配置仅保存 + if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); } + } catch (MaatConvertException e) { + logger.error("加密隧道行为配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (CallExternalProceduresException e) { + logger.error("调用外部程序出错:",e); + addMessage(redirectAttributes, "error", "call_external_procedures_failed"); + } catch (Exception e) { + logger.error("加密隧道行为配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + entity.getFunctionId(); @@ -221,7 +226,7 @@ public class EncryptedTunnelBehaviorController extends BaseController { entity.setFunctionId(functionId); entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR); try { - appCfgService.auditAppPolicyCfg(entity, isAudit); + appCfgService.auditAppPolicyCfg(entity, isAudit,Constants.INSERT_ACTION); addMessage(redirectAttributes, "success", "audit_success"); } catch (Exception e) { if (e instanceof MaatConvertException) { diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java index 8d1f00066..45eb2b2f7 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java @@ -98,15 +98,19 @@ public class DnsIpCfgController extends BaseController { @ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) { try { dnsIpCfgService.saveOrUpdate(cfg); - addMessage(redirectAttributes, "success", "save_success"); - } catch (Exception e) { - logger.error("信息保存失败", e); - e.printStackTrace(); - if (e instanceof MaatConvertException) { - addMessage(redirectAttributes, "error", "request_service_failed"); - } else { - addMessage(redirectAttributes, "error", "save_failed"); + //配置仅保存 + if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); } + } catch (MaatConvertException e) { + logger.error("DNS欺骗ip配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + logger.error("DNS欺骗ip配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + cfg.getFunctionId(); diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java index 2c368c953..50c9ab2fb 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java @@ -80,10 +80,18 @@ public class DnsResStrategyController extends BaseController { dnsResStrategyService.saveOrUpdate(cfg); - addMessage(redirectAttributes, "success", "save_success"); + //配置仅保存 + if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); + } } catch (MaatConvertException e) { + logger.error("DNS响应策略配置下发失败:",e); addMessage(redirectAttributes, "error", "request_service_failed"); } catch (Exception e) { + logger.error("DNS响应策略配置保存失败:",e); addMessage(redirectAttributes, "error", "save_failed"); } diff --git a/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java b/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java index 66c0e7462..3dd1dd5d4 100644 --- a/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java @@ -71,15 +71,19 @@ public class DdosCfgController extends BaseController { @ModelAttribute("cfg") DdosIpCfg cfg, RedirectAttributes redirectAttributes) { try { ddosCfgService.saveOrUpdate(cfg); - addMessage(redirectAttributes, "success", "save_success"); - } catch (Exception e) { - logger.error("信息保存失败", e); - e.printStackTrace(); - if (e instanceof MaatConvertException) { - addMessage(redirectAttributes, "error", "request_service_failed"); - } else { - addMessage(redirectAttributes, "error", "save_failed"); + //配置仅保存 + if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); } + } catch (MaatConvertException e) { + logger.error("DDOS配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (Exception e) { + logger.error("DDOS配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } return "redirect:" + adminPath + "/manipulation/ddos/list?functionId=" + cfg.getFunctionId(); @@ -120,7 +124,7 @@ public class DdosCfgController extends BaseController { Date auditTime = new Date(); for (String id : idArray) { try { - ddosCfgService.audit(isAudit, isValid, functionId, id, auditTime); + ddosCfgService.audit(isAudit, isValid, functionId, id, auditTime,Constants.INSERT_ACTION); addMessage(redirectAttributes, "success", "audit_success"); } catch (MaatConvertException e) { e.printStackTrace(); diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java b/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java index 879265dda..07f2fcbcc 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java @@ -238,20 +238,26 @@ public class PxyObjKeyringController extends BaseController { } } pxyObjKeyringService.saveOrUpdate(cfg); - addMessage(redirectAttributes, "success", "save_success"); + //配置仅保存 + if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); + } } + } catch (MultiPartNewException e) { + logger.error("证书文件上传失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); + } catch (MaatConvertException e) { + logger.error("拦截策略配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); } catch (Exception e) { - logger.error("证书上传失败", e); - if (e instanceof MaatConvertException) { - addMessage(redirectAttributes, "error", "request_service_failed"); - } else if (e instanceof MultiPartNewException) { - addMessage(redirectAttributes, "error", e.getMessage()); - } else { - addMessage(redirectAttributes, "error", "save_failed"); - } + logger.error("拦截策略配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } - + return "redirect:" + adminPath + "/proxy/intercept/strateagy/list?functionId=" + cfg.getFunctionId(); } @@ -641,18 +647,24 @@ public class PxyObjKeyringController extends BaseController { } } pxyObjKeyringService.trustedCertsaveOrUpdate(cfg); - addMessage(redirectAttributes, "success", "save_success"); + //配置仅保存 + if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) { + addMessage(redirectAttributes, "success", "save_success"); + }else { + //配置直接生效 + addMessage(redirectAttributes, "success", "audit_success"); + } } + } catch (MultiPartNewException e) { + logger.error("可信证书上传失败:",e); + addMessage(redirectAttributes, "error", e.getMessage()); + } catch (MaatConvertException e) { + logger.error("可信证书单配置下发失败:",e); + addMessage(redirectAttributes, "error", "request_service_failed"); } catch (Exception e) { - logger.error("证书上传失败", e); - if (e instanceof MultiPartNewException) { - addMessage(redirectAttributes, "error", e.getMessage()); - } else if (e instanceof MaatConvertException) { - addMessage(redirectAttributes, "error", "request_service_failed"); - } else { - addMessage(redirectAttributes, "error", "save_failed"); - } + logger.error("可信证书配置保存失败:",e); + addMessage(redirectAttributes, "error", "save_failed"); } return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + cfg.getFunctionId(); diff --git a/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml b/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml index 050f88518..7fd5af05e 100644 --- a/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/basics/AsnIpCfgDao.xml @@ -336,6 +336,9 @@ from asn_ip_cfg r where r.is_valid!=-1 and r.user_region1=#{asnId} + + SELECT LAST_INSERT_ID() + insert into asn_ip_cfg ( CFG_DESC, ACTION, diff --git a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml index ebc3570cd..bc3c12fcc 100644 --- a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml @@ -215,6 +215,9 @@ + + SELECT LAST_INSERT_ID() + insert into dns_ip_cfg ( CFG_DESC, ACTION, diff --git a/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml b/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml index cf3f9708c..9b9451376 100644 --- a/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml @@ -197,6 +197,9 @@ LEFT JOIN dns_res_strategy r ON a.dns_strategy_id=r.res_group_1_id order by r.cfg_Id + + SELECT LAST_INSERT_ID() + insert into dns_res_strategy ( CFG_DESC, ACTION, diff --git a/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml b/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml index 4fc39163f..e19d26e08 100644 --- a/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml @@ -359,6 +359,9 @@ + + SELECT LAST_INSERT_ID() + insert into pxy_obj_keyring ( CFG_ID, CFG_DESC, @@ -434,6 +437,9 @@ ) + + SELECT LAST_INSERT_ID() + insert into pxy_obj_trusted_ca_cert ( CFG_ID, CFG_DESC, diff --git a/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java b/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java index 4cf6f81ba..31cc6f60e 100644 --- a/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java +++ b/src/main/java/com/nis/web/service/basics/AsnIpCfgService.java @@ -34,6 +34,7 @@ import com.nis.domain.maat.ToMaatResult; import com.nis.domain.specific.ConfigGroupInfo; import com.nis.util.ConfigServiceUtil; import com.nis.util.Constants; +import com.nis.util.StringUtil; import com.nis.web.dao.CrudDao; import com.nis.web.dao.basics.AsnGroupInfoDao; import com.nis.web.dao.basics.AsnIpCfgDao; @@ -82,24 +83,31 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { public void save(List entitys) { logger.warn("Start to save IP,size:"+entitys.size()); long start=System.currentTimeMillis(); - SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); - SqlSession batchSqlSession = null; - try{ - batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); - for(AsnIpCfg asnIpCfg:entitys) { - ((AsnIpCfgDao) batchSqlSession.getMapper(AsnIpCfgDao.class)).insert(asnIpCfg); - } - batchSqlSession.commit(); - }finally { - if(batchSqlSession != null){ - batchSqlSession.close(); - } - } +// SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); +// SqlSession batchSqlSession = null; +// try{ +// batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); +// for(AsnIpCfg asnIpCfg:entitys) { +// ((AsnIpCfgDao) batchSqlSession.getMapper(AsnIpCfgDao.class)).insert(asnIpCfg); +// } +// batchSqlSession.commit(); + for(AsnIpCfg asnIpCfg:entitys) { + asnIpCfgDao.insert(asnIpCfg); + } +// }finally { +// if(batchSqlSession != null){ +// batchSqlSession.close(); +// } +// } long end=System.currentTimeMillis(); logger.warn("Save IP finish,cost:"+(end-start)); } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void update(AsnIpCfg entity){ + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } Date editTime=new Date(); entity.setEditTime(editTime); entity.setEditorId(entity.getCurrentUser().getId()); @@ -115,6 +123,22 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { entity.setDetail(detail); entity.setCompileId(groupInfo.getCompileId()); asnIpCfgDao.update(entity); + if(isValid==1) { + Map> asnIpMap=Maps.newHashMap(); + entity.setIsAudit(1); + entity.setIsValid(1); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + if(asnIpMap.containsKey(Long.parseLong(entity.getUserRegion1()))) { + asnIpMap.get(Long.parseLong(entity.getUserRegion1())).add(entity); + }else { + List _asnIps=Lists.newArrayList(); + _asnIps.add(entity); + asnIpMap.put(Long.parseLong(entity.getUserRegion1()), _asnIps); + } + + auditIpBatch(asnIpMap,entity.getIsAudit()); + } } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void processGroup(Map asnNoMap){ @@ -261,6 +285,10 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void saveAsnIpCfg(CfgIndexInfo entity) { + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } Date createTime=new Date(); //asn号 String userRegion1=entity.getUserRegion1(); @@ -308,6 +336,26 @@ public class AsnIpCfgService extends CrudService, AsnIpCfg> { } } this.save(entity.getAsnIpCfgs()); + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + + Map> asnIpMap=Maps.newHashMap(); + for(AsnIpCfg asnIpCfg:entity.getAsnIpCfgs()) { + asnIpCfg.setIsAudit(1); + asnIpCfg.setIsValid(1); + asnIpCfg.setAuditorId(UserUtils.getUser().getId()); + asnIpCfg.setAuditTime(new Date()); + if(asnIpMap.containsKey(Long.parseLong(asnIpCfg.getUserRegion1()))) { + asnIpMap.get(Long.parseLong(asnIpCfg.getUserRegion1())).add(asnIpCfg); + }else { + List _asnIps=Lists.newArrayList(); + _asnIps.add(asnIpCfg); + asnIpMap.put(Long.parseLong(asnIpCfg.getUserRegion1()), _asnIps); + } + } + auditIpBatch(asnIpMap,entity.getIsAudit()); + } } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void delete(String ids) { 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 fe2fb8faa..5018db3cd 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -248,7 +248,10 @@ public class AppCfgService extends BaseService { public void saveOrUpdateAppPolicyCfg(AppPolicyCfg entity) throws Exception { // 设置区域运营商信息 setAreaEffectiveIds(entity); - + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } if (entity.getCfgId() == null) { Integer compileId = 0; try { @@ -302,7 +305,20 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg); } } - + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + if(entity.getFunctionId() == 407){ + entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL); + } + if(entity.getFunctionId() == 63){ + entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP); + } + if(entity.getFunctionId() == 408){ + entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR); + } + auditAppPolicyCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION); + } } else { entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditTime(new Date()); @@ -356,6 +372,20 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + if(entity.getFunctionId() == 407){ + entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL); + } + if(entity.getFunctionId() == 63){ + entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP); + } + if(entity.getFunctionId() == 408){ + entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR); + } + auditAppPolicyCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION); + } } } @@ -363,7 +393,10 @@ public class AppCfgService extends BaseService { public void saveOrUpdateAppIpCfg(AppIpCfg entity) throws Exception { // 设置区域运营商信息 setAreaEffectiveIds(entity); - + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } if (entity.getCfgId() == null) { SpecificServiceCfg specificServiceCfg=specificServiceCfgDao.getBySpecServiceId(entity.getSpecServiceId()); @@ -433,6 +466,13 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + if(isValid==1) { + List entitys=new ArrayList(); + entity.setIsAudit(1); + entity.setIsValid(1); + entitys.add(entity); + auditAppIpCfg(entitys, entity.getIsAudit()); + } } else { entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditTime(new Date()); @@ -457,6 +497,16 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + if(isValid==1) { + List entitys=new ArrayList(); + entity.setIsAudit(1); + entity.setIsValid(1); + AppIpCfg entity2 = appCfgDao.getAppIpCfg(entity.getCfgId()); + entity2.setIsAudit(1); + entity2.setIsValid(1); + entitys.add(entity2); + auditAppIpCfg(entitys, entity.getIsAudit()); + } } } public void saveAppHttpCfg(List cfgs) { @@ -538,7 +588,10 @@ public class AppCfgService extends BaseService { public void saveOrUpdateAppDomainCfg(AppDomainCfg entity) throws Exception { // 设置区域运营商信息 setAreaEffectiveIds(entity); - + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } if (entity.getCfgId() == null) { Integer compileId = 0; try { @@ -565,6 +618,11 @@ public class AppCfgService extends BaseService { logger.info("获取编译ID出错"); throw new MaatConvertException(e.getMessage()); } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + auditAppDomainCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION); + } } else { entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditTime(new Date()); @@ -586,6 +644,11 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + auditAppDomainCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION); + } } } @@ -593,7 +656,10 @@ public class AppCfgService extends BaseService { public void saveOrUpdateAppTopicDomainCfg(AppTopicDomainCfg entity) throws Exception { // 设置区域运营商信息 setAreaEffectiveIds(entity); - + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } if (entity.getCfgId() == null) { Integer compileId = 0; try { @@ -620,6 +686,11 @@ public class AppCfgService extends BaseService { logger.info("获取编译ID出错"); throw new MaatConvertException(e.getMessage()); } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + auditAppTopicDomainCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION); + } } else { entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditTime(new Date()); @@ -641,6 +712,11 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + auditAppTopicDomainCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION); + } } } @@ -890,7 +966,10 @@ public class AppCfgService extends BaseService { } } - public void auditAppPolicyCfg(AppPolicyCfg entity, Integer isAudit) { + public void auditAppPolicyCfg(AppPolicyCfg entity, Integer isAudit,Integer opAction) { + entity.setIsAudit(isAudit); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); String configType = entity.getConfigType(); ToMaatBean maatBean = new ToMaatBean(); MaatCfg maatCfg = new MaatCfg(); @@ -1036,7 +1115,7 @@ public class AppCfgService extends BaseService { maatBean.setAuditTime(entity.getAuditTime()); maatBean.setCreatorName(entity.getCurrentUser().getName()); maatBean.setVersion(Constants.MAAT_VERSION); - maatBean.setOpAction(Constants.INSERT_ACTION); + maatBean.setOpAction(opAction); // 调用服务接口下发配置数据 String json = gsonToJson(maatBean); logger.info("app策略配置下发配置参数:" + json); @@ -1164,6 +1243,12 @@ public class AppCfgService extends BaseService { } } public void auditAppIpCfg(List entitys, Integer isAudit) { + for (AppIpCfg entity : entitys) { + entity.setTableName(AppIpCfg.getTablename()); + entity.setIsAudit(isAudit); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + } MaatCfg maatCfg = new MaatCfg(); List configCompileList = new ArrayList(); List groupRelationList = new ArrayList(); @@ -1380,7 +1465,10 @@ public class AppCfgService extends BaseService { } } - public void auditAppDomainCfg(AppDomainCfg entity, Integer isAudit) { + public void auditAppDomainCfg(AppDomainCfg entity, Integer isAudit,Integer opAction) { + entity.setIsAudit(isAudit); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); ToMaatBean maatBean = new ToMaatBean(); MaatCfg maatCfg = new MaatCfg(); List configCompileList = new ArrayList(); @@ -1441,7 +1529,7 @@ public class AppCfgService extends BaseService { maatBean.setAuditTime(entity.getAuditTime()); maatBean.setCreatorName(entity.getCurrentUser().getName()); maatBean.setVersion(Constants.MAAT_VERSION); - maatBean.setOpAction(Constants.INSERT_ACTION); + maatBean.setOpAction(opAction); // 调用服务接口下发配置数据 String json = gsonToJson(maatBean); logger.info("app域名配置下发配置参数:" + json); @@ -1469,7 +1557,10 @@ public class AppCfgService extends BaseService { } // app主题网站配置审核 - public void auditAppTopicDomainCfg(AppTopicDomainCfg entity, Integer isAudit) { + public void auditAppTopicDomainCfg(AppTopicDomainCfg entity, Integer isAudit,Integer opAction) { + entity.setIsAudit(isAudit); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); ToMaatBean maatBean = new ToMaatBean(); MaatCfg maatCfg = new MaatCfg(); List configCompileList = new ArrayList(); @@ -1536,7 +1627,7 @@ public class AppCfgService extends BaseService { maatBean.setAuditTime(entity.getAuditTime()); maatBean.setCreatorName(entity.getCurrentUser().getName()); maatBean.setVersion(Constants.MAAT_VERSION); - maatBean.setOpAction(Constants.INSERT_ACTION); + maatBean.setOpAction(opAction); // 调用服务接口下发配置数据 String json = gsonToJson(maatBean); logger.info("app主题网站配置下发配置参数:" + json); diff --git a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java index 3d1694ff6..61b330c5d 100644 --- a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java @@ -78,6 +78,10 @@ public class AppMultiFeatureCfgService extends BaseService { //新增或保存复杂特征配置 @Transactional(readOnly = false, rollbackFor = RuntimeException.class) public void saveOrUpdateAppFeatureCfg(AppFeatureIndex entity) throws Exception { + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } if (entity.getCfgId() == null) { Integer compileId = 0; try { @@ -166,6 +170,11 @@ public class AppMultiFeatureCfgService extends BaseService { logger.info("获取编译ID出错"); throw new MaatConvertException(e.getMessage()); } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + auditAppFeatureCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION); + } } else { entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditTime(new Date()); @@ -243,6 +252,11 @@ public class AppMultiFeatureCfgService extends BaseService { } } } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + auditAppFeatureCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION); + } } } @@ -286,7 +300,11 @@ public class AppMultiFeatureCfgService extends BaseService { cfg.setCfgKeywords(keyword); } - public void auditAppFeatureCfg(AppFeatureIndex entity, Integer isAudit) { + public void auditAppFeatureCfg(AppFeatureIndex entity, Integer isAudit,Integer opAction) { + entity.setIsAudit(isAudit); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + ToMaatBean maatBean = new ToMaatBean(); MaatCfg maatCfg = new MaatCfg(); List configCompileList = new ArrayList(); @@ -421,7 +439,7 @@ public class AppMultiFeatureCfgService extends BaseService { maatBean.setAuditTime(entity.getAuditTime()); maatBean.setCreatorName(entity.getCurrentUser().getName()); maatBean.setVersion(Constants.MAAT_VERSION); - maatBean.setOpAction(Constants.INSERT_ACTION); + maatBean.setOpAction(opAction); // 调用服务接口下发配置数据 String json = gsonToJson(maatBean); logger.info("app 特征配置下发配置参数:" + json); diff --git a/src/main/java/com/nis/web/service/configuration/DdosCfgService.java b/src/main/java/com/nis/web/service/configuration/DdosCfgService.java index 20e1f0736..6c6000e8e 100644 --- a/src/main/java/com/nis/web/service/configuration/DdosCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/DdosCfgService.java @@ -71,10 +71,14 @@ public class DdosCfgService extends BaseService{ return ddosCfgDao.getDdosIpCfg(cfgId,compileId); } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void saveOrUpdate(DdosIpCfg entity){ + public void saveOrUpdate(DdosIpCfg entity) throws Exception{ Date createTime=new Date(); //设置区域运营商信息 setAreaEffectiveIds(entity); + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } String antiddosProtocol = entity.getAntiddosProtocol(); Long bpsThreadshold = entity.getBpsThreadshold(); Long ppsThreadshold = entity.getPpsThreadshold(); @@ -116,7 +120,11 @@ public class DdosCfgService extends BaseService{ }else { throw new RuntimeException("Could not get compileId!"); } - + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + audit(entity.getIsAudit(), isValid, entity.getFunctionId(),String.valueOf(entity.getCfgId()), new Date(),Constants.INSERT_ACTION); + } //修改 }else{ Date editTime=new Date(); @@ -126,6 +134,11 @@ public class DdosCfgService extends BaseService{ entity.setEditTime(editTime); ddosCfgDao.update(entity); + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + audit(entity.getIsAudit(), isValid, entity.getFunctionId(),String.valueOf(entity.getCfgId()), new Date(),Constants.UPDATE_ACTION); + } } } @@ -228,7 +241,7 @@ public class DdosCfgService extends BaseService{ }*/ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime) throws Exception{ + public void audit(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime,Integer opAction) throws Exception{ DdosIpCfg entity = new DdosIpCfg(); entity=ddosCfgDao.getDdosIpCfg(Long.valueOf(id),entity.getCompileId()); @@ -308,7 +321,7 @@ public class DdosCfgService extends BaseService{ maatBean.setAuditTime(auditTime); maatBean.setCreatorName(entity.getCurrentUser().getName()); maatBean.setVersion(Constants.MAAT_VERSION); - maatBean.setOpAction(Constants.INSERT_ACTION); + maatBean.setOpAction(opAction); //调用服务接口下发配置数据 String json=gsonToJson(maatBean); logger.info("ddos 配置下发配置参数:"+json); diff --git a/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java b/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java index eb43010aa..b418a1ce3 100644 --- a/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java @@ -22,6 +22,7 @@ import com.nis.domain.maat.ToMaatResult; import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigServiceUtil; import com.nis.util.Constants; +import com.nis.util.StringUtil; import com.nis.web.dao.configuration.DnsIpCfgDao; import com.nis.web.security.UserUtils; import com.nis.web.service.BaseService; @@ -64,6 +65,10 @@ public class DnsIpCfgService extends BaseService{ Date createTime=new Date(); //设置区域运营商信息 setAreaEffectiveIds(entity); + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } //新增 if(entity.getCfgId()==null){ entity.setCreatorId(UserUtils.getUser().getId()); @@ -102,6 +107,11 @@ public class DnsIpCfgService extends BaseService{ entity.setEditTime(editTime); dnsIpCfgDao.update(entity); } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date()); + } } /** diff --git a/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java b/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java index 42756bfa0..13a01c3c1 100644 --- a/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java +++ b/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java @@ -19,6 +19,7 @@ import com.nis.domain.configuration.DnsResStrategy; import com.nis.domain.maat.ToMaatResult; import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigServiceUtil; +import com.nis.util.Constants; import com.nis.util.StringUtil; import com.nis.web.dao.configuration.DnsResStrategyDao; import com.nis.web.dao.configuration.StringCfgDao; @@ -86,6 +87,10 @@ public class DnsResStrategyService extends BaseService{ public void saveOrUpdate(DnsResStrategy entity){ Date createTime=new Date(); setAreaEffectiveIds(entity); + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } List list = new ArrayList(); if( entity.getCfgId()!=null && !"".equals(entity.getCfgId())){ list=dnsResStrategyDao.findList(entity.getCfgId(),null,null); @@ -112,6 +117,11 @@ public class DnsResStrategyService extends BaseService{ } } dnsResStrategyDao.insert(entity); + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date()); + } //修改 }else{ Date editTime=new Date(); @@ -121,6 +131,11 @@ public class DnsResStrategyService extends BaseService{ entity.setEditTime(editTime); dnsResStrategyDao.update(entity); + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date()); + } } } @@ -157,8 +172,8 @@ public class DnsResStrategyService extends BaseService{ cfg.setCfgId(Long.valueOf(id)); cfg.setIsValid(isValid); cfg.setIsAudit(isAudit); - cfg.setEditTime(auditTime); - cfg.setEditorId(UserUtils.getUser().getId()); +// cfg.setEditTime(auditTime); +// cfg.setEditorId(UserUtils.getUser().getId()); cfg.setAuditorId(UserUtils.getUser().getId()); cfg.setAuditTime(auditTime); dnsResStrategyDao.update(cfg); diff --git a/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java b/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java index 6f99c3755..90f070c77 100644 --- a/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java +++ b/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java @@ -20,6 +20,7 @@ import com.nis.domain.configuration.PxyObjTrustedCaCrl; import com.nis.domain.maat.ToMaatResult; import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigServiceUtil; +import com.nis.util.Constants; import com.nis.util.StringUtil; import com.nis.web.dao.basics.ServiceDictInfoDao; import com.nis.web.dao.configuration.PxyObjKeyringDao; @@ -100,6 +101,10 @@ public class PxyObjKeyringService extends BaseService{ public void saveOrUpdate(PxyObjKeyring entity){ Date createTime=new Date(); setAreaEffectiveIds(entity); + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } entity.setIsValid(0); entity.setIsAudit(0); //新增 @@ -128,11 +133,21 @@ public class PxyObjKeyringService extends BaseService{ pxyObjKeyringDao.update(entity); } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + audit( entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date()); + } + } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void trustedCertsaveOrUpdate(PxyObjTrustedCaCert entity){ + public void trustedCertsaveOrUpdate(PxyObjTrustedCaCert entity) throws InterruptedException{ Date createTime=new Date(); setAreaEffectiveIds(entity); + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } entity.setIsValid(0); entity.setIsAudit(0); //新增 @@ -162,11 +177,16 @@ public class PxyObjKeyringService extends BaseService{ //修改主表cert配置时,需要修改子表crl配置信息 PxyObjTrustedCaCrl crlCfg =new PxyObjTrustedCaCrl(); BeanUtils.copyProperties(entity, crlCfg, new String[]{"cfgId","serviceId","compileId","cfgType"}); - entity=pxyObjKeyringDao.getPxyObjTrustedCaCert(entity.getCfgId()); - crlCfg.setCertId(entity.getCompileId()); + PxyObjTrustedCaCert cert=pxyObjKeyringDao.getPxyObjTrustedCaCert(entity.getCfgId()); + crlCfg.setCertId(cert.getCompileId()); pxyObjKeyringDao.updatePxyObjTrustedCaCrl(crlCfg); } + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + trustedCertAudit(entity.getIsAudit(), isValid, entity.getFunctionId(), String.valueOf(entity.getCfgId()), new Date()); + } } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void trustedCrlsaveOrUpdate(PxyObjTrustedCaCrl entity){ @@ -320,8 +340,8 @@ public class PxyObjKeyringService extends BaseService{ cfg.setCfgId(Long.valueOf(id)); cfg.setIsValid(isValid); cfg.setIsAudit(isAudit); - cfg.setEditTime(auditTime); - cfg.setEditorId(UserUtils.getUser().getId()); +// cfg.setEditTime(auditTime); +// cfg.setEditorId(UserUtils.getUser().getId()); cfg.setAuditorId(UserUtils.getUser().getId()); cfg.setAuditTime(auditTime); pxyObjKeyringDao.update(cfg); @@ -402,8 +422,8 @@ public class PxyObjKeyringService extends BaseService{ cfg.setCfgId(Long.valueOf(id)); cfg.setIsValid(isValid); cfg.setIsAudit(isAudit); - cfg.setEditTime(auditTime); - cfg.setEditorId(UserUtils.getUser().getId()); +// cfg.setEditTime(auditTime); +// cfg.setEditorId(UserUtils.getUser().getId()); cfg.setAuditorId(UserUtils.getUser().getId()); cfg.setAuditTime(auditTime); //修改主表cert 配置状态 diff --git a/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp b/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp index 01bcab5e9..87c613952 100644 --- a/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp +++ b/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormAdd.jsp @@ -152,6 +152,8 @@ var reSort=function(obj,index){ + + @@ -429,7 +431,23 @@ var reSort=function(obj,index){
- + + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp b/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp index b9335a0e2..40e6c8a8c 100644 --- a/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp +++ b/src/main/webapp/WEB-INF/views/basics/asnIpCfgFormUpdate.jsp @@ -97,10 +97,17 @@ $(function(){ - - - - + + + + + + + + + + + @@ -377,7 +384,23 @@ $(function(){
- + + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp index 327b898aa..5ee8a39ba 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp @@ -66,6 +66,8 @@ $(function(){ + + @@ -378,7 +380,23 @@ $(function(){
- + + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp index 2908a8a28..f0bfb7ab4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp @@ -47,6 +47,8 @@ $(function(){ + + @@ -301,7 +303,23 @@ $(function(){
- + + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp index 5540a7022..bafd39f07 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appMultiFeatureCfgForm.jsp @@ -260,6 +260,8 @@ function changeKeywordFormate(exprType,obj){ + + @@ -554,9 +556,23 @@ function changeKeywordFormate(exprType,obj){
- + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp index c216110a8..f3527d75a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp @@ -223,6 +223,8 @@ var delContent = function(contentClassName, addBtnClassName) { + + @@ -492,7 +494,23 @@ var delContent = function(contentClassName, addBtnClassName) {
- + + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp index 888c217cf..251b250b3 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgForm.jsp @@ -163,6 +163,8 @@ $(function(){ + + <%-- --%> @@ -518,7 +520,23 @@ $(function(){
- + + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp index ce256091d..4fc2fd86f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp @@ -177,6 +177,8 @@ var switchRateLimitType=function(){ + + <%-- --%> <%-- --%> @@ -438,7 +440,23 @@ var switchRateLimitType=function(){
- + + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp index 3182630d6..84f24fb8b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp @@ -108,6 +108,8 @@ $(function(){ + + @@ -248,7 +250,23 @@ $(function(){
- + + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp index 6f3569f79..8ed87382d 100644 --- a/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/dnsIpCfgForm.jsp @@ -52,6 +52,8 @@ $(function(){ + + @@ -317,7 +319,23 @@ $(function(){
- + + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp index e82e9ed12..97bec1b07 100644 --- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp @@ -202,6 +202,8 @@ var switchRateLimitType=function(){ + + <%-- --%> <%-- --%> @@ -470,7 +472,23 @@ var switchRateLimitType=function(){
- + + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp index f196ad5cc..82e0f8752 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/form.jsp @@ -185,6 +185,8 @@ function privateFileValidate(){
+ + @@ -398,7 +400,23 @@ function privateFileValidate(){
- + + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/trustedCertForm.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/trustedCertForm.jsp index 3cebfb2ff..ab7d7bd0a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/trustedCertForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/strateagy/trustedCertForm.jsp @@ -93,6 +93,8 @@ function certFileValidate(){ + + @@ -214,7 +216,23 @@ function certFileValidate(){
- + + + + + + + + + + + + +
diff --git a/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp index 6624e839f..f953fb0e9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/maintenance/dnsResStrategy/form.jsp @@ -91,6 +91,8 @@ $(function(){ + + @@ -222,7 +224,23 @@ $(function(){
- + + + + + + + + + + + + +