|
@@ -18,10 +18,7 @@ import com.fs.common.utils.ParseUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.company.cache.ICompanyTagCacheService;
|
|
import com.fs.company.cache.ICompanyTagCacheService;
|
|
|
import com.fs.company.cache.ICompanyUserCacheService;
|
|
import com.fs.company.cache.ICompanyUserCacheService;
|
|
|
-import com.fs.company.domain.Company;
|
|
|
|
|
-import com.fs.company.domain.CompanyTag;
|
|
|
|
|
-import com.fs.company.domain.CompanyTagUser;
|
|
|
|
|
-import com.fs.company.domain.CompanyUser;
|
|
|
|
|
|
|
+import com.fs.company.domain.*;
|
|
|
import com.fs.company.mapper.*;
|
|
import com.fs.company.mapper.*;
|
|
|
import com.fs.company.service.ICompanyTagService;
|
|
import com.fs.company.service.ICompanyTagService;
|
|
|
import com.fs.course.domain.FsUserCompanyUser;
|
|
import com.fs.course.domain.FsUserCompanyUser;
|
|
@@ -724,15 +721,8 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
item.setTag(String.join(",", tagNames));
|
|
item.setTag(String.join(",", tagNames));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
|
|
- map.put("userId", item.getUserId());
|
|
|
|
|
- map.put("companyUserId", item.getCompanyUserId());
|
|
|
|
|
- map.put("projectId", item.getProjectId());
|
|
|
|
|
- // 获取小程序标签
|
|
|
|
|
- List<CompanyTag> companyTags = companyTagMapper.selectCompanyTagByUserId(map);
|
|
|
|
|
- if (companyTags != null && companyTags.size() > 0) {
|
|
|
|
|
- item.setProjectTagName(companyTags.stream().map(CompanyTag::getTag).collect(Collectors.joining(",")));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 添加小程序标签返回值
|
|
|
|
|
+ addUserTag(fsUserPageListVOS);
|
|
|
|
|
|
|
|
// 是否宠粉
|
|
// 是否宠粉
|
|
|
// Integer isRepeat = qwExternalContactCacheService.selectQwIsRepeat(item.getUserId());
|
|
// Integer isRepeat = qwExternalContactCacheService.selectQwIsRepeat(item.getUserId());
|
|
@@ -761,6 +751,47 @@ public class FsUserServiceImpl implements IFsUserService {
|
|
|
return rspData;
|
|
return rspData;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 添加小程序标签返回值
|
|
|
|
|
+ public void addUserTag(List<FsUserPageListVO> fsUserPageListVOS) {
|
|
|
|
|
+ // 1. 收集所有需要查询标签的用户信息
|
|
|
|
|
+ List<Map<String, Object>> batchParams = new ArrayList<>();
|
|
|
|
|
+ for (FsUserPageListVO item : fsUserPageListVOS) {
|
|
|
|
|
+ if (item.getUserId() != null) {
|
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
+ map.put("userId", item.getUserId());
|
|
|
|
|
+ map.put("companyUserId", item.getCompanyUserId());
|
|
|
|
|
+ map.put("projectId", item.getProjectId());
|
|
|
|
|
+ batchParams.add(map);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 2. 批量查询所有标签(需要修改Mapper方法支持批量查询)
|
|
|
|
|
+ List<CompanyTagResult> batchTags = companyTagMapper.selectCompanyTagByUserIds(batchParams);
|
|
|
|
|
+
|
|
|
|
|
+ // 3. 按用户分组标签结果
|
|
|
|
|
+ Map<String, List<CompanyTag>> tagGroupMap = batchTags.stream()
|
|
|
|
|
+ .collect(Collectors.groupingBy(
|
|
|
|
|
+ tag -> tag.getUserId() + "_" + tag.getCompanyUserId() + "_" + tag.getProjectId(),
|
|
|
|
|
+ Collectors.mapping(tag -> {
|
|
|
|
|
+ CompanyTag companyTag = new CompanyTag();
|
|
|
|
|
+ companyTag.setTag(tag.getTag());
|
|
|
|
|
+ return companyTag;
|
|
|
|
|
+ }, Collectors.toList())
|
|
|
|
|
+ ));
|
|
|
|
|
+
|
|
|
|
|
+ // 4. 重新遍历设置标签
|
|
|
|
|
+ for (FsUserPageListVO item : fsUserPageListVOS) {
|
|
|
|
|
+ if (item.getUserId() != null) {
|
|
|
|
|
+ String key = item.getUserId() + "_" + item.getCompanyUserId() + "_" + item.getProjectId();
|
|
|
|
|
+ List<CompanyTag> tags = tagGroupMap.get(key);
|
|
|
|
|
+ if (tags != null && !tags.isEmpty()) {
|
|
|
|
|
+ item.setProjectTagName(tags.stream().map(CompanyTag::getTag).collect(Collectors.joining(",")));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public Long selectFsUserCount(FsUserPageListParam param) {
|
|
public Long selectFsUserCount(FsUserPageListParam param) {
|
|
|
return fsUserMapper.selectFsUserPageListCount(param);
|
|
return fsUserMapper.selectFsUserPageListCount(param);
|