Browse Source

提交新生信息维护代码

dzx 1 year ago
parent
commit
06e117e0b6

+ 3 - 9
src/main/java/com/xjrsoft/module/student/controller/BaseNewStudentController.java

@@ -3,12 +3,10 @@ package com.xjrsoft.module.student.controller;
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
 import com.alibaba.excel.EasyExcel;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
-import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.student.dto.AddBaseNewStudentDto;
 import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import com.xjrsoft.module.student.dto.UpdateBaseNewStudentDto;
@@ -53,11 +51,7 @@ public class BaseNewStudentController {
     @SaCheckPermission("basenewstudent:detail")
     public RT<PageOutput<BaseNewStudentPageVo>> page(@Valid BaseNewStudentPageDto dto){
 
-        LambdaQueryWrapper<BaseNewStudent> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper
-                    .orderByDesc(BaseNewStudent::getId)
-                .select(BaseNewStudent.class,x -> VoToColumnUtil.fieldsToColumns(BaseNewStudentPageVo.class).contains(x.getProperty()));
-        IPage<BaseNewStudent> page = baseNewStudentService.page(ConventPage.getPage(dto), queryWrapper);
+        Page<BaseNewStudentPageVo> page = baseNewStudentService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
         PageOutput<BaseNewStudentPageVo> pageOutput = ConventPage.getPageOutput(page, BaseNewStudentPageVo.class);
         return RT.ok(pageOutput);
     }
@@ -80,7 +74,7 @@ public class BaseNewStudentController {
     public RT<Boolean> add(@Valid @RequestBody AddBaseNewStudentDto dto){
         BaseNewStudent baseNewStudent = BeanUtil.toBean(dto, BaseNewStudent.class);
         boolean isSuccess = baseNewStudentService.save(baseNewStudent);
-    return RT.ok(isSuccess);
+        return RT.ok(isSuccess);
     }
 
     @PutMapping

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

@@ -95,4 +95,6 @@ public class AddBaseNewStudentDto implements Serializable {
     @ApiModelProperty("班级状态(0:未分配, 1:已分配)")
     private Integer status;
 
+    @ApiModelProperty("是否可调配(0:否,1:是)")
+    private Integer isAdjust;
 }

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

@@ -1,9 +1,12 @@
 package com.xjrsoft.module.student.dto;
 
 import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.Date;
+
 
 /**
 * @title: 新生维护信息分页查询入参
@@ -15,5 +18,37 @@ import lombok.EqualsAndHashCode;
 @EqualsAndHashCode(callSuper = false)
 public class BaseNewStudentPageDto extends PageInput {
 
+    @ApiModelProperty("姓名")
+    private String name;
+
+    @ApiModelProperty("身份证")
+    private String credentialNumber;
+
+    @ApiModelProperty("是否可调配(0:否,1:是)")
+    private Integer isAdjust;
+
+    @ApiModelProperty("是否导入成绩(0:否,1:是)")
+    private Integer isImportScore;
+
+    @ApiModelProperty("第一志愿")
+    private String firstAmbition;
+
+    @ApiModelProperty("第二志愿")
+    private String secondAmbition;
+
+
+    @ApiModelProperty("添加时间-开始")
+    private Date startDate;
+
+    @ApiModelProperty("添加时间-结束")
+    private Date endDate;
+
+    @ApiModelProperty("毕业学校")
+    private String graduateSchool;
+
+    @ApiModelProperty("性别")
+    private String gender;
 
+    @ApiModelProperty("班级状态(0:未分配, 1:已分配)")
+    private Integer status;
 }

+ 2 - 1
src/main/java/com/xjrsoft/module/student/entity/BaseNewStudent.java

@@ -146,5 +146,6 @@ public class BaseNewStudent implements Serializable {
     @ApiModelProperty("班级状态(0:未分配, 1:已分配)")
     private Integer status;
 
-
+    @ApiModelProperty("是否可调配(0:否,1:是)")
+    private Integer isAdjust;
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseNewStudentMapper.java

@@ -1,7 +1,10 @@
 package com.xjrsoft.module.student.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
+import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -13,4 +16,5 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface BaseNewStudentMapper extends MPJBaseMapper<BaseNewStudent> {
 
+    Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/student/service/IBaseNewStudentService.java

@@ -1,7 +1,10 @@
 package com.xjrsoft.module.student.service;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
+import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
 
 /**
 * @title: 新生维护信息
@@ -11,4 +14,6 @@ import com.xjrsoft.module.student.entity.BaseNewStudent;
 */
 
 public interface IBaseNewStudentService extends MPJBaseService<BaseNewStudent> {
+
+    Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto);
 }

+ 7 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseNewStudentServiceImpl.java

@@ -1,9 +1,12 @@
 package com.xjrsoft.module.student.service.impl;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.student.dto.BaseNewStudentPageDto;
 import com.xjrsoft.module.student.entity.BaseNewStudent;
 import com.xjrsoft.module.student.mapper.BaseNewStudentMapper;
 import com.xjrsoft.module.student.service.IBaseNewStudentService;
+import com.xjrsoft.module.student.vo.BaseNewStudentPageVo;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
@@ -16,4 +19,8 @@ import org.springframework.stereotype.Service;
 @Service
 @AllArgsConstructor
 public class BaseNewStudentServiceImpl extends MPJBaseServiceImpl<BaseNewStudentMapper, BaseNewStudent> implements IBaseNewStudentService {
+    @Override
+    public Page<BaseNewStudentPageVo> getPage(Page<BaseNewStudentPageVo> page, BaseNewStudentPageDto dto) {
+        return this.baseMapper.getPage(page, dto);
+    }
 }

+ 11 - 42
src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentPageVo.java

@@ -30,50 +30,8 @@ public class BaseNewStudentPageVo {
     @ContentStyle(dataFormat = 49)
     @ExcelProperty("")
     @ApiModelProperty("")
-    private Long createUserId;
-    /**
-    * 
-    */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("")
-    @ApiModelProperty("")
     private Date createDate;
     /**
-    * 
-    */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("")
-    @ApiModelProperty("")
-    private Long modifyUserId;
-    /**
-    * 
-    */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("")
-    @ApiModelProperty("")
-    private Date modifyDate;
-    /**
-    * 
-    */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("")
-    @ApiModelProperty("")
-    private Integer deleteMark;
-    /**
-    * 
-    */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("")
-    @ApiModelProperty("")
-    private Integer enabledMark;
-    /**
-    * 
-    */
-    @ContentStyle(dataFormat = 49)
-    @ExcelProperty("")
-    @ApiModelProperty("")
-    private Integer sortCode;
-    /**
     * 毕业学校
     */
     @ContentStyle(dataFormat = 49)
@@ -94,6 +52,11 @@ public class BaseNewStudentPageVo {
     @ExcelProperty("性别")
     @ApiModelProperty("性别")
     private String gender;
+
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("性别")
+    @ApiModelProperty("性别中文")
+    private String genderCn;
     /**
     * 身份证号
     */
@@ -143,6 +106,9 @@ public class BaseNewStudentPageVo {
     @ExcelProperty("住宿类型")
     @ApiModelProperty("住宿类型")
     private String stduyStatus;
+
+    @ApiModelProperty("住宿类型中文")
+    private String stduyStatusCn;
     /**
     * 手机号
     */
@@ -172,4 +138,7 @@ public class BaseNewStudentPageVo {
     @ApiModelProperty("班级状态(0:未分配, 1:已分配)")
     private Integer status;
 
+    @ApiModelProperty("是否可调配(0:否,1:是)")
+    private Integer isAdjust;
+
 }

+ 2 - 1
src/main/java/com/xjrsoft/module/student/vo/BaseNewStudentVo.java

@@ -95,6 +95,7 @@ public class BaseNewStudentVo {
     @ApiModelProperty("班级状态(0:未分配, 1:已分配)")
     private Integer status;
 
-
+    @ApiModelProperty("是否可调配(0:否,1:是)")
+    private Integer isAdjust;
 
 }

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

@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xjrsoft.module.student.mapper.BaseNewStudentMapper">
+    <select id="getPage" parameterType="com.xjrsoft.module.student.dto.BaseNewStudentPageDto" resultType="com.xjrsoft.module.student.vo.BaseNewStudentPageVo">
+        SELECT t1.id,t1.graduate_school,t1.name,t1.gender,t2.name AS gender_cn,t1.credential_number,t1.height,t1.weight,
+        t1.score,t1.graduate_class,t1.source,t1.stduy_status,t3.name AS stduy_status_cn,t1.mobile,t1.first_ambition,
+        t1.second_ambition,t1.is_adjust,t1.status FROM base_new_student t1
+        LEFT JOIN xjr_dictionary_detail t2 ON t1.gender = t2.code AND t2.item_id = 2023000000000000004
+        LEFT JOIN xjr_dictionary_detail t3 ON t1.stduy_status = t3.code AND t3.item_id = 2023000000000000030
+        WHERE t1.delete_mark = 0
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.credentialNumber != null and dto.credentialNumber != ''">
+            and t1.credential_number like concat('%', #{dto.credentialNumber}, '%')
+        </if>
+        <if test="dto.isImportScore != null">
+            <if test="dto.isImportScore == 1">
+                and t1.score is not null
+            </if>
+            <if test="dto.isImportScore == 0">
+                and t1.score is null
+            </if>
+        </if>
+        <if test="dto.firstAmbition != null and dto.firstAmbition != ''">
+            and t1.first_ambition = #{dto.firstAmbition}
+        </if>
+        <if test="dto.secondAmbition != null and dto.secondAmbition != ''">
+            and t1.second_ambition = #{dto.secondAmbition}
+        </if>
+
+        <if test="dto.startDate != null and dto.endDate != null">
+            AND t1.create_date between #{dto.startDate} and #{dto.endDate}
+        </if>
+        <if test="dto.gender != null and dto.gender != ''">
+            AND t1.gender = #{dto.gender}
+        </if>
+        <if test="dto.status != null">
+            AND t1.status = #{dto.status}
+        </if>
+    </select>
+
+    <select id="getInfo" resultType="com.xjrsoft.module.student.vo.BaseStudentBehaviorManageVo">
+        SELECT t.id, t2.score_type, t1.sort_code,
+               t.file_id, t.assessment_address, t3.name AS semester_name,
+               t.assessment_date, t.score, t.score_number, t.total_score, t4.name AS grade_name,
+               t.is_affect, t1.name AS behaviorCategoryName, t2.name AS behaviorProjectName,
+               (
+                   SELECT GROUP_CONCAT(b.name) FROM base_student_behavior_class_relation a
+                   LEFT JOIN base_class b ON a.class_id = b.id
+                   WHERE a.base_student_behavior_manage_id = t.id GROUP BY a.base_student_behavior_manage_id
+               ) AS asbinarysessment_class_names,
+               (
+                   SELECT name FROM xjr_user WHERE id = t.assessment_user_id
+               ) AS assessment_user_name
+        FROM base_student_behavior_manage t
+                 LEFT JOIN base_student_behavior_category t1 ON t1.id = t.base_student_behavior_category_id
+                 LEFT JOIN base_student_behavior_project t2 ON t2.id = t.base_student_behavior_project_id
+                 LEFT JOIN base_semester t3 ON t3.id = t.base_semester_id
+                 LEFT JOIN base_grade t4 ON t.grade_id = t4.id
+        WHERE t.delete_mark = 0 AND t1.delete_mark = 0 AND t2.delete_mark = 0 AND t.status = 1
+          AND t.id = #{id}
+    </select>
+
+    <select id="getMobilePage" parameterType="com.xjrsoft.module.student.dto.BaseStudentBehaviorManageMobilePageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentBehaviorManageMobilePageVo">
+        SELECT t1.sort_code,t1.name,t1.class_name,t.assessment_date,
+        t3.name AS categoryName,t4.name AS projectName,t.score,t4.score_type,
+        t2.name AS assessmentUserName,
+        t.assessment_address,
+        t3.name AS behaviorCategoryName,
+        t4.name AS behaviorProjectName
+        FROM base_student_behavior_manage t
+        INNER JOIN base_student_behavior_student_relation t1 ON t1.base_student_behavior_manage_id = t.id
+        <if test="dto.studentName != null and dto.studentName != ''">
+            and t1.name like concat('%',#{dto.studentName},'%')
+        </if>
+        LEFT JOIN xjr_user t2 ON t2.id = t.assessment_user_id
+        LEFT JOIN base_student_behavior_category t3 ON t3.id = t.base_student_behavior_category_id
+        LEFT JOIN base_student_behavior_project t4 ON t4.id = t.base_student_behavior_project_id
+        LEFT JOIN base_student_school_roll t5 ON t1.user_id = t5.user_id
+        WHERE t.status = 1 AND t.delete_mark = 0 AND t3.delete_mark = 0
+        AND t5.class_id IN (
+        SELECT id FROM base_class WHERE teacher_id = #{dto.teacherId}
+        )
+        <if test="dto.gradeIds != null and dto.gradeIds.size() > 0">
+            AND t5.grade_id in
+            <foreach item="gradeId" index="index" collection="dto.gradeIds" open="(" close=")" separator=",">
+                #{gradeId}
+            </foreach>
+        </if>
+        <if test="dto.classIds != null and dto.classIds.size() > 0">
+            AND t5.class_id in
+            <foreach item="classId" index="index" collection="dto.classIds" open="(" close=")" separator=",">
+                #{classId}
+            </foreach>
+        </if>
+        <if test="dto.assessmentUserIds != null and dto.assessmentUserIds.size() > 0">
+            AND t.assessment_user_id in
+            <foreach item="assessmentUserId" index="index" collection="dto.assessmentUserIds" open="(" close=")" separator=",">
+                #{assessmentUserId}
+            </foreach>
+        </if>
+        <if test="dto.startDate != null and dto.startDate != ''">
+            and t.assessment_date &gt;= #{dto.startDate}
+        </if>
+        <if test="dto.endDate != null and dto.endDate != ''">
+            and t.assessment_date &lt;= #{dto.endDate}
+        </if>
+    </select>
+
+</mapper>