多媒体中目录下的特殊用户修改或保存配置直接下发

This commit is contained in:
zhanghongqing
2019-04-17 14:20:19 +08:00
parent cc8cb48da1
commit 1cf9594bd2
7 changed files with 136 additions and 24 deletions

View File

@@ -87,6 +87,13 @@ public class AvCfgService extends BaseService{
public void saveOrUpdateAvFileSample(AvFileSampleCfg entity,MultipartFile srcFile){
//设置区域运营商信息
setAreaEffectiveIds(entity);
int isAudit=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isAudit=1;
}
entity.setIsValid(0);
entity.setIsAudit(0);
if(entity.getCfgId()==null){
entity.setCreatorId(UserUtils.getUser().getId());
entity.setCreateTime(new Date());
@@ -117,6 +124,11 @@ public class AvCfgService extends BaseService{
}else{
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}
if(isAudit==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditAvFileSample(entity, isAudit);
}
}else{
AvFileSampleCfg oldEntity = this.getAvFileSampleById(entity.getCfgId(),entity.getCompileId());
entity.setEditorId(UserUtils.getUser().getId());
@@ -133,6 +145,17 @@ public class AvCfgService extends BaseService{
}
avCfgDao.updateAvFileSample(entity);
if(isAudit==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
if(StringUtil.isEmpty(entity.getSamplePath())){ // 没有更换上传文件使用旧的
entity.setSrcUrl(oldEntity.getSrcUrl());
entity.setSampleUrl(oldEntity.getSampleUrl());
entity.setSampleMd5(oldEntity.getSampleMd5());
entity.setSrcMd5(oldEntity.getSrcMd5());
}
auditAvFileSample(entity, isAudit);
}
}
}
/**
@@ -340,6 +363,8 @@ public class AvCfgService extends BaseService{
}
public void auditAvFileSample(AvFileSampleCfg entity,Integer isAudit) throws MaatConvertException{
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
//修改数据库审核状态信息
avCfgDao.auditAvFileSample(entity);
List<AvFileSampleCfg> list = new ArrayList<AvFileSampleCfg>();
@@ -383,6 +408,7 @@ public class AvCfgService extends BaseService{
public void audioAuditAvSignSample(AvSignSampleCfg entity,Integer isAudit,boolean init) throws MaatConvertException{
entity.setAuditTime(new Date());
entity.setAuditorId(UserUtils.getUser().getId());
avCfgDao.auditAvSignSample(entity);
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
if(isAudit==1){
@@ -457,9 +483,21 @@ public class AvCfgService extends BaseService{
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
entity.setEditTime(new Date());
entity.setDescription("0");
int isAudit=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isAudit=1;
}
entity.setIsValid(0);
entity.setIsAudit(0);
list.add(entity);
try {
avCfgDao.updateAvSignSampleValid(entity);
if(isAudit==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
audioAuditAvSignSample(entity, isAudit,false);
}
} catch (Exception e) {
e.printStackTrace();
}

View File

@@ -438,6 +438,10 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
//设置区域运营商信息
setAreaEffectiveIds(entity);
int isValid=0;
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
isValid=1;
}
entity.setIsValid(0);
entity.setIsAudit(0);
@@ -481,7 +485,11 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
}
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditFileDigestCfg(entity.getIsAudit(), isValid,entity.getFunctionId(),entity.getCfgId()+"",Constants.INSERT_ACTION);
}
}else{
if(!StringUtil.isEmpty(entity.getCfdsLevel()) && entity.getCfdsLevel() > 0) {
@@ -545,7 +553,11 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
areaIpCfgDao.deleteAreaIpCfgByCfgId(areaIpCfg);
}
}
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
auditFileDigestCfg(entity.getIsAudit(), isValid,entity.getFunctionId(),entity.getCfgId()+"",Constants.UPDATE_ACTION);
}
}
}
@@ -577,8 +589,9 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
public void auditFileDigestCfg(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime) throws MaatConvertException{
public void auditFileDigestCfg(Integer isAudit,Integer isValid,Integer functionId,String id, Integer opAction) throws MaatConvertException{
FileDigestCfg entity = new FileDigestCfg();
Date auditTime = new Date();
entity.setCfgId(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
@@ -655,7 +668,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
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("File Digest配置下发配置参数"+json);