From f6ba3e15355e22767e69f8fc14ae22523f8db8dc Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期三, 22 十一月 2023 19:33:58 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai --- cloud-server-account/src/main/java/com/dsh/account/service/impl/EvaluateStudentServiceImpl.java | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cloud-server-account/src/main/java/com/dsh/account/service/impl/EvaluateStudentServiceImpl.java b/cloud-server-account/src/main/java/com/dsh/account/service/impl/EvaluateStudentServiceImpl.java index 58f2acc..62bea5b 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/service/impl/EvaluateStudentServiceImpl.java +++ b/cloud-server-account/src/main/java/com/dsh/account/service/impl/EvaluateStudentServiceImpl.java @@ -2,12 +2,15 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dsh.account.entity.Coach; import com.dsh.account.entity.EvaluateStudent; import com.dsh.account.entity.TStudent; import com.dsh.account.mapper.EvaluateStudentMapper; import com.dsh.account.mapper.TStudentMapper; import com.dsh.account.model.vo.commentDetail.StuCommentsVo; +import com.dsh.account.service.CoachService; import com.dsh.account.service.EvaluateStudentService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -32,17 +35,26 @@ private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); + + @Autowired + private CoachService coachService; @Override public List<StuCommentsVo> queryStuCommentsList(Integer stuId) { List<StuCommentsVo> stuCommentsVos = new ArrayList<>(); TStudent tStudent = tstuMapper.selectById(stuId); List<EvaluateStudent> evaluateStudents = this.list(new QueryWrapper<EvaluateStudent>() .eq("studentId",stuId )); + + if (evaluateStudents.size() > 0){ for (EvaluateStudent evaluateStudent : evaluateStudents) { StuCommentsVo vo = new StuCommentsVo(); - vo.setHeadImg(tStudent.getHeadImg()); - vo.setStuName(tStudent.getName()); + + Coach coach = coachService.getById(evaluateStudent.getCoachId()); +// vo.setHeadImg(tStudent.getHeadImg()); + vo.setHeadImg(coach.getDiploma()); +// vo.setStuName(tStudent.getName()); + vo.setStuName(coach.getName()); vo.setComTime(format.format(tStudent.getInsertTime())); vo.setContents(evaluateStudent.getContent()); String imgs = evaluateStudent.getImgs(); -- Gitblit v1.7.1