1、样例配置审核,一条配置提交一次服务(为了保证一条配置提交过程完整的事务性);2、表单验证信息完善;3、列表分类性质标签列显示样式调整
This commit is contained in:
@@ -141,81 +141,13 @@ public class AvCfgService extends BaseService{
|
||||
|
||||
|
||||
}
|
||||
public void auditAvFileSample(Integer isAudit,Integer isValid,String ids){
|
||||
AvFileSampleCfg entity = new AvFileSampleCfg();
|
||||
String[] idArray = ids.split(",");
|
||||
List<AvFileSampleCfg> list = new ArrayList();
|
||||
Gson gson=new GsonBuilder().disableHtmlEscaping()
|
||||
.excludeFieldsWithoutExposeAnnotation()
|
||||
.create();
|
||||
for(String id :idArray){
|
||||
entity = getAvFileSampleById(Long.parseLong(id));
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
|
||||
String oldSrcUrl = entity.getSrcPath();
|
||||
String oldSampleUrl = entity.getSamplePath();
|
||||
if(isAudit==1){
|
||||
//音视频文件上传接口调用
|
||||
try {
|
||||
File srcFile = new File(oldSrcUrl);
|
||||
Map<String,Object> srcMap = new HashMap();
|
||||
srcMap.put("filetype", FileUtils.getSuffix(srcFile.getName(), false));
|
||||
srcMap.put("datatype", "dbSystem");//源文件存入数据中心
|
||||
srcMap.put("createTime", entity.getCreateTime());
|
||||
srcMap.put("key",FileUtils.getPrefix(srcFile.getName(), false));
|
||||
srcMap.put("fileName", srcFile.getName());
|
||||
srcMap.put("checksum", entity.getSrcMd5());
|
||||
ToMaatResult result1 = ConfigServiceUtil.postFileCfg(null, srcFile, JSONObject.fromObject(srcMap));
|
||||
logger.info("音视频源文件上传响应信息:"+result1);
|
||||
//获取文件上传响应信息(新的文件访问路径)
|
||||
String srcAccessUrl = null;
|
||||
if(!StringUtil.isEmpty(result1)){
|
||||
ResponseData data = result1.getData();
|
||||
srcAccessUrl=data.getAccessUrl();
|
||||
entity.setSrcUrl(srcAccessUrl);
|
||||
// entity.setSrcPath("");
|
||||
}
|
||||
File sampleFile = new File(oldSampleUrl);
|
||||
Map<String,Object> sampleMap = new HashMap();
|
||||
sampleMap.put("filetype", FileUtils.getSuffix(sampleFile.getName(), false));
|
||||
sampleMap.put("datatype", "fileSystem");//样例文件存入fastdfs
|
||||
sampleMap.put("createTime", entity.getCreateTime());
|
||||
sampleMap.put("key",FileUtils.getPrefix(sampleFile.getName(), false));
|
||||
sampleMap.put("fileName", sampleFile.getName());
|
||||
sampleMap.put("checksum", entity.getSampleMd5());
|
||||
ToMaatResult result2 = ConfigServiceUtil.postFileCfg(null, sampleFile, JSONObject.fromObject(sampleMap));
|
||||
logger.info("音视频样例文件上传响应信息:"+result2);
|
||||
|
||||
//获取文件上传响应信息(新的文件访问路径)
|
||||
String sampleAccessUrl = null;
|
||||
if(!StringUtil.isEmpty(result2)){
|
||||
ResponseData data = result2.getData();
|
||||
sampleAccessUrl = data.getAccessUrl();
|
||||
entity.setSampleUrl(sampleAccessUrl);
|
||||
// entity.setSamplePath("");
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("音视频文件样例配置下发失败");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
avCfgDao.auditAvFileSample(entity);
|
||||
//删除本地源文件和样例文件
|
||||
if(!oldSrcUrl.equals(entity.getSrcUrl())){
|
||||
FileUtils.deleteFile(oldSrcUrl);
|
||||
}
|
||||
if(!oldSampleUrl.equals(entity.getSampleUrl())){
|
||||
FileUtils.deleteFile(oldSampleUrl);
|
||||
}
|
||||
list.add(entity);
|
||||
}
|
||||
if(isAudit==1){
|
||||
public void auditAvFileSample(AvFileSampleCfg entity,Integer isAudit){
|
||||
//修改数据库审核状态信息
|
||||
avCfgDao.auditAvFileSample(entity);
|
||||
List<AvFileSampleCfg> list = new ArrayList<AvFileSampleCfg>();
|
||||
list.add(entity);
|
||||
//一条配置提交一次综合服务
|
||||
if(isAudit==1){
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(list);
|
||||
logger.info("音视频文件样例下发配置参数:"+json);
|
||||
@@ -255,19 +187,10 @@ public class AvCfgService extends BaseService{
|
||||
avCfgDao.updateAvSignSampleValid(entity);
|
||||
}
|
||||
}
|
||||
public void auditAvSignSample(Integer isAudit,Integer isValid,String ids){
|
||||
AvSignSampleCfg entity = new AvSignSampleCfg();
|
||||
String[] idArray = ids.split(",");
|
||||
List<AvSignSampleCfg> list = new ArrayList();
|
||||
for(String id :idArray){
|
||||
entity = getAvSignSampleById(Long.parseLong(id));
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
avCfgDao.auditAvSignSample(entity);
|
||||
list.add(entity);
|
||||
}
|
||||
public void auditAvSignSample(AvSignSampleCfg entity,Integer isAudit){
|
||||
avCfgDao.auditAvSignSample(entity);
|
||||
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
|
||||
list.add(entity);
|
||||
if(isAudit==1){
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(list);
|
||||
|
||||
Reference in New Issue
Block a user