|
@@ -3,14 +3,18 @@ package com.xjrsoft.module.student.controller;
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.xjrsoft.common.enums.DeleteMark;
|
|
|
+import com.xjrsoft.common.enums.EnabledMark;
|
|
|
import com.xjrsoft.common.enums.EnrollTypeEnum;
|
|
|
import com.xjrsoft.common.enums.GenderDictionaryEnum;
|
|
|
+import com.xjrsoft.common.enums.RoleCodeEnum;
|
|
|
import com.xjrsoft.common.enums.StudyStatusEnum;
|
|
|
import com.xjrsoft.common.model.result.RT;
|
|
|
import com.xjrsoft.common.page.ConventPage;
|
|
@@ -18,6 +22,7 @@ import com.xjrsoft.common.page.PageOutput;
|
|
|
import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
import com.xjrsoft.module.base.entity.BaseGrade;
|
|
|
import com.xjrsoft.module.base.entity.BaseSemester;
|
|
|
+import com.xjrsoft.module.base.service.IBaseClassService;
|
|
|
import com.xjrsoft.module.base.service.IBaseGradeService;
|
|
|
import com.xjrsoft.module.base.service.IBaseSemesterService;
|
|
|
import com.xjrsoft.module.databoard.vo.ItemCountVo;
|
|
@@ -77,6 +82,8 @@ public class StudentReportRecordController {
|
|
|
private final IBaseSemesterService semesterService;
|
|
|
private final IBaseGradeService gradeService;
|
|
|
private final IStudentReportPlanService studentReportPlanService;
|
|
|
+ private final IStudentReportPlanService planService;
|
|
|
+ private final IBaseClassService classService;
|
|
|
|
|
|
@GetMapping(value = "/page")
|
|
|
@ApiOperation(value="学生报到记录表列表(分页)")
|
|
@@ -190,6 +197,7 @@ public class StudentReportRecordController {
|
|
|
@ApiOperation(value="班级统计")
|
|
|
@SaCheckPermission("studentreportrecord:detail")
|
|
|
public RT<StudentReportRecordStatisticsVo> classStatistics(@Valid StudentReportRecordStatisticsDto dto){
|
|
|
+
|
|
|
if(dto.getTeacherId() == null){
|
|
|
dto.setTeacherId(StpUtil.getLoginIdAsLong());
|
|
|
}
|
|
@@ -213,6 +221,10 @@ public class StudentReportRecordController {
|
|
|
dto.setGradeId(gradeList.get(0).getId());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ Long planId = planService.getEffectivePlanId(dto.getTeacherId());
|
|
|
+ dto.setStudentReportPlanId(planId);
|
|
|
+
|
|
|
StudentReportRecordStatisticsVo statisticsVo = studentReportRecordService.getClassStatistics(dto);
|
|
|
if(statisticsVo == null){
|
|
|
statisticsVo = new StudentReportRecordStatisticsVo();
|
|
@@ -335,6 +347,14 @@ public class StudentReportRecordController {
|
|
|
@ApiOperation(value="学生报到记录表列表(分页)")
|
|
|
@SaCheckPermission("studentreportrecord:detail")
|
|
|
public RT<PageOutput<StudentReportRecordPlanPageVo>> planPage(@Valid StudentReportRecordPageDto dto){
|
|
|
+ List<String> roleList = StpUtil.getRoleList();
|
|
|
+ if(roleList.size() == 2 && roleList.contains(RoleCodeEnum.TEACHER.getCode()) && roleList.contains(RoleCodeEnum.CLASSTE.getCode())){
|
|
|
+ Long classId = classService.getIdByTeacherId(StpUtil.getLoginIdAsLong());
|
|
|
+ if(ObjectUtil.isNull(classId)){
|
|
|
+ return RT.ok(new PageOutput<>());
|
|
|
+ }
|
|
|
+ dto.setClassId(classId);
|
|
|
+ }
|
|
|
Page<StudentReportRecordPlanPageVo> planPage = studentReportRecordService.getPlanPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
|
|
|
PageOutput<StudentReportRecordPlanPageVo> pageOutput = ConventPage.getPageOutput(planPage, StudentReportRecordPlanPageVo.class);
|
|
|
return RT.ok(pageOutput);
|