Kaynağa Gözat

学籍异动列表查询增加查询条件,详情增加字段

dzx 1 yıl önce
ebeveyn
işleme
fb79df5568

+ 6 - 45
src/main/java/com/xjrsoft/module/student/controller/SchoolRollStudentController.java

@@ -1,36 +1,23 @@
 package com.xjrsoft.module.student.controller;
 
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import cn.dev33.satoken.annotation.SaCheckPermission;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.xjrsoft.common.constant.GlobalConstant;
-import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
-import com.xjrsoft.common.model.result.RT;
-import com.xjrsoft.common.utils.VoToColumnUtil;
-import com.xjrsoft.module.student.dto.AddSchoolRollStudentDto;
-import com.xjrsoft.module.student.dto.UpdateSchoolRollStudentDto;
-import cn.dev33.satoken.annotation.SaCheckPermission;
-
 import com.xjrsoft.module.student.dto.SchoolRollStudentPageDto;
-import com.xjrsoft.module.student.entity.SchoolRollStudent;
 import com.xjrsoft.module.student.service.ISchoolRollStudentService;
 import com.xjrsoft.module.student.vo.SchoolRollStudentPageVo;
-
 import com.xjrsoft.module.student.vo.SchoolRollStudentVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+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 javax.validation.constraints.NotNull;
-import java.util.List;
 
 /**
 * @title: 学籍异动学生
@@ -68,31 +55,5 @@ public class SchoolRollStudentController {
     }
 
 
-    @PostMapping
-    @ApiOperation(value = "新增学籍异动学生")
-    @SaCheckPermission("schoolrollstudent:add")
-    public RT<Boolean> add(@Valid @RequestBody AddSchoolRollStudentDto dto){
-        SchoolRollStudent schoolRollStudent = BeanUtil.toBean(dto, SchoolRollStudent.class);
-        boolean isSuccess = schoolRollStudentService.save(schoolRollStudent);
-    return RT.ok(isSuccess);
-    }
-
-    @PutMapping
-    @ApiOperation(value = "修改学籍异动学生")
-    @SaCheckPermission("schoolrollstudent:edit")
-    public RT<Boolean> update(@Valid @RequestBody UpdateSchoolRollStudentDto dto){
-
-        SchoolRollStudent schoolRollStudent = BeanUtil.toBean(dto, SchoolRollStudent.class);
-        return RT.ok(schoolRollStudentService.updateById(schoolRollStudent));
-
-    }
-
-    @DeleteMapping
-    @ApiOperation(value = "删除学籍异动学生")
-    @SaCheckPermission("schoolrollstudent:delete")
-    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
-        return RT.ok(schoolRollStudentService.removeBatchByIds(ids));
-
-    }
 
 }

+ 10 - 10
src/main/java/com/xjrsoft/module/student/dto/SchoolRollStudentPageDto.java

@@ -22,8 +22,8 @@ import java.util.Date;
 @EqualsAndHashCode(callSuper = false)
 public class SchoolRollStudentPageDto extends PageInput {
 
-    @ApiModelProperty("异动类型id")
-    private Long schoolRollCategoryId;
+    @ApiModelProperty("学籍异动类型")
+    private String scholarshipSource;
 
     @ApiModelProperty("异动原因id")
     private Long schoolRollReasonId;
@@ -31,13 +31,13 @@ public class SchoolRollStudentPageDto extends PageInput {
     @ApiModelProperty("学生姓名")
     private String name;
 
-    @ApiModelProperty("学号")
-    private String studentId;
-
-    @ApiModelProperty("证件号")
-    private String credentialNumber;
-
-    @ApiModelProperty("异动前班级")
-    private Long beforeClassName;
+//    @ApiModelProperty("学号")
+//    private String studentId;
+//
+//    @ApiModelProperty("证件号")
+//    private String credentialNumber;
+//
+//    @ApiModelProperty("异动前班级")
+//    private Long beforeClassName;
 
 }

+ 11 - 0
src/main/java/com/xjrsoft/module/student/vo/SchoolRollStudentVo.java

@@ -88,4 +88,15 @@ public class SchoolRollStudentVo {
     @ApiModelProperty("入班日期")
     private String inClassDate;
 
+    @ApiModelProperty("离班日期")
+    private String outClassDate;
+
+    @ApiModelProperty("休学时段(开始时间)")
+    private String leaveStartYear;
+
+    @ApiModelProperty("休学时段(结束时间)")
+    private String leaveEndYear;
+
+    @ApiModelProperty("是否已经维护到国家/省学籍系统(0:未维护 1:已维护 2:无需维护)")
+    private Integer isMaintained;
 }

+ 21 - 11
src/main/resources/mapper/student/SchoolRollStudentMapper.xml

@@ -4,17 +4,27 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xjrsoft.module.student.mapper.SchoolRollStudentMapper">
     <select id="getPage" parameterType="com.xjrsoft.module.student.dto.SchoolRollStudentPageDto" resultType="com.xjrsoft.module.student.vo.SchoolRollStudentPageVo">
-        select t.id,t.sort_code,t1.name,t1.credential_number,t3.name as scholarship_source_cn,
-        t4.name as before_class_name,t5.name AS back_class_name,t1.remark,t.in_class_date,t.out_class_date
-        ,t.scholarship_source from school_roll_student t
-        left join xjr_user t1 on t1.id = t.student_id
-        left join base_student t2 on t.student_id = t2.user_id
-        left join xjr_dictionary_detail t3 on t.scholarship_source = t3.code and t3.item_id = 1729751199857102849
-        left join base_class t4 on t.before_class_id = t4.id
+        SELECT t.id,t.sort_code,t1.name,t1.credential_number,t3.name AS scholarship_source_cn,
+        t4.name AS before_class_name,t5.name AS back_class_name,t1.remark,t.in_class_date,t.out_class_date
+        ,t.scholarship_source,t2.student_id,t8.name AS applicant_user_name FROM school_roll_student t
+        LEFT JOIN xjr_user t1 ON t1.id = t.student_id
+        LEFT JOIN base_student t2 ON t.student_id = t2.user_id
+        LEFT JOIN xjr_dictionary_detail t3 ON t.scholarship_source = t3.code AND t3.item_id = 1729751199857102849
+        LEFT JOIN base_class t4 ON t.before_class_id = t4.id
         LEFT JOIN base_class t5 ON t.back_class_id = t5.id
-        left join school_roll_category t6 on t.school_roll_category_id = t6.id
-        left join school_roll_reason t7 on t.school_roll_reason_id = t7.id
-        where t.delete_mark = 0 and t.status = 1
+        LEFT JOIN school_roll_category t6 ON t.school_roll_category_id = t6.id
+        LEFT JOIN school_roll_reason t7 ON t.school_roll_reason_id = t7.id
+        LEFT JOIN xjr_user t8 ON t8.id = t.applicant_user_id
+        WHERE t.delete_mark = 0 AND t.status = 1
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.scholarshipSource != null and dto.scholarshipSource != ''">
+            and t.scholarship_source = #{dto.scholarshipSource}
+        </if>
+        <if test="dto.schoolRollReasonId != null">
+            and t7.id = #{dto.schoolRollReasonId}
+        </if>
     </select>
     <select id="getInfo" resultType="com.xjrsoft.module.student.vo.SchoolRollStudentVo">
         select t.id,t1.name,t2.student_id,t1.gender,t1.credential_number,t3.name as scholarship_source_cn
@@ -24,7 +34,7 @@
         t11.name as before_department_name,
         t5.name AS back_class_name,t12.name as back_grade_name,t13.name as back_major_set_name,
         t14.name as back_department_name,t.reason,
-        t1.remark,t.in_class_date,t.out_class_date,t.status
+        t1.remark,t.in_class_date,t.out_class_date,t.status,t.leave_start_year,t.leave_end_year,t.is_maintained
         from school_roll_student t
         left join xjr_user t1 on t1.id = t.student_id
         left join base_student t2 on t.student_id = t2.user_id