|
@@ -11,6 +11,7 @@ import com.ym.mec.education.entity.*;
|
|
import com.ym.mec.education.enums.StudentAttendanceStatusEnum;
|
|
import com.ym.mec.education.enums.StudentAttendanceStatusEnum;
|
|
import com.ym.mec.education.mapper.StudentAttendanceMapper;
|
|
import com.ym.mec.education.mapper.StudentAttendanceMapper;
|
|
import com.ym.mec.education.req.ClassGroupReq;
|
|
import com.ym.mec.education.req.ClassGroupReq;
|
|
|
|
+import com.ym.mec.education.req.CourseScheduleReq;
|
|
import com.ym.mec.education.resp.StudentAttendanceResp;
|
|
import com.ym.mec.education.resp.StudentAttendanceResp;
|
|
import com.ym.mec.education.resp.StudentAttendanceStatisticsResp;
|
|
import com.ym.mec.education.resp.StudentAttendanceStatisticsResp;
|
|
import com.ym.mec.education.service.*;
|
|
import com.ym.mec.education.service.*;
|
|
@@ -20,7 +21,6 @@ import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
-
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
|
|
@@ -75,6 +75,7 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
|
|
Integer normalCount = count(normalWrapper);
|
|
Integer normalCount = count(normalWrapper);
|
|
page.getRecords().forEach(item -> {
|
|
page.getRecords().forEach(item -> {
|
|
StudentAttendanceResp studentAttendanceResp = new StudentAttendanceResp();
|
|
StudentAttendanceResp studentAttendanceResp = new StudentAttendanceResp();
|
|
|
|
+ studentAttendanceResp.setCourseScheduleId(item.getCourseScheduleId());
|
|
studentAttendanceResp.setLeaveNum(leaveCount);
|
|
studentAttendanceResp.setLeaveNum(leaveCount);
|
|
if (totalCount != 0) {
|
|
if (totalCount != 0) {
|
|
studentAttendanceResp.setAttendanceRate(normalCount + "/" + totalCount);
|
|
studentAttendanceResp.setAttendanceRate(normalCount + "/" + totalCount);
|
|
@@ -99,16 +100,16 @@ public class StudentAttendanceServiceImpl extends ServiceImpl<StudentAttendanceM
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public PageResponse getPageRollCall(ClassGroupReq classGroupReq) {
|
|
|
|
- if (Objects.isNull(classGroupReq.getGroupId())) {
|
|
|
|
|
|
+ public PageResponse getPageByCourse(CourseScheduleReq courseScheduleReq) {
|
|
|
|
+ if (Objects.isNull(courseScheduleReq.getCourseScheduleId())) {
|
|
return PageResponse.errorParam();
|
|
return PageResponse.errorParam();
|
|
}
|
|
}
|
|
- CourseSchedule courseSchedule = courseScheduleService.getLastCourseSchedule(classGroupReq.getGroupId());
|
|
|
|
|
|
+ CourseSchedule courseSchedule = courseScheduleService.getById(courseScheduleReq.getCourseScheduleId());
|
|
Page<StudentAttendanceResp> pageResult = new Page<>();
|
|
Page<StudentAttendanceResp> pageResult = new Page<>();
|
|
if (Objects.nonNull(courseSchedule)) {
|
|
if (Objects.nonNull(courseSchedule)) {
|
|
- Page<StudentAttendance> studentAttendancePage = new Page<StudentAttendance>(classGroupReq.getPageNo(), classGroupReq.getPageSize());
|
|
|
|
|
|
+ Page<StudentAttendance> studentAttendancePage = new Page<StudentAttendance>(courseScheduleReq.getPageNo(), courseScheduleReq.getPageSize());
|
|
QueryWrapper<StudentAttendance> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<StudentAttendance> queryWrapper = new QueryWrapper<>();
|
|
- queryWrapper.lambda().eq(true, StudentAttendance::getClassGroupId, classGroupReq.getGroupId())
|
|
|
|
|
|
+ queryWrapper.lambda().eq(true, StudentAttendance::getCourseScheduleId, courseScheduleReq.getCourseScheduleId())
|
|
.eq(true, StudentAttendance::getCourseScheduleId, courseSchedule.getId());
|
|
.eq(true, StudentAttendance::getCourseScheduleId, courseSchedule.getId());
|
|
IPage<StudentAttendance> page = page(studentAttendancePage, queryWrapper);
|
|
IPage<StudentAttendance> page = page(studentAttendancePage, queryWrapper);
|
|
if (!CollectionUtils.isEmpty(page.getRecords())) {
|
|
if (!CollectionUtils.isEmpty(page.getRecords())) {
|