Browse Source

开学报到调整

dzx 10 months ago
parent
commit
7c1a075845

+ 6 - 4
src/main/java/com/xjrsoft/module/student/controller/StudentReportRecordController.java

@@ -222,7 +222,7 @@ public class StudentReportRecordController {
             }
         }
 
-        Long planId = planService.getEffectivePlanId(dto.getTeacherId());
+        Long planId = planService.getEffectivePlanId(dto.getTeacherId(), dto.getClassId());
         dto.setStudentReportPlanId(planId);
 
         StudentReportRecordStatisticsVo statisticsVo = studentReportRecordService.getClassStatistics(dto);
@@ -350,11 +350,13 @@ public class StudentReportRecordController {
         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)){
+            if(ObjectUtil.isNull(classId) && dto.getClassId() == null){
                 return RT.ok(new PageOutput<>());
             }
-            dto.setClassId(classId);
-            Long planId = planService.getEffectivePlanId(dto.getTeacherId());
+            if(dto.getClassId() == null){
+                dto.setClassId(classId);
+            }
+            Long planId = planService.getEffectivePlanId(dto.getTeacherId(), dto.getClassId());
             dto.setStudentReportPlanId(planId);
         }
         Page<StudentReportRecordPlanPageVo> planPage = studentReportRecordService.getPlanPage(new Page<>(dto.getLimit(), dto.getSize()), dto);

+ 1 - 1
src/main/java/com/xjrsoft/module/student/service/IStudentReportPlanService.java

@@ -47,5 +47,5 @@ public interface IStudentReportPlanService extends MPJBaseService<StudentReportP
 
     Boolean release(StudentReportPlan studentReportPlan);
 
-    Long getEffectivePlanId(Long teacherId);
+    Long getEffectivePlanId(Long teacherId, Long classId);
 }

+ 2 - 1
src/main/java/com/xjrsoft/module/student/service/impl/StudentReportPlanServiceImpl.java

@@ -193,13 +193,14 @@ public class StudentReportPlanServiceImpl extends MPJBaseServiceImpl<StudentRepo
      * @return 计划id
      */
     @Override
-    public Long getEffectivePlanId(Long teacherId) {
+    public Long getEffectivePlanId(Long teacherId, Long classId) {
         LocalDateTime now = LocalDateTime.now();
         List<StudentReportPlan> list = this.selectJoinList(StudentReportPlan.class,
                 new MPJLambdaWrapper<StudentReportPlan>()
                         .leftJoin(StudentReportPlanClassRelation.class, StudentReportPlanClassRelation::getStudentReportPlanId, StudentReportPlan::getId)
                         .leftJoin(BaseClass.class, BaseClass::getId, StudentReportPlanClassRelation::getClassId)
                         .eq(teacherId != null, BaseClass::getTeacherId, teacherId)
+                        .eq(classId != null, BaseClass::getId, classId)
                         .eq(StudentReportPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
                         .le(StudentReportPlan::getStartTime, now)
                         .ge(StudentReportPlan::getEndTime, now)