Commit 1443fe25 by zhangkb

修改标签共享接口

parent f883a38d
......@@ -23,7 +23,6 @@ import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import com.keymobile.auth.common.security.GrantedAuthHelper;
import com.keymobile.tagmanager.exception.TagDuplicateException;
......@@ -831,9 +830,9 @@ public class TagService {
logger.info("tag share systemTagMap:"+systemTagMap);
if(!systemTagMap.isEmpty()) {
//获取传入的标签关联的元数据
Map<String,Object> data = repoService.getTagMetadata(tag.getDimensionType(),
tag.getIdPath(),"", null,1, 100000,tag.getTagType());
List<Map<String,Object>> content = (List<Map<String,Object>>)data.get("content");
List<Map<String,Object>> content = repoService.getByTagByPrivileges(systemTagMap,
null, tag.getIdPath(), tag.getTagType(), tag.getDimensionType(), "",
1, 10);
if(!content.isEmpty()) {
//比较标签关联的元数据所属系统跟用户被授予的系统是否一致
for(Map<String,Object> mData : content) {
......@@ -848,10 +847,14 @@ public class TagService {
//根据当前用户被授予的标签获取关联的元数据
Set<String> tags = systemTagMap.get(Long.valueOf(sys));
for(String usrTag : tags) {
Map<String,Object> tagData = repoService.getTagMetadata("1",
usrTag, "", null, 1, 100000,"1");
List<Map<String,Object>> tagContent = (List<Map<String,Object>>)tagData.get("content");
if(tagContent.contains(mData)) {
List<Map<String,Object>> tagContent = repoService.
getByTagByPrivileges(systemTagMap, null,
usrTag, "1", "1", "", 1, 10);
List<String> idList = new ArrayList<>();
for(Map<String,Object> map : tagContent) {
idList.add(map.get("_id").toString());
}
if(idList.contains(mData.get("_id"))) {
return true;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment