| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.course.CourseSessionNameClient; |
| | | import com.dsh.account.feignclient.course.model.StuSessionDetailsVo; |
| | | import com.dsh.account.mapper.TStudentMapper; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.ClassDetailsInsVo; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.StuDetailsReq; |
| | | import com.dsh.account.service.TStudentService; |
| | | |
| | | import com.dsh.account.util.ToolUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TStudentServiceImpl extends ServiceImpl<TStudentMapper, TStudent> implements TStudentService { |
| | | |
| | | @Autowired |
| | | private CourseSessionNameClient sessionNameClient; |
| | | |
| | | @Override |
| | | public void addStuOfAppUser(StuDetailsReq stu,Integer appUserId) { |
| | | TStudent student = new TStudent(); |
| | | student.setAppUserId(appUserId); |
| | | student.setName(stu.getName()); |
| | | student.setHeadImg(stu.getHeadImg()); |
| | | student.setPhone(stu.getPhone()); |
| | | student.setPhone(ToolUtil.isNotEmpty(stu.getPhone()) ? stu.getPhone() : ""); |
| | | student.setSex(stu.getSex()); |
| | | student.setIdCard(stu.getIdCard()); |
| | | student.setIdCard(ToolUtil.isNotEmpty(stu.getIdCard())?stu.getIdCard() : ""); |
| | | student.setBirthday(new Date(stu.getBirthday())); |
| | | student.setHeight(stu.getHeight()); |
| | | student.setWeight(stu.getWeight()); |
| | |
| | | student.setState(1); |
| | | this.baseMapper.insert(student); |
| | | } |
| | | |
| | | @Override |
| | | public ClassDetailsInsVo querySessionDetailsDt(Integer userIdFormRedis, Integer lessonId, Integer stuId) { |
| | | ClassDetailsInsVo insVo = new ClassDetailsInsVo(); |
| | | List<StuSessionDetailsVo> stuSessionList = sessionNameClient.getStuSessionList(stuId,userIdFormRedis); |
| | | TStudent tStudent = this.baseMapper.selectById(stuId); |
| | | if (ToolUtil.isNotEmpty(tStudent)){ |
| | | insVo.setStuId(tStudent.getId()); |
| | | insVo.setStuName(tStudent.getName()); |
| | | insVo.setStuImage(tStudent.getHeadImg()); |
| | | |
| | | insVo.setSessionNames(stuSessionList); |
| | | |
| | | } |
| | | |
| | | return insVo; |
| | | } |
| | | } |