123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 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<StudentDao, StudentEntity> implements StudentService {
- private static final Logger log = LoggerFactory.getLogger(StudentServiceImpl.class);
- @Override
- public StudentEntity findStudentByStudentCode(Long orgId, String studentCode) {
- QueryWrapper<StudentEntity> 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) {
- }
- }
|