Browse Source

逻辑修改

dev_shibei_match
jianjun 4 years ago
parent
commit
3e56eff0d0
  1. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java

@ -749,37 +749,34 @@ 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);
logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(collection),topicUserIdList);
topicUserMap = collection.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getTopicId,o->o,(o1,o2)->o1));
}
List<ScreenProjectDataDTO> collection = userDao.selectScreenProjectData(topicUserIdList);
logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(collection),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;}));
}*/
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(topicUserIdList)){
List<ScreenProjectDataDTO> staffList = userDao.selectStaffInfo(staffUserIdList);
logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(staffList),staffUserIdList);
staffMap = staffList.stream().collect(Collectors.toMap(ScreenProjectDataDTO::getId,o->o,(o1,o2)->o1));
}
List<ScreenProjectDataDTO> staffList = userDao.selectStaffInfo(staffUserIdList);
logger.info("fillScreenProjectData staff list:{},param:{}", JSON.toJSONString(staffList),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){
for (ScreenProjectDataDTO project : list) {
ScreenProjectDataDTO userDTO = staffMap.get(project.getLinkName());
if (userDTO == null) {
userDTO = topicUserMap.get(project.getLinkName());
}
if (userDTO != null){
if (userDTO != null) {
project.setLinkName(userDTO.getLinkName());
project.setLinkMobile(userDTO.getLinkMobile());
}
});
}
}
/**

Loading…
Cancel
Save