package com.qmth.exam.reserve.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.qmth.boot.core.exception.StatusException; import com.qmth.exam.reserve.bean.student.StudentInfo; import com.qmth.exam.reserve.bean.student.WechatBindReq; import com.qmth.exam.reserve.dao.StudentDao; import com.qmth.exam.reserve.entity.StudentEntity; import com.qmth.exam.reserve.service.StudentService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @Service public class StudentServiceImpl extends ServiceImpl implements StudentService { private static final Logger log = LoggerFactory.getLogger(StudentServiceImpl.class); @Override public StudentEntity findStudentByStudentCode(Long orgId, String studentCode) { QueryWrapper wrapper = new QueryWrapper<>(); if (orgId != null) { wrapper.lambda().eq(StudentEntity::getOrgId, orgId); } wrapper.lambda().eq(StudentEntity::getStudentCode, studentCode); return baseMapper.selectOne(wrapper); } @Override public StudentInfo findInfoByStudentId(Long studentId) { StudentEntity entity = baseMapper.selectById(studentId); if (entity == null) { throw new StatusException("学生不存在"); } StudentInfo info = new StudentInfo(); info.setOrgId(entity.getOrgId()); info.setId(entity.getId()); info.setName(entity.getName()); info.setStudentCode(entity.getStudentCode()); info.setIdentityNumber(entity.getIdentityNumber()); info.setPhotoPath(entity.getPhotoPath()); info.setGender(entity.getGender()); info.setApplyNumber(entity.getApplyNumber()); info.setApplyTaskId(entity.getApplyTaskId()); info.setCategoryId(entity.getCategoryId()); info.setOpenId(entity.getOpenId()); info.setUid(entity.getUid()); return info; } @Override public void bindingWechat(WechatBindReq req) { } @Override public void unbindWechatByStudentId(Long studentId) { } }