dzx 9 месяцев назад
Родитель
Сommit
b99e1a85e5

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

@@ -103,14 +103,12 @@ public class BandingTaskClassStudentServiceImpl extends MPJBaseServiceImpl<Bandi
                         }
                     }}
             );
-            BandingTaskClass taskClass = taskClassMapper.selectById(dto.getBandingTaskClassId());
-
             insertList.add(
                     new StudentReportRecord(){{
                         setCreateDate(new Date());
                         setCreateUserId(StpUtil.getLoginIdAsLong());
                         setUserId(newStudentId);
-                        setBandingTaskId(taskClass.getBandingTaskId());
+                        setStudentReportPlanId(plan.getId());
                         setDeleteMark(DeleteMark.NODELETE.getCode());
                         setEnabledMark(EnabledMark.ENABLED.getCode());
                     }}

+ 10 - 8
src/main/java/com/xjrsoft/module/banding/service/impl/BandingTaskServiceImpl.java

@@ -764,6 +764,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                         .eq(StudentReportPlan::getDeleteMark, DeleteMark.NODELETE.getCode())
                         .eq(StudentReportPlan::getEnabledMark, EnabledMark.ENABLED.getCode())
                         .eq(StudentReportPlan::getSemesterId, semester.getId())
+                        .eq(StudentReportPlan::getBandingTaskId, dto.getBandingTaskId())
                         .eq(StudentReportPlan::getCategory, 2)
         );
         if(plan == null){
@@ -771,6 +772,7 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
                 setName(bandingTask.getName());
                 setCategory(2);
                 setSemesterId(semester.getId());
+                setBandingTaskId(dto.getBandingTaskId());
             }};
 
             reportPlanService.save(plan);
@@ -779,14 +781,14 @@ public class BandingTaskServiceImpl extends MPJBaseServiceImpl<BandingTaskMapper
 
         //将新生数据初始化到报到表中
         for (BaseNewStudent student : updateList) {
-            reportRecordMapper.insert(new StudentReportRecord(){{
-                setCreateDate(new Date());
-                setCreateUserId(StpUtil.getLoginIdAsLong());
-                setUserId(student.getId());
-                setBandingTaskId(dto.getBandingTaskId());
-                setDeleteMark(DeleteMark.NODELETE.getCode());
-                setEnabledMark(EnabledMark.ENABLED.getCode());
-            }});
+            StudentReportRecord record = new StudentReportRecord();
+            record.setCreateDate(new Date());
+            record.setCreateUserId(StpUtil.getLoginIdAsLong());
+            record.setUserId(student.getId());
+            record.setStudentReportPlanId(plan.getId());
+            record.setDeleteMark(DeleteMark.NODELETE.getCode());
+            record.setEnabledMark(EnabledMark.ENABLED.getCode());
+            reportRecordMapper.insert(record);
         }
 
 

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

@@ -11,15 +11,14 @@ import com.xjrsoft.common.enums.RoleCodeEnum;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
-import com.xjrsoft.module.banding.entity.BandingRule;
 import com.xjrsoft.module.banding.service.IBandingTaskClassStudentService;
-import com.xjrsoft.module.banding.vo.BandingRuleVo;
 import com.xjrsoft.module.student.dto.ChangeBandingStatusDto;
 import com.xjrsoft.module.student.dto.StudentReportRecordPageDto;
 import com.xjrsoft.module.student.dto.StudentReportSignDto;
+import com.xjrsoft.module.student.entity.StudentReportPlan;
 import com.xjrsoft.module.student.entity.StudentReportRecord;
+import com.xjrsoft.module.student.service.IStudentReportPlanService;
 import com.xjrsoft.module.student.service.IStudentReportRecordService;
-import com.xjrsoft.module.student.vo.StudentReportPlanVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordExcelVo;
 import com.xjrsoft.module.student.vo.StudentReportRecordPlanPageVo;
 import io.swagger.annotations.Api;
@@ -30,7 +29,6 @@ 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;
@@ -53,6 +51,7 @@ public class StudentTryReadingReportController {
 
     private final IStudentReportRecordService recordService;
     private final IBandingTaskClassStudentService classStudentService;
+    private final IStudentReportPlanService reportPlanService;
 
 
     @GetMapping(value = "/page")
@@ -75,9 +74,10 @@ public class StudentTryReadingReportController {
     @XjrLog(value="非本班学生")
     public RT<Boolean> clearClass(@Valid @RequestBody ChangeBandingStatusDto dto){
         StudentReportRecord record = recordService.getById(dto.getId());
+        StudentReportPlan reportPlan = reportPlanService.getById(record.getStudentReportPlanId());
         List<Long> list = new ArrayList<>();
         list.add(record.getUserId());
-        classStudentService.removeStudent(list, record.getBandingTaskId());
+        classStudentService.removeStudent(list, reportPlan.getBandingTaskId());
         return RT.ok(true);
     }
 

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

@@ -65,7 +65,7 @@ public class StudentReportRecordPageDto extends PageInput {
     @ApiModelProperty("报到时间结束")
     private LocalDate reportTimeEnd;
 
-    @ApiModelProperty("分班任务id")
-    private Long bandingTaskId;
+    @ApiModelProperty("招生计划id(enrollment_plan)")
+    private Long enrollmentPlanId;
 
 }

+ 3 - 0
src/main/java/com/xjrsoft/module/student/entity/StudentReportPlan.java

@@ -121,4 +121,7 @@ public class StudentReportPlan implements Serializable {
     @ApiModelProperty("类别(1:开学报到 2:试读报到 3:新生报到)")
     private Integer category;
 
+    @ApiModelProperty("分班任务id")
+    private Long bandingTaskId;
+
 }

+ 0 - 4
src/main/java/com/xjrsoft/module/student/entity/StudentReportRecord.java

@@ -88,8 +88,4 @@ public class StudentReportRecord implements Serializable {
     @ApiModelProperty("报到计划id")
     private Long studentReportPlanId;
 
-    @ApiModelProperty("分班任务id")
-    private Long bandingTaskId;
-
-
 }

+ 2 - 2
src/main/resources/mapper/student/StudentReportRecordMapper.xml

@@ -240,7 +240,7 @@
         LEFT JOIN enrollment_plan t11 ON t11.id = t1.enrollment_plan_id
         WHERE t1.delete_mark = 0 AND t1.enabled_mark = 1
         and t11.status = 1
-        and t1.banding_task_id = #{dto.bandingTaskId}
+        and t3.enrollment_plan_id = #{dto.enrollmentPlanId}
         <if test="dto.keyword != null and dto.keyword != ''">
             and t1.name like concat('%', #{dto.keyword},'%')
         </if>
@@ -298,7 +298,7 @@
         LEFT JOIN banding_task t10 ON t5.banding_task_id = t10.id
         LEFT JOIN base_grade t4 ON t10.grade_id = t4.id
         WHERE t1.delete_mark = 0 AND t1.enabled_mark = 1
-        and t1.banding_task_id = #{dto.bandingTaskId}
+        and t3.enrollment_plan_id = #{dto.enrollmentPlanId}
         <if test="dto.keyword != null and dto.keyword != ''">
             and t1.name like concat('%', #{dto.keyword},'%')
         </if>

+ 4 - 3
src/main/resources/sqlScript/20250310_sql.sql

@@ -1,9 +1,10 @@
 ALTER TABLE `student_report_record`   
-  ADD COLUMN `banding_task_id` BIGINT NULL   COMMENT '分班任务id' AFTER `student_report_plan_id`, 
-  ADD INDEX (`student_report_plan_id`),
-  ADD INDEX (`banding_task_id`);
+  ADD INDEX (`student_report_plan_id`);
 
 ALTER TABLE `student_report_record`   
   CHANGE `user_id` `user_id` BIGINT NULL   COMMENT '学生id(banding_task_id不为空时则为新生id)';
 ALTER TABLE `student_report_plan`   
   ADD COLUMN `category` INT DEFAULT 1  NULL   COMMENT '类别(1:开学报到 2:试读报到 3:新生报到)' AFTER `status`;
+  
+ALTER TABLE `student_report_plan`   
+  ADD COLUMN `banding_task_id` BIGINT NULL   COMMENT '分班任务id';