|
|
@ -26,6 +26,7 @@ import com.epmet.dao.IssueProjectTagDictDao; |
|
|
|
import com.epmet.dto.result.IssueCategoryTagResultDTO; |
|
|
|
import com.epmet.entity.IssueProjectCategoryDictEntity; |
|
|
|
import com.epmet.entity.IssueProjectTagDictEntity; |
|
|
|
import com.epmet.service.IssueProjectCategoryDictService; |
|
|
|
import com.epmet.utils.ModuleConstants; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -39,7 +40,6 @@ import org.springframework.data.redis.core.ZSetOperations; |
|
|
|
import org.springframework.lang.Nullable; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
import sun.security.krb5.internal.PAData; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
@ -61,6 +61,8 @@ public class IssueProjectTagDictRedis { |
|
|
|
private IssueProjectTagDictDao poolDao; |
|
|
|
@Autowired |
|
|
|
private IssueProjectCategoryDictDao categoryDictDao; |
|
|
|
@Autowired |
|
|
|
private IssueProjectCategoryDictService categoryDictService; |
|
|
|
public void delete(Object[] ids) { |
|
|
|
|
|
|
|
} |
|
|
@ -305,7 +307,7 @@ public class IssueProjectTagDictRedis { |
|
|
|
IssueCategoryTagResultDTO tag = ConvertUtils.sourceToTarget(entity,IssueCategoryTagResultDTO.class); |
|
|
|
tag.setName(entity.getTagName()); return tag;}).collect(Collectors.toList())); |
|
|
|
//自定义标签:按照热度排序 sorted(Comparator.comparing(IssueProjectTagDictEntity :: getIssueUseCount).reversed())
|
|
|
|
result.put(ModuleConstants.CUSTOMIZED_TAG_CATEGORY_NAME,CollectionUtils.isEmpty(db) ? null : db.stream().filter(o -> !StringUtils.equals(ModuleConstants.CUSTOMIZED_TAG_CATEGORY_NAME,o.getCategoryId())).sorted(Comparator.comparing(IssueProjectTagDictEntity :: getIssueUseCount).reversed()).map(entity -> { |
|
|
|
result.put(ModuleConstants.CUSTOMIZED_TAG_CATEGORY_NAME,CollectionUtils.isEmpty(db) ? null : db.stream().filter(o -> StringUtils.equals(ModuleConstants.CUSTOMIZED_TAG_CATEGORY_NAME,o.getCategoryId())).sorted(Comparator.comparing(IssueProjectTagDictEntity :: getIssueUseCount).reversed()).map(entity -> { |
|
|
|
IssueCategoryTagResultDTO tag = ConvertUtils.sourceToTarget(entity,IssueCategoryTagResultDTO.class); |
|
|
|
tag.setName(entity.getTagName());return tag;}).collect(Collectors.toList())); |
|
|
|
return result; |
|
|
|