Commit c306c418 by zhangkb

标签元数据添加标签模糊搜索条件

parent 03999886
package com.keymobile.tagmanager.persistence; package com.keymobile.tagmanager.persistence;
import java.util.List;
import java.util.Optional; import java.util.Optional;
import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.data.mongodb.repository.MongoRepository;
...@@ -8,5 +9,7 @@ import org.springframework.data.mongodb.repository.MongoRepository; ...@@ -8,5 +9,7 @@ import org.springframework.data.mongodb.repository.MongoRepository;
import com.keymobile.tagmanager.model.Tag; import com.keymobile.tagmanager.model.Tag;
public interface TagRepository extends MongoRepository<Tag, String> { public interface TagRepository extends MongoRepository<Tag, String> {
public Optional<Tag> findByIdPath(String idPath); public Optional<Tag> findByIdPath(String idPath);
public List<Tag> findByIdPathLikeAndNameLike(String idPath,String tagName);
} }
...@@ -31,6 +31,7 @@ public interface RepoServiceClient { ...@@ -31,6 +31,7 @@ public interface RepoServiceClient {
@RequestParam String tagType, @RequestParam String tagType,
@RequestParam String dimensionType, @RequestParam String dimensionType,
@RequestParam(required = false) String keyword, @RequestParam(required = false) String keyword,
@RequestParam(required = false) List<String> tagIds,
@RequestParam(required = false) String startDate, @RequestParam(required = false) String startDate,
@RequestParam(required = false) String endDate, @RequestParam(required = false) String endDate,
@RequestParam int pageNum, @RequestParam int pageNum,
......
...@@ -728,9 +728,18 @@ public class TagService { ...@@ -728,9 +728,18 @@ public class TagService {
//获取用户关联的数据权限 //获取用户关联的数据权限
Map<Long, Set<String>> systemTagMap = GrantedAuthHelper.getDataPrivileges(); Map<Long, Set<String>> systemTagMap = GrantedAuthHelper.getDataPrivileges();
logger.info("tag metadata user privilege:"+systemTagMap); logger.info("tag metadata user privilege:"+systemTagMap);
//author:zhangkb time:2020-3-10 desc:根据keyword模糊匹配标签内容
List<Tag> likeTagList = tagRepository.findByIdPathLikeAndNameLike(idPath,keyword);
List<String> tagIdList = new ArrayList<>();
if(!likeTagList.isEmpty()) {
for(Tag tag : likeTagList) {
tagIdList.add(tag.getId());
}
}
//调用repo接口获取标签关联的元数据 //调用repo接口获取标签关联的元数据
Map<String,Object> tagData = repoService.getPageByTag(systemTagMap, modelPath, idPath, Map<String,Object> tagData = repoService.getPageByTag(systemTagMap, modelPath, idPath,
tagType, dimensionType, keyword, startDate, endDate, pageNum, pageSize); tagType, dimensionType, keyword, tagIdList, startDate, endDate, pageNum, pageSize);
tagData.put("systemTagMap", systemTagMap); tagData.put("systemTagMap", systemTagMap);
List<Map<String,Object>> content = (List<Map<String,Object>>)tagData.get("content"); List<Map<String,Object>> content = (List<Map<String,Object>>)tagData.get("content");
//判断不是个人标签 //判断不是个人标签
......
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