|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.epmet.service.user.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
@ -748,35 +749,36 @@ public class UserServiceImpl implements UserService { |
|
|
|
public void fillScreenProjectData(List<ScreenProjectDataDTO> list) { |
|
|
|
List<String> topicUserIdList = list.stream().filter(o -> ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(o.getOrigin())) |
|
|
|
.map(ScreenProjectDataDTO::getLinkName).distinct().collect(Collectors.toList()); |
|
|
|
if (CollectionUtils.isEmpty(topicUserIdList)){ |
|
|
|
return; |
|
|
|
} |
|
|
|
Map<String, ScreenProjectDataDTO> topicUserMap = new HashMap<>(); |
|
|
|
if (!CollectionUtils.isEmpty(topicUserIdList)){ |
|
|
|
List<ScreenProjectDataDTO> collection = userDao.selectScreenProjectData(topicUserIdList); |
|
|
|
Map<String, ScreenProjectDataDTO> topicUserMap = collection.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getTopicId,o->o,(o1,o2)->o1)); |
|
|
|
/* if(!CollectionUtils.isEmpty(collection)){ |
|
|
|
list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId())) |
|
|
|
.map(merge -> { |
|
|
|
target.setLinkName(merge.getLinkName()); |
|
|
|
target.setLinkMobile(merge.getLinkMobile()); |
|
|
|
return target;})); |
|
|
|
}*/ |
|
|
|
logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(collection),topicUserIdList); |
|
|
|
topicUserMap = collection.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getTopicId,o->o,(o1,o2)->o1)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
List<String> staffUserIdList = list.stream().filter(o -> ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(o.getOrigin())) |
|
|
|
.map(ScreenProjectDataDTO::getLinkName).distinct().collect(Collectors.toList()); |
|
|
|
if (CollectionUtils.isEmpty(topicUserIdList)){ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, ScreenProjectDataDTO> staffMap = new HashMap<>(); |
|
|
|
if (!CollectionUtils.isEmpty(staffUserIdList)){ |
|
|
|
List<ScreenProjectDataDTO> staffList = userDao.selectStaffInfo(staffUserIdList); |
|
|
|
Map<String, ScreenProjectDataDTO> collect = staffList.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getId,o->o,(o1,o2)->o1)); |
|
|
|
list.forEach(project->{ |
|
|
|
ScreenProjectDataDTO userDTO = collect.get(project.getLinkName()); |
|
|
|
if (userDTO == null){ |
|
|
|
logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(staffList),staffUserIdList); |
|
|
|
staffMap = staffList.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getId,o->o,(o1,o2)->o1)); |
|
|
|
} |
|
|
|
|
|
|
|
for (ScreenProjectDataDTO project : list) { |
|
|
|
ScreenProjectDataDTO userDTO = staffMap.get(project.getLinkName()); |
|
|
|
if (userDTO == null) { |
|
|
|
userDTO = topicUserMap.get(project.getLinkName()); |
|
|
|
} |
|
|
|
if (userDTO != null){ |
|
|
|
if (userDTO != null) { |
|
|
|
logger.info("fillScreenProjectData every user data:{}", JSON.toJSONString(userDTO)); |
|
|
|
project.setLinkName(userDTO.getLinkName()); |
|
|
|
project.setLinkMobile(userDTO.getLinkMobile()); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
logger.info("fillScreenProjectData result list:{}", JSON.toJSONString(list)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|