Browse Source

修改教材,学生荣誉,寝室相关遗漏问题

phoenix 1 year ago
parent
commit
5beed1306f

+ 2 - 2
src/main/java/com/xjrsoft/module/student/controller/StudentHonorsController.java

@@ -2,7 +2,7 @@ package com.xjrsoft.module.student.controller;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.hutool.core.bean.BeanUtil;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
@@ -43,7 +43,7 @@ public class StudentHonorsController {
     @ApiOperation(value="学生荣誉列表(分页)")
     @SaCheckPermission("studenthonors:detail")
     public RT<PageOutput<StudentHonorsPageVo>> page(@Valid StudentHonorsPageDto dto){
-        Page<StudentHonorsPageVo> page = studentHonorsService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        IPage<StudentHonorsPageVo> page = studentHonorsService.getPage(dto);
         PageOutput<StudentHonorsPageVo> pageOutput = ConventPage.getPageOutput(page, StudentHonorsPageVo.class);
         return RT.ok(pageOutput);
     }

+ 31 - 0
src/main/java/com/xjrsoft/module/student/dto/StudentHonorsPageDto.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
+import java.util.Date;
 import java.util.List;
 
 
@@ -26,4 +27,34 @@ public class StudentHonorsPageDto extends PageInput {
 
     @ApiModelProperty("学期Id")
     private Long baseSemesterId;
+    /**
+     * 学生用户编号
+     */
+    @ApiModelProperty("学生用户编号")
+    private Long studentUserId;
+    /**
+     * 荣誉级别(xjr_dictionary_item[honors_level])
+     */
+    @ApiModelProperty("荣誉级别(xjr_dictionary_item[honors_level])")
+    private String honorsLevel;
+    /**
+     * 荣誉等级(xjr_dictionary_item[honors_grade])
+     */
+    @ApiModelProperty("荣誉等级(xjr_dictionary_item[honors_grade])")
+    private String honorsGrade;
+    /**
+     * 荣誉类型(xjr_dictionary_item[honors_type])
+     */
+    @ApiModelProperty("荣誉类型(xjr_dictionary_item[honors_type])")
+    private String honorsType;
+    /**
+     * 获奖日期
+     */
+    @ApiModelProperty("获奖日期")
+    private Date awardDate;
+    /**
+     * 学生姓名
+     */
+    @ApiModelProperty("学生姓名")
+    private String userName;
 }

+ 2 - 2
src/main/java/com/xjrsoft/module/student/mapper/StudentHonorsMapper.java

@@ -1,6 +1,6 @@
 package com.xjrsoft.module.student.mapper;
 
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.yulichang.base.MPJBaseMapper;
 import com.xjrsoft.module.student.dto.StudentHonorsPageDto;
 import com.xjrsoft.module.student.entity.StudentHonors;
@@ -19,7 +19,7 @@ import java.util.List;
 */
 @Mapper
 public interface StudentHonorsMapper extends MPJBaseMapper<StudentHonors> {
-    Page<StudentHonorsPageVo> getPage(Page<StudentHonorsPageDto> page, StudentHonorsPageDto dto);
+    IPage<StudentHonorsPageVo> getPage(IPage<StudentHonorsPageDto> page, StudentHonorsPageDto dto);
 
     List<StudentHonorsListVo> getClassInfo();
 

+ 2 - 2
src/main/java/com/xjrsoft/module/student/service/IStudentHonorsService.java

@@ -1,6 +1,6 @@
 package com.xjrsoft.module.student.service;
 
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.yulichang.base.MPJBaseService;
 import com.xjrsoft.module.student.dto.StudentHonorsPageDto;
 import com.xjrsoft.module.student.entity.StudentHonors;
@@ -23,7 +23,7 @@ public interface IStudentHonorsService extends MPJBaseService<StudentHonors> {
     /**
      * 分页查询
      */
-    Page<StudentHonorsPageVo> getPage(Page<StudentHonorsPageDto> page, StudentHonorsPageDto dto);
+    IPage<StudentHonorsPageVo> getPage(StudentHonorsPageDto dto);
 
     /**
      * 查询班级信息

+ 4 - 3
src/main/java/com/xjrsoft/module/student/service/impl/StudentHonorsServiceImpl.java

@@ -3,9 +3,10 @@ package com.xjrsoft.module.student.service.impl;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.mapper.BaseClassMapper;
 import com.xjrsoft.module.student.dto.StudentHonorsPageDto;
@@ -37,7 +38,7 @@ public class StudentHonorsServiceImpl extends MPJBaseServiceImpl<StudentHonorsMa
 
     private final BaseClassMapper baseClassMapper;
     @Override
-    public Page<StudentHonorsPageVo> getPage(Page<StudentHonorsPageDto> page, StudentHonorsPageDto dto) {
+    public IPage<StudentHonorsPageVo> getPage(StudentHonorsPageDto dto) {
         //获取当前用户所管理的班级
         LambdaQueryWrapper<BaseClass> queryWrapperClass = new LambdaQueryWrapper<>();
         queryWrapperClass
@@ -50,7 +51,7 @@ public class StudentHonorsServiceImpl extends MPJBaseServiceImpl<StudentHonorsMa
             }
             dto.setClassIdList(classIdList);
         }
-        return studentHonorsMapper.getPage(page, dto);
+        return studentHonorsMapper.getPage(ConventPage.getPage(dto), dto);
     }
 
     @Override

+ 6 - 6
src/main/java/com/xjrsoft/module/textbook/dto/TextbookIssueRecordPageDto.java

@@ -4,12 +4,6 @@ import com.xjrsoft.common.page.PageInput;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.time.LocalTime;
-import java.time.LocalDateTime;
-import java.math.BigDecimal;
-import java.util.Date;
 
 
 /**
@@ -48,4 +42,10 @@ public class TextbookIssueRecordPageDto extends PageInput {
 
     @ApiModelProperty("规划教材")
     public String isTextbookPlan;
+
+    /**
+     * 出版社
+     */
+    @ApiModelProperty("出版社")
+    private String publishingHouse;
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/textbook/dto/TextbookWarehouseRecordPageDto.java

@@ -42,4 +42,9 @@ public class TextbookWarehouseRecordPageDto extends PageInput {
 
     @ApiModelProperty("规划教材")
     public String isTextbookPlan;
+    /**
+     * 出版社
+     */
+    @ApiModelProperty("出版社")
+    private String publishingHouse;
 }

+ 71 - 29
src/main/resources/mapper/student/StudentHonorsMapper.xml

@@ -3,7 +3,8 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xjrsoft.module.student.mapper.StudentHonorsMapper">
-    <select id="getPage" parameterType="com.xjrsoft.module.student.dto.StudentHonorsPageDto" resultType="com.xjrsoft.module.student.vo.StudentHonorsPageVo">
+    <select id="getPage" parameterType="com.xjrsoft.module.student.dto.StudentHonorsPageDto"
+            resultType="com.xjrsoft.module.student.vo.StudentHonorsPageVo">
         SELECT t1.id,t1.sort_code,t2.name AS student_name,t1.student_id,t3.name AS honors_level,t4.name AS honors_type,
         t5.name AS honors_grade,t1.name, t1.award_date,t1.status,t1.file_id FROM student_honors t1
         LEFT JOIN xjr_user t2 ON t1.student_user_id = t2.id
@@ -18,45 +19,86 @@
                 #{classId}
             </foreach>
         </if>
-          <if test="dto.classId != null and dto.classId > 0">
-              AND t1.class_id = #{dto.classId}
-          </if>
-            <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
-                AND t1.base_semester_id = #{dto.baseSemesterId}
-            </if>
-          and t1.status = 1
+        <if test="dto.classId != null and dto.classId > 0">
+            AND t1.class_id = #{dto.classId}
+        </if>
+        <if test="dto.baseSemesterId != null and dto.baseSemesterId > 0">
+            AND t1.base_semester_id = #{dto.baseSemesterId}
+        </if>
+        <if test="dto.honorsLevel != null and dto.honorsLevel != ''">
+            AND t1.honors_level = #{dto.honorsLevel}
+        </if>
+        <if test="dto.honorsGrade != null and dto.honorsGrade != ''">
+            AND t1.honors_grade = #{dto.honorsGrade}
+        </if>
+        <if test="dto.honorsType != null and dto.honorsType != ''">
+            AND t1.honors_type = #{dto.honorsType}
+        </if>
+        <if test="dto.awardDate != null and dto.awardDate != ''">
+            AND t1.award_date > #{dto.awardDate}
+        </if>
+        <if test="dto.userName != null and dto.userName != ''">
+            AND t2.name like concat('%',#{dto.userName},'%')
+        </if>
+        <if test="dto.studentUserId != null and dto.studentUserId != ''">
+            AND t1.student_user_id = #{dto.studentUserId}
+        </if>
+        and t1.status = 1
+        order by t1.id desc
     </select>
 
     <select id="getSemesterInfo" resultType="com.xjrsoft.module.student.vo.StudentHonorsListVo">
-        SELECT DISTINCT t1.base_semester_id as id,t2.name FROM student_honors t1
-        INNER JOIN base_semester t2 ON t1.base_semester_id = t2.id
+        SELECT DISTINCT t1.base_semester_id as id, t2.name
+        FROM student_honors t1
+                 INNER JOIN base_semester t2 ON t1.base_semester_id = t2.id
         WHERE t1.delete_mark = 0
     </select>
     <select id="getClassInfo" resultType="com.xjrsoft.module.student.vo.StudentHonorsListVo">
-        SELECT DISTINCT t1.class_id as id,t2.name,t1.base_semester_id as parent_id FROM student_honors t1
-        INNER JOIN base_class t2 ON t1.class_id = t2.id
+        SELECT DISTINCT t1.class_id as id, t2.name, t1.base_semester_id as parent_id
+        FROM student_honors t1
+                 INNER JOIN base_class t2 ON t1.class_id = t2.id
         WHERE t1.delete_mark = 0
     </select>
 
     <select id="getInfo" resultType="com.xjrsoft.module.student.vo.StudentHonorsVo">
-        SELECT t1.id,t2.name AS student_name,t1.student_id,t3.grade_id,t4.name AS grade_name,t1.class_id,t5.name AS class_name,
-        t1.major_set_id,t11.name AS major_set_name,t1.applicant_user_id,t1.name AS applicant_user_name,t1.award_date,
-        t1.name,t1.honors_level,t8.name AS honors_level_cn,
-        t1.honors_type,t9.name AS honors_type_cn,t1.honors_grade, t10.name AS honors_grade_cn,
-        t1.file_id,t1.base_semester_id,t1.student_user_id  FROM student_honors t1
-        LEFT JOIN xjr_user t2 ON t1.student_user_id = t2.id
-        LEFT JOIN base_student_school_roll t3 ON t1.student_user_id = t3.user_id
-        LEFT JOIN base_grade t4 ON t3.grade_id = t4.id
-        LEFT JOIN base_class t5 ON t1.class_id = t5.id
-        LEFT JOIN base_major_set t6 ON t3.major_set_id = t6.id
-        LEFT JOIN xjr_user t7 ON t1.applicant_user_id = t7.id
-        LEFT JOIN xjr_dictionary_detail t8 ON t1.honors_level = t8.code AND t8.item_id = 1731576278748352514
-        LEFT JOIN xjr_dictionary_detail t9 ON t1.honors_type = t9.code AND t9.item_id = 1731577666295418881
-        LEFT JOIN xjr_dictionary_detail t10 ON t1.honors_grade = t10.code AND t10.item_id = 1731577201793028098
-        LEFT JOIN base_major_set t11 ON t1.major_set_id = t11.id
-        WHERE t1.id = #{id} and t1.delete_mark = 0
+        SELECT t1.id,
+               t2.name  AS student_name,
+               t1.student_id,
+               t3.grade_id,
+               t4.name  AS grade_name,
+               t1.class_id,
+               t5.name  AS class_name,
+               t1.major_set_id,
+               t11.name AS major_set_name,
+               t1.applicant_user_id,
+               t1.name  AS applicant_user_name,
+               t1.award_date,
+               t1.name,
+               t1.honors_level,
+               t8.name  AS honors_level_cn,
+               t1.honors_type,
+               t9.name  AS honors_type_cn,
+               t1.honors_grade,
+               t10.name AS honors_grade_cn,
+               t1.file_id,
+               t1.base_semester_id,
+               t1.student_user_id
+        FROM student_honors t1
+                 LEFT JOIN xjr_user t2 ON t1.student_user_id = t2.id
+                 LEFT JOIN base_student_school_roll t3 ON t1.student_user_id = t3.user_id
+                 LEFT JOIN base_grade t4 ON t3.grade_id = t4.id
+                 LEFT JOIN base_class t5 ON t1.class_id = t5.id
+                 LEFT JOIN base_major_set t6 ON t3.major_set_id = t6.id
+                 LEFT JOIN xjr_user t7 ON t1.applicant_user_id = t7.id
+                 LEFT JOIN xjr_dictionary_detail t8 ON t1.honors_level = t8.code AND t8.item_id = 1731576278748352514
+                 LEFT JOIN xjr_dictionary_detail t9 ON t1.honors_type = t9.code AND t9.item_id = 1731577666295418881
+                 LEFT JOIN xjr_dictionary_detail t10 ON t1.honors_grade = t10.code AND t10.item_id = 1731577201793028098
+                 LEFT JOIN base_major_set t11 ON t1.major_set_id = t11.id
+        WHERE t1.id = #{id}
+          and t1.delete_mark = 0
     </select>
     <select id="getSortCode" resultType="java.lang.Integer">
-        SELECT IFNULL(MAX(IFNULL(sort_code, 0)), 0) + 1 FROM student_honors
+        SELECT IFNULL(MAX(IFNULL(sort_code, 0)), 0) + 1
+        FROM student_honors
     </select>
 </mapper>

+ 3 - 0
src/main/resources/mapper/textbook/TextbookIssueRecordMapper.xml

@@ -24,6 +24,9 @@
         <if test="dto.baseSemesterId != null">
             and t3.base_semester_id = #{dto.baseSemesterId}
         </if>
+        <if test="dto.publishingHouse != null">
+            and t3.publishing_house = like concat('%',#{dto.publishingHouse}, '%')
+        </if>
         <if test="dto.subjectGroupId != null">
             and t3.subject_group_id = #{dto.subjectGroupId}
         </if>

+ 4 - 1
src/main/resources/mapper/textbook/TextbookWarehouseRecordMapper.xml

@@ -18,6 +18,9 @@
         <if test="dto.baseSemesterId != null">
             and t3.base_semester_id = #{dto.baseSemesterId}
         </if>
+        <if test="dto.publishingHouse != null">
+            and t3.publishing_house = like concat('%',#{dto.publishingHouse}, '%')
+        </if>
         <if test="dto.subjectGroupId != null">
             and t3.subject_group_id = #{dto.subjectGroupId}
         </if>
@@ -39,7 +42,7 @@
         <if test="dto.isTextbookPlan != null and dto.isTextbookPlan != ''">
             and t3.is_textbook_plan = #{dto.isTextbookPlan}
         </if>
-        ORDER BY t1.sort_code
+        ORDER BY t1.create_date
     </select>
 
 </mapper>