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

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

@@ -395,8 +395,6 @@ public class AvController extends BaseController {
entity = avCfgService.getAvFileSampleById(Long.parseLong(id), null);
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
// String oldSrcUrl = entity.getSrcPath();
// String oldSampleUrl = entity.getSamplePath();
try {
@@ -511,8 +509,7 @@ public class AvController extends BaseController {
entity = avCfgService.getAvSignSampleById(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
try {
avCfgService.audioAuditAvSignSample(entity, isAudit, false);
addMessage(redirectAttributes, "success", "audit_success");

View File

@@ -299,13 +299,12 @@ public class FileTransferCfgController extends BaseController {
}
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity, result, areaCfgIds);
addMessage(redirectAttributes, "success", "save_success");
} catch (MaatConvertException e) {
logger.error("文件摘要配置下发失败:",e);
addMessage(redirectAttributes, "error", "request_service_failed");
} catch (Exception e) {
if (e instanceof MaatConvertException) {
addMessage(redirectAttributes, "error", "request_service_failed");
} else {
addMessage(redirectAttributes, "error", "save_failed");
}
logger.error("文件摘要配置保存失败:",e);
addMessage(redirectAttributes, "error", "save_failed");
}
return "redirect:" + adminPath + "/ntc/fileTransfer/fileDigestList?functionId=" + entity.getFunctionId();
}
@@ -343,10 +342,9 @@ public class FileTransferCfgController extends BaseController {
HttpServletResponse response, HttpServletRequest request) {
if (!StringUtil.isEmpty(ids)) {
String[] idArray = ids.split(",");
Date auditTime = new Date();
for (String id : idArray) {
try {
fileTransferCfgService.auditFileDigestCfg(isAudit, isValid, functionId, id, auditTime);
fileTransferCfgService.auditFileDigestCfg(isAudit, isValid, functionId, id,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) {
logger.error("File Digest配置下发失败", e);
@@ -383,7 +381,7 @@ public class FileTransferCfgController extends BaseController {
}
return "redirect:" + adminPath + "/ntc/fileTransfer/fileDigestList?functionId=" + functionId;
}
@RequestMapping(value = { "ajaxFileDigestSubIdList" })
public String ajaxFileDigestSubIdList(Model model, Long cfgId, Integer index, Integer compileId) {
FileDigestCfg cfg = fileTransferCfgService.getFileDigestSubIdCfg(cfgId, compileId);

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