BaseStudentScholarshipApplicantServiceImpl.java 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package com.xjrsoft.module.student.service.impl;
  2. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  3. import com.github.yulichang.base.MPJBaseServiceImpl;
  4. import com.xjrsoft.common.enums.GenderEnum;
  5. import com.xjrsoft.module.student.dto.BaseStudentScholarshipApplicantCategoryPageDto;
  6. import com.xjrsoft.module.student.entity.BaseStudentScholarshipApplicant;
  7. import com.xjrsoft.module.student.entity.BaseStudentUser;
  8. import com.xjrsoft.module.student.mapper.BaseStudentMapper;
  9. import com.xjrsoft.module.student.mapper.BaseStudentScholarshipApplicantMapper;
  10. import com.xjrsoft.module.student.service.IBaseStudentScholarshipApplicantService;
  11. import com.xjrsoft.module.student.vo.StudentInfoVo;
  12. import com.xjrsoft.module.student.vo.BaseStudentScholarshipApplicantCategoryPageVo;
  13. import lombok.AllArgsConstructor;
  14. import org.springframework.stereotype.Service;
  15. import org.springframework.transaction.annotation.Transactional;
  16. import java.util.List;
  17. import java.util.Objects;
  18. import java.util.stream.Collectors;
  19. import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  20. /**
  21. * @title: 奖学金申请
  22. * @Author dzx
  23. * @Date: 2023-11-23
  24. * @Version 1.0
  25. */
  26. @Service
  27. @AllArgsConstructor
  28. public class BaseStudentScholarshipApplicantServiceImpl extends MPJBaseServiceImpl<BaseStudentScholarshipApplicantMapper, BaseStudentScholarshipApplicant> implements IBaseStudentScholarshipApplicantService {
  29. private final BaseStudentScholarshipApplicantMapper baseStudentScholarshipApplicantMapper;
  30. @Override
  31. public Page<BaseStudentScholarshipApplicantCategoryPageVo> getScholarshiPage(Page<BaseStudentScholarshipApplicantCategoryPageDto> page, BaseStudentScholarshipApplicantCategoryPageDto dto) {
  32. Page<BaseStudentScholarshipApplicantCategoryPageVo> result = baseStudentScholarshipApplicantMapper.getScholarshiPage(page, dto);
  33. return result;
  34. }
  35. private final BaseStudentScholarshipApplicantMapper scholarshipApplicantMapper;
  36. private final BaseStudentMapper studentMapper;
  37. @Override
  38. public Boolean processDataHandler(Long dataId) {
  39. if (dataId == null) {
  40. return false;
  41. }
  42. // 原始数据
  43. BaseStudentScholarshipApplicant scholarshipApplicant = scholarshipApplicantMapper.selectById(dataId);
  44. // 获取学生信息
  45. StudentInfoVo studentInfo = studentMapper.getStudentInfo(scholarshipApplicant.getApplicantUserId());
  46. scholarshipApplicant.setGradeName(studentInfo.getGradeName());
  47. scholarshipApplicant.setClassName(studentInfo.getClassName());
  48. scholarshipApplicant.setName(studentInfo.getStudentName());
  49. scholarshipApplicant.setStudentId(studentInfo.getStudentId());
  50. scholarshipApplicant.setGenderName(GenderEnum.getValue(studentInfo.getGender()));
  51. scholarshipApplicant.setEnrollTypeCn(studentInfo.getEnrollmentType());
  52. scholarshipApplicant.setMajorName(studentInfo.getMajorName());
  53. return updateById(scholarshipApplicant);
  54. }
  55. }