Browse Source

试读报到

dzx 9 months ago
parent
commit
235409d819

+ 3 - 1
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java

@@ -733,8 +733,10 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
         //修改新生信息中的状态
         List<BandingTaskClassStudent> classStudents = classStudentService.list(
                 new MPJLambdaWrapper<BandingTaskClassStudent>()
+                        .select(BandingTaskClassStudent::getId)
+                        .select(BandingTaskClassStudent.class, x -> VoToColumnUtil.fieldsToColumns(BandingTaskClassStudent.class).contains(x.getProperty()))
                         .innerJoin(BandingTaskClass.class, BandingTaskClass::getId, BandingTaskClassStudent::getBandingTaskClassId)
-                        .eq(BandingTaskClass::getBandingTaskId, dto.getBandingTaskId())
+                        .eq(BandingTaskClass::getBandingTaskId, dto.getId())
         );
         List<Long> studentIds = classStudents.stream().map(BandingTaskClassStudent::getNewStudentId).collect(Collectors.toList());
         if(studentIds.isEmpty()){

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

@@ -13,7 +13,6 @@ import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
 import com.xjrsoft.common.utils.TreeUtil;
-import com.xjrsoft.module.banding.entity.BandingTask;
 import com.xjrsoft.module.banding.service.IBandingTaskService;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.entity.BaseSemester;
@@ -23,8 +22,10 @@ import com.xjrsoft.module.student.dto.AddStudentReportPlanDto;
 import com.xjrsoft.module.student.dto.StudentReportPlanPageDto;
 import com.xjrsoft.module.student.dto.StudentReportPlanStatusDto;
 import com.xjrsoft.module.student.dto.UpdateStudentReportPlanDto;
+import com.xjrsoft.module.student.entity.EnrollmentPlan;
 import com.xjrsoft.module.student.entity.StudentReportPlan;
 import com.xjrsoft.module.student.entity.StudentReportPlanClassRelation;
+import com.xjrsoft.module.student.service.IEnrollmentPlanService;
 import com.xjrsoft.module.student.service.IStudentReportPlanService;
 import com.xjrsoft.module.student.vo.StudentReportPlanClassRelationVo;
 import com.xjrsoft.module.student.vo.StudentReportPlanPageVo;
@@ -67,7 +68,7 @@ public class StudentReportPlanController {
     private final IStudentReportPlanService studentReportPlanService;
     private final IBaseSemesterService semesterService;
     private final IBaseClassService classService;
-    private final IBandingTaskService taskService;
+    private final IEnrollmentPlanService enrollmentPlanService;
 
     @GetMapping(value = "/page")
     @ApiOperation(value="学生报到计划列表(分页)")
@@ -240,15 +241,8 @@ public class StudentReportPlanController {
     @ApiOperation(value="根据分班任务id查询试读报到计划信息")
     @SaCheckPermission("bandingrule:try-reading-plan")
     @XjrLog(value="根据分班任务id查询试读报到计划信息")
-    public RT<StudentReportPlanVo> tryReadingPlan(@RequestParam Long bandingTaskId){
-        BandingTask bandingTask = taskService.getById(bandingTaskId);
-        BaseSemester semester = semesterService.getCurrentSemester();
-        StudentReportPlan plan = studentReportPlanService.getOne(
-                new QueryWrapper<StudentReportPlan>().lambda()
-                        .eq(StudentReportPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
-                        .eq(StudentReportPlan::getSemesterId, semester.getId())
-                        .eq(StudentReportPlan::getName, bandingTask.getName())
-        );
+    public RT<StudentReportPlanVo> tryReadingPlan(@RequestParam Long id){
+        EnrollmentPlan plan = enrollmentPlanService.getById(id);
         if (plan == null) {
             return RT.error("找不到此数据!");
         }