|
@@ -455,7 +455,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
e.printStackTrace();
|
|
|
} catch (EncoderException e) {
|
|
|
e.printStackTrace();
|
|
|
-
|
|
|
} finally {
|
|
|
try {
|
|
|
if (fis != null) {
|
|
@@ -467,8 +466,6 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -507,15 +504,13 @@ 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");
|
|
|
- }
|
|
|
+ String url = json.getString("url");
|
|
|
+ String code = json.getString("code");
|
|
|
MaterialInfo info = new MaterialInfo();
|
|
|
Long projectId = json.getLong("projectId");
|
|
|
Project project = projectService.getById(projectId);
|
|
|
Long productId = project.getProductId();
|
|
|
- String code = MD5Util.md5ByUrl(url);
|
|
|
+
|
|
|
info.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
info.setCode(code);
|
|
|
if (!Check.isNull(json.getString("watermarkUrl"))) {
|
|
@@ -586,13 +581,19 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
//TODO 需要添加获取设计负责人代码
|
|
|
SysUser clip = userService.getById(clipId);
|
|
|
String roleCode = userService.getRoleCodeByUserId(clipId);
|
|
|
+ log.info("剪辑人员名称:"+clip.getRealname()+";ID:"+clipId);
|
|
|
+ String leaderName = "";
|
|
|
+ String leaderId = "";
|
|
|
if("designTeamLeader".equals(roleCode)){
|
|
|
- materialAscription.setLeaderId(clipId);
|
|
|
- materialAscription.setLeaderName(clip.getRealname());
|
|
|
+ leaderId = clipId;
|
|
|
+ leaderName = clip.getRealname();
|
|
|
}else{
|
|
|
- materialAscription.setLeaderId(clip.getLeaderId());
|
|
|
- materialAscription.setLeaderName(clip.getLeaderName());
|
|
|
+ leaderId = clip.getLeaderId();
|
|
|
+ leaderName = clip.getLeaderName();
|
|
|
}
|
|
|
+ log.info("负责人名称:"+leaderName+";ID:"+leaderId);
|
|
|
+ materialAscription.setLeaderName(leaderName);
|
|
|
+ materialAscription.setLeaderId(leaderId);
|
|
|
int result = materialAscriptionMapper.insert(materialAscription);
|
|
|
if (result > 0) {
|
|
|
log.info("素材归属信息入库完成,MaterialId:{}", info.getId());
|
|
@@ -615,6 +616,28 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public JSONArray checkArrayCode(JSONArray array) {
|
|
|
+ if(null == array||array.isEmpty()){
|
|
|
+ return new JSONArray();
|
|
|
+ }
|
|
|
+ Map<String,String> codeMap = new HashMap<>();
|
|
|
+ JSONArray resultArray = new JSONArray();
|
|
|
+ for(int i=0;i<array.size();i++){
|
|
|
+ JSONObject data = array.getJSONObject(i);
|
|
|
+ String url = "https:"+data.getString("url");
|
|
|
+ data.put("url",url);
|
|
|
+ String code = MD5Util.md5ByUrl(url);
|
|
|
+ if(codeMap.containsKey(code)){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ codeMap.put(code,code);
|
|
|
+ data.put("code",code);
|
|
|
+ resultArray.add(data);
|
|
|
+ }
|
|
|
+ return resultArray;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 素材库关联上传素材 1
|
|
|
*
|
|
@@ -706,13 +729,19 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
//TODO 需要添加获取设计负责人代码
|
|
|
SysUser clip = userService.getById(clipId);
|
|
|
String roleCode = userService.getRoleCodeByUserId(clipId);
|
|
|
+ log.info("剪辑人员名称:"+clip.getRealname()+";ID:"+clipId);
|
|
|
+ String leaderName = "";
|
|
|
+ String leaderId = "";
|
|
|
if("designTeamLeader".equals(roleCode)){
|
|
|
- materialAscription.setLeaderId(clipId);
|
|
|
- materialAscription.setLeaderName(clip.getRealname());
|
|
|
+ leaderId = clipId;
|
|
|
+ leaderName = clip.getRealname();
|
|
|
}else{
|
|
|
- materialAscription.setLeaderId(clip.getLeaderId());
|
|
|
- materialAscription.setLeaderName(clip.getLeaderName());
|
|
|
+ leaderId = clip.getLeaderId();
|
|
|
+ leaderName = clip.getLeaderName();
|
|
|
}
|
|
|
+ log.info("负责人名称:"+leaderName+";ID:"+leaderId);
|
|
|
+ materialAscription.setLeaderName(leaderName);
|
|
|
+ materialAscription.setLeaderId(leaderId);
|
|
|
int result = materialAscriptionMapper.insert(materialAscription);
|
|
|
if (result > 0) {
|
|
|
log.info("素材归属信息入库完成,MaterialId:{}", info.getId());
|