增加高级功能菜单下的配置审核不通过、删除功能.
This commit is contained in:
@@ -3136,7 +3136,7 @@ public class BaseController {
|
|||||||
}else{
|
}else{
|
||||||
//400 ASN IP
|
//400 ASN IP
|
||||||
if(auditBatchCfg.getServiceId().equals(400)) {
|
if(auditBatchCfg.getServiceId().equals(400)) {
|
||||||
if(auditBatchCfg.getIsValid() == 1) {
|
if(auditBatchCfg.getIsAudit() == 1) {
|
||||||
boolean hasData = true;
|
boolean hasData = true;
|
||||||
//批量生效[按每组每批次下发一次]
|
//批量生效[按每组每批次下发一次]
|
||||||
AsnGroupInfo groupInfo=new AsnGroupInfo();
|
AsnGroupInfo groupInfo=new AsnGroupInfo();
|
||||||
@@ -3178,6 +3178,15 @@ public class BaseController {
|
|||||||
List<AsnIpCfg> list=asnIpCfgService.findPage(page, searchAsnIpCfg).getList();
|
List<AsnIpCfg> list=asnIpCfgService.findPage(page, searchAsnIpCfg).getList();
|
||||||
|
|
||||||
if(!StringUtil.isEmpty(list)){
|
if(!StringUtil.isEmpty(list)){
|
||||||
|
if(auditBatchCfg.getIsAudit() == 2) {
|
||||||
|
List<BaseCfg> BaseCfgList=new ArrayList<>();
|
||||||
|
for (AsnIpCfg cfg : list) {
|
||||||
|
BaseCfg baseCfg=new BaseCfg();
|
||||||
|
BeanUtils.copyProperties(cfg, baseCfg);
|
||||||
|
BaseCfgList.add(baseCfg);
|
||||||
|
}
|
||||||
|
hasData = commonPolicyService.batchUnApproveMaatData(cfgList, page, auditBatchCfg, BaseCfgList, hasData);
|
||||||
|
}else {
|
||||||
Map<Integer,List> asnIpMap=new HashMap();
|
Map<Integer,List> asnIpMap=new HashMap();
|
||||||
if(!StringUtil.isEmpty(list)) {
|
if(!StringUtil.isEmpty(list)) {
|
||||||
for (AsnIpCfg obj : list) {
|
for (AsnIpCfg obj : list) {
|
||||||
@@ -3193,13 +3202,15 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
hasData=commonPolicyService.auditReuseConfigData(page, auditBatchCfg,asnIpMap,hasData);
|
hasData=commonPolicyService.auditReuseConfigData(page, auditBatchCfg,asnIpMap,hasData);
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
hasData = false;
|
hasData = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if(auditBatchCfg.getServiceId().equals(1028)) {
|
}else if(auditBatchCfg.getServiceId().equals(1028)) {
|
||||||
if(auditBatchCfg.getIsValid() == 1) {
|
if(auditBatchCfg.getIsAudit() == 1) {
|
||||||
boolean hasData = true;
|
boolean hasData = true;
|
||||||
//批量生效[按每组每批次下发一次]
|
//批量生效[按每组每批次下发一次]
|
||||||
ConfigGroupInfo groupInfo=new ConfigGroupInfo();
|
ConfigGroupInfo groupInfo=new ConfigGroupInfo();
|
||||||
@@ -3249,6 +3260,16 @@ public class BaseController {
|
|||||||
List<AppIpCfg> list=appCfgService.findAppIpList(page, searchAppIpCfg).getList();
|
List<AppIpCfg> list=appCfgService.findAppIpList(page, searchAppIpCfg).getList();
|
||||||
|
|
||||||
if(!StringUtil.isEmpty(list)){
|
if(!StringUtil.isEmpty(list)){
|
||||||
|
if(auditBatchCfg.getIsAudit() == 2) { // 配置批量审核不通过
|
||||||
|
List<BaseCfg> BaseCfgList=new ArrayList<>();
|
||||||
|
for (AppIpCfg cfg : list) {
|
||||||
|
BaseCfg baseCfg=new BaseCfg();
|
||||||
|
BeanUtils.copyProperties(cfg, baseCfg);
|
||||||
|
BaseCfgList.add(baseCfg);
|
||||||
|
}
|
||||||
|
hasData = commonPolicyService.batchUnApproveMaatData(cfgList, page, auditBatchCfg, BaseCfgList, hasData);
|
||||||
|
|
||||||
|
}else {
|
||||||
Map<Integer,List> appIpMap=new HashMap();
|
Map<Integer,List> appIpMap=new HashMap();
|
||||||
if(!StringUtil.isEmpty(list)) {
|
if(!StringUtil.isEmpty(list)) {
|
||||||
for (AppIpCfg obj : list) {
|
for (AppIpCfg obj : list) {
|
||||||
@@ -3264,6 +3285,7 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
hasData=commonPolicyService.auditReuseConfigData(page, auditBatchCfg,appIpMap,hasData);
|
hasData=commonPolicyService.auditReuseConfigData(page, auditBatchCfg,appIpMap,hasData);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
hasData = false;
|
hasData = false;
|
||||||
}
|
}
|
||||||
@@ -3296,7 +3318,7 @@ public class BaseController {
|
|||||||
list=appCfgService.findAppHttpList(page, searchAppHttpCfg).getList();
|
list=appCfgService.findAppHttpList(page, searchAppHttpCfg).getList();
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmpty(list)){
|
if(!StringUtil.isEmpty(list)){
|
||||||
if(auditBatchCfg.getIsValid().equals(1)) {
|
if(auditBatchCfg.getIsAudit().equals(1)) {
|
||||||
hasData=configSynchronizationService.auditSingleMaatData(cfgType,userRegionList,
|
hasData=configSynchronizationService.auditSingleMaatData(cfgType,userRegionList,
|
||||||
page,auditBatchCfg,list,hasData,true);
|
page,auditBatchCfg,list,hasData,true);
|
||||||
}else {
|
}else {
|
||||||
@@ -3307,8 +3329,12 @@ public class BaseController {
|
|||||||
newList.add(cfg);
|
newList.add(cfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(auditBatchCfg.getIsAudit().equals(2)) { // 配置批量审核不通过
|
||||||
|
hasData = commonPolicyService.batchUnApproveMaatData(cfgList, page, auditBatchCfg, newList, hasData);
|
||||||
|
}else {
|
||||||
hasData=commonPolicyService.auditNtcMaatData(cfgList, page, auditBatchCfg,newList, hasData);
|
hasData=commonPolicyService.auditNtcMaatData(cfgList, page, auditBatchCfg,newList, hasData);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
hasData = false;
|
hasData = false;
|
||||||
}
|
}
|
||||||
@@ -3372,6 +3398,19 @@ public class BaseController {
|
|||||||
AvFileSampleCfg searchFileSampleCfg=new AvFileSampleCfg();
|
AvFileSampleCfg searchFileSampleCfg=new AvFileSampleCfg();
|
||||||
DdosIpCfg searchDdosIpCfg=new DdosIpCfg();
|
DdosIpCfg searchDdosIpCfg=new DdosIpCfg();
|
||||||
|
|
||||||
|
AppIpCfg searchAppIpCfg=new AppIpCfg();
|
||||||
|
AppHttpCfg searchAppHttpCfg=new AppHttpCfg();
|
||||||
|
AppDomainCfg searchAppDomainCfg=new AppDomainCfg();
|
||||||
|
AppTopicDomainCfg searchAppTopicCfg=new AppTopicDomainCfg();
|
||||||
|
AppSslCertCfg searchAppSslCertCfg=new AppSslCertCfg();
|
||||||
|
AppFeatureIndex searchAppFeatureIndex=new AppFeatureIndex();
|
||||||
|
|
||||||
|
DnsResStrategy searchDnsResStrategy=new DnsResStrategy();
|
||||||
|
DnsIpCfg searchDnsIpCfg=new DnsIpCfg();
|
||||||
|
PxyObjKeyring searchObjKeyringCfg=new PxyObjKeyring();
|
||||||
|
PxyObjTrustedCaCert searchTrustedCaCertCfg=new PxyObjTrustedCaCert();
|
||||||
|
AsnIpCfg searchAsnIpCfg=new AsnIpCfg();
|
||||||
|
|
||||||
// 传递检索条件
|
// 传递检索条件
|
||||||
if(entity != null && (entity instanceof CfgIndexInfo)) {
|
if(entity != null && (entity instanceof CfgIndexInfo)) {
|
||||||
BeanUtils.copyProperties(entity, searchCfg);
|
BeanUtils.copyProperties(entity, searchCfg);
|
||||||
@@ -3403,6 +3442,78 @@ public class BaseController {
|
|||||||
searchDdosIpCfg.setIsAudit(0);
|
searchDdosIpCfg.setIsAudit(0);
|
||||||
searchDdosIpCfg.setFunctionId(functionId);
|
searchDdosIpCfg.setFunctionId(functionId);
|
||||||
}
|
}
|
||||||
|
if(entity != null && (entity instanceof AppHttpCfg)) {
|
||||||
|
BeanUtils.copyProperties(entity, searchAppHttpCfg);
|
||||||
|
searchAppHttpCfg.setIsValid(0);
|
||||||
|
searchAppHttpCfg.setIsAudit(0);
|
||||||
|
searchAppHttpCfg.setFunctionId(functionId);
|
||||||
|
}
|
||||||
|
if(entity != null && (entity instanceof AppHttpCfg)) {
|
||||||
|
BeanUtils.copyProperties(entity, searchAppHttpCfg);
|
||||||
|
searchAppHttpCfg.setIsValid(0);
|
||||||
|
searchAppHttpCfg.setIsAudit(0);
|
||||||
|
searchAppHttpCfg.setFunctionId(functionId);
|
||||||
|
}
|
||||||
|
if(entity != null && (entity instanceof AppDomainCfg)) {
|
||||||
|
BeanUtils.copyProperties(entity, searchAppDomainCfg);
|
||||||
|
searchAppDomainCfg.setIsValid(0);
|
||||||
|
searchAppDomainCfg.setIsAudit(0);
|
||||||
|
searchAppDomainCfg.setFunctionId(functionId);
|
||||||
|
}
|
||||||
|
if(entity != null && (entity instanceof AppTopicDomainCfg)) {
|
||||||
|
BeanUtils.copyProperties(entity, searchAppTopicCfg);
|
||||||
|
searchAppTopicCfg.setIsValid(0);
|
||||||
|
searchAppTopicCfg.setIsAudit(0);
|
||||||
|
searchAppTopicCfg.setFunctionId(functionId);
|
||||||
|
}
|
||||||
|
if(entity != null && (entity instanceof AppSslCertCfg)) {
|
||||||
|
BeanUtils.copyProperties(entity, searchAppSslCertCfg);
|
||||||
|
searchAppSslCertCfg.setIsValid(0);
|
||||||
|
searchAppSslCertCfg.setIsAudit(0);
|
||||||
|
searchAppSslCertCfg.setFunctionId(functionId);
|
||||||
|
}
|
||||||
|
if(entity != null && (entity instanceof AppIpCfg)) {
|
||||||
|
BeanUtils.copyProperties(entity, searchAppIpCfg);
|
||||||
|
searchAppIpCfg.setIsValid(0);
|
||||||
|
searchAppIpCfg.setIsAudit(0);
|
||||||
|
searchAppIpCfg.setFunctionId(functionId);
|
||||||
|
}
|
||||||
|
if(entity != null && (entity instanceof AppFeatureIndex)) {
|
||||||
|
BeanUtils.copyProperties(entity, searchAppFeatureIndex);
|
||||||
|
searchAppFeatureIndex.setIsValid(0);
|
||||||
|
searchAppFeatureIndex.setIsAudit(0);
|
||||||
|
searchAppFeatureIndex.setFunctionId(functionId);
|
||||||
|
}
|
||||||
|
if(entity != null && (entity instanceof DnsResStrategy)) {
|
||||||
|
BeanUtils.copyProperties(entity, searchDnsResStrategy);
|
||||||
|
searchDnsResStrategy.setIsValid(0);
|
||||||
|
searchDnsResStrategy.setIsAudit(0);
|
||||||
|
searchDnsResStrategy.setFunctionId(functionId);
|
||||||
|
}
|
||||||
|
if(entity != null && (entity instanceof DnsIpCfg)) {
|
||||||
|
BeanUtils.copyProperties(entity, searchDnsIpCfg);
|
||||||
|
searchDnsIpCfg.setIsValid(0);
|
||||||
|
searchDnsIpCfg.setIsAudit(0);
|
||||||
|
searchDnsIpCfg.setFunctionId(functionId);
|
||||||
|
}
|
||||||
|
if(entity != null && (entity instanceof PxyObjKeyring)) {
|
||||||
|
BeanUtils.copyProperties(entity, searchObjKeyringCfg);
|
||||||
|
searchObjKeyringCfg.setIsValid(0);
|
||||||
|
searchObjKeyringCfg.setIsAudit(0);
|
||||||
|
searchObjKeyringCfg.setFunctionId(functionId);
|
||||||
|
}
|
||||||
|
if(entity != null && (entity instanceof PxyObjTrustedCaCert)) {
|
||||||
|
BeanUtils.copyProperties(entity, searchTrustedCaCertCfg);
|
||||||
|
searchTrustedCaCertCfg.setIsValid(0);
|
||||||
|
searchTrustedCaCertCfg.setIsAudit(0);
|
||||||
|
searchTrustedCaCertCfg.setFunctionId(functionId);
|
||||||
|
}
|
||||||
|
if(entity != null && (entity instanceof AsnIpCfg)) {
|
||||||
|
BeanUtils.copyProperties(entity, searchAsnIpCfg);
|
||||||
|
searchAsnIpCfg.setIsValid(0);
|
||||||
|
searchAsnIpCfg.setIsAudit(0);
|
||||||
|
searchAsnIpCfg.setFunctionId(functionId);
|
||||||
|
}
|
||||||
|
|
||||||
BaseCfg batchCfg = new BaseCfg();
|
BaseCfg batchCfg = new BaseCfg();
|
||||||
batchCfg.setEditTime(new Date());
|
batchCfg.setEditTime(new Date());
|
||||||
@@ -3427,7 +3538,8 @@ public class BaseController {
|
|||||||
|
|
||||||
// 存放域配置类型 及 对应表名
|
// 存放域配置类型 及 对应表名
|
||||||
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
||||||
//if(!StringUtil.isEmpty(cfgList)) {
|
if(!StringUtil.isEmpty(cfgList)) {
|
||||||
|
/** -- 多域maat -- **/
|
||||||
if("cfg_index_info".equals(tableNameXml)){
|
if("cfg_index_info".equals(tableNameXml)){
|
||||||
boolean hasData = true;
|
boolean hasData = true;
|
||||||
while(hasData){
|
while(hasData){
|
||||||
@@ -3435,13 +3547,13 @@ public class BaseController {
|
|||||||
page.setLastPage(false);
|
page.setLastPage(false);
|
||||||
List<CfgIndexInfo> list = getDataList(page,searchCfg,null,null,null); // 通过serviceId获取主配置表数据
|
List<CfgIndexInfo> list = getDataList(page,searchCfg,null,null,null); // 通过serviceId获取主配置表数据
|
||||||
if(!StringUtil.isEmpty(list)){
|
if(!StringUtil.isEmpty(list)){
|
||||||
List<BaseCfg> BaseCfgList=new ArrayList<>();
|
List<BaseCfg> baseCfgList=new ArrayList<>();
|
||||||
for (CfgIndexInfo cfg : list) {
|
for (CfgIndexInfo cfg : list) {
|
||||||
BaseCfg baseCfg=new BaseCfg();
|
BaseCfg baseCfg=new BaseCfg();
|
||||||
BeanUtils.copyProperties(cfg, baseCfg);
|
BeanUtils.copyProperties(cfg, baseCfg);
|
||||||
BaseCfgList.add(baseCfg);
|
baseCfgList.add(baseCfg);
|
||||||
}
|
}
|
||||||
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, BaseCfgList, hasData);
|
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, baseCfgList, hasData);
|
||||||
}else{
|
}else{
|
||||||
hasData = false;
|
hasData = false;
|
||||||
}
|
}
|
||||||
@@ -3453,13 +3565,13 @@ public class BaseController {
|
|||||||
page.setLastPage(false);
|
page.setLastPage(false);
|
||||||
List<FileDigestCfg> list = getDataList(page,null,null,searchDigestCfg,null); // 通过serviceId获取主配置表数据
|
List<FileDigestCfg> list = getDataList(page,null,null,searchDigestCfg,null); // 通过serviceId获取主配置表数据
|
||||||
if(!StringUtil.isEmpty(list)){
|
if(!StringUtil.isEmpty(list)){
|
||||||
List<BaseCfg> BaseCfgList=new ArrayList<>();
|
List<BaseCfg> baseCfgList=new ArrayList<>();
|
||||||
for (FileDigestCfg cfg : list) {
|
for (FileDigestCfg cfg : list) {
|
||||||
BaseCfg baseCfg=new BaseCfg();
|
BaseCfg baseCfg=new BaseCfg();
|
||||||
BeanUtils.copyProperties(cfg, baseCfg);
|
BeanUtils.copyProperties(cfg, baseCfg);
|
||||||
BaseCfgList.add(baseCfg);
|
baseCfgList.add(baseCfg);
|
||||||
}
|
}
|
||||||
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, BaseCfgList, hasData);
|
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, baseCfgList, hasData);
|
||||||
}else{
|
}else{
|
||||||
hasData = false;
|
hasData = false;
|
||||||
}
|
}
|
||||||
@@ -3471,17 +3583,60 @@ public class BaseController {
|
|||||||
page.setLastPage(false);
|
page.setLastPage(false);
|
||||||
List<AppPolicyCfg> list = getDataList(page,null,searchAppCfg,null,null); // 通过serviceId获取主配置表数据
|
List<AppPolicyCfg> list = getDataList(page,null,searchAppCfg,null,null); // 通过serviceId获取主配置表数据
|
||||||
if(!StringUtil.isEmpty(list)){
|
if(!StringUtil.isEmpty(list)){
|
||||||
List<BaseCfg> BaseCfgList=new ArrayList<>();
|
List<BaseCfg> baseCfgList=new ArrayList<>();
|
||||||
for (AppPolicyCfg cfg : list) {
|
for (AppPolicyCfg cfg : list) {
|
||||||
BaseCfg baseCfg=new BaseCfg();
|
BaseCfg baseCfg=new BaseCfg();
|
||||||
BeanUtils.copyProperties(cfg, baseCfg);
|
BeanUtils.copyProperties(cfg, baseCfg);
|
||||||
BaseCfgList.add(baseCfg);
|
baseCfgList.add(baseCfg);
|
||||||
}
|
}
|
||||||
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, BaseCfgList, hasData);
|
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, baseCfgList, hasData);
|
||||||
}else{
|
}else{
|
||||||
hasData = false;
|
hasData = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else if("app_feature_index".equals(tableNameXml)) {
|
||||||
|
boolean hasData = true;
|
||||||
|
while(hasData){
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
List<AppFeatureIndex> list = getDataList(page,null,null,null,searchAppFeatureIndex); // 通过serviceId获取主配置表数据
|
||||||
|
if(!StringUtil.isEmpty(list)){
|
||||||
|
List<BaseCfg> baseCfgList=new ArrayList<>();
|
||||||
|
for (AppFeatureIndex cfg : list) {
|
||||||
|
BaseCfg baseCfg=new BaseCfg();
|
||||||
|
BeanUtils.copyProperties(cfg, baseCfg);
|
||||||
|
baseCfgList.add(baseCfg);
|
||||||
|
}
|
||||||
|
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, baseCfgList, hasData);
|
||||||
|
}else{
|
||||||
|
hasData = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
logger.info("未知业务");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
/** -- 单域maat -- **/
|
||||||
|
if("ddos_ip_cfg".equals(tableNameXml)) {
|
||||||
|
boolean hasData = true;
|
||||||
|
while(hasData){
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
List<DdosIpCfg> list=ddosCfgService.findPage(page, searchDdosIpCfg).getList();
|
||||||
|
if(!StringUtil.isEmpty(list)){
|
||||||
|
List<BaseCfg> baseCfgList=new ArrayList<>();
|
||||||
|
for (DdosIpCfg cfg : list) {
|
||||||
|
BaseCfg baseCfg=new BaseCfg();
|
||||||
|
BeanUtils.copyProperties(cfg, baseCfg);
|
||||||
|
baseCfgList.add(baseCfg);
|
||||||
|
}
|
||||||
|
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, baseCfgList, hasData);
|
||||||
|
}else{
|
||||||
|
hasData = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}else if("av_file_sample_cfg".equals(tableNameXml)) {
|
}else if("av_file_sample_cfg".equals(tableNameXml)) {
|
||||||
boolean hasData = true;
|
boolean hasData = true;
|
||||||
while(hasData){
|
while(hasData){
|
||||||
@@ -3495,31 +3650,123 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if("ddos_ip_cfg".equals(tableNameXml)) {
|
}else if("dns_res_strategy".equals(tableNameXml)) {
|
||||||
boolean hasData = true;
|
boolean hasData = true;
|
||||||
while(hasData){
|
while(hasData){
|
||||||
page.setPageNo(1);
|
page.setPageNo(1);
|
||||||
page.setLastPage(false);
|
page.setLastPage(false);
|
||||||
List<DdosIpCfg> list=ddosCfgService.findPage(page, searchDdosIpCfg).getList();
|
List<BaseCfg> list = dnsResStrategyService.findPage(page,searchDnsResStrategy).getList();
|
||||||
if(!StringUtil.isEmpty(list)){
|
if(!StringUtil.isEmpty(list)){
|
||||||
List<BaseCfg> BaseCfgList=new ArrayList<>();
|
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, list, hasData);
|
||||||
for (DdosIpCfg cfg : list) {
|
|
||||||
BaseCfg baseCfg=new BaseCfg();
|
|
||||||
BeanUtils.copyProperties(cfg, baseCfg);
|
|
||||||
BaseCfgList.add(baseCfg);
|
|
||||||
}
|
|
||||||
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, BaseCfgList, hasData);
|
|
||||||
}else{
|
}else{
|
||||||
hasData = false;
|
hasData = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if("app_feature_index".equals(tableNameXml)) {
|
}else if("dns_ip_cfg".equals(tableNameXml)) {
|
||||||
|
boolean hasData = true;
|
||||||
}else{
|
while(hasData){
|
||||||
logger.info("未知业务");
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
List<DnsIpCfg> list = dnsIpCfgService.findPage(page,searchDnsIpCfg).getList();
|
||||||
|
if(!StringUtil.isEmpty(list)){
|
||||||
|
List<BaseCfg> baseCfgList=new ArrayList<>();
|
||||||
|
for (DnsIpCfg cfg : list) {
|
||||||
|
BaseCfg baseCfg=new BaseCfg();
|
||||||
|
BeanUtils.copyProperties(cfg, baseCfg);
|
||||||
|
baseCfgList.add(baseCfg);
|
||||||
|
}
|
||||||
|
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, baseCfgList, hasData);
|
||||||
|
}else{
|
||||||
|
hasData = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if("pxy_obj_keyring".equals(tableNameXml)) {
|
||||||
|
boolean hasData = true;
|
||||||
|
while(hasData){
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
List<BaseCfg> list = pxyObjKeyringService.findPage(page,searchObjKeyringCfg).getList();
|
||||||
|
if(!StringUtil.isEmpty(list)){
|
||||||
|
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, list, hasData);
|
||||||
|
}else{
|
||||||
|
hasData = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if("pxy_obj_trusted_ca_cert".equals(tableNameXml)) {
|
||||||
|
boolean hasData = true;
|
||||||
|
while(hasData){
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
List<BaseCfg> list = pxyObjKeyringService.findTrustedCertPage(page,searchTrustedCaCertCfg).getList();
|
||||||
|
if(!StringUtil.isEmpty(list)){
|
||||||
|
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, list, hasData);
|
||||||
|
}else{
|
||||||
|
hasData = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else if("asn_ip_cfg".equals(tableNameXml)) { // ASN IP
|
||||||
|
boolean hasData = true;
|
||||||
|
while(hasData){
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
List<BaseCfg> list=asnIpCfgService.findPage(page, searchAsnIpCfg).getList();
|
||||||
|
if(!StringUtil.isEmpty(list)){
|
||||||
|
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, list, hasData);
|
||||||
|
}else{
|
||||||
|
hasData = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
boolean hasData = true;
|
||||||
|
while(hasData){
|
||||||
|
page.setPageNo(1);
|
||||||
|
page.setLastPage(false);
|
||||||
|
List list = Lists.newArrayList();
|
||||||
|
/*
|
||||||
|
1026 app_domain_cfg
|
||||||
|
1028 app_ip_cfg
|
||||||
|
1029 app_ssl_cert_cfg
|
||||||
|
1152 app_topic_domain_cfg
|
||||||
|
1024 app_http_cfg
|
||||||
|
1026 app_domain_cfg
|
||||||
|
*/
|
||||||
|
if(batchCfg.getServiceId().equals(1028)) {
|
||||||
|
list = appCfgService.findAppIpList(page, searchAppIpCfg).getList();
|
||||||
|
}
|
||||||
|
if(batchCfg.getServiceId().equals(1026)) {
|
||||||
|
list = appCfgService.findAppDomainList(page, searchAppDomainCfg).getList();
|
||||||
|
}
|
||||||
|
if(batchCfg.getServiceId().equals(1029)) {
|
||||||
|
list = appCfgService.findAppSslList(page, searchAppSslCertCfg).getList();
|
||||||
|
}
|
||||||
|
if(batchCfg.getServiceId().equals(1152)) {
|
||||||
|
list = appCfgService.findAppTopicDomainList(page, searchAppTopicCfg).getList();
|
||||||
|
}
|
||||||
|
if(batchCfg.getServiceId().equals(1024)) {
|
||||||
|
list = appCfgService.findAppHttpList(page, searchAppHttpCfg).getList();
|
||||||
|
}
|
||||||
|
if(!StringUtil.isEmpty(list)){
|
||||||
|
List<BaseCfg> baseCfgList = new ArrayList<>();
|
||||||
|
if(!StringUtil.isEmpty(list)) {
|
||||||
|
for (Object obj : list) {
|
||||||
|
BaseCfg cfg = (BaseCfg)obj;
|
||||||
|
baseCfgList.add(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hasData = commonPolicyService.batchDeleteMaatData(cfgList, page, batchCfg, baseCfgList, hasData);
|
||||||
|
}else{
|
||||||
|
hasData = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
long end=System.currentTimeMillis();
|
long end=System.currentTimeMillis();
|
||||||
|
|||||||
@@ -160,12 +160,17 @@ public class AsnIpController extends BaseController{
|
|||||||
}
|
}
|
||||||
@RequestMapping(value = {"/delete"})
|
@RequestMapping(value = {"/delete"})
|
||||||
@RequiresPermissions(value={"asn:ip:config"})
|
@RequiresPermissions(value={"asn:ip:config"})
|
||||||
public String delete(Integer isValid
|
public String delete(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
,String ids,Integer functionId
|
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")AsnIpCfg cfg){
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
try{
|
try{
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
asnIpCfgService.delete(ids);
|
asnIpCfgService.delete(ids);
|
||||||
addMessage(redirectAttributes,"success","delete_success");
|
addMessage(redirectAttributes,"success","delete_success");
|
||||||
|
}else {
|
||||||
|
// 批量删除
|
||||||
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
|
deleteAll(searchPage, functionId, cfg);
|
||||||
|
}
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("Delete failed",e);
|
logger.error("Delete failed",e);
|
||||||
if(e instanceof MaatConvertException) {
|
if(e instanceof MaatConvertException) {
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ public class AppCfgController extends BaseController {
|
|||||||
addMessage(redirectAttributes, "success", "delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
}else {
|
}else {
|
||||||
// 批量删除
|
// 批量删除
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "a");
|
||||||
deleteAll(searchPage, functionId, cfg);
|
deleteAll(searchPage, functionId, cfg);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -492,8 +492,26 @@ public class AppCfgController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "updateAppIpCfgValid" })
|
@RequestMapping(value = { "updateAppIpCfgValid" })
|
||||||
@RequiresPermissions(value = { "app:ip:config" })
|
@RequiresPermissions(value = { "app:ip:config" })
|
||||||
public String updateAppIpCfgValid(Integer isValid, String ids, Integer functionId) {
|
public String updateAppIpCfgValid(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
|
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")AppIpCfg cfg) {
|
||||||
|
try {
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
appCfgService.updateAppIpCfgValid(isValid, ids, functionId);
|
appCfgService.updateAppIpCfgValid(isValid, ids, functionId);
|
||||||
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
|
}else {
|
||||||
|
// 批量删除
|
||||||
|
Page<AppIpCfg> searchPage = new Page<AppIpCfg>(request, response, "a");
|
||||||
|
deleteAll(searchPage, functionId, cfg);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("配置删除失败:", e);
|
||||||
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return "redirect:" + adminPath + "/app/ipCfgList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/app/ipCfgList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -803,8 +821,26 @@ public class AppCfgController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "updateAppDomainCfgValid" })
|
@RequestMapping(value = { "updateAppDomainCfgValid" })
|
||||||
@RequiresPermissions(value = { "app:domain:config" })
|
@RequiresPermissions(value = { "app:domain:config" })
|
||||||
public String updateAppDomainCfgValid(Integer isValid, String ids, Integer functionId) {
|
public String updateAppDomainCfgValid(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
|
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")AppDomainCfg cfg) {
|
||||||
|
try {
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
appCfgService.updateAppDomainCfgValid(isValid, ids, functionId);
|
appCfgService.updateAppDomainCfgValid(isValid, ids, functionId);
|
||||||
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
|
}else {
|
||||||
|
// 批量删除
|
||||||
|
Page<AppDomainCfg> searchPage = new Page<AppDomainCfg>(request, response, "a");
|
||||||
|
deleteAll(searchPage, functionId, cfg);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("配置删除失败:", e);
|
||||||
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return "redirect:" + adminPath + "/app/domainCfgList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/app/domainCfgList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1558,20 +1594,24 @@ public class AppCfgController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "updateAppTopicDomainCfgValid" })
|
@RequestMapping(value = { "updateAppTopicDomainCfgValid" })
|
||||||
@RequiresPermissions(value = { "app:topic:config" })
|
@RequiresPermissions(value = { "app:topic:config" })
|
||||||
public String updateAppTopicDomainCfgValid(Integer isValid, String ids, Integer functionId,
|
public String updateAppTopicDomainCfgValid(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
RedirectAttributes redirectAttributes) {
|
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")AppTopicDomainCfg cfg) {
|
||||||
try {
|
try {
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
appCfgService.updateAppTopicDomainCfgValid(isValid, ids, functionId);
|
appCfgService.updateAppTopicDomainCfgValid(isValid, ids, functionId);
|
||||||
addMessage(redirectAttributes, "success", "delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
|
}else {
|
||||||
|
// 批量删除
|
||||||
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
|
deleteAll(searchPage, functionId, cfg);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("app主题网站删除失败", e);
|
logger.error("app主题网站删除失败", e);
|
||||||
if (e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
e.printStackTrace();
|
|
||||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
} else if (e instanceof CallExternalProceduresException) {
|
} else if (e instanceof CallExternalProceduresException) {
|
||||||
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||||
} else {
|
} else {
|
||||||
e.printStackTrace();
|
|
||||||
addMessage(redirectAttributes, "error", "delete_failed");
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,8 +225,26 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = { "updateAppFeatureCfgValid" })
|
@RequestMapping(value = { "updateAppFeatureCfgValid" })
|
||||||
public String updateAppFeatureCfgValid(Integer isValid, String ids, Integer functionId) {
|
public String updateAppFeatureCfgValid(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
|
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")AppFeatureIndex cfg) {
|
||||||
|
try {
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
appMultiFeatureCfgService.updateAppFeatureCfgValid(isValid, ids, functionId);
|
appMultiFeatureCfgService.updateAppFeatureCfgValid(isValid, ids, functionId);
|
||||||
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
|
}else {
|
||||||
|
// 批量删除
|
||||||
|
Page<AppFeatureIndex> searchPage = new Page<AppFeatureIndex>(request, response, "a");
|
||||||
|
deleteAll(searchPage, functionId, cfg);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("配置删除失败:", e);
|
||||||
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ public class BasicProtocolController extends BaseController {
|
|||||||
appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId);
|
appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId);
|
||||||
addMessage(redirectAttributes, "success", "delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
}else {
|
}else {
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "a");
|
||||||
deleteAll(searchPage, functionId, cfg);
|
deleteAll(searchPage, functionId, cfg);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
addMessage(redirectAttributes, "success", "delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
}else {
|
}else {
|
||||||
// 批量删除
|
// 批量删除
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "a");
|
||||||
deleteAll(searchPage, functionId, cfg);
|
deleteAll(searchPage, functionId, cfg);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -114,9 +114,26 @@ public class DnsIpCfgController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/delete" })
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
RedirectAttributes redirectAttributes) {
|
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")DnsIpCfg cfg) {
|
||||||
|
try {
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
dnsIpCfgService.delete(isAudit, isValid, ids, functionId);
|
dnsIpCfgService.delete(isAudit, isValid, ids, functionId);
|
||||||
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
|
}else {
|
||||||
|
// 批量删除
|
||||||
|
Page<DnsIpCfg> searchPage = new Page<DnsIpCfg>(request, response, "a");
|
||||||
|
deleteAll(searchPage, functionId, cfg);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("配置删除失败:", e);
|
||||||
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,12 +103,26 @@ public class DnsResStrategyController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/delete" })
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, @ModelAttribute("cfg")DnsResStrategy cfg,
|
||||||
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||||
|
try {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
dnsResStrategyService.delete(isAudit, isValid, ids, functionId);
|
dnsResStrategyService.delete(isAudit, isValid, ids, functionId);
|
||||||
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
|
}else {
|
||||||
|
// 批量删除
|
||||||
|
Page<DnsResStrategy> searchPage = new Page<DnsResStrategy>(request, response, "a");
|
||||||
|
deleteAll(searchPage, functionId, cfg);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("配置删除失败:", e);
|
||||||
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class DdosCfgController extends BaseController {
|
|||||||
addMessage(redirectAttributes, "success", "delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
}else {
|
}else {
|
||||||
// 批量删除
|
// 批量删除
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<DdosIpCfg> searchPage = new Page<DdosIpCfg>(request, response, "a");
|
||||||
deleteAll(searchPage, functionId, cfg);
|
deleteAll(searchPage, functionId, cfg);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ public class AvController extends BaseController {
|
|||||||
addMessage(redirectAttributes, "success", "delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
}else {
|
}else {
|
||||||
// 批量删除
|
// 批量删除
|
||||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
Page<AvFileSampleCfg> searchPage = new Page<AvFileSampleCfg>(request, response, "a");
|
||||||
deleteAll(searchPage, functionId, cfg);
|
deleteAll(searchPage, functionId, cfg);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -328,10 +328,25 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
|
|
||||||
@RequestMapping(value = { "/delete" })
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions(value = { "proxy:intercept:config" })
|
@RequiresPermissions(value = { "proxy:intercept:config" })
|
||||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, @ModelAttribute("cfg")PxyObjKeyring cfg,
|
||||||
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||||
|
try {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
pxyObjKeyringService.delete(isAudit, isValid, ids, functionId);
|
pxyObjKeyringService.delete(isAudit, isValid, ids, functionId);
|
||||||
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
|
}else {
|
||||||
|
// 批量删除
|
||||||
|
Page<PxyObjKeyring> searchPage = new Page<PxyObjKeyring>(request, response, "a");
|
||||||
|
deleteAll(searchPage, functionId, cfg);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("配置删除失败:", e);
|
||||||
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return "redirect:" + adminPath + "/proxy/intercept/strateagy/list?functionId=" + functionId;
|
return "redirect:" + adminPath + "/proxy/intercept/strateagy/list?functionId=" + functionId;
|
||||||
@@ -860,11 +875,25 @@ public class PxyObjKeyringController extends BaseController {
|
|||||||
@RequestMapping(value = { "/trustedCertDelete" })
|
@RequestMapping(value = { "/trustedCertDelete" })
|
||||||
@RequiresPermissions(value = { "proxy:trustedCert:config" })
|
@RequiresPermissions(value = { "proxy:trustedCert:config" })
|
||||||
public String trustedCertDelete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
public String trustedCertDelete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
||||||
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes, @ModelAttribute PxyObjTrustedCaCert cfg) {
|
||||||
|
try {
|
||||||
if (!StringUtil.isEmpty(ids)) {
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
pxyObjKeyringService.trustedCertDelete(isAudit, isValid, ids, functionId);
|
pxyObjKeyringService.trustedCertDelete(isAudit, isValid, ids, functionId);
|
||||||
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
|
}else {
|
||||||
|
// 批量删除
|
||||||
|
Page<PxyObjKeyring> searchPage = new Page<PxyObjKeyring>(request, response, "a");
|
||||||
|
deleteAll(searchPage, functionId, cfg);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("配置删除失败:", e);
|
||||||
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + functionId;
|
return "redirect:" + adminPath + "/proxy/intercept/strateagy/trustedCertList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1019,10 +1019,26 @@
|
|||||||
editor_id = #{entity.editorId,jdbcType=INTEGER},
|
editor_id = #{entity.editorId,jdbcType=INTEGER},
|
||||||
edit_time = #{entity.editTime,jdbcType=TIMESTAMP}
|
edit_time = #{entity.editTime,jdbcType=TIMESTAMP}
|
||||||
<where>
|
<where>
|
||||||
|
<choose>
|
||||||
|
<when test="tableName == 'app_ip_cfg'">
|
||||||
|
AND user_region1 IN
|
||||||
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
||||||
|
#{compileId}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
<when test="tableName == 'asn_ip_cfg'">
|
||||||
|
AND region_id IN
|
||||||
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
||||||
|
#{compileId}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
AND compile_id IN
|
AND compile_id IN
|
||||||
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
<foreach collection="compileIds" index="index" item="compileId" open="(" separator="," close=")">
|
||||||
#{compileId}
|
#{compileId}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|||||||
@@ -322,46 +322,17 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
|
|||||||
// 1.获取所有配置的编译ID
|
// 1.获取所有配置的编译ID
|
||||||
List<Integer> compileIds = new ArrayList();
|
List<Integer> compileIds = new ArrayList();
|
||||||
for(BaseCfg cfg:list){
|
for(BaseCfg cfg:list){
|
||||||
|
if(entity.getServiceId().equals(1028)) {
|
||||||
|
compileIds.add(Integer.parseInt(cfg.getUserRegion1()));
|
||||||
|
}else if(entity.getServiceId().equals(400)) {
|
||||||
|
compileIds.add(cfg.getRegionId());
|
||||||
|
}else {
|
||||||
compileIds.add(cfg.getCompileId());
|
compileIds.add(cfg.getCompileId());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 2.更新配置审核状态(主表)
|
// 2.更新配置审核状态(主表)
|
||||||
if(!StringUtil.isEmpty(compileIds) && !StringUtil.isEmpty(entity.getTableName())) {
|
if(!StringUtil.isEmpty(compileIds) && !StringUtil.isEmpty(entity.getTableName())) {
|
||||||
List auditHttpCompileIds= new ArrayList();
|
|
||||||
List deleteHttpCompileIds= new ArrayList();
|
|
||||||
|
|
||||||
// Protocol -> HTTP 请求/响应内容关键字单独处理 ------>
|
|
||||||
//http关键字配置失效,获取与其匹配的http url配置
|
|
||||||
if(entity.getServiceId().equals(152) || entity.getServiceId().equals(40)) {
|
|
||||||
List<CfgIndexInfo> httpUrlCfgs=commonPolicyDao.getHttpUrlCfgBySourceCompileId(compileIds);
|
|
||||||
if(!StringUtil.isEmpty(httpUrlCfgs)) {
|
|
||||||
for (CfgIndexInfo httpUrlCfg: httpUrlCfgs) {
|
|
||||||
//审核通过的
|
|
||||||
if(httpUrlCfg.getIsValid().equals(1) && httpUrlCfg.getIsAudit().equals(1)) {
|
|
||||||
auditHttpCompileIds.add(httpUrlCfg.getCompileId());
|
|
||||||
/*maatCfg = new MaatCfg();
|
|
||||||
maatCfg.setCompileId(httpUrlCfg.getCompileId());
|
|
||||||
maatCfg.setServiceId(httpUrlCfg.getServiceId());
|
|
||||||
maatCfg.setIsValid(0);//无效
|
|
||||||
configCompileList.add(maatCfg);*/
|
|
||||||
}
|
|
||||||
//未审核或者审核未通过的
|
|
||||||
if(httpUrlCfg.getIsValid().equals(0) && (httpUrlCfg.getIsAudit().equals(0) || httpUrlCfg.getIsAudit().equals(2))) {
|
|
||||||
deleteHttpCompileIds.add(httpUrlCfg.getCompileId());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!StringUtil.isEmpty(auditHttpCompileIds)) {
|
|
||||||
commonPolicyDao.auditCfgBatch("cfg_index_info", entity,auditHttpCompileIds,null);
|
|
||||||
commonPolicyDao.auditCfgBatch("http_url_cfg", entity,auditHttpCompileIds,null);
|
|
||||||
}
|
|
||||||
if(!StringUtil.isEmpty(deleteHttpCompileIds)) {
|
|
||||||
commonPolicyDao.deleteHttpUrlCfg("cfg_index_info", entity,deleteHttpCompileIds);
|
|
||||||
commonPolicyDao.deleteHttpUrlCfg("http_url_cfg", entity,deleteHttpCompileIds);
|
|
||||||
}
|
|
||||||
// Protocol -> HTTP 请求/响应内容关键字单独处理 ------>
|
|
||||||
|
|
||||||
commonPolicyDao.auditCfgBatch( entity.getTableName(), entity,compileIds,null); // 批量审核并修改配置审核状态(主表)
|
commonPolicyDao.auditCfgBatch( entity.getTableName(), entity,compileIds,null); // 批量审核并修改配置审核状态(主表)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,8 +357,14 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
|
|||||||
// 1.获取所有配置的编译ID
|
// 1.获取所有配置的编译ID
|
||||||
List<Integer> compileIds = new ArrayList();
|
List<Integer> compileIds = new ArrayList();
|
||||||
for(BaseCfg cfg:list){
|
for(BaseCfg cfg:list){
|
||||||
|
if(entity.getServiceId().equals(1028)) {
|
||||||
|
compileIds.add(Integer.parseInt(cfg.getUserRegion1()));
|
||||||
|
}else if(entity.getServiceId().equals(400)) {
|
||||||
|
compileIds.add(cfg.getRegionId());
|
||||||
|
}else {
|
||||||
compileIds.add(cfg.getCompileId());
|
compileIds.add(cfg.getCompileId());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 2.更新配置状态(主表)
|
// 2.更新配置状态(主表)
|
||||||
if(!StringUtil.isEmpty(compileIds) && !StringUtil.isEmpty(entity.getTableName())) {
|
if(!StringUtil.isEmpty(compileIds) && !StringUtil.isEmpty(entity.getTableName())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user