Commit 1443fe25 by zhangkb

修改标签共享接口

parent f883a38d
...@@ -23,7 +23,6 @@ import org.springframework.data.mongodb.core.MongoOperations; ...@@ -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.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import com.keymobile.auth.common.security.GrantedAuthHelper; import com.keymobile.auth.common.security.GrantedAuthHelper;
import com.keymobile.tagmanager.exception.TagDuplicateException; import com.keymobile.tagmanager.exception.TagDuplicateException;
...@@ -831,9 +830,9 @@ public class TagService { ...@@ -831,9 +830,9 @@ public class TagService {
logger.info("tag share systemTagMap:"+systemTagMap); logger.info("tag share systemTagMap:"+systemTagMap);
if(!systemTagMap.isEmpty()) { if(!systemTagMap.isEmpty()) {
//获取传入的标签关联的元数据 //获取传入的标签关联的元数据
Map<String,Object> data = repoService.getTagMetadata(tag.getDimensionType(), List<Map<String,Object>> content = repoService.getByTagByPrivileges(systemTagMap,
tag.getIdPath(),"", null,1, 100000,tag.getTagType()); null, tag.getIdPath(), tag.getTagType(), tag.getDimensionType(), "",
List<Map<String,Object>> content = (List<Map<String,Object>>)data.get("content"); 1, 10);
if(!content.isEmpty()) { if(!content.isEmpty()) {
//比较标签关联的元数据所属系统跟用户被授予的系统是否一致 //比较标签关联的元数据所属系统跟用户被授予的系统是否一致
for(Map<String,Object> mData : content) { for(Map<String,Object> mData : content) {
...@@ -848,10 +847,14 @@ public class TagService { ...@@ -848,10 +847,14 @@ public class TagService {
//根据当前用户被授予的标签获取关联的元数据 //根据当前用户被授予的标签获取关联的元数据
Set<String> tags = systemTagMap.get(Long.valueOf(sys)); Set<String> tags = systemTagMap.get(Long.valueOf(sys));
for(String usrTag : tags) { for(String usrTag : tags) {
Map<String,Object> tagData = repoService.getTagMetadata("1", List<Map<String,Object>> tagContent = repoService.
usrTag, "", null, 1, 100000,"1"); getByTagByPrivileges(systemTagMap, null,
List<Map<String,Object>> tagContent = (List<Map<String,Object>>)tagData.get("content"); usrTag, "1", "1", "", 1, 10);
if(tagContent.contains(mData)) { 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; 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