huanghongfa
2021-09-09 814594ddf60a3e9aa2a3e1247c6c9f2f06ddb648
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -1834,13 +1834,18 @@
     * @return 标签集合
     */
    @Override
    public R listTags(Long communityId) {
    public R listTags() {
        List<String> list = new ArrayList<>();
        List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO
            .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId));
            .selectList(null);
        if (!ObjectUtils.isEmpty(comMngUserTagDOS)) {
            list = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName())
                .collect(Collectors.toList());
            for (ComMngUserTagDO comMngUserTagDO : comMngUserTagDOS) {
                if (!list.contains(comMngUserTagDO.getTagName())) {
                    list.add(comMngUserTagDO.getTagName());
                }
            }
//            list = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName())
//                .collect(Collectors.toList());
        }
        return R.ok(list);
    }