瀏覽代碼

Merge branch 'pre'

dzx 9 月之前
父節點
當前提交
84e4fb54d9

+ 3 - 0
src/main/java/com/xjrsoft/module/banding/service/IBandingTaskClassService.java

@@ -7,6 +7,7 @@ import com.xjrsoft.module.banding.dto.UpdateBandingClassDto;
 import com.xjrsoft.module.banding.entity.BandingTask;
 import com.xjrsoft.module.banding.entity.BandingTaskClass;
 import com.xjrsoft.module.banding.vo.BandingTaskClassPageVo;
+import com.xjrsoft.module.banding.vo.BandingTaskClassReportStatisticsVo;
 import com.xjrsoft.module.banding.vo.BandingTaskClassStudentListVo;
 import com.xjrsoft.module.banding.vo.BandingTaskClassSureListVo;
 import com.xjrsoft.module.base.entity.BaseClass;
@@ -67,4 +68,6 @@ public interface IBandingTaskClassService extends MPJBaseService<BandingTaskClas
     Boolean initClassByBaseClass(BandingTask bandingTask);
 
     Boolean deleteClass(List<Long> ids);
+
+    BandingTaskClassReportStatisticsVo getTryReadingReportClassStatistics(Long classId);
 }

+ 80 - 3
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskClassServiceImpl.java

@@ -8,9 +8,9 @@ import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.common.enums.GenderDictionaryEnum;
 import com.xjrsoft.common.enums.YesOrNoEnum;
 import com.xjrsoft.common.exception.MyException;
-import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.banding.dto.BandingTaskClassPageDto;
 import com.xjrsoft.module.banding.dto.BandingTaskClassStudentPageDto;
@@ -23,6 +23,7 @@ import com.xjrsoft.module.banding.mapper.BandingTaskClassStudentMapper;
 import com.xjrsoft.module.banding.mapper.BandingTaskMapper;
 import com.xjrsoft.module.banding.service.IBandingTaskClassService;
 import com.xjrsoft.module.banding.vo.BandingTaskClassPageVo;
+import com.xjrsoft.module.banding.vo.BandingTaskClassReportStatisticsVo;
 import com.xjrsoft.module.banding.vo.BandingTaskClassStudentListVo;
 import com.xjrsoft.module.banding.vo.BandingTaskClassSureListVo;
 import com.xjrsoft.module.base.entity.BaseClass;
@@ -33,6 +34,16 @@ import com.xjrsoft.module.base.service.IBaseClassroomService;
 import com.xjrsoft.module.base.service.IBaseMajorSetService;
 import com.xjrsoft.module.organization.entity.User;
 import com.xjrsoft.module.organization.service.IUserService;
+import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
+import com.xjrsoft.module.student.dto.StudentTryReadingReportPageDto;
+import com.xjrsoft.module.student.entity.EnrollmentPlan;
+import com.xjrsoft.module.student.entity.StudentReportPlan;
+import com.xjrsoft.module.student.mapper.EnrollmentPlanMapper;
+import com.xjrsoft.module.student.mapper.StudentReportPlanMapper;
+import com.xjrsoft.module.student.mapper.StudentReportRecordMapper;
+import com.xjrsoft.module.student.service.IEnrollmentPlanService;
+import com.xjrsoft.module.student.service.IStudentReportPlanService;
+import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
 import com.xjrsoft.module.system.entity.DictionaryDetail;
 import com.xjrsoft.module.system.entity.DictionaryItem;
 import com.xjrsoft.module.system.mapper.DictionarydetailMapper;
@@ -65,6 +76,11 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
     private final IBaseMajorSetService majorSetService;
     private final DictionarydetailMapper detailMapper;
     private final BaseClassMapper classMapper;
+    private final StudentReportRecordMapper reportRecordMapper;
+    private final EnrollmentPlanMapper enrollmentPlanMapper;
+    private final IStudentReportPlanService reportPlanService;
+
+
     @Override
     public Boolean add(BandingTaskClass bandingTaskClass) {
         bandingTaskClass.setCreateDate(new Date());
@@ -318,8 +334,6 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
 
     /**
      * 班级管理中,修改信息时同步修改新生分班中的班级信息
-     * @param baseClass
-     * @return
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -442,4 +456,67 @@ public class BandingTaskClassServiceImpl extends MPJBaseServiceImpl<BandingTaskC
         }
         return true;
     }
+
+    @Override
+    public BandingTaskClassReportStatisticsVo getTryReadingReportClassStatistics(Long classId) {
+        BandingTaskClassReportStatisticsVo result = new BandingTaskClassReportStatisticsVo();
+        StudentTryReadingReportPageDto dto = new StudentTryReadingReportPageDto();
+        if(classId == 0L){
+            StudentReportPlan plan = reportPlanService.getLastTryReadingPlan();
+            BandingTask bandingTask = bandingTaskMapper.selectById(plan.getBandingTaskId());
+            List<EnrollmentPlan> enrollmentPlans = enrollmentPlanMapper.selectList(
+                    new QueryWrapper<EnrollmentPlan>().lambda()
+                            .eq(EnrollmentPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
+                            .eq(EnrollmentPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
+                            .eq(EnrollmentPlan::getEnrollType, bandingTask.getEnrollType())
+                            .eq(EnrollmentPlan::getGradeId, bandingTask.getGradeId())
+                            .orderByDesc(EnrollmentPlan::getId)
+            );
+            if(!enrollmentPlans.isEmpty()){
+                dto.setEnrollmentPlanId(enrollmentPlans.get(0).getId());
+            }
+        }else{
+            BandingTaskClass taskClass = this.getById(classId);
+            BandingTask task = bandingTaskMapper.selectById(taskClass.getBandingTaskId());
+            List<EnrollmentPlan> enrollmentPlanList = enrollmentPlanMapper.selectList(
+                    new QueryWrapper<EnrollmentPlan>().lambda()
+                            .eq(EnrollmentPlan::getEnrollType, task.getEnrollType())
+                            .eq(EnrollmentPlan::getGradeId, task.getGradeId())
+                            .eq(EnrollmentPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
+                            .eq(EnrollmentPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
+                            .orderByDesc(EnrollmentPlan::getId)
+            );
+            if(!enrollmentPlanList.isEmpty()){
+                dto.setEnrollmentPlanId(enrollmentPlanList.get(0).getId());
+            }
+        }
+
+
+        dto.setClassId(classId);
+        List<StudentReportRecordPlanPageVo> tryReadingList = reportRecordMapper.getTryReadingList(dto);
+
+        result.setAllCount(tryReadingList.size());
+
+        //女生人数
+        List<StudentReportRecordPlanPageVo> femaleList = tryReadingList.stream()
+                .filter(x -> x.getGender() != null && GenderDictionaryEnum.FEMALE.getValue().equals(x.getGender()))
+                .collect(Collectors.toList());
+        result.setMaleCount(femaleList.size());
+        //男生人数
+        List<StudentReportRecordPlanPageVo> maleList = tryReadingList.stream()
+                .filter(x -> x.getGender() != null && GenderDictionaryEnum.MALE.getValue().equals(x.getGender()))
+                .collect(Collectors.toList());
+        result.setFemaleCount(maleList.size());
+        //已到人数
+        List<StudentReportRecordPlanPageVo> arrivedList = tryReadingList.stream()
+                .filter(x -> x.getIsReport() == 1)
+                .collect(Collectors.toList());
+        result.setArrivedCount(arrivedList.size());
+        //未到人数
+        List<StudentReportRecordPlanPageVo> notArrivedList = tryReadingList.stream()
+                .filter(x -> x.getIsReport() == 0)
+                .collect(Collectors.toList());
+        result.setNotArrivedCount(notArrivedList.size());
+        return result;
+    }
 }

+ 65 - 0
src/main/java/com/xjrsoft/module/banding/vo/BandingTaskClassReportStatisticsVo.java

@@ -0,0 +1,65 @@
+package com.xjrsoft.module.banding.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+* @title: 新生分班任务分页列表出参
+* @Author dzx
+* @Date: 2024-07-01
+* @Version 1.0
+*/
+@Data
+public class BandingTaskClassReportStatisticsVo {
+
+    @ApiModelProperty("主键编号")
+    private Long id;
+
+    @ApiModelProperty("学生人数")
+    private Integer allCount;
+
+    @ApiModelProperty("男生人数")
+    private Integer maleCount;
+
+    @ApiModelProperty("女生人数")
+    private Integer femaleCount;
+
+    @ApiModelProperty("班级名称")
+    private String name;
+
+    @ApiModelProperty("班级人数")
+    private Integer number;
+
+    @ApiModelProperty("是否订单班(0:否 1:是)")
+    private Integer isOrderClass;
+
+
+    @ApiModelProperty("班主任id")
+    private Long teacherId;
+
+    @ApiModelProperty("班主任名称")
+    private String teacherName;
+
+    @ApiModelProperty("教室id")
+    private Long classroomId;
+
+    @ApiModelProperty("教室名称")
+    private String classroomName;
+
+    @ApiModelProperty("班级类型")
+    private String classType;
+
+    @ApiModelProperty("已到人数")
+    private Integer arrivedCount;
+
+    @ApiModelProperty("未到人数")
+    private Integer notArrivedCount;
+
+    @ApiModelProperty("已到男生人数")
+    private Integer arrivedMaleCount;
+
+    @ApiModelProperty("已到女生人数")
+    private Integer arrivedFemaleCount;
+}

+ 13 - 0
src/main/java/com/xjrsoft/module/classtime/controller/ClassTimeDeleteController.java

@@ -78,6 +78,19 @@ public class ClassTimeDeleteController {
         return RT.ok(isSuccess);
     }
 
+    @PostMapping(value = "add-batch")
+    @ApiOperation(value = "批量新增新增课时删除")
+    @SaCheckPermission("classtimedelete:add")
+    public RT<Boolean> add(@Valid @RequestBody List<AddClassTimeDeleteDto> dtoList){
+        for (AddClassTimeDeleteDto dto : dtoList) {
+            ClassTimeDelete classTimeDelete = BeanUtil.toBean(dto, ClassTimeDelete.class);
+            classTimeDelete.setCreateDate(new Date());
+            classTimeDeleteService.save(classTimeDelete);
+        }
+
+        return RT.ok(true);
+    }
+
     @PutMapping
     @ApiOperation(value = "修改课时删除")
     @SaCheckPermission("classtimedelete:edit")

+ 1 - 1
src/main/java/com/xjrsoft/module/student/controller/StudentReportPlanController.java

@@ -255,7 +255,7 @@ public class StudentReportPlanController {
                         .eq(BandingTask::getGradeId, enrollmentPlan.getGradeId())
         );
         if (plan == null) {
-            return RT.ok(new StudentReportPlanVo());
+            return RT.error("未能查询到有报到学生,无法设置");
         }
         return RT.ok(BeanUtil.toBean(plan, StudentReportPlanVo.class));
     }

+ 256 - 14
src/main/java/com/xjrsoft/module/student/controller/StudentTryReadingReportController.java

@@ -5,25 +5,52 @@ import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
 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.extension.plugins.pagination.Page;
 import com.xjrsoft.common.annotation.XjrLog;
+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;
 import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.banding.dto.BandingTaskClassPageDto;
+import com.xjrsoft.module.banding.entity.BandingTask;
 import com.xjrsoft.module.banding.service.IBandingTaskClassService;
 import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
+import com.xjrsoft.module.banding.service.IBandingTaskService;
 import com.xjrsoft.module.banding.vo.BandingTaskClassPageVo;
+import com.xjrsoft.module.banding.vo.BandingTaskClassReportStatisticsVo;
+import com.xjrsoft.module.base.entity.BaseGrade;
+import com.xjrsoft.module.base.service.IBaseGradeService;
+import com.xjrsoft.module.base.service.IBaseSemesterService;
+import com.xjrsoft.module.databoard.vo.ItemCountVo;
+import com.xjrsoft.module.organization.dto.GetUserByParamDto;
+import com.xjrsoft.module.organization.entity.User;
+import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.student.dto.ChangeBandingStatusDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
+import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
 import com.xjrsoft.module.student.dto.StudentReportSignDto;
+import com.xjrsoft.module.student.dto.StudentTryReadingReportPageDto;
+import com.xjrsoft.module.student.entity.BaseNewStudent;
+import com.xjrsoft.module.student.entity.EnrollmentPlan;
 import com.xjrsoft.module.student.entity.StudentReportPlan;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
+import com.xjrsoft.module.student.service.IBaseNewStudentService;
+import com.xjrsoft.module.student.service.IBaseStudentSchoolRollService;
+import com.xjrsoft.module.student.service.IEnrollmentPlanService;
 import com.xjrsoft.module.student.service.IStudentReportPlanService;
 import com.xjrsoft.module.student.service.IStudentReportRecordService;
 import com.xjrsoft.module.student.vo.StudentReportRecordExcelVo;
+import com.xjrsoft.module.student.vo.StudentReportRecordItemVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
+import com.xjrsoft.module.student.vo.StudentReportRecordStatisticsVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
@@ -32,13 +59,18 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
 import java.io.ByteArrayOutputStream;
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
 * @title: 新生维护信息
@@ -56,17 +88,39 @@ public class StudentTryReadingReportController {
     private final IBandingTaskClassStudentService classStudentService;
     private final IStudentReportPlanService reportPlanService;
     private final IBandingTaskClassService bandingTaskClassService;
+    private final IBaseSemesterService semesterService;
+    private final IBaseGradeService gradeService;
+    private final IEnrollmentPlanService enrollmentPlanService;
+    private final IBandingTaskService bandingTaskService;
+    private final IUserService userService;
+    private final IBaseStudentSchoolRollService rollService;
+    private final IBaseNewStudentService newStudentService;
 
 
     @GetMapping(value = "/page")
     @ApiOperation(value="试读报到(分页)")
     @SaCheckPermission("tryreadingreport:detail")
     @XjrLog(value="试读报到(分页)")
-    public RT<PageOutput<StudentReportRecordPlanPageVo>> page(@Valid StudentReportRecordPageDto dto){
+    public RT<PageOutput<StudentReportRecordPlanPageVo>> page(@Valid StudentTryReadingReportPageDto dto){
         List<String> roleList = StpUtil.getRoleList();
         if(roleList.contains("CLASSTE") && roleList.contains("TEACHER")){
             dto.setTeacherId(StpUtil.getLoginIdAsLong());
         }
+        if(dto.getIsMoible() != null && dto.getIsMoible() == 1){
+            StudentReportPlan plan = reportPlanService.getLastTryReadingPlan();
+            BandingTask bandingTask = bandingTaskService.getById(plan.getBandingTaskId());
+            List<EnrollmentPlan> enrollmentPlans = enrollmentPlanService.list(
+                    new QueryWrapper<EnrollmentPlan>().lambda()
+                            .eq(EnrollmentPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
+                            .eq(EnrollmentPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
+                            .eq(EnrollmentPlan::getEnrollType, bandingTask.getEnrollType())
+                            .eq(EnrollmentPlan::getGradeId, bandingTask.getGradeId())
+                            .orderByDesc(EnrollmentPlan::getId)
+            );
+            if(!enrollmentPlans.isEmpty()){
+                dto.setEnrollmentPlanId(enrollmentPlans.get(0).getId());
+            }
+        }
         Page<StudentReportRecordPlanPageVo> page = recordService.getTryReadingPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
         PageOutput<StudentReportRecordPlanPageVo> pageOutput = ConventPage.getPageOutput(page, StudentReportRecordPlanPageVo.class);
         return RT.ok(pageOutput);
@@ -82,6 +136,17 @@ public class StudentTryReadingReportController {
         List<Long> list = new ArrayList<>();
         list.add(record.getUserId());
         classStudentService.removeStudent(list, reportPlan.getBandingTaskId());
+        BaseNewStudent newStudent = newStudentService.getById(record.getUserId());
+        if(newStudent != null){
+            User user = userService.getUserByParam(new GetUserByParamDto() {{
+                setCredentialNumber(newStudent.getCredentialNumber());
+            }});
+            if(user != null){
+                rollService.disableStudent(user.getId());
+            }
+        }
+
+
         return RT.ok(true);
     }
 
@@ -128,7 +193,7 @@ public class StudentTryReadingReportController {
     @ApiOperation(value="导出")
     @SaCheckPermission("studentreportrecord:detail")
     @XjrLog(value = "导出")
-    public ResponseEntity<byte[]> exportQuerty(@Valid @RequestBody StudentReportRecordPageDto dto){
+    public ResponseEntity<byte[]> exportQuerty(@Valid @RequestBody StudentTryReadingReportPageDto dto){
         List<StudentReportRecordExcelVo> dataList = new ArrayList<>();
 
         List<String> roleList = StpUtil.getRoleList();
@@ -162,22 +227,199 @@ public class StudentTryReadingReportController {
     @GetMapping(value = "/class-list")
     @ApiOperation(value="查询班级信息")
     @SaCheckPermission("studentreportrecord:detail")
-    @XjrLog(value = "导出")
-    public RT<List<BandingTaskClassPageVo>> classList(@Valid Long teacherId){
-        BandingTaskClassPageDto dto = new BandingTaskClassPageDto();
-        if(teacherId != null){
-            dto.setTeacherId(teacherId);
+    @XjrLog(value = "查询班级信息")
+    public RT<List<BandingTaskClassPageVo>> classList(@Valid StudentReportRecordPageDto dto){
+        BandingTaskClassPageDto classDto = new BandingTaskClassPageDto();
+        if(dto.getEnrollmentPlanId() == null){
+            if(dto.getTeacherId() != null){
+                classDto.setTeacherId(dto.getTeacherId());
+            }else{
+                classDto.setTeacherId(StpUtil.getLoginIdAsLong());
+            }
+            StudentReportPlan plan = reportPlanService.getLastTryReadingPlan();
+            if(plan == null){
+                return RT.ok(new ArrayList<>());
+            }
+            classDto.setBandingTaskId(plan.getBandingTaskId());
         }else{
-            dto.setTeacherId(StpUtil.getLoginIdAsLong());
-        }
-        StudentReportPlan plan = reportPlanService.getLastTryReadingPlan();
-        if(plan == null){
-            return RT.ok(new ArrayList<>());
+            EnrollmentPlan enrollmentPlan = enrollmentPlanService.getById(dto.getEnrollmentPlanId());
+            if(enrollmentPlan != null){
+                List<BandingTask> list = bandingTaskService.list(
+                        new QueryWrapper<BandingTask>().lambda()
+                                .eq(BandingTask::getEnrollType, enrollmentPlan.getEnrollType())
+                                .eq(BandingTask::getGradeId, enrollmentPlan.getGradeId())
+                                .eq(BandingTask::getDeleteMark, DeleteMark.NODELETE.getCode())
+                                .eq(BandingTask::getEnabledMark, EnabledMark.ENABLED.getCode())
+                                .orderByDesc(BandingTask::getId)
+                );
+                if(!list.isEmpty()){
+                    classDto.setBandingTaskId(list.get(0).getId());
+                }
+            }
         }
-        dto.setBandingTaskId(plan.getBandingTaskId());
-        List<BandingTaskClassPageVo> list = bandingTaskClassService.getList(dto);
+
+        List<BandingTaskClassPageVo> list = bandingTaskClassService.getList(classDto);
         return RT.ok(list);
     }
 
+    @GetMapping(value = "/class-statistics")
+    @ApiOperation(value="班级数据统计")
+    @SaCheckPermission("studentreportrecord:detail")
+    @XjrLog(value = "班级数据统计")
+    public RT<BandingTaskClassReportStatisticsVo> classStatistics(@RequestParam Long classId){
+        return RT.ok(bandingTaskClassService.getTryReadingReportClassStatistics(classId));
+    }
+
+    @GetMapping(value = "/statistics")
+    @ApiOperation(value="领导统计")
+    @SaCheckPermission("studentreportrecord:detail")
+    public RT<StudentReportRecordStatisticsVo> statistics(@Valid StudentReportRecordStatisticsDto dto){
+        if(dto.getGradeId() == null && (dto.getCategory() == null || dto.getCategory() == 1)){
+            LambdaQueryWrapper<BaseGrade> queryWrapper = new LambdaQueryWrapper<>();
+            queryWrapper
+                    .orderByDesc(BaseGrade::getTitle)
+                    .select(BaseGrade.class,x -> VoToColumnUtil.fieldsToColumns(BaseGrade.class).contains(x.getProperty()));
+            List<BaseGrade> gradeList = gradeService.list(queryWrapper);
+            if(!gradeList.isEmpty()){
+                dto.setGradeId(gradeList.get(0).getId());
+            }
+        }
+        if(dto.getEnrollType() == null || dto.getEnrollType().isEmpty()){
+            dto.setEnrollType(EnrollTypeEnum.AUTUMN_ENROLLMENT.getCode());
+        }
+        if(dto.getCategory() != null && dto.getCategory() == 2 && dto.getBaseSemesterId() == null){
+            dto.setBaseSemesterId(semesterService.getLastSemester());
+        }
+
+        List<EnrollmentPlan> enrollmentPlanList = enrollmentPlanService.list(
+                new QueryWrapper<EnrollmentPlan>().lambda()
+                        .eq(EnrollmentPlan::getEnrollType, dto.getEnrollType())
+                        .eq(EnrollmentPlan::getGradeId, dto.getGradeId())
+                        .eq(EnrollmentPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
+                        .eq(EnrollmentPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
+                        .orderByDesc(EnrollmentPlan::getId)
+        );
+        if(enrollmentPlanList.isEmpty()){
+            return RT.ok(new StudentReportRecordStatisticsVo());
+        }
+
+        StudentTryReadingReportPageDto recordPageDto = new StudentTryReadingReportPageDto();
+        recordPageDto.setEnrollmentPlanId(enrollmentPlanList.get(0).getId());
+
+        List<StudentReportRecordPlanPageVo> dataList = recordService.getTryReadingList(recordPageDto);
+        StudentReportRecordStatisticsVo statisticsVo = new StudentReportRecordStatisticsVo();
+        statisticsVo.setAllCount(dataList.stream().count());
+
+        statisticsVo.setArrivedCount(dataList.stream().filter(x -> x.getReportTime() != null).count());
+        statisticsVo.setNotArrivedCount(dataList.stream().filter(x -> x.getReportTime() == null).count());
+        statisticsVo.setArrivedMaleCount(dataList.stream().filter(x -> x.getReportTime() != null && GenderDictionaryEnum.MALE.getCode().equals(x.getGender())).count());
+        statisticsVo.setArrivedFemaleCount(dataList.stream().filter(x -> x.getReportTime() != null && GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender())).count());
+
+        statisticsVo.setStayMaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.MALE.getCode().equals(x.getGender())
+                        && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatusCn())
+                        && x.getReportTime() != null
+        ).count());
+        statisticsVo.setStayFemaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender())
+                        && StudyStatusEnum.InResidence.getCode().equals(x.getStduyStatusCn())
+                        && x.getReportTime() != null
+        ).count());
+        statisticsVo.setNotStayMaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.MALE.getCode().equals(x.getGender())
+                        && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatusCn())
+                        && x.getReportTime() != null
+        ).count());
+        statisticsVo.setNotStayFemaleCount(dataList.stream().filter(
+                x -> GenderDictionaryEnum.FEMALE.getCode().equals(x.getGender())
+                        && StudyStatusEnum.AttendDaySchool.getCode().equals(x.getStduyStatusCn())
+                        && x.getReportTime() != null
+        ).count());
+
+        if(dto.getCategory() != null && dto.getCategory() == 1){
+            Map<String, List<StudentReportRecordPlanPageVo>> graduatedUniversityMap = dataList.stream().filter(x -> x.getReportTime() != null)
+                    .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getGraduateSchool));
+            List<ItemCountVo> graduatedUniversityList = new ArrayList<>();
+            for (String graduatedUniversity : graduatedUniversityMap.keySet()) {
+                graduatedUniversityList.add(
+                        new ItemCountVo(){{
+                            setItem(graduatedUniversity);
+                            setCount(graduatedUniversityMap.get(graduatedUniversity).size());
+                        }}
+                );
+            }
+            statisticsVo.setGraduatedUniversityList(graduatedUniversityList);
+        }
+
+        Map<String, List<StudentReportRecordPlanPageVo>> classMap = dataList.stream().filter(x -> x.getReportTime() != null)
+                .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassName));
+        Map<String, List<StudentReportRecordPlanPageVo>> classNotMap = dataList.stream().filter(x -> x.getReportTime() == null)
+                .collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassName));
+        List<StudentReportRecordItemVo> classList = new ArrayList<>();
+        for (String className : classMap.keySet()) {
+            classList.add(
+                    new StudentReportRecordItemVo(){{
+                        setItem(className);
+                        setCount(classMap.get(className).size());
+                        if(classNotMap.get(className) != null && !(classNotMap.get(className).isEmpty())){
+                            setCount2(classNotMap.get(className).size());
+                        }
+                    }}
+            );
+        }
+        statisticsVo.setClassList(classList);
+
+        Map<String, List<StudentReportRecordPlanPageVo>> classTypeMap = dataList.stream().filter(x -> x.getReportTime() != null).collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassType));
+        Map<String, List<StudentReportRecordPlanPageVo>> classTypeNotMap = dataList.stream().filter(x -> x.getReportTime() == null).collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getClassType));
+        List<StudentReportRecordItemVo> classTypeList = new ArrayList<>();
+        for (String classType : classTypeMap.keySet()) {
+            classTypeList.add(
+                    new StudentReportRecordItemVo(){{
+                        setItem(classType);
+                        setCount(classTypeMap.get(classType).size());
+                        if(classTypeNotMap.get(classType) != null && !(classTypeNotMap.get(classType).isEmpty())){
+                            setCount2(classTypeNotMap.get(classType).size());
+                        }
+                    }}
+            );
+        }
+        statisticsVo.setClassTypeList(classTypeList);
+
+        Map<String, List<StudentReportRecordPlanPageVo>> majorMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getMajorName() != null).collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getMajorName));
+        Map<String, List<StudentReportRecordPlanPageVo>> majorNotMap = dataList.stream().filter(x -> x.getReportTime() == null && x.getMajorName() != null).collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getMajorName));
+        List<StudentReportRecordItemVo> majorList = new ArrayList<>();
+        for (String majorName : majorMap.keySet()) {
+            majorList.add(
+                    new StudentReportRecordItemVo(){{
+                        setItem(majorName);
+                        setCount(majorMap.get(majorName).size());
+                        if(majorNotMap.get(majorName) != null && !(majorNotMap.get(majorName).isEmpty())){
+                            setCount2(majorNotMap.get(majorName).size());
+                        }
+                    }}
+            );
+        }
+        statisticsVo.setMajorList(majorList);
+
+        Map<String, List<StudentReportRecordPlanPageVo>> deptMap = dataList.stream().filter(x -> x.getReportTime() != null && x.getDeptName() != null).collect(Collectors.groupingBy(StudentReportRecordPlanPageVo::getDeptName));
+        List<ItemCountVo> deptList = new ArrayList<>();
+        for (String deptName : deptMap.keySet()) {
+            deptList.add(
+                    new ItemCountVo(){{
+                        setItem(deptName);
+                        setCount(deptMap.get(deptName).size());
+                    }}
+            );
+        }
+        statisticsVo.setDeptList(deptList);
+
+        BigDecimal divide = BigDecimal.ZERO;
+        if( statisticsVo.getAllCount() != 0){
+            divide = BigDecimal.valueOf(statisticsVo.getArrivedCount()).divide(BigDecimal.valueOf(statisticsVo.getAllCount()), 4, RoundingMode.HALF_UP);
+        }
+        statisticsVo.setReportRate(divide.doubleValue());
+        return RT.ok(statisticsVo);
+    }
+
 
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/dto/StudentReportRecordPageDto.java

@@ -68,4 +68,7 @@ public class StudentReportRecordPageDto extends PageInput {
     @ApiModelProperty("招生计划id(enrollment_plan)")
     private Long enrollmentPlanId;
 
+    @ApiModelProperty("是否移动端(1:是 0:否)")
+    private Integer isMoible;
+
 }

+ 73 - 0
src/main/java/com/xjrsoft/module/student/dto/StudentTryReadingReportPageDto.java

@@ -0,0 +1,73 @@
+package com.xjrsoft.module.student.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+
+/**
+* @title: 学生报到记录表分页查询入参
+* @Author dzx
+* @Date: 2024-08-28
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class StudentTryReadingReportPageDto extends PageInput {
+    @ApiModelProperty("学期id")
+    private Long baseSemesterId;
+
+    @ApiModelProperty("教师id")
+    private Long teacherId;
+
+
+    @ApiModelProperty("年级id")
+    private Long gradeId;
+
+    @ApiModelProperty("班级id")
+    private Long classId;
+
+    @ApiModelProperty("计划id")
+    private Long studentReportPlanId;
+
+    @ApiModelProperty("姓名")
+    private String name;
+
+    @ApiModelProperty("班级名称")
+    private String className;
+
+    @ApiModelProperty("身份证号")
+    private String credentialNumber;
+
+    @ApiModelProperty("学籍状态")
+    private String archivesStatus;
+
+    @ApiModelProperty("就读方式")
+    private String stduyStatus;
+
+    @ApiModelProperty("学生来源")
+    private String studentType;
+
+    @ApiModelProperty("是否已报到(1:是 0:否)")
+    private Integer isReport;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty("报到时间开始")
+    private LocalDateTime reportTimeStart;
+
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty("报到时间结束")
+    private LocalDateTime reportTimeEnd;
+
+    @ApiModelProperty("招生计划id(enrollment_plan)")
+    private Long enrollmentPlanId;
+
+    @ApiModelProperty("是否移动端(1:是 0:否)")
+    private Integer isMoible;
+
+}

+ 3 - 2
src/main/java/com/xjrsoft/module/student/mapper/StudentReportRecordMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
+import com.xjrsoft.module.student.dto.StudentTryReadingReportPageDto;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
 import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
@@ -36,8 +37,8 @@ public interface StudentReportRecordMapper extends MPJBaseMapper<StudentReportRe
 
     List<StudentReportRecordStatisticsListVo> getStatisticsPlanDataList(@Param("dto") StudentReportRecordStatisticsDto dto);
 
-    Page<StudentReportRecordPlanPageVo> getTryReadingPage(Page<StudentReportRecordPlanPageVo> page, @Param("dto") StudentReportRecordPageDto dto);
+    Page<StudentReportRecordPlanPageVo> getTryReadingPage(Page<StudentReportRecordPlanPageVo> page, @Param("dto") StudentTryReadingReportPageDto dto);
 
-    List<StudentReportRecordPlanPageVo> getTryReadingList(@Param("dto") StudentReportRecordPageDto dto);
+    List<StudentReportRecordPlanPageVo> getTryReadingList(@Param("dto") StudentTryReadingReportPageDto dto);
 
 }

+ 3 - 2
src/main/java/com/xjrsoft/module/student/service/IStudentReportRecordService.java

@@ -6,6 +6,7 @@ import com.xjrsoft.module.banding.dto.ChangeClassDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
 import com.xjrsoft.module.student.dto.StudentReportSignDto;
+import com.xjrsoft.module.student.dto.StudentTryReadingReportPageDto;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
 import com.xjrsoft.module.student.vo.StudentReportRecordPageVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
@@ -49,9 +50,9 @@ public interface IStudentReportRecordService extends MPJBaseService<StudentRepor
 
     Boolean updateStduyStatusByTryReading(StudentReportSignDto dto);
 
-    Page<StudentReportRecordPlanPageVo> getTryReadingPage(Page<StudentReportRecordPlanPageVo> page, StudentReportRecordPageDto dto);
+    Page<StudentReportRecordPlanPageVo> getTryReadingPage(Page<StudentReportRecordPlanPageVo> page, StudentTryReadingReportPageDto dto);
 
-    List<StudentReportRecordPlanPageVo> getTryReadingList(StudentReportRecordPageDto dto);
+    List<StudentReportRecordPlanPageVo> getTryReadingList(StudentTryReadingReportPageDto dto);
 
     Boolean tryReadingSign(StudentReportSignDto dto);
 

+ 6 - 6
src/main/java/com/xjrsoft/module/student/service/impl/StudentChangeRecordServiceImpl.java

@@ -7,7 +7,6 @@ import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.xjrsoft.common.enums.ArchivesStatusEnum;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.EnabledMark;
-import com.xjrsoft.common.enums.LearnStatusEnum;
 import com.xjrsoft.common.enums.RollModalityEnum;
 import com.xjrsoft.common.enums.RoomApplicantTypeEnum;
 import com.xjrsoft.common.enums.StudentChangeTypeEnum;
@@ -33,6 +32,7 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 
 /**
 * @title: 学生异动记录表
@@ -173,7 +173,7 @@ public class StudentChangeRecordServiceImpl extends MPJBaseServiceImpl<StudentCh
     @Override
     public Boolean insertDataByStudentUpdate(BaseStudentSchoolRoll beforeRoll, BaseStudentSchoolRoll afterRoll) {
         List<StudentChangeRecord> insertList = new ArrayList<>();
-        if(!beforeRoll.getClassId().equals(afterRoll.getClassId())){
+        if(!Objects.equals(beforeRoll.getClassId(), afterRoll.getClassId())){
             BaseClass afterClass = classService.getById(afterRoll.getClassId());
             BaseClass beforeClass = classService.getById(beforeRoll.getClassId());
 
@@ -193,7 +193,7 @@ public class StudentChangeRecordServiceImpl extends MPJBaseServiceImpl<StudentCh
             insertList.add(record);
         }
 
-        if(!beforeRoll.getArchivesStatus().equals(afterRoll.getArchivesStatus())){
+        if(!Objects.equals(beforeRoll.getArchivesStatus(), afterRoll.getArchivesStatus())){
             StudentChangeRecord record = new StudentChangeRecord() {{
                 setAfterData(ArchivesStatusEnum.fromCode(afterRoll.getArchivesStatus()));
                 setAfterDataCode(afterRoll.getArchivesStatus());
@@ -209,7 +209,7 @@ public class StudentChangeRecordServiceImpl extends MPJBaseServiceImpl<StudentCh
             }};
             insertList.add(record);
         }
-        if(!beforeRoll.getStudentType().equals(afterRoll.getStudentType())){
+        if(!Objects.equals(beforeRoll.getStudentType(), afterRoll.getStudentType())){
             StudentChangeRecord record = new StudentChangeRecord() {{
                 setAfterData(StudentTypeEnum.fromCode(afterRoll.getStudentType()));
                 setAfterDataCode(afterRoll.getStudentType());
@@ -226,7 +226,7 @@ public class StudentChangeRecordServiceImpl extends MPJBaseServiceImpl<StudentCh
             insertList.add(record);
         }
 
-        if(!beforeRoll.getStduyStatus().equals(afterRoll.getStduyStatus())){
+        if(!Objects.equals(beforeRoll.getStduyStatus(), afterRoll.getStduyStatus())){
             StudentChangeRecord record = new StudentChangeRecord() {{
                 setAfterData(StudyStatusEnum.fromCode(afterRoll.getStduyStatus()));
                 setAfterDataCode(afterRoll.getStduyStatus());
@@ -243,7 +243,7 @@ public class StudentChangeRecordServiceImpl extends MPJBaseServiceImpl<StudentCh
             insertList.add(record);
         }
 
-        if(!beforeRoll.getLearnStatus().equals(afterRoll.getLearnStatus())){
+        if(!Objects.equals(beforeRoll.getLearnStatus(), afterRoll.getLearnStatus())){
             StudentChangeRecord record = new StudentChangeRecord() {{
                 setAfterData(RollModalityEnum.fromCode(afterRoll.getLearnStatus()));
                 setAfterDataCode(afterRoll.getLearnStatus());

+ 10 - 3
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportRecordServiceImpl.java

@@ -16,6 +16,7 @@ import com.xjrsoft.common.enums.RoleEnum;
 import com.xjrsoft.common.enums.StudentChangeTypeEnum;
 import com.xjrsoft.common.enums.StudyStatusEnum;
 import com.xjrsoft.common.exception.MyException;
+import com.xjrsoft.common.utils.LocalDateTimeUtil;
 import com.xjrsoft.common.utils.LocalDateUtil;
 import com.xjrsoft.common.utils.RedisUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
@@ -34,6 +35,7 @@ import com.xjrsoft.module.organization.service.IUserService;
 import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordStatisticsDto;
 import com.xjrsoft.module.student.dto.StudentReportSignDto;
+import com.xjrsoft.module.student.dto.StudentTryReadingReportPageDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.entity.BaseStudent;
 import com.xjrsoft.module.student.entity.BaseStudentFamily;
@@ -291,12 +293,12 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
     }
 
     @Override
-    public Page<StudentReportRecordPlanPageVo> getTryReadingPage(Page<StudentReportRecordPlanPageVo> page, StudentReportRecordPageDto dto) {
+    public Page<StudentReportRecordPlanPageVo> getTryReadingPage(Page<StudentReportRecordPlanPageVo> page, StudentTryReadingReportPageDto dto) {
         return this.baseMapper.getTryReadingPage(page, dto);
     }
 
     @Override
-    public List<StudentReportRecordPlanPageVo> getTryReadingList(StudentReportRecordPageDto dto) {
+    public List<StudentReportRecordPlanPageVo> getTryReadingList(StudentTryReadingReportPageDto dto) {
         return this.baseMapper.getTryReadingList(dto);
     }
 
@@ -309,6 +311,12 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
     @Transactional(rollbackFor = Exception.class)
     public Boolean tryReadingSign(StudentReportSignDto dto) {
         StudentReportRecord record = this.getById(dto.getId());
+        LocalDateTime now = LocalDateTime.now();
+        StudentReportPlan reportPlan = planMapper.selectById(record.getStudentReportPlanId());
+        if(!LocalDateTimeUtil.isDateTimeInRange(now, reportPlan.getStartTime(), reportPlan.getEndTime())){
+            throw new MyException("不在修改时间内,无法修改");
+        }
+
         BaseNewStudent student = newStudentMapper.selectById(record.getUserId());
         if(record.getReportTime() == null){
             record.setReportTime(new Date());
@@ -342,7 +350,6 @@ public class StudentReportRecordServiceImpl extends MPJBaseServiceImpl<StudentRe
                 rollService.activateStudent(user.getId());
             }else{
                 LocalDate birthDate = getBirthDate(student.getCredentialNumber());
-                LocalDateTime now = LocalDateTime.now();
                 User xjrUser = new User() {{
                     setCreateDate(now);
                     setPassword(BCrypt.hashpw(propertiesConfig.getDefaultPassword(), BCrypt.gensalt()));

+ 12 - 0
src/main/java/com/xjrsoft/module/student/vo/StudentReportRecordPlanPageVo.java

@@ -77,4 +77,16 @@ public class StudentReportRecordPlanPageVo {
     @ApiModelProperty("家长电话")
     private String parentMobile;
 
+    @ApiModelProperty("毕业学校")
+    private String graduateSchool;
+
+    @ApiModelProperty("专业名称")
+    private String majorName;
+
+    @ApiModelProperty("班级类型")
+    private String classType;
+
+    @ApiModelProperty("部门名称")
+    private String deptName;
+
 }

+ 48 - 26
src/main/resources/mapper/student/StudentReportRecordMapper.xml

@@ -221,32 +221,43 @@
     </select>
 
 
-    <select id="getTryReadingPage" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordPageDto" resultType="com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo">
+    <select id="getTryReadingPage" parameterType="com.xjrsoft.module.student.dto.StudentTryReadingReportPageDto" resultType="com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo">
         SELECT t1.id, t1.user_id, t4.name AS grade_name,t5.name AS class_name,t6.name AS teacher_name,
         t3.name,t7.name AS gender,t3.credential_number,t3.mobile,t8.name AS student_type_cn,
-        t9.name AS stduy_status_cn,
+        t9.name AS stduy_status_cn,t3.gender,t13.name as major_name,t14.name as class_type,
         t1.report_time,IF(t1.report_time IS NULL, 0, 1) AS is_report,
-        t3.family_mobile AS parent_mobile
+        t3.family_mobile AS parent_mobile,t15.name as dept_name
         FROM student_report_record t1
-        INNER JOIN banding_task_class_student t2 ON t1.user_id = t2.new_student_id
         INNER JOIN base_new_student t3 ON t3.id = t1.user_id
+        LEFT JOIN banding_task_class_student t2 ON t1.user_id = t2.new_student_id and t2.delete_mark = 0
         LEFT JOIN banding_task_class t5 ON t2.banding_task_class_id = t5.id
         LEFT JOIN xjr_user t6 ON t5.teacher_id = t6.id
-        LEFT JOIN xjr_dictionary_detail t7 ON t3.gender = t7.code
-        LEFT JOIN xjr_dictionary_detail t8 ON t3.source = t8.code
-        LEFT JOIN xjr_dictionary_detail t9 ON t3.stduy_status = t9.code
+        LEFT JOIN xjr_dictionary_detail t7 ON t3.gender = t7.code and t7.delete_mark = 0
+        LEFT JOIN xjr_dictionary_detail t8 ON t3.source = t8.code and t8.delete_mark = 0
+        LEFT JOIN xjr_dictionary_detail t9 ON t3.stduy_status = t9.code and t9.delete_mark = 0
         LEFT JOIN banding_task t10 ON t5.banding_task_id = t10.id
-        LEFT JOIN base_grade t4 ON t10.grade_id = t4.id
         LEFT JOIN enrollment_plan t11 ON t11.id = t3.enrollment_plan_id
+        LEFT JOIN base_grade t4 ON t11.grade_id = t4.id
         LEFT JOIN student_report_plan t12 ON t12.id = t1.student_report_plan_id
+        LEFT JOIN base_major_set t13 ON t13.id = t5.major_set_id
+        LEFT JOIN xjr_dictionary_detail t14 ON t5.class_type = t14.code and t14.delete_mark = 0
+        LEFT JOIN xjr_department t15 ON t15.id = t13.department_id
         WHERE t1.delete_mark = 0 AND t1.enabled_mark = 1
-        and t12.status = 1 and t2.delete_mark = 0
+        and t12.status = 1
         and t3.enrollment_plan_id = #{dto.enrollmentPlanId}
         <if test="dto.keyword != null and dto.keyword != ''">
             and t1.name like concat('%', #{dto.keyword},'%')
         </if>
         <if test="dto.classId != null">
-            and t5.id = #{dto.classId}
+            <if test="dto.classId != 0">
+                and t5.id = #{dto.classId}
+            </if>
+            <if test="dto.classId == 0">
+                and t5.id is null
+            </if>
+        </if>
+        <if test="dto.teacherId != null">
+            and (t5.teacher_id = #{dto.teacherId} or t5.id is null)
         </if>
         <if test="dto.gradeId != null">
             and t4.id = #{dto.gradeId}
@@ -261,13 +272,13 @@
             and t3.credential_number like concat('%', #{dto.credentialNumber}, '%')
         </if>
         <if test="dto.archivesStatus != null and dto.archivesStatus != ''">
-            and t1.archives_status = #{dto.archivesStatus}
+            and t3.archives_status = #{dto.archivesStatus}
         </if>
         <if test="dto.stduyStatus != null and dto.stduyStatus != ''">
-            and t1.stduy_status = #{dto.stduyStatus}
+            and t3.stduy_status = #{dto.stduyStatus}
         </if>
         <if test="dto.studentType != null and dto.studentType != ''">
-            and t1.student_type = #{dto.studentType}
+            and t3.source = #{dto.studentType}
         </if>
         <if test="dto.isReport != null">
             <if test="dto.isReport == 1">
@@ -280,34 +291,45 @@
         <if test="dto.reportTimeStart != null and dto.reportTimeEnd != null">
             and t1.report_time between #{dto.reportTimeStart} and #{dto.reportTimeEnd}
         </if>
-        ORDER BY t1.report_time IS NULL DESC, t1.report_time DESC,t5.name
+        ORDER BY t1.report_time IS NULL DESC, t1.report_time DESC,t5.name is null desc,t5.name
     </select>
-    <select id="getTryReadingList" parameterType="com.xjrsoft.module.student.dto.StudentReportRecordPageDto" resultType="com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo">
+    <select id="getTryReadingList" parameterType="com.xjrsoft.module.student.dto.StudentTryReadingReportPageDto" resultType="com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo">
         SELECT t1.id, t1.user_id, t4.name AS grade_name,t5.name AS class_name,t6.name AS teacher_name,
         t3.name,t7.name AS gender,t3.credential_number,t3.mobile,t8.name AS student_type_cn,
-        t9.name AS stduy_status_cn,
+        t9.name AS stduy_status_cn,t3.gender,t13.name as major_name,t14.name as class_type,
         t1.report_time,IF(t1.report_time IS NULL, 0, 1) AS is_report,
-        t3.family_mobile AS parent_mobile
+        t3.family_mobile AS parent_mobile,t15.name as dept_name
         FROM student_report_record t1
-        INNER JOIN banding_task_class_student t2 ON t1.user_id = t2.new_student_id
         INNER JOIN base_new_student t3 ON t3.id = t1.user_id
+        LEFT JOIN banding_task_class_student t2 ON t1.user_id = t2.new_student_id and t2.delete_mark = 0
         LEFT JOIN banding_task_class t5 ON t2.banding_task_class_id = t5.id
         LEFT JOIN xjr_user t6 ON t5.teacher_id = t6.id
-        LEFT JOIN xjr_dictionary_detail t7 ON t3.gender = t7.code
-        LEFT JOIN xjr_dictionary_detail t8 ON t3.source = t8.code
-        LEFT JOIN xjr_dictionary_detail t9 ON t3.stduy_status = t9.code
+        LEFT JOIN xjr_dictionary_detail t7 ON t3.gender = t7.code and t7.delete_mark = 0
+        LEFT JOIN xjr_dictionary_detail t8 ON t3.source = t8.code and t8.delete_mark = 0
+        LEFT JOIN xjr_dictionary_detail t9 ON t3.stduy_status = t9.code and t9.delete_mark = 0
         LEFT JOIN banding_task t10 ON t5.banding_task_id = t10.id
-        LEFT JOIN base_grade t4 ON t10.grade_id = t4.id
         LEFT JOIN enrollment_plan t11 ON t11.id = t3.enrollment_plan_id
+        LEFT JOIN base_grade t4 ON t11.grade_id = t4.id
         LEFT JOIN student_report_plan t12 ON t12.id = t1.student_report_plan_id
+        LEFT JOIN base_major_set t13 ON t13.id = t5.major_set_id
+        LEFT JOIN xjr_dictionary_detail t14 ON t5.class_type = t14.code and t14.delete_mark = 0
+        LEFT JOIN xjr_department t15 ON t15.id = t13.department_id
         WHERE t1.delete_mark = 0 AND t1.enabled_mark = 1
-        and t12.status = 1 and t2.delete_mark = 0
+        and t12.status = 1
         and t3.enrollment_plan_id = #{dto.enrollmentPlanId}
         <if test="dto.keyword != null and dto.keyword != ''">
             and t1.name like concat('%', #{dto.keyword},'%')
         </if>
         <if test="dto.classId != null">
-            and t5.id = #{dto.classId}
+            <if test="dto.classId != 0">
+                and t5.id = #{dto.classId}
+            </if>
+            <if test="dto.classId == 0">
+                and t5.id is null
+            </if>
+        </if>
+        <if test="dto.teacherId != null">
+            and (t5.teacher_id = #{dto.teacherId} or t5.id is null)
         </if>
         <if test="dto.gradeId != null">
             and t4.id = #{dto.gradeId}
@@ -328,7 +350,7 @@
             and t3.stduy_status = #{dto.stduyStatus}
         </if>
         <if test="dto.studentType != null and dto.studentType != ''">
-            and t3.student_type = #{dto.studentType}
+            and t3.source = #{dto.studentType}
         </if>
         <if test="dto.isReport != null">
             <if test="dto.isReport == 1">
@@ -341,6 +363,6 @@
         <if test="dto.reportTimeStart != null and dto.reportTimeEnd != null">
             and t1.report_time between #{dto.reportTimeStart} and #{dto.reportTimeEnd}
         </if>
-        ORDER BY t1.report_time IS NULL DESC, t1.report_time DESC,t5.name is null desc,t5.name
+        ORDER BY t5.name IS NULL,t5.name DESC,t1.report_time IS NULL DESC, t1.report_time DESC
     </select>
 </mapper>