协议-配置支持对某些用户的配置不经过审核直接生效的流程

This commit is contained in:
leijun
2019-04-16 14:34:05 +08:00
parent 36e990a247
commit bdcc2bb1b4
23 changed files with 572 additions and 158 deletions

View File

@@ -119,6 +119,10 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
public void saveFtpCfg(CfgIndexInfo entity){
//设置区域运营商信息
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
entity.setIsValid(0);
entity.setIsAudit(0);
if(entity.getCfgId()==null){
@@ -168,6 +172,11 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditFtpCfg(entity, isValid,Constants.INSERT_ACTION);
}
}else{
entity.setEditorId(entity.getCurrentUser().getId());
@@ -219,6 +228,11 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditFtpCfg(entity, isValid,Constants.UPDATE_ACTION);
}
}
}
public void updateFtpCfgValid(Integer isValid,String ids,Integer functionId){
@@ -266,9 +280,12 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
}
public void auditFtpCfg(CfgIndexInfo entity,Integer isAudit) throws MaatConvertException{
public void auditFtpCfg(CfgIndexInfo entity,Integer isAudit,Integer opAction) throws MaatConvertException{
//修改数据库审核状态信息
entity.setTableName(CfgIndexInfo.getTablename());
entity.setIsAudit(isAudit);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
fileTransferCfgDao.auditCfg(entity);
ToMaatBean maatBean = new ToMaatBean();
@@ -365,7 +382,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
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("ftp配置下发配置参数"+json);
@@ -741,6 +758,10 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
public void saveP2pCfg(CfgIndexInfo entity){
// 设置区域运营商信息
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
@@ -799,7 +820,11 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditP2pCfg(entity, isValid,Constants.INSERT_ACTION);
}
}else{
// 审核未通过状态的配置 修改后状态改为未审核
@@ -861,6 +886,12 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditP2pCfg(entity, isValid,Constants.UPDATE_ACTION);
}
}
}
@@ -915,9 +946,12 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
public void auditP2pCfg(CfgIndexInfo entity,Integer isAudit) throws MaatConvertException{
public void auditP2pCfg(CfgIndexInfo entity,Integer isAudit,Integer opAction) throws MaatConvertException{
//修改数据库审核状态信息
entity.setTableName(CfgIndexInfo.getTablename());
entity.setIsAudit(isAudit);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
fileTransferCfgDao.auditCfg(entity);
ToMaatBean maatBean = new ToMaatBean();
@@ -1048,7 +1082,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
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);