|
@@ -50,6 +50,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
@@ -246,20 +247,16 @@ public class ImUserFriendServiceImpl extends ServiceImpl<ImUserFriendDao, ImUser
|
|
if (ClientEnum.STUDENT.getCode().equals(friendClientType)) {
|
|
if (ClientEnum.STUDENT.getCode().equals(friendClientType)) {
|
|
StudentVo detail = studentDao.detail(userId);
|
|
StudentVo detail = studentDao.detail(userId);
|
|
if (detail != null && StringUtils.isNotEmpty(detail.getSubjectId())) {
|
|
if (detail != null && StringUtils.isNotEmpty(detail.getSubjectId())) {
|
|
- String subjectId = detail.getSubjectId();
|
|
|
|
- List<Subject> subject = subjectService.findBySubjectByIdList(subjectId);
|
|
|
|
- if (!subject.isEmpty()) {
|
|
|
|
- result.setFriendSubjectName(subject.get(0).getName());
|
|
|
|
- }
|
|
|
|
|
|
+ List<Subject> subject = subjectService.findBySubjectByIdList(detail.getSubjectId());
|
|
|
|
+ String subjectName = subject.stream().map(Subject::getName).collect(Collectors.joining("、"));
|
|
|
|
+ result.setFriendSubjectName(subjectName);
|
|
}
|
|
}
|
|
} else if (ClientEnum.TEACHER.getCode().equals(friendClientType)) {
|
|
} else if (ClientEnum.TEACHER.getCode().equals(friendClientType)) {
|
|
TeacherVo detail = teacherDao.detail(userId);
|
|
TeacherVo detail = teacherDao.detail(userId);
|
|
if (detail != null && StringUtils.isNotEmpty(detail.getSubjectId())) {
|
|
if (detail != null && StringUtils.isNotEmpty(detail.getSubjectId())) {
|
|
- String subjectId = detail.getSubjectId();
|
|
|
|
- List<Subject> subject = subjectService.findBySubjectByIdList(subjectId);
|
|
|
|
- if (!subject.isEmpty()) {
|
|
|
|
- result.setFriendSubjectName(subject.get(0).getName());
|
|
|
|
- }
|
|
|
|
|
|
+ List<Subject> subject = subjectService.findBySubjectByIdList(detail.getSubjectId());
|
|
|
|
+ String subjectName = subject.stream().map(Subject::getName).collect(Collectors.joining("、"));
|
|
|
|
+ result.setFriendSubjectName(subjectName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
VipCardRecordWrapper.UserVip userVip = vipCardRecordService.UserVipInfo(userId, ClientEnum.valueOf(friendClientType));
|
|
VipCardRecordWrapper.UserVip userVip = vipCardRecordService.UserVipInfo(userId, ClientEnum.valueOf(friendClientType));
|