|
@@ -589,28 +589,15 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
|
|
|
log.info("素材归属信息入库完成,MaterialId:{}", info.getId());
|
|
|
}
|
|
|
}
|
|
|
- JSONArray tag = json.getJSONArray("tag");
|
|
|
- if (!Check.isNull(tag)) {
|
|
|
- materialTagMapper.deleteByMap(deleteMap);
|
|
|
- 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());
|
|
|
- materialTag.setTag(tagStr);
|
|
|
- materialTagMapper.insert(materialTag);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- JSONArray tagList = json.getJSONArray("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);
|
|
|
- materialTagInfoService.save(setTag);
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ JSONArray modalityTagList = json.getJSONArray("modalityTagList");
|
|
|
+ insertTagList(code,userId,modalityTagList);
|
|
|
+ JSONArray contentTagList = json.getJSONArray("contentTagList");
|
|
|
+ insertTagList(code,userId,contentTagList);
|
|
|
+ JSONArray senceTagList = json.getJSONArray("senceTagList");
|
|
|
+ insertTagList(code,userId,senceTagList);
|
|
|
+ JSONArray modTagList = json.getJSONArray("modTagList");
|
|
|
+ insertTagList(code,userId,modTagList);
|
|
|
getFile(info, project.getMediaId());
|
|
|
ResultMapUtils.setResultMap(resultMap, StatusCode.COMMON_SUCCESS.getCode());
|
|
|
} catch (Exception e) {
|
|
@@ -619,6 +606,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++){
|
|
|
+ Long tagId = tagList.getLong(m);
|
|
|
+ TagInfo tagInfo = tagInfoService.getById(tagId);
|
|
|
+ MaterialTagInfo setTag= new MaterialTagInfo(code,tagInfo,userId);
|
|
|
+ setTag.setCategoryId(tagInfo.getTagCategoryId());
|
|
|
+ materialTagInfoService.save(setTag);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
@Autowired
|
|
|
private ITagInfoService tagInfoService;
|
|
|
@Autowired
|