|
@@ -517,7 +517,7 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
MaterialInfo info = new MaterialInfo();
|
|
|
Long projectId = json.getLong("projectId");
|
|
|
String code = json.getString("code");
|
|
|
- // info.setId(code + projectId);
|
|
|
+ info.setId(code + "_" + projectId);
|
|
|
info.setCode(code);
|
|
|
if (!Check.isNull(json.getString("watermarkUrl"))) {
|
|
|
info.setWatermarkUrl(json.getString("watermarkUrl"));
|
|
@@ -546,13 +546,15 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
String coverUrl = CloudVideoProcessUtil.videoCutPictureHandle(videoUrl, loadImage);
|
|
|
info.setCoverUrl(coverUrl);
|
|
|
Thread thread = new Thread() {
|
|
|
- @Override
|
|
|
- public void run() { try {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ try {
|
|
|
log.info("开始抽帧,code:{}", code);
|
|
|
materialCutFrameService.getTencentCutFrame(videoUrl, code, coverUrl);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- } }
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
thread.start();
|
|
|
} else {
|
|
@@ -586,13 +588,13 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
}
|
|
|
|
|
|
JSONArray modalityTagList = json.getJSONArray("modalityTagList");
|
|
|
- insertTagList(code,userId,modalityTagList);
|
|
|
+ insertTagList(code, userId, modalityTagList);
|
|
|
JSONArray contentTagList = json.getJSONArray("contentTagList");
|
|
|
- insertTagList(code,userId,contentTagList);
|
|
|
+ insertTagList(code, userId, contentTagList);
|
|
|
JSONArray senceTagList = json.getJSONArray("senceTagList");
|
|
|
- insertTagList(code,userId,senceTagList);
|
|
|
+ insertTagList(code, userId, senceTagList);
|
|
|
JSONArray modTagList = json.getJSONArray("modTagList");
|
|
|
- insertTagList(code,userId,modTagList);
|
|
|
+ insertTagList(code, userId, modTagList);
|
|
|
getFile(info, project.getMediaId());
|
|
|
ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
|
|
|
} catch (Exception e) {
|
|
@@ -602,17 +604,18 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
return resultMap;
|
|
|
}
|
|
|
|
|
|
- private void insertTagList(String code,String userId,JSONArray tagList){
|
|
|
- if(null!=tagList&&!tagList.isEmpty()){
|
|
|
- for(int m=0;m<tagList.size();m++){
|
|
|
+ private void insertTagList(String code, String userId, JSONArray tagList) {
|
|
|
+ if (null != tagList && !tagList.isEmpty()) {
|
|
|
+ for (int m = 0; m < tagList.size(); m++) {
|
|
|
Long tagId = tagList.getLong(m);
|
|
|
TagInfo tagInfo = tagInfoService.getById(tagId);
|
|
|
- MaterialTagInfo setTag= new MaterialTagInfo(code,tagInfo,userId);
|
|
|
+ MaterialTagInfo setTag = new MaterialTagInfo(code, tagInfo, userId);
|
|
|
setTag.setCategoryId(tagInfo.getTagCategoryId());
|
|
|
materialTagInfoService.save(setTag);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
private ITagInfoService tagInfoService;
|
|
|
@Autowired
|