Sfoglia il codice sorgente

新生报到功能

dzx 6 mesi fa
parent
commit
46c663a762

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

@@ -94,7 +94,10 @@ public class BaseNewStudentController {
     @ApiOperation(value="新生报到(分页)")
     @SaCheckPermission("basenewstudent:detail")
     public RT<PageOutput<BaseNewStudentPageVo>> reportPage(@Valid BaseNewStudentPageDto dto){
-
+        List<String> roleList = StpUtil.getRoleList();
+        if(roleList.size() == 2 && roleList.contains("CLASSTE") && roleList.contains("TEACHER") && dto.getTeacherId() == null){
+            dto.setTeacherId(StpUtil.getLoginIdAsLong());
+        }
         Page<BaseNewStudentPageVo> page = baseNewStudentService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
         PageOutput<BaseNewStudentPageVo> pageOutput = ConventPage.getPageOutput(page, BaseNewStudentPageVo.class);
         return RT.ok(pageOutput);

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

@@ -60,4 +60,7 @@ public class BaseNewStudentPageDto extends PageInput {
 
     @ApiModelProperty("树id")
     private Long treeId;
+
+    @ApiModelProperty("班主任id")
+    private Long teacherId;
 }

+ 3 - 0
src/main/resources/mapper/student/BaseNewStudentMapper.xml

@@ -126,6 +126,9 @@
         <if test="dto.isAdjust != null">
             AND t1.is_adjust = #{dto.isAdjust}
         </if>
+        <if test="dto.teacherId != null">
+            AND t11.teacher_id = #{dto.teacherId}
+        </if>
         <if test="dto.enrollmentPlanId != null">
             AND t1.enrollment_plan_id = #{dto.enrollmentPlanId}
         </if>