stream、DDOS和高级功能模块对某些用户的配置不经过审核直接生效及生效中的配置进行修改的功能

This commit is contained in:
shangguanyanfei
2019-04-19 17:20:32 +08:00
parent 5a5bdddba4
commit 865811b9b2
34 changed files with 729 additions and 189 deletions

View File

@@ -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<MaatCfg> 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);