package com.xjrsoft.module.student.service.impl; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.yulichang.base.MPJBaseServiceImpl; import com.xjrsoft.common.enums.GenderEnum; import com.xjrsoft.module.student.dto.BaseStudentScholarshipApplicantCategoryPageDto; import com.xjrsoft.module.student.entity.BaseStudentScholarshipApplicant; import com.xjrsoft.module.student.entity.BaseStudentUser; import com.xjrsoft.module.student.mapper.BaseStudentMapper; import com.xjrsoft.module.student.mapper.BaseStudentScholarshipApplicantMapper; import com.xjrsoft.module.student.service.IBaseStudentScholarshipApplicantService; import com.xjrsoft.module.student.vo.StudentInfoVo; import com.xjrsoft.module.student.vo.BaseStudentScholarshipApplicantCategoryPageVo; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; import com.baomidou.mybatisplus.core.toolkit.Wrappers; /** * @title: 奖学金申请 * @Author dzx * @Date: 2023-11-23 * @Version 1.0 */ @Service @AllArgsConstructor public class BaseStudentScholarshipApplicantServiceImpl extends MPJBaseServiceImpl implements IBaseStudentScholarshipApplicantService { private final BaseStudentScholarshipApplicantMapper baseStudentScholarshipApplicantMapper; @Override public Page getScholarshiPage(Page page, BaseStudentScholarshipApplicantCategoryPageDto dto) { Page result = baseStudentScholarshipApplicantMapper.getScholarshiPage(page, dto); return result; } private final BaseStudentScholarshipApplicantMapper scholarshipApplicantMapper; private final BaseStudentMapper studentMapper; @Override public Boolean processDataHandler(Long dataId) { if (dataId == null) { return false; } // 原始数据 BaseStudentScholarshipApplicant scholarshipApplicant = scholarshipApplicantMapper.selectById(dataId); // 获取学生信息 StudentInfoVo studentInfo = studentMapper.getStudentInfo(scholarshipApplicant.getApplicantUserId()); scholarshipApplicant.setGradeName(studentInfo.getGradeName()); scholarshipApplicant.setClassName(studentInfo.getClassName()); scholarshipApplicant.setName(studentInfo.getStudentName()); scholarshipApplicant.setStudentId(studentInfo.getStudentId()); scholarshipApplicant.setGenderName(GenderEnum.getValue(studentInfo.getGender())); scholarshipApplicant.setEnrollTypeCn(studentInfo.getEnrollmentType()); scholarshipApplicant.setMajorName(studentInfo.getMajorName()); return updateById(scholarshipApplicant); } }