|
|
@@ -518,7 +518,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"));
|
|
|
@@ -589,13 +589,13 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
}
|
|
|
materialTagInfoService.deleteByCode(code);
|
|
|
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) {
|
|
|
@@ -605,17 +605,25 @@ 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++){
|
|
|
- Long tagId = tagList.getLong(m);
|
|
|
- TagInfo tagInfo = tagInfoService.getById(tagId);
|
|
|
- MaterialTagInfo setTag= new MaterialTagInfo(code,tagInfo,userId);
|
|
|
- setTag.setCategoryId(tagInfo.getTagCategoryId());
|
|
|
- materialTagInfoService.save(setTag);
|
|
|
+ private void insertTagList(String code, String userId, JSONArray tagList) {
|
|
|
+ try {
|
|
|
+
|
|
|
+ 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);
|
|
|
+ setTag.setCategoryId(tagInfo.getTagCategoryId());
|
|
|
+ materialTagInfoService.save(setTag);
|
|
|
+ }
|
|
|
}
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
@Autowired
|
|
|
private ITagInfoService tagInfoService;
|
|
|
@Autowired
|
|
|
@@ -676,14 +684,14 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String,Object> getListByParams(String tagCode,String type, Integer status, List<Long> projectIds, String materialName, String code, String startDate, String endDate, String userId, Integer pageNo, Integer pageSize) {
|
|
|
- Map<String,Object> result = new HashMap<>();
|
|
|
- PageHelper.startPage(pageNo,pageSize);
|
|
|
- List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode,type,status,projectIds,materialName,code,startDate,endDate, userId);
|
|
|
+ public Map<String, Object> getListByParams(String tagCode, String type, Integer status, List<Long> projectIds, String materialName, String code, String startDate, String endDate, String userId, Integer pageNo, Integer pageSize) {
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ PageHelper.startPage(pageNo, pageSize);
|
|
|
+ List<MaterialInfo> dailyList = materialInfoMapper.getListByParams(tagCode, type, status, projectIds, materialName, code, startDate, endDate, userId);
|
|
|
List<MaterialInfo> setList = new ArrayList<>();
|
|
|
PageInfo<MaterialInfo> pageInfo = new PageInfo<>(dailyList);
|
|
|
- if(null!=dailyList&&!dailyList.isEmpty()){
|
|
|
- for(MaterialInfo info:dailyList){
|
|
|
+ if (null != dailyList && !dailyList.isEmpty()) {
|
|
|
+ for (MaterialInfo info : dailyList) {
|
|
|
MaterialInfo materialInfo = materialInfoMapper.selectById(info.getId());
|
|
|
//判断是否已经同步到快手平台
|
|
|
Integer kuaishouMaterialUpCount = this.getKuaishouUpVideoCount(info.getCode());
|
|
|
@@ -722,8 +730,8 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
}
|
|
|
}
|
|
|
pageInfo.setList(setList);
|
|
|
- result.put("data",pageInfo);
|
|
|
- ResultMapUtils.setResultMap(result,StatusCode.COMMON_SUCCESS);
|
|
|
+ result.put("data", pageInfo);
|
|
|
+ ResultMapUtils.setResultMap(result, StatusCode.COMMON_SUCCESS);
|
|
|
return result;
|
|
|
}
|
|
|
}
|