|
@@ -358,18 +358,14 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
try {
|
|
|
Map<String, Object> requestMap = new HashMap<>();
|
|
|
requestMap.put("userId", userId);
|
|
|
-
|
|
|
Integer totalCount = materialInfoMapper.selectCountByMap(requestMap);
|
|
|
json.put("total", totalCount);
|
|
|
-
|
|
|
requestMap.put("status", 0);
|
|
|
Integer waitAudit = materialInfoMapper.selectCountByMap(requestMap);
|
|
|
json.put("waitAudit", waitAudit);
|
|
|
-
|
|
|
requestMap.put("status", 1);
|
|
|
Integer passAudit = materialInfoMapper.selectCountByMap(requestMap);
|
|
|
json.put("passAudit", passAudit);
|
|
|
-
|
|
|
requestMap.put("status", 2);
|
|
|
Integer refuseAudit = materialInfoMapper.selectCountByMap(requestMap);
|
|
|
json.put("refuseAudit", refuseAudit);
|
|
@@ -384,7 +380,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
return materialInfoMapper.getRoleCodeByUserId(userId);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public void getFile(MaterialInfo materialInfo, String mediaId) {
|
|
|
uploadExecutorService.submit(new Runnable() {
|
|
@@ -439,7 +434,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
// 默认抽帧 素造供应商
|
|
|
Long templateId = MaterialSupplierEnum.getTemplateIdBySize(Integer.valueOf(width), Integer.valueOf(height));
|
|
|
if (!Check.isNull(templateId)) {
|
|
|
-
|
|
|
Thread thread = new Thread() {
|
|
|
@Override
|
|
|
public void run() {
|
|
@@ -447,15 +441,9 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
}
|
|
|
};
|
|
|
thread.start();
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
} catch (FileNotFoundException e) {
|
|
|
e.printStackTrace();
|
|
|
} catch (IOException e) {
|
|
@@ -526,11 +514,11 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
try {
|
|
|
String type = json.getString("type");
|
|
|
+
|
|
|
String url = "";
|
|
|
if (!Check.isNull(json.getString("url"))) {
|
|
|
url = "https:" + json.getString("url");
|
|
|
}
|
|
|
-
|
|
|
MaterialInfo info = new MaterialInfo();
|
|
|
Long projectId = json.getLong("projectId");
|
|
|
String code = json.getString("code");
|
|
@@ -563,23 +551,19 @@ 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 {
|
|
|
info.setCoverUrl(cutFrame.getUrl());
|
|
|
}
|
|
|
-
|
|
|
this.save(info);
|
|
|
-
|
|
|
JSONArray imageArr = json.getJSONArray("imageArr");
|
|
|
if (!Check.isNull(imageArr)) {
|
|
|
JSONObject imageJson = new JSONObject();
|
|
@@ -589,34 +573,27 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
imageJson.put("imageArr", imageArr);
|
|
|
materialImageInfoService.insertImage(imageJson);
|
|
|
}
|
|
|
-
|
|
|
Map<String, Object> deleteMap = new HashMap<>();
|
|
|
deleteMap.put("material_id", info.getCode());
|
|
|
JSONObject ascription = json.getJSONObject("ascription");
|
|
|
if (!Check.isNull(ascription)) {
|
|
|
MaterialAscription materialAscription = new MaterialAscription();
|
|
|
materialAscription.setMaterialId(info.getCode());
|
|
|
- // 剪辑人
|
|
|
materialAscription.setClipId(ascription.getString("clipId"));
|
|
|
- // 拍摄人id
|
|
|
materialAscription.setShotId(ascription.getString("shotId"));
|
|
|
- // 策划id
|
|
|
materialAscription.setPlanId(ascription.getString("planId"));
|
|
|
- //平面id
|
|
|
materialAscription.setPlaneId(ascription.getString("planeId"));
|
|
|
materialAscriptionMapper.deleteByMap(deleteMap);
|
|
|
- int i = materialAscriptionMapper.insert(materialAscription);
|
|
|
- if (i > 0) {
|
|
|
+ int result = materialAscriptionMapper.insert(materialAscription);
|
|
|
+ if (result > 0) {
|
|
|
log.info("素材归属信息入库完成,MaterialId:{}", info.getId());
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
JSONArray tag = json.getJSONArray("tag");
|
|
|
if (!Check.isNull(tag)) {
|
|
|
materialTagMapper.deleteByMap(deleteMap);
|
|
|
- for (int i = 0; i < tag.size(); i++) {
|
|
|
- String tagStr = tag.getString(i);
|
|
|
+ for (int j = 0; j < tag.size(); j++) {
|
|
|
+ String tagStr = tag.getString(j);
|
|
|
if (!Check.isNull(tagStr)) {
|
|
|
MaterialTag materialTag = new MaterialTag();
|
|
|
materialTag.setMaterialId(info.getCode());
|
|
@@ -625,6 +602,13 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ JSONArray tagList = json.getJSONArray("tagList");
|
|
|
+ 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);
|
|
|
+ materialTagInfoService.save(setTag);
|
|
|
+ }
|
|
|
getFile(info, project.getMediaId());
|
|
|
ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
|
|
|
} catch (Exception e) {
|
|
@@ -633,6 +617,10 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
}
|
|
|
return resultMap;
|
|
|
}
|
|
|
+ @Autowired
|
|
|
+ private ITagInfoService tagInfoService;
|
|
|
+ @Autowired
|
|
|
+ private IMaterialTagInfoService materialTagInfoService;
|
|
|
|
|
|
@Override
|
|
|
public Map<String, Object> insertImage(JSONObject imageJson) {
|