增加配置批量审核不通过和删除操作
除高级功能菜单下配置
This commit is contained in:
@@ -306,4 +306,107 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
|
||||
logger.warn("回调配置批量失效-下发耗时:end("+(end-start)+")");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置批量审核不通过
|
||||
* @param cfgList // 存放域配置类型 及 对应表名
|
||||
* @param page
|
||||
* @param entity // 保存要审核的状态类
|
||||
* @param list // 主配置表数据(在调用前查出)
|
||||
* @param hasData // 标识是否还有数据
|
||||
* @return
|
||||
*/
|
||||
public boolean batchUnApproveMaatData(List<Map<String, Object>> cfgList, Page page, BaseCfg entity,
|
||||
List<BaseCfg> list, boolean hasData) {
|
||||
|
||||
// 1.获取所有配置的编译ID
|
||||
List<Integer> compileIds = new ArrayList();
|
||||
for(BaseCfg cfg:list){
|
||||
compileIds.add(cfg.getCompileId());
|
||||
}
|
||||
|
||||
// 2.更新配置审核状态(主表)
|
||||
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); // 批量审核并修改配置审核状态(主表)
|
||||
}
|
||||
|
||||
// 3.更新域配置审核状态(子表)
|
||||
if(cfgList!=null){
|
||||
for(Map<String,Object> m:cfgList){
|
||||
String tableName = m.get("tableName").toString();
|
||||
commonPolicyDao.auditCfgBatch( tableName, entity,compileIds,null);
|
||||
}
|
||||
}
|
||||
|
||||
// 4.判断是否是当前检索条件下最后一页数据 并返回结果
|
||||
page.setList(list);
|
||||
if(page.isLastPage()){
|
||||
hasData = false;
|
||||
}
|
||||
return hasData;
|
||||
|
||||
}
|
||||
public boolean batchDeleteMaatData(List<Map<String, Object>> cfgList, Page page, BaseCfg entity,
|
||||
List<BaseCfg> list, boolean hasData) {
|
||||
// 1.获取所有配置的编译ID
|
||||
List<Integer> compileIds = new ArrayList();
|
||||
for(BaseCfg cfg:list){
|
||||
compileIds.add(cfg.getCompileId());
|
||||
}
|
||||
|
||||
// 2.更新配置状态(主表)
|
||||
if(!StringUtil.isEmpty(compileIds) && !StringUtil.isEmpty(entity.getTableName())) {
|
||||
commonPolicyDao.deleteCfgBatch(entity.getTableName(), entity,compileIds); // 批量修改配置状态(主表)
|
||||
}
|
||||
|
||||
// 3.更新域配置状态(子表)
|
||||
if(cfgList != null){
|
||||
for(Map<String,Object> m : cfgList){
|
||||
String tableName = m.get("tableName").toString();
|
||||
commonPolicyDao.deleteCfgBatch(tableName, entity, compileIds);
|
||||
}
|
||||
}
|
||||
|
||||
// 4.判断是否是当前检索条件下最后一页数据 并返回结果
|
||||
page.setList(list);
|
||||
if(page.isLastPage()){
|
||||
hasData = false;
|
||||
}
|
||||
return hasData;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user