소스 검색

学生信息修改接口

dzx 1 년 전
부모
커밋
566dc41adf

+ 1 - 1
src/main/java/com/xjrsoft/module/organization/dto/DepartmentPageDto.java

@@ -15,7 +15,7 @@ import org.hibernate.validator.constraints.Length;
 @Data
 public class DepartmentPageDto extends PageInput {
 
-    @Length(min = 1,max = 20,message = "机构名称最少2个字符,最多20个字符!")
+    @Length(min = 1,max = 50,message = "机构名称最少2个字符,最多50个字符!")
     private String name;
 
     @Length(min = 1,max = 10,message = "机构编码最少2个字符,最多10个字符!")

+ 1 - 1
src/main/java/com/xjrsoft/module/organization/dto/DepartmentTreeDto.java

@@ -12,7 +12,7 @@ import org.hibernate.validator.constraints.Length;
 @Data
 public class DepartmentTreeDto {
 
-    @Length(min = 1,max = 20,message = "机构名称最少2个字符,最多20个字符!")
+    @Length(min = 1,max = 50,message = "机构名称最少2个字符,最多50个字符!")
     private String name;
 
     @Length(min = 1,max = 10,message = "机构编码最少2个字符,最多10个字符!")

+ 1 - 1
src/main/java/com/xjrsoft/module/organization/dto/PostTreeDto.java

@@ -9,7 +9,7 @@ import org.hibernate.validator.constraints.Length;
 @EqualsAndHashCode(callSuper = true)
 public class PostTreeDto extends ListInput {
 
-    @Length(min = 1,max = 20,message = "机构名称最少2个字符,最多20个字符!")
+    @Length(min = 1,max = 50,message = "机构名称最少2个字符,最多50个字符!")
     private String name;
 
     @Length(min = 1,max = 10,message = "机构编码最少2个字符,最多10个字符!")

+ 56 - 0
src/main/java/com/xjrsoft/module/student/controller/BaseStudentInfoController.java

@@ -0,0 +1,56 @@
+package com.xjrsoft.module.student.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+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.module.student.dto.BaseStudentInfoPageDto;
+import com.xjrsoft.module.student.dto.UpdateBaseStudentInfoDto;
+import com.xjrsoft.module.student.service.impl.IBaseStudentSchoolRollService;
+import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+
+/**
+* @title: 学生职务设置
+* @Author dzx
+* @Date: 2023-11-13
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/student" + "/basestudentinfo")
+@Api(value = "/student"  + "/basestudentinfo",tags = "学生信息修改管理")
+@AllArgsConstructor
+public class BaseStudentInfoController {
+
+
+    private final IBaseStudentSchoolRollService baseStudentSchoolRollService;
+
+    @GetMapping(value = "/mobile-page")
+    @ApiOperation(value="学生列表(分页)")
+    @SaCheckPermission("basestudentpost:detail")
+    public RT<PageOutput<BaseStudentInfoPageVo>> mobilePage(@Valid BaseStudentInfoPageDto dto){
+        Page<BaseStudentInfoPageVo> mobilePage = baseStudentSchoolRollService.getMobilePage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<BaseStudentInfoPageVo> pageOutput = ConventPage.getPageOutput(mobilePage, BaseStudentInfoPageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+
+    @PutMapping
+    @ApiOperation(value = "修改学生职务设置")
+    @SaCheckPermission("basestudentpost:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateBaseStudentInfoDto dto){
+        return RT.ok(baseStudentSchoolRollService.updateInfo(dto));
+    }
+
+
+}

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

@@ -0,0 +1,35 @@
+package com.xjrsoft.module.student.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+/**
+* @title: 学生职务设置分页查询入参
+* @Author dzx
+* @Date: 2023-11-13
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class BaseStudentInfoPageDto extends PageInput {
+    /**
+     * 年级id
+     */
+    @ApiModelProperty("年级id")
+    private Long gradeId;
+
+    /**
+     * 专业方向id
+     */
+    @ApiModelProperty("专业方向id")
+    private Long majorSetId;
+
+    /**
+     * 班级id
+     */
+    @ApiModelProperty("班级id")
+    private Long classId;
+}

+ 39 - 0
src/main/java/com/xjrsoft/module/student/dto/UpdateBaseStudentInfoDto.java

@@ -0,0 +1,39 @@
+package com.xjrsoft.module.student.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+* @title: 学生职务设置
+* @Author dzx
+* @Date: 2023-11-13
+* @Version 1.0
+*/
+@Data
+public class UpdateBaseStudentInfoDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 学习形式
+    */
+    @ApiModelProperty("学习形式")
+    private Long rollModality;
+    /**
+     * 学籍状态(xjr_dictionary_item[archives_status])
+     */
+    @ApiModelProperty("学籍状态(xjr_dictionary_item[archives_status])")
+    private Long archivesStatus;
+    /**
+     * 就读方式(xjr_dictionary_item[stduy_status])
+     */
+    @ApiModelProperty("就读方式(xjr_dictionary_item[stduy_status])")
+    private Long stduyStatus;
+
+    @ApiModelProperty("学生userIds")
+    private List<Long> userIds;
+}

+ 7 - 0
src/main/java/com/xjrsoft/module/student/mapper/BaseStudentSchoolRollMapper.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.BaseStudentInfoPageDto;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
+import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -12,4 +15,8 @@ import org.apache.ibatis.annotations.Mapper;
  */
 @Mapper
 public interface BaseStudentSchoolRollMapper extends MPJBaseMapper<BaseStudentSchoolRoll> {
+
+    Page<BaseStudentInfoPageVo> getMobilePage(Page<BaseStudentInfoPageVo> page, BaseStudentInfoPageDto dto);
+
 }
+

+ 25 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentSchoolRollServiceImpl.java

@@ -1,8 +1,14 @@
 package com.xjrsoft.module.student.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.room.entity.RoomBed;
+import com.xjrsoft.module.student.dto.BaseStudentInfoPageDto;
+import com.xjrsoft.module.student.dto.UpdateBaseStudentInfoDto;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 import com.xjrsoft.module.student.mapper.BaseStudentSchoolRollMapper;
+import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
 
@@ -17,4 +23,23 @@ import org.springframework.stereotype.Service;
 public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStudentSchoolRollMapper, BaseStudentSchoolRoll> implements IBaseStudentSchoolRollService {
 
     private final BaseStudentSchoolRollMapper baseStudentSchoolRollMapper;
+
+    @Override
+    public Page<BaseStudentInfoPageVo> getMobilePage(Page<BaseStudentInfoPageVo> page, BaseStudentInfoPageDto dto) {
+        return baseStudentSchoolRollMapper.getMobilePage(page, dto);
+    }
+
+    @Override
+    public Boolean updateInfo(UpdateBaseStudentInfoDto dto) {
+        for (Long id : dto.getUserIds()) {
+            BaseStudentSchoolRoll roll = baseStudentSchoolRollMapper.selectById(id);
+            UpdateWrapper<BaseStudentSchoolRoll> updateWrapper = new UpdateWrapper<>();
+            updateWrapper.eq("user_id", id);
+            updateWrapper.set("archives_status", dto.getArchivesStatus());
+            updateWrapper.set("roll_modality", dto.getRollModality());
+            updateWrapper.set("stduy_status", dto.getStduyStatus());
+            baseStudentSchoolRollMapper.update(roll, updateWrapper);
+        }
+        return true;
+    }
 }

+ 8 - 0
src/main/java/com/xjrsoft/module/student/service/impl/IBaseStudentSchoolRollService.java

@@ -1,7 +1,12 @@
 package com.xjrsoft.module.student.service.impl;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.room.dto.RoomPageDto;
+import com.xjrsoft.module.student.dto.BaseStudentInfoPageDto;
+import com.xjrsoft.module.student.dto.UpdateBaseStudentInfoDto;
 import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
+import com.xjrsoft.module.student.vo.BaseStudentInfoPageVo;
 
 /**
 * @title: 奖学金申请
@@ -12,5 +17,8 @@ import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
 
 public interface IBaseStudentSchoolRollService extends MPJBaseService<BaseStudentSchoolRoll> {
 
+    Page<BaseStudentInfoPageVo> getMobilePage(Page<BaseStudentInfoPageVo> page, BaseStudentInfoPageDto dto);
 
+
+    Boolean updateInfo(UpdateBaseStudentInfoDto dto);
 }

+ 49 - 0
src/main/java/com/xjrsoft/module/student/vo/BaseStudentInfoPageVo.java

@@ -0,0 +1,49 @@
+package com.xjrsoft.module.student.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 移动端学生修改信息列表
+* @Author dzx
+* @Date: 2024年2月26日
+* @Version 1.0
+*/
+@Data
+public class BaseStudentInfoPageVo {
+
+
+    @ApiModelProperty("主键编号")
+    private Long id;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("序号")
+    private Integer sortCode;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("学生姓名")
+    private String studentName;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("学号")
+    private String studentId;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("本人电话")
+    private String phone;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("监护人电话")
+    private String guardianPhone;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("班主任名称")
+    private String teacherName;
+
+    @ContentStyle(dataFormat = 49)
+    @ApiModelProperty("班级名称")
+    private String className;
+
+}

+ 18 - 0
src/main/resources/mapper/student/BaseStudentSchoolRollMapper.xml

@@ -0,0 +1,18 @@
+<?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.BaseStudentSchoolRollMapper">
+    <select id="getMobilePage" parameterType="com.xjrsoft.module.student.dto.BaseStudentInfoPageDto" resultType="com.xjrsoft.module.student.vo.BaseStudentInfoPageVo">
+        SELECT t2.id,t2.name AS student_name,t1.student_id,t2.mobile AS phone,t5.name AS teacher_name,t4.name AS class_name,
+        (SELECT mobile FROM base_student_family_member WHERE delete_mark = 0 AND user_id = t2.id AND is_guardian = 1) AS guardian_phone FROM base_student t1
+        INNER JOIN xjr_user t2 ON t1.user_id = t2.id
+        INNER JOIN base_student_school_roll t3 ON t1.user_id = t3.user_id
+        LEFT JOIN base_class t4 ON t3.class_id = t4.id
+        LEFT JOIN xjr_user t5 ON t4.teacher_id = t5.id
+        WHERE t2.delete_mark = 0 AND t1.delete_mark = 0
+    </select>
+    <!--姓名和性别,测试阶段采用姓名第一个字拼接user_id的方式脱敏-->
+    <select id="getJianyueStudentList" resultType="com.xjrsoft.module.schedule.vo.StudentJianyuekbVo">
+    </select>
+</mapper>