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.ScoreTypeEnum; import com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionMobilePageDto; import com.xjrsoft.module.student.dto.BaseStudentAssessmentInspectionPageDto; import com.xjrsoft.module.student.entity.BaseStudentAssessmentInspection; import com.xjrsoft.module.student.mapper.BaseStudentAssessmentInspectionMapper; import com.xjrsoft.module.student.service.IBaseStudentAssessmentInspectionService; import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionMobilePageVo; import com.xjrsoft.module.student.vo.BaseStudentAssessmentInspectionPageVo; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; /** * @title: 学生班级巡查考核 * @Author dzx * @Date: 2023-11-16 * @Version 1.0 */ @Service @AllArgsConstructor public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceImpl implements IBaseStudentAssessmentInspectionService { private final BaseStudentAssessmentInspectionMapper assessmentInspectionMapper; @Override public Page getPage(Page page, BaseStudentAssessmentInspectionPageDto dto) { Page result = assessmentInspectionMapper.getPage(page, dto); // 处理加减分 result.getRecords().forEach((node) -> { if (node.getScoreType().equals(ScoreTypeEnum.ScoreMinus.getCode())) { node.setScore(node.getScore() * -1); } }); return result; } @Override public Page getMobilePage(Page page, BaseStudentAssessmentInspectionMobilePageDto dto) { Page result = assessmentInspectionMapper.getMobilePage(page, dto); // 处理加减分 result.getRecords().forEach((node) -> { if (node.getScoreType().equals(ScoreTypeEnum.ScoreMinus.getCode())) { node.setScore(node.getScore() * -1); } }); return result; } }