Browse Source

班级管理调整

dzx 10 months ago
parent
commit
04bbf79b4f

+ 99 - 0
src/main/java/com/xjrsoft/module/base/controller/BaseClassController.java

@@ -0,0 +1,99 @@
+package com.xjrsoft.module.base.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xjrsoft.common.enums.DeleteMark;
+import com.xjrsoft.common.enums.EnabledMark;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.module.base.dto.AddBaseClassPageDto;
+import com.xjrsoft.module.base.dto.BaseClassPageDto;
+import com.xjrsoft.module.base.dto.UpdateBaseClassPageDto;
+import com.xjrsoft.module.base.entity.BaseClass;
+import com.xjrsoft.module.base.service.IBaseClassService;
+import com.xjrsoft.module.base.vo.BaseClassPageVo;
+import com.xjrsoft.module.base.vo.BaseClassVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+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.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.Date;
+import java.util.List;
+
+/**
+* @title: 班级管理
+* @Author dzx
+* @Date: 2024年4月28日
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/baseClass")
+@Api(value = "/baseClass",tags = "班级管理")
+@AllArgsConstructor
+public class BaseClassController {
+    private final IBaseClassService baseClassService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="班级列表(分页)")
+    @SaCheckPermission("baseclass:detail")
+    public RT<PageOutput<BaseClassPageVo>> page(@Valid BaseClassPageDto dto){
+
+        Page<BaseClassPageVo> page = baseClassService.getPage(new Page<>(dto.getLimit(), dto.getSize()), dto);
+        PageOutput<BaseClassPageVo> pageOutput = ConventPage.getPageOutput(page, BaseClassPageVo.class);
+        return RT.ok(pageOutput);
+    }
+    @DeleteMapping
+    @ApiOperation(value = "删除")
+    @SaCheckPermission("baseclass:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(baseClassService.removeByIds(ids));
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询班级信息")
+    @SaCheckPermission("baseclass:detail")
+    public RT<BaseClassVo> info(@RequestParam Long id){
+        BaseClass baseClass = baseClassService.getByIdDeep(id);
+        if (baseClass == null) {
+            return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(baseClass, BaseClassVo.class));
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增班级")
+    @SaCheckPermission("baseclass:add")
+    public RT<Boolean> add(@Valid @RequestBody AddBaseClassPageDto dto){
+        BaseClass baseClass = BeanUtil.toBean(dto, BaseClass.class);
+        baseClass.setDeleteMark(DeleteMark.NODELETE.getCode());
+        baseClass.setCreateDate(new Date());
+        baseClass.setEnabledMark(EnabledMark.ENABLED.getCode());
+        baseClass.setCreateUserId(StpUtil.getLoginIdAsLong());
+        boolean isSuccess = baseClassService.save(baseClass);
+        return RT.ok(isSuccess);
+    }
+
+
+    @PutMapping
+    @ApiOperation(value = "修改班级")
+    @SaCheckPermission("baseclass:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateBaseClassPageDto dto){
+        BaseClass baseClass = BeanUtil.toBean(dto, BaseClass.class);
+        baseClass.setModifyDate(new Date());
+        baseClass.setModifyUserId(StpUtil.getLoginIdAsLong());
+        return RT.ok(baseClassService.updateById(baseClass));
+    }
+}

+ 47 - 0
src/main/java/com/xjrsoft/module/base/dto/AddBaseClassPageDto.java

@@ -0,0 +1,47 @@
+package com.xjrsoft.module.base.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author dzx
+ * @date 2024年4月28日
+ */
+@Data
+public class AddBaseClassPageDto implements Serializable {
+
+
+    @ApiModelProperty("班级名称")
+    private String name;
+
+    @ApiModelProperty("班级代码")
+    private String code;
+
+    @ApiModelProperty("所属年级(base_grade)")
+    private Long gradeId;
+
+    @ApiModelProperty("招生类型(xjr_dictionary_item[enroll_type])")
+    private String enrollType;
+
+    @ApiModelProperty("组织机构(xjr_department)")
+    private Long orgId;
+
+    @ApiModelProperty("是否订单班")
+    private Integer isOrderClass;
+
+    @ApiModelProperty("固定教室(base_classroom)")
+    private Long classroomId;
+
+    @ApiModelProperty("班主任(xjr_user)")
+    private Long teacherId;
+
+    @ApiModelProperty("在读状态(1: 在读 2: 毕业)")
+    private Integer isGraduate;
+
+    @ApiModelProperty("班级类型(xjr_dictionary_item[class_type])")
+    private String classType;
+
+}

+ 31 - 0
src/main/java/com/xjrsoft/module/base/dto/BaseClassPageDto.java

@@ -0,0 +1,31 @@
+package com.xjrsoft.module.base.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author dzx
+ * @date 2024年4月28日
+ */
+@Data
+public class BaseClassPageDto extends PageInput {
+
+    @ApiModelProperty("班级名称")
+    private String name;
+
+    @ApiModelProperty("年级id")
+    private Long gradeId;
+
+    @ApiModelProperty("班主任名字")
+    private String teacherName;
+
+    @ApiModelProperty("教室名字")
+    private String classroomName;
+
+    @ApiModelProperty("班级类型")
+    private String classType;
+
+}

+ 19 - 0
src/main/java/com/xjrsoft/module/base/dto/UpdateBaseClassPageDto.java

@@ -0,0 +1,19 @@
+package com.xjrsoft.module.base.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author dzx
+ * @date 2024年4月28日
+ */
+@Data
+public class UpdateBaseClassPageDto extends AddBaseClassPageDto{
+
+    @ApiModelProperty("主键")
+    private Long id;
+
+}

+ 3 - 0
src/main/java/com/xjrsoft/module/base/entity/BaseClass.java

@@ -70,4 +70,7 @@ public class BaseClass implements Serializable {
 
     @ApiModelProperty("在读状态(1: 在读 2: 毕业)")
     private Integer isGraduate;
+
+    @ApiModelProperty("班级类型(xjr_dictionary_item[class_type])")
+    private String classType;
 }

+ 4 - 0
src/main/java/com/xjrsoft/module/base/mapper/BaseClassMapper.java

@@ -1,7 +1,10 @@
 package com.xjrsoft.module.base.mapper;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.base.dto.BaseClassPageDto;
 import com.xjrsoft.module.base.entity.BaseClass;
+import com.xjrsoft.module.base.vo.BaseClassPageVo;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
@@ -15,4 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 public interface BaseClassMapper extends MPJBaseMapper<BaseClass> {
 
+    Page<BaseClassPageVo> getPage(Page<BaseClassPageVo> page, BaseClassPageDto dto);
 }

+ 5 - 0
src/main/java/com/xjrsoft/module/base/service/IBaseClassService.java

@@ -1,7 +1,10 @@
 package com.xjrsoft.module.base.service;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.base.dto.BaseClassPageDto;
 import com.xjrsoft.module.base.entity.BaseClass;
+import com.xjrsoft.module.base.vo.BaseClassPageVo;
 import com.xjrsoft.module.organization.vo.UserStudentVo;
 
 import java.util.List;
@@ -9,4 +12,6 @@ import java.util.List;
 public interface IBaseClassService extends MPJBaseService<BaseClass> {
     List<UserStudentVo> getStudents(long id);
     UserStudentVo getClassInfo(long id);
+
+    Page<BaseClassPageVo> getPage(Page<BaseClassPageVo> page, BaseClassPageDto dto);
 }

+ 10 - 0
src/main/java/com/xjrsoft/module/base/service/impl/BaseClassServiceImpl.java

@@ -1,11 +1,14 @@
 package com.xjrsoft.module.base.service.impl;
 
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import com.xjrsoft.module.base.dto.BaseClassPageDto;
 import com.xjrsoft.module.base.entity.BaseClass;
 import com.xjrsoft.module.base.mapper.BaseClassMapper;
 import com.xjrsoft.module.base.service.IBaseClassService;
+import com.xjrsoft.module.base.vo.BaseClassPageVo;
 import com.xjrsoft.module.organization.entity.UserStudent;
 import com.xjrsoft.module.organization.service.IUserStudentService;
 import com.xjrsoft.module.organization.vo.UserStudentVo;
@@ -24,6 +27,8 @@ public class BaseClassServiceImpl extends MPJBaseServiceImpl<BaseClassMapper, Ba
 
     private final IUserStudentService userStudentService;
 
+    private final BaseClassMapper baseClassMapper;
+
     /**
      * 获取家长关联的学生 id 是家长的ID
      * @param id
@@ -71,4 +76,9 @@ public class BaseClassServiceImpl extends MPJBaseServiceImpl<BaseClassMapper, Ba
                 .selectAs(BaseStudentUser::getAvatar, UserStudentVo::getAvatar);
         return selectJoinOne(UserStudentVo.class, queryWrapper);
     }
+
+    @Override
+    public Page<BaseClassPageVo> getPage(Page<BaseClassPageVo> page, BaseClassPageDto dto) {
+        return baseClassMapper.getPage(page, dto);
+    }
 }

+ 53 - 0
src/main/java/com/xjrsoft/module/base/vo/BaseClassPageVo.java

@@ -0,0 +1,53 @@
+package com.xjrsoft.module.base.vo;
+
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+* @title: 班级管理列表
+* @Author dzx
+* @Date: 2024年4月28日
+* @Version 1.0
+*/
+@Data
+public class BaseClassPageVo {
+
+    @ApiModelProperty("班级id")
+    private String id;
+
+    @ApiModelProperty("班级名称")
+    private String name;
+
+    @ApiModelProperty("班级代码")
+    private String code;
+
+    @ApiModelProperty("入住性别")
+    private String gradeName;
+
+    @ApiModelProperty("教师名称")
+    private String classroomName;
+
+    @ApiModelProperty("班主任名字")
+    private String teacherName;
+
+    @ApiModelProperty("招生类型-中文")
+    private String enrollTypeCn;
+
+    @ApiModelProperty("男生人数")
+    private Integer maleCout;
+
+    @ApiModelProperty("女生人数")
+    private Integer femaleCount;
+
+    @ApiModelProperty("住校数量")
+    private Integer stayCount;
+
+    @ApiModelProperty("走读数量")
+    private Integer notStayCount;
+
+    @ApiModelProperty("班级类型")
+    private String classTypeCn;
+
+}

+ 71 - 0
src/main/java/com/xjrsoft/module/base/vo/BaseClassVo.java

@@ -0,0 +1,71 @@
+package com.xjrsoft.module.base.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+
+/**
+* @title: 班级管理
+* @Author dzx
+* @Date: 2024年4月28日
+* @Version 1.0
+*/
+@Data
+public class BaseClassVo {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty("主键")
+    private Long id;
+
+    @ApiModelProperty("创建人")
+    private Long createUserId;
+
+    @ApiModelProperty("创建时间")
+    private Date createDate;
+
+    @ApiModelProperty("修改人")
+    private Long modifyUserId;
+
+    @ApiModelProperty("修改时间")
+    private Date modifyDate;
+
+    @ApiModelProperty("删除标记")
+    private Integer deleteMark;
+
+    @ApiModelProperty("有效标志")
+    private Integer enabledMark;
+
+    @ApiModelProperty("班级名称")
+    private String name;
+
+    @ApiModelProperty("班级代码")
+    private String code;
+
+    @ApiModelProperty("所属年级(base_grade)")
+    private Long gradeId;
+
+    @ApiModelProperty("招生类型(xjr_dictionary_item[enroll_type])")
+    private String enrollType;
+
+    @ApiModelProperty("组织机构(xjr_department)")
+    private Long orgId;
+
+    @ApiModelProperty("是否订单班")
+    private Integer isOrderClass;
+
+    @ApiModelProperty("固定教室(base_classroom)")
+    private Long classroomId;
+
+    @ApiModelProperty("班主任(xjr_user)")
+    private Long teacherId;
+
+    @ApiModelProperty("在读状态(1: 在读 2: 毕业)")
+    private Integer isGraduate;
+
+    @ApiModelProperty("班级类型(xjr_dictionary_item[class_type])")
+    private String classType;
+
+}

+ 52 - 0
src/main/resources/mapper/base/BaseClass.xml

@@ -0,0 +1,52 @@
+<?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.base.mapper.BaseClassMapper">
+    <select id="getPage" parameterType="com.xjrsoft.module.base.dto.BaseClassPageDto" resultType="com.xjrsoft.module.base.vo.BaseClassPageVo">
+        SELECT t1.id,t1.name,t1.code,t4.name AS grade_name,t2.name AS teacher_name,t3.name AS enroll_type_cn,
+        t5.name AS class_type_cn,t6.name AS classroomName,
+        (SELECT COUNT(DISTINCT(a1.id)) FROM xjr_user a1
+        LEFT JOIN base_student_school_roll a2 ON a1.id = a2.user_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
+        AND a1.gender = 'SB10001' AND a2.class_id = t1.id
+        AND a2.archives_status = 'FB2901') AS male_cout,
+        (SELECT COUNT(DISTINCT(a1.id)) FROM xjr_user a1
+        LEFT JOIN base_student_school_roll a2 ON a1.id = a2.user_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
+        AND a1.gender = 'SB10002' AND a2.class_id = t1.id
+        AND a2.archives_status = 'FB2901') AS female_count,
+        (SELECT COUNT(DISTINCT(a1.id)) FROM xjr_user a1
+        LEFT JOIN base_student_school_roll a2 ON a1.id = a2.user_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
+        AND a2.class_id = t1.id AND a2.stduy_status = 'FB3002'
+        AND a2.archives_status = 'FB2901') AS stay_count,
+        (SELECT COUNT(DISTINCT(a1.id)) FROM xjr_user a1
+        LEFT JOIN base_student_school_roll a2 ON a1.id = a2.user_id
+        WHERE a1.delete_mark = 0 AND a2.delete_mark = 0
+        AND a2.class_id = t1.id AND a2.stduy_status = 'FB3001'
+        AND a2.archives_status = 'FB2901') AS not_stay_count FROM base_class t1
+        LEFT JOIN xjr_user t2 ON t1.teacher_id = t2.id
+        LEFT JOIN xjr_dictionary_detail t3 ON t3.code = t1.enroll_type AND t3.item_id = 2023000000000000027
+        LEFT JOIN xjr_dictionary_detail t5 ON t5.code = t1.class_type AND t5.item_id = 1784405535724978177
+        LEFT JOIN base_grade t4 ON t1.grade_id = t4.id
+        LEFT JOIN base_classroom t6 ON t1.classroom_id = t6.id
+        WHERE t1.delete_mark = 0
+        <if test="dto.name != null and dto.name != ''">
+            and t1.name like concat('%', #{dto.name}, '%')
+        </if>
+        <if test="dto.teacherName != null and dto.teacherName != ''">
+            and t2.name like concat('%', #{dto.teacherName}, '%')
+        </if>
+        <if test="dto.gradeId != null">
+            and t4.id = #{dto.gradeId}
+        </if>
+        <if test="dto.classroomName != null and dto.classroomName != ''">
+            and t6.name like concat('%', #{dto.classroomName}, '%')
+        </if>
+        <if test="dto.classType != null and dto.classType != ''">
+            and t1.class_type = #{dto.classType}
+        </if>
+    </select>
+
+</mapper>

+ 14 - 0
src/main/resources/sqlScript/200240428_sql.sql

@@ -0,0 +1,14 @@
+-- 添加班级类型字段
+DROP PROCEDURE IF EXISTS createCom;
+DELIMITER $$
+CREATE
+    PROCEDURE createCom()
+BEGIN
+    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='system_update_message' AND COLUMN_NAME = 'release_date') THEN
+ALTER TABLE `base_class`   
+  ADD COLUMN `class_type` VARCHAR(50) NULL   COMMENT '班级类型(xjr_dictionary_item[class_type])' AFTER `is_graduate`;
+    END IF;
+END$$
+DELIMITER ;
+CALL createCom;
+DROP PROCEDURE createCom;

+ 258 - 0
src/main/resources/sqlScript/20240415_sql.sql

@@ -0,0 +1,258 @@
+-- ------------------------------------------------
+-- 系统消息
+-- ------------------------------------------------
+DROP TABLE IF EXISTS system_update_message;
+CREATE TABLE `system_update_message` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `send_range` INT DEFAULT NULL COMMENT '发送范围(1:全体师生,2:全体教职工)',
+  `title` VARCHAR(200) DEFAULT NULL COMMENT '消息标题',
+  `title_color` VARCHAR(30) DEFAULT NULL COMMENT '标题颜色',
+  `content` VARCHAR(1000) DEFAULT NULL COMMENT '消息内容',
+  `status` INT DEFAULT 0 COMMENT '状态(0:未发布 1:已发布)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统消息';
+
+-- ------------------------------------------------
+-- 系统消息
+-- ------------------------------------------------
+DROP TABLE IF EXISTS system_update_message_notice;
+CREATE TABLE `system_update_message_notice` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `system_update_message_id` BIGINT DEFAULT NULL COMMENT '系统消息(system_update_message)',
+  `user_id` VARCHAR(200) DEFAULT NULL COMMENT '用户id(xjr_user)',
+  `status` INT DEFAULT 0 COMMENT '状态(0:未读,1:已读)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='系统消息通知表';
+
+-- ------------------------------------------------
+-- 学生插班
+-- ------------------------------------------------
+DROP TABLE IF EXISTS student_transfer;
+CREATE TABLE `student_transfer` (
+  `id` BIGINT NOT NULL COMMENT '主键',
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATETIME(3) DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人id',
+  `modify_date` DATETIME(3) DEFAULT NULL COMMENT '修改日期',
+  `delete_mark` INT DEFAULT NULL COMMENT '删除标记',
+  `enabled_mark` INT DEFAULT NULL COMMENT '有效标记',
+  `student_user_id` BIGINT DEFAULT NULL COMMENT '学生用户id',
+  `gender` VARCHAR(20) DEFAULT NULL COMMENT '性别',
+  `I_D_number`  VARCHAR(100) DEFAULT NULL COMMENT '身份证号',
+  `study_status` VARCHAR(20) DEFAULT NULL COMMENT '就读方式(xjr_dictionary_item[stduy_status])',
+  `textbook_fees` VARCHAR(50) DEFAULT NULL COMMENT '教材费缴费情况',
+  `homestay` VARCHAR(50) DEFAULT NULL COMMENT '住宿费缴费情况',
+  `class_id` BIGINT DEFAULT NULL COMMENT '班级id',
+  `teacher_id` BIGINT DEFAULT NULL COMMENT '班主任id',
+  `status` INT DEFAULT '0' COMMENT '状态(0:未结束 1:结束)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='学生插班';
+
+-- ------------------------------------------------
+-- 退学申请
+-- ------------------------------------------------
+DROP TABLE IF EXISTS student_drop_out;
+CREATE TABLE `student_drop_out` (
+  `id` BIGINT NOT NULL COMMENT '主键',
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATETIME(3) DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人id',
+  `modify_date` DATETIME(3) DEFAULT NULL COMMENT '修改日期',
+  `delete_mark` INT DEFAULT NULL COMMENT '删除标记',
+  `enabled_mark` INT DEFAULT NULL COMMENT '有效标记',
+  `student_user_id` BIGINT DEFAULT NULL COMMENT '学生用户id',
+  `grade_id` BIGINT DEFAULT NULL COMMENT '年级id',
+  `class_id` BIGINT DEFAULT NULL COMMENT '班级id',
+  `I_D_number`  VARCHAR(100) DEFAULT NULL COMMENT '身份证号',
+  `drop_date` DATETIME DEFAULT NULL COMMENT '退学日期',
+  `reason` VARCHAR(400) DEFAULT NULL COMMENT '请假原因',
+  `folder_id` BIGINT DEFAULT NULL COMMENT '附件',
+  `teacher_id` BIGINT DEFAULT NULL COMMENT '班主任id',
+  `status` INT DEFAULT '0' COMMENT '状态(0:未结束 1:结束)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='退学申请';
+
+-- ------------------------------------------------
+-- 学生请假
+-- ------------------------------------------------
+DROP TABLE IF EXISTS student_leave;
+CREATE TABLE `student_leave` (
+  `id` BIGINT NOT NULL COMMENT '主键',
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATETIME(3) DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人id',
+  `modify_date` DATETIME(3) DEFAULT NULL COMMENT '修改日期',
+  `delete_mark` INT DEFAULT NULL COMMENT '删除标记',
+  `enabled_mark` INT DEFAULT NULL COMMENT '有效标记',
+  `student_user_id` BIGINT DEFAULT NULL COMMENT '学生用户id',
+  `class_id` BIGINT DEFAULT NULL COMMENT '班级id',
+  `start_date` DATETIME DEFAULT NULL COMMENT '开始时间',
+  `end_date` DATETIME DEFAULT NULL COMMENT '结束时间',
+  `day_duration` FLOAT DEFAULT NULL COMMENT '时长(天)',
+  `leave_type` VARCHAR(50) DEFAULT '' COMMENT '请假类型',
+  `reason` VARCHAR(400) DEFAULT NULL COMMENT '请假原因',
+  `folder_id` BIGINT DEFAULT NULL COMMENT '附件',
+  `teacher_id` BIGINT DEFAULT NULL COMMENT '班主任id',
+  `status` INT DEFAULT '0' COMMENT '状态(0:未结束 1:结束)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='学生请假';
+
+-- ------------------------------------------------
+-- 学生转班
+-- ------------------------------------------------
+DROP TABLE IF EXISTS student_change_class;
+CREATE TABLE `student_change_class` (
+  `id` BIGINT NOT NULL COMMENT '主键',
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATETIME(3) DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人id',
+  `modify_date` DATETIME(3) DEFAULT NULL COMMENT '修改日期',
+  `delete_mark` INT DEFAULT NULL COMMENT '删除标记',
+  `enabled_mark` INT DEFAULT NULL COMMENT '有效标记',
+  `before_class_id` BIGINT DEFAULT NULL COMMENT '转出班级id',
+  `student_user_id` BIGINT DEFAULT NULL COMMENT '学生用户id',
+  `gender` VARCHAR(20) DEFAULT NULL COMMENT '性别',
+  `I_D_number` VARCHAR(100) DEFAULT NULL COMMENT '身份证号',
+  `textbook_fees` VARCHAR(20) DEFAULT NULL COMMENT '教材费缴费情况',
+  `homestay` VARCHAR(20) DEFAULT NULL COMMENT '住宿费缴费情况',
+  `after_class_id` BIGINT DEFAULT NULL COMMENT '转入班级id',
+  `teacher_id` BIGINT DEFAULT NULL COMMENT '班主任id',
+  `status` INT DEFAULT '0' COMMENT '状态(0:未结束 1:结束)',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='学生转班';
+
+
+ALTER TABLE `base_student_school_roll`   
+  CHANGE `roll_number` `roll_number` VARCHAR(30) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL   COMMENT '学籍号',
+  CHANGE `archives_number` `archives_number` VARCHAR(30) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL   COMMENT '学生档案编号',
+  CHANGE `study_year` `study_year` DECIMAL(6,1) NULL   COMMENT '学制(base_major_set)';
+
+-- ------------------------------------------------
+-- 常用功能设置
+-- ------------------------------------------------
+DROP TABLE IF EXISTS system_menu_commonly_used;
+CREATE TABLE `system_menu_commonly_used` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `menu_id` BIGINT DEFAULT NULL COMMENT '菜单id',
+  `seq` INT DEFAULT NULL COMMENT '序号',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='常用功能设置';
+
+
+ALTER TABLE `base_course_subject`   
+  CHANGE `code` `code` VARCHAR(30) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL   COMMENT '课程学科代码';
+  
+DROP PROCEDURE IF EXISTS createCom;
+DELIMITER $$
+CREATE
+    PROCEDURE createCom()
+BEGIN
+    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='xjr_user' AND COLUMN_NAME = 'sign_folder_id') THEN
+ALTER TABLE `xjr_user`   
+  ADD COLUMN `sign_folder_id` BIGINT NULL   COMMENT '签名文件' AFTER `is_change_password`;
+    END IF;
+END$$
+DELIMITER ;
+CALL createCom;
+DROP PROCEDURE createCom;
+
+DROP PROCEDURE IF EXISTS createCom;
+DELIMITER $$
+CREATE
+    PROCEDURE createCom()
+BEGIN
+    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='xjr_user' AND COLUMN_NAME = 'sign_password') THEN
+ALTER TABLE `xjr_user`   
+  ADD COLUMN `sign_password` VARCHAR(100) NULL   COMMENT '签名密码' AFTER `is_change_password`;
+    END IF;
+END$$
+DELIMITER ;
+CALL createCom;
+DROP PROCEDURE createCom;
+
+
+
+-- ------------------------------------------------
+-- 数据导出-数据源设置
+-- ------------------------------------------------
+DROP TABLE IF EXISTS data_expert_source;
+CREATE TABLE `data_expert_source` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `name` VARCHAR(100) DEFAULT NULL COMMENT '数据源名称',
+  `source_type` VARCHAR(50) DEFAULT NULL COMMENT '数据源类型',
+  `api_url` VARCHAR(50) DEFAULT NULL COMMENT 'magicapi地址',
+  `field_json` LONGTEXT DEFAULT NULL COMMENT '字段配置',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据导出-数据源设置';
+
+
+-- ------------------------------------------------
+-- 数据导出-数据模板
+-- ------------------------------------------------
+DROP TABLE IF EXISTS data_expert_template;
+CREATE TABLE `data_expert_template` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `name` VARCHAR(100) DEFAULT NULL COMMENT '模板名称',
+  `data_expert_source_id` BIGINT DEFAULT NULL COMMENT '数据源(data_expert_source)',
+  `field_json` LONGTEXT DEFAULT NULL COMMENT '字段配置',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据导出-数据模板';
+
+-- ------------------------------------------------
+-- 寝室申请
+-- ------------------------------------------------
+DROP TABLE IF EXISTS wf_room_applicant;
+CREATE TABLE `wf_room_applicant` (
+  `id` BIGINT NOT NULL COMMENT '主键编号',
+  `create_user_id` BIGINT DEFAULT NULL COMMENT '创建人',
+  `create_date` DATETIME DEFAULT NULL COMMENT '创建时间',
+  `modify_user_id` BIGINT DEFAULT NULL COMMENT '修改人',
+  `modify_date` DATETIME DEFAULT NULL COMMENT '修改时间',
+  `delete_mark` INT NOT NULL COMMENT '删除标记',
+  `enabled_mark` INT NOT NULL COMMENT '有效标志',
+  `sort_code` INT DEFAULT NULL COMMENT '序号',
+  `applicant_user_id` BIGINT DEFAULT NULL COMMENT '申请人',
+  `head_teacher_id` BIGINT DEFAULT NULL COMMENT '班主任用户编号',
+  `recede_type` VARCHAR(20) DEFAULT NULL COMMENT '寝室申请类型(xjr_dictionary_item[room_applicant_type])',
+  `class_name` VARCHAR(200) DEFAULT NULL COMMENT '班级名称',
+  `room_bed_number` VARCHAR(200) DEFAULT NULL COMMENT '寝室+床位名称',
+  `start_time` DATE DEFAULT NULL COMMENT '开始时间',
+  `nos_reason` VARCHAR(20) DEFAULT NULL COMMENT '离宿事由(xjr_dictionary_item[nos_reason])',
+  `remark` VARCHAR(1000) DEFAULT NULL COMMENT '备注',
+  `status` INT NOT NULL DEFAULT '0' COMMENT '状态(1:结束 0:未结束)',
+  `grade` BIGINT DEFAULT NULL,
+  `I_D_number` VARCHAR(100) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='寝室申请';

+ 92 - 0
src/main/resources/sqlScript/20240423_sql.sql

@@ -0,0 +1,92 @@
+DROP PROCEDURE IF EXISTS createCom;
+DELIMITER $$
+CREATE
+    PROCEDURE createCom()
+BEGIN
+    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='system_update_message' AND COLUMN_NAME = 'release_date') THEN
+ALTER TABLE `system_update_message`   
+  ADD COLUMN `release_date` DATETIME NULL   COMMENT '发布时间';
+    END IF;
+END$$
+DELIMITER ;
+CALL createCom;
+DROP PROCEDURE createCom;
+
+
+ALTER TABLE `base_student_school_roll`   
+  ADD INDEX (`class_id`),
+  ADD INDEX (`grade_id`);
+
+DROP PROCEDURE IF EXISTS createCom;
+DELIMITER $$
+CREATE
+    PROCEDURE createCom()
+BEGIN
+    IF NOT EXISTS(SELECT 1 FROM information_schema.columns  WHERE table_name='xjr_menu' AND COLUMN_NAME = 'is_show_servce') THEN
+ALTER TABLE `xjr_menu`   
+  ADD COLUMN `is_show_servce` SMALLINT DEFAULT 1  NULL   COMMENT '是否显示在服务中心(0:否 1:是)' ;
+
+    END IF;
+END$$
+DELIMITER ;
+CALL createCom;
+DROP PROCEDURE createCom;
+
+UPDATE xjr_menu SET is_show_servce = 1 WHERE is_show_servce IS NULL;
+
+ALTER TABLE `data_expert_source`   
+  DROP COLUMN `field_json`, 
+  CHANGE `api_url` `view_name` VARCHAR(50) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL   COMMENT '视图名称';
+
+ALTER TABLE `base_student`   
+  ADD COLUMN `native_place_type` VARCHAR(50) NULL   COMMENT '籍贯类型' ;
+
+DROP TABLE IF EXISTS data_expert_source;
+CREATE TABLE `data_expert_source` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `name` VARCHAR(100) DEFAULT NULL COMMENT '数据源名称',
+  `source_type` VARCHAR(50) DEFAULT NULL COMMENT '数据源类型',
+  `view_name` VARCHAR(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '视图名称',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据导出-数据源设置';
+
+DROP TABLE IF EXISTS data_expert_source_field;
+CREATE TABLE `data_expert_source_field` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `data_expert_source_id` BIGINT DEFAULT NULL COMMENT '数据源(data_expert_source)',
+  `field_name` VARCHAR(100) DEFAULT NULL COMMENT '字段名称',
+  `show_name` VARCHAR(50) DEFAULT NULL COMMENT '映射名称',
+  `remarks` VARCHAR(50) DEFAULT NULL COMMENT '备注',
+  `data_group` VARCHAR(50) DEFAULT NULL COMMENT '数据分组',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据导出-数据源-字段设置';
+
+DROP TABLE IF EXISTS data_expert_template;
+CREATE TABLE `data_expert_template` (
+  `id` BIGINT NOT NULL,
+  `create_user_id` BIGINT DEFAULT NULL,
+  `create_date` DATETIME(3) DEFAULT NULL,
+  `modify_user_id` BIGINT DEFAULT NULL,
+  `modify_date` DATETIME(3) DEFAULT NULL,
+  `delete_mark` INT DEFAULT NULL,
+  `enabled_mark` INT DEFAULT NULL,
+  `sort_code` INT DEFAULT NULL,
+  `name` VARCHAR(100) DEFAULT NULL COMMENT '模板名称',
+  `data_expert_source_id` BIGINT DEFAULT NULL COMMENT '数据源(data_expert_source)',
+  `field_json` LONGTEXT COMMENT '字段配置',
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='数据导出-数据模板';