refactor: 项目重构为 bschclassmanage 包结构,修复启动/CORS/路由问题
- 根包 com.bestsch.classicalchinese 重命名为 com.bestsch.bschclassmanage - 修复 CORS 启动失败:allowCredentials=true 时 allowedOrigins 不能含 "*", 23 个 Controller 的 @CrossOrigin 改用语义等价的 originPatterns - 修复 /api/* 与 /oapi/* 接口 404:API_PATH/OAPI 常量去掉尾斜杠, 消除 Spring Boot 2.7 PathPattern 下的双斜杠(/api//subject/) 导致的匹配失败 - UserSysRoleArgumentResolver 增加从 URL 参数 currentrole 回退解析(便于本地调试), 原请求头 currentrole 注入方式保持不变
This commit is contained in:
-19
@@ -1,19 +0,0 @@
|
|||||||
# Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
# or more contributor license agreements. See the NOTICE file
|
|
||||||
# distributed with this work for additional information
|
|
||||||
# regarding copyright ownership. The ASF licenses this file
|
|
||||||
# to you under the Apache License, Version 2.0 (the
|
|
||||||
# "License"); you may not use this file except in compliance
|
|
||||||
# with the License. You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing,
|
|
||||||
# software distributed under the License is distributed on an
|
|
||||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
# KIND, either express or implied. See the License for the
|
|
||||||
# specific language governing permissions and limitations
|
|
||||||
# under the License.
|
|
||||||
wrapperVersion=3.3.2
|
|
||||||
distributionType=only-script
|
|
||||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
|
|
||||||
@@ -5,18 +5,41 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>2.2.4.RELEASE</version>
|
<!-- <version>2.2.4.RELEASE</version>-->
|
||||||
|
<version>2.7.18</version>
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>com.bestsch.previewUnit</groupId>
|
<!-- <groupId>com.bestsch.previewUnit</groupId>-->
|
||||||
<artifactId>previewunit</artifactId>
|
<artifactId>BschClass</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.1</version>
|
||||||
<name>previewunit</name>
|
<name>BschClass</name>
|
||||||
<description>Demo project for Spring Boot</description>
|
<description>Demo project for Spring Boot</description>
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<tomcat.version>9.0.63</tomcat.version>
|
<tomcat.version>9.0.63</tomcat.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<dependencyManagement>
|
||||||
|
<!-- 基础平台版本管理(含 yh-* 架包与 spring-boot-dependencies 对齐) -->
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yunhai.platform</groupId>
|
||||||
|
<artifactId>yh-platform-dependencies</artifactId>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- Spring Cloud Alibaba(Nacos 配置中心,对齐 Boot 2.7) -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||||
|
<version>2021.0.5.0</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@@ -30,21 +53,28 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.36</version> <!-- 加上这行 -->
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>mysql</groupId>-->
|
||||||
|
<!-- <artifactId>mysql-connector-java</artifactId>-->
|
||||||
|
<!-- <scope>runtime</scope>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>8.0.33</version> <!-- 明确指定版本 -->
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--bsch-->
|
<!--bsch-->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>com.bestsch</groupId>
|
<!-- <groupId>com.bestsch</groupId>-->
|
||||||
<artifactId>bsch-spring-boot-starter</artifactId>
|
<!-- <artifactId>bsch-spring-boot-starter</artifactId>-->
|
||||||
<version>1.2.5-SNAPSHOT</version>
|
<!-- <version>1.2.5-SNAPSHOT</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
@@ -108,24 +138,10 @@
|
|||||||
<version>20210307</version>
|
<version>20210307</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--百度 API SDK-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.baidu.aip</groupId>
|
|
||||||
<artifactId>java-sdk</artifactId>
|
|
||||||
<version>4.16.19</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 视频转码-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>ws.schild</groupId>
|
|
||||||
<artifactId>jave-core</artifactId>
|
|
||||||
<version>2.4.6</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.squareup.okhttp3</groupId>
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
<artifactId>okhttp</artifactId>
|
<artifactId>okhttp</artifactId>
|
||||||
<version>4.10.0</version>
|
<version>3.14.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Apache POI -->
|
<!-- Apache POI -->
|
||||||
@@ -136,7 +152,49 @@
|
|||||||
<version>4.1.0</version>
|
<version>4.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-aop</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- easypoi style -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.afterturn</groupId>
|
||||||
|
<artifactId>easypoi-spring-boot-starter</artifactId>
|
||||||
|
<version>4.2.0</version> <!-- 或其他稳定版本,如 4.1.0、4.2.0 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 基础平台架包:认证(CAS/会话/SSO)+ 应用间签名鉴权 + 用户中心静态门面 + 统一响应 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yunhai.platform</groupId>
|
||||||
|
<artifactId>yh-auth-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yunhai.platform</groupId>
|
||||||
|
<artifactId>yh-app-auth-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yunhai.platform</groupId>
|
||||||
|
<artifactId>yh-openapi-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.yunhai.platform</groupId>
|
||||||
|
<artifactId>yh-api-std</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- CAS 客户端(浏览器 SSO 重定向 / ticket 校验 / getRemoteUser 包装)。
|
||||||
|
版本 3.5.1 已在本地 .m2 仓库。 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jasig.cas.client</groupId>
|
||||||
|
<artifactId>cas-client-core</artifactId>
|
||||||
|
<version>3.5.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
@@ -149,4 +207,20 @@
|
|||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>nexus-public</id>
|
||||||
|
<name>bsch/nexus public</name>
|
||||||
|
<url>http://nexus.yunhaixingtong.com/repository/maven-public/</url>
|
||||||
|
<releases><enabled>true</enabled></releases>
|
||||||
|
<snapshots><enabled>true</enabled></snapshots>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<!--
|
||||||
|
ci 构建档案:将构建产物重定向到 IDE(IntelliJ/Eclipse)索引目录之外,
|
||||||
|
避免 IDE 后台进程持续锁定 target/maven-status/.../createdFiles.lst 导致
|
||||||
|
"Error while storing the mojo status / 拒绝访问"。
|
||||||
|
输出目录需从未被 IDE 打开过。常规本地构建无需激活此 profile。
|
||||||
|
-->
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -0,0 +1,500 @@
|
|||||||
|
/*
|
||||||
|
Navicat Premium Data Transfer
|
||||||
|
|
||||||
|
Source Server : 本地
|
||||||
|
Source Server Type : MySQL
|
||||||
|
Source Server Version : 80044
|
||||||
|
Source Host : localhost:3306
|
||||||
|
Source Schema : dbschoolclass
|
||||||
|
|
||||||
|
Target Server Type : MySQL
|
||||||
|
Target Server Version : 80044
|
||||||
|
File Encoding : 65001
|
||||||
|
|
||||||
|
Date: 17/06/2026 10:30:52
|
||||||
|
*/
|
||||||
|
|
||||||
|
SET NAMES utf8mb4;
|
||||||
|
SET FOREIGN_KEY_CHECKS = 0;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for base_dic_grade
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `base_dic_grade`;
|
||||||
|
CREATE TABLE `base_dic_grade` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`code` int(0) NULL DEFAULT NULL COMMENT '年级编码',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '年级名称',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of base_dic_grade
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (1, 1, '一年级');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (2, 2, '二年级');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (3, 3, '三年级');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (4, 4, '四年级');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (5, 5, '五年级');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (6, 6, '六年级');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (7, 7, '初一');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (8, 8, '初二');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (9, 9, '初三');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (10, 10, '高一');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (11, 11, '高二');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (12, 12, '高三');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (13, -4, '幼托');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (14, -3, '幼小');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (15, -2, '幼中');
|
||||||
|
INSERT INTO `base_dic_grade` VALUES (16, -1, '幼大');
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for base_dic_subject
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `base_dic_subject`;
|
||||||
|
CREATE TABLE `base_dic_subject` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '编码',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '名称',
|
||||||
|
`sort` int(0) NULL DEFAULT NULL COMMENT '序号',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 18 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of base_dic_subject
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (1, 'SUB01', '语文', 1);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (2, 'SUB02', '数学', 2);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (3, 'SUB03', '英语', 3);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (4, 'SUB04', '物理', 4);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (5, 'SUB05', '化学', 5);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (6, 'SUB06', '生物', 6);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (7, 'SUB07', '历史', 7);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (8, 'SUB08', '地理', 8);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (9, 'SUB09', '政治', 9);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (10, 'SUB10', '艺术', 10);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (11, 'SUB11', '体育', 11);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (12, 'SUB12', '心理', 12);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (13, 'SUB13', '信息', 13);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (14, 'SUB14', '劳技', 14);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (15, 'SUB15', '跨学科', 15);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (16, 'SUB16', '美术', 16);
|
||||||
|
INSERT INTO `base_dic_subject` VALUES (17, 'SUB17', '音乐', 17);
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for base_sch_system
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `base_sch_system`;
|
||||||
|
CREATE TABLE `base_sch_system` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '名称 ',
|
||||||
|
`academic_stage` int(0) NULL DEFAULT NULL COMMENT '学段(0学前 1小学 2初中 3高中 4高等)',
|
||||||
|
`start_grade_code` int(0) NULL DEFAULT NULL COMMENT '开班年级编码',
|
||||||
|
`end_grade_code` int(0) NULL DEFAULT NULL COMMENT '毕业年级编码',
|
||||||
|
`graduation_leng` int(0) NULL DEFAULT NULL COMMENT '毕业年长度',
|
||||||
|
`type` int(0) NULL DEFAULT NULL COMMENT '类型(1学前教育 2职业教育)',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of base_sch_system
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `base_sch_system` VALUES (1, '学前教育', 0, -3, -1, 3, 1);
|
||||||
|
INSERT INTO `base_sch_system` VALUES (2, '学前4年', 0, -4, -1, 4, 1);
|
||||||
|
INSERT INTO `base_sch_system` VALUES (3, '小学六年', 1, 1, 6, 6, 1);
|
||||||
|
INSERT INTO `base_sch_system` VALUES (4, '小学五年', 1, 1, 5, 5, 1);
|
||||||
|
INSERT INTO `base_sch_system` VALUES (5, '初中三年', 2, 7, 9, 3, 1);
|
||||||
|
INSERT INTO `base_sch_system` VALUES (6, '初中四年', 2, 6, 9, 4, 1);
|
||||||
|
INSERT INTO `base_sch_system` VALUES (7, '九年一贯制', 2, 1, 9, 9, 1);
|
||||||
|
INSERT INTO `base_sch_system` VALUES (8, '高中三年', 3, 10, 12, 3, 1);
|
||||||
|
INSERT INTO `base_sch_system` VALUES (9, '初高中七年制', 3, 6, 12, 7, 1);
|
||||||
|
INSERT INTO `base_sch_system` VALUES (10, '职高', 3, 0, 0, 3, 2);
|
||||||
|
INSERT INTO `base_sch_system` VALUES (11, '\r\n专科三年制', 4, 0, 0, 3, 2);
|
||||||
|
INSERT INTO `base_sch_system` VALUES (12, '\r\n专科五年制', 4, 0, 0, 5, 2);
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for base_sch_system_grade
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `base_sch_system_grade`;
|
||||||
|
CREATE TABLE `base_sch_system_grade` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`grade_id` int(0) NULL DEFAULT NULL COMMENT '年级id',
|
||||||
|
`grade_nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '年级别名',
|
||||||
|
`sch_system_id` int(0) NULL DEFAULT NULL COMMENT '学制id',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 44 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of base_sch_system_grade
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (1, -3, '幼小', 1);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (2, -2, '幼中', 1);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (3, -1, '幼大', 1);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (4, -4, '幼托', 2);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (5, -3, '幼小', 2);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (6, -2, '幼中', 2);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (7, -1, '幼大', 2);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (8, 1, '小一', 3);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (9, 2, '小二', 3);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (10, 3, '小三', 3);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (11, 4, '小四', 3);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (12, 5, '小五', 3);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (13, 6, '小六', 3);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (14, 1, '小一', 4);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (15, 2, '小二', 4);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (16, 3, '小三', 4);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (17, 4, '小四', 4);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (18, 5, '小五', 4);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (19, 7, '初一', 5);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (20, 8, '初二', 5);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (21, 9, '初三', 5);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (22, 6, '预备', 6);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (23, 7, '初一', 6);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (24, 8, '初二', 6);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (25, 9, '初三', 6);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (26, 1, '小一', 7);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (27, 2, '小二', 7);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (28, 3, '小三', 7);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (29, 4, '小四', 7);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (30, 5, '小五', 7);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (31, 6, '小六', 7);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (32, 7, '初一', 7);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (33, 8, '初二', 7);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (34, 9, '初三', 7);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (35, 10, '高一', 8);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (36, 11, '高二', 8);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (37, 12, '高三', 8);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (38, 6, '预备', 9);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (39, 7, '初一', 9);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (40, 8, '初二', 9);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (41, 9, '初三', 9);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (42, 10, '高一', 9);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (43, 11, '高二', 9);
|
||||||
|
INSERT INTO `base_sch_system_grade` VALUES (44, 12, '高三', 9);
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for base_year_term
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `base_year_term`;
|
||||||
|
CREATE TABLE `base_year_term` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`year` int(0) NULL DEFAULT NULL COMMENT '学年',
|
||||||
|
`year_start_date` date NULL DEFAULT NULL COMMENT '学年开始日期',
|
||||||
|
`year_end_date` date NULL DEFAULT NULL COMMENT '学年结束日期',
|
||||||
|
`first_term_start_date` date NULL DEFAULT NULL COMMENT '第一学期开始日期',
|
||||||
|
`first_term_end_date` date NULL DEFAULT NULL COMMENT '第一学期结束日期',
|
||||||
|
`second_term_start_date` date NOT NULL COMMENT '第二学期开始日期',
|
||||||
|
`second_term_end_date` date NULL DEFAULT NULL COMMENT '第二学期结束日期',
|
||||||
|
`upgrade_date` date NULL DEFAULT NULL COMMENT '毕业时间',
|
||||||
|
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_date` datetime(0) NULL DEFAULT NULL COMMENT '修改日期',
|
||||||
|
`create_user_id` int(0) NULL DEFAULT NULL COMMENT '创建用户',
|
||||||
|
`update_user_id` int(0) NULL DEFAULT NULL COMMENT '修改用户',
|
||||||
|
PRIMARY KEY (`id`, `second_term_start_date`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of base_year_term
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `base_year_term` VALUES (1, 2025, '2025-09-01', '2026-07-10', '2025-09-01', '2026-01-15', '2026-02-20', '2026-07-05', '2026-07-15', '2026-06-15 10:11:06', NULL, 100000, NULL);
|
||||||
|
INSERT INTO `base_year_term` VALUES (2, 2024, '2024-09-01', '2025-07-10', '2024-09-01', '2025-01-15', '2025-02-20', '2025-07-05', '2025-07-15', '2026-06-15 10:19:53', NULL, 100000, NULL);
|
||||||
|
INSERT INTO `base_year_term` VALUES (3, 2023, '2023-09-01', '2024-07-10', '2023-09-01', '2024-01-15', '2024-02-20', '2024-07-05', '2024-07-15', '2026-06-15 10:20:58', NULL, 100000, NULL);
|
||||||
|
INSERT INTO `base_year_term` VALUES (4, 2022, '2022-09-01', '2023-07-10', '2022-09-01', '2023-01-15', '2023-02-20', '2023-07-05', '2023-07-15', '2026-06-15 10:21:51', NULL, 100000, NULL);
|
||||||
|
INSERT INTO `base_year_term` VALUES (5, 2021, '2021-09-01', '2022-07-10', '2021-09-01', '2022-01-15', '2022-02-20', '2022-07-05', '2022-07-15', '2026-06-15 10:22:00', NULL, 100000, NULL);
|
||||||
|
INSERT INTO `base_year_term` VALUES (6, 2020, '2020-09-01', '2021-07-10', '2020-09-01', '2021-01-15', '2021-02-20', '2021-07-05', '2021-07-15', '2026-06-15 10:23:22', NULL, 100000, NULL);
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sch_bin_sch_system
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sch_bin_sch_system`;
|
||||||
|
CREATE TABLE `sch_bin_sch_system` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT,
|
||||||
|
`sch_system_id` int(0) NOT NULL COMMENT '学制id',
|
||||||
|
`sch_id` int(0) NULL DEFAULT NULL COMMENT '学校id',
|
||||||
|
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`create_user_id` int(0) NULL DEFAULT NULL COMMENT '创建用户',
|
||||||
|
`update_date` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
|
||||||
|
`update_user_id` int(0) NULL DEFAULT NULL COMMENT '修改日期',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of sch_bin_sch_system
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `sch_bin_sch_system` VALUES (5, 6, 3260, '2026-06-11 15:21:34', 100000, '2026-06-11 15:21:34', 100000);
|
||||||
|
INSERT INTO `sch_bin_sch_system` VALUES (6, 8, 3260, '2026-06-11 15:21:34', 100000, '2026-06-11 15:21:34', 100000);
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sch_class
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sch_class`;
|
||||||
|
CREATE TABLE `sch_class` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`code` int(10) UNSIGNED ZEROFILL NULL DEFAULT NULL COMMENT '编码',
|
||||||
|
`grade_id` int(0) NULL DEFAULT NULL COMMENT '年级id',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '名称',
|
||||||
|
`cname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '别称',
|
||||||
|
`group_class_id` int(0) UNSIGNED NOT NULL COMMENT '班级组id',
|
||||||
|
`group_grade_id` int(0) NOT NULL COMMENT '年级组id',
|
||||||
|
`first_teacher_id` int(0) NULL DEFAULT NULL COMMENT '班主任',
|
||||||
|
`second_teacher_id` int(0) NULL DEFAULT NULL COMMENT '副班主任',
|
||||||
|
`campus_id` int(0) NULL DEFAULT NULL COMMENT '校区',
|
||||||
|
`division_id` int(0) NULL DEFAULT NULL COMMENT '系部',
|
||||||
|
`majors_id` int(0) NULL DEFAULT NULL COMMENT '专业',
|
||||||
|
`graduate` bit(1) NULL DEFAULT NULL COMMENT '毕业',
|
||||||
|
`sch_id` int(0) NULL DEFAULT NULL COMMENT '学校id',
|
||||||
|
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',
|
||||||
|
`update_date` datetime(0) NULL DEFAULT NULL COMMENT '修改日期',
|
||||||
|
`create_user_id` int(0) NULL DEFAULT NULL COMMENT '创建用户',
|
||||||
|
`update_user_id` int(0) NULL DEFAULT NULL COMMENT '修改用户',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sch_class_teach
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sch_class_teach`;
|
||||||
|
CREATE TABLE `sch_class_teach` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`grade_id` int(0) NULL DEFAULT NULL COMMENT '年级id',
|
||||||
|
`class_id` int(0) NULL DEFAULT NULL COMMENT '班级id',
|
||||||
|
`sub_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学科id',
|
||||||
|
`tea_id` int(0) NULL DEFAULT NULL COMMENT '教师id',
|
||||||
|
`sch_id` int(0) NULL DEFAULT NULL COMMENT '学校id',
|
||||||
|
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',
|
||||||
|
`update_date` datetime(0) NULL DEFAULT NULL COMMENT '修改日期',
|
||||||
|
`create_user_id` int(0) NULL DEFAULT NULL COMMENT '创建用户',
|
||||||
|
`update_user_id` int(0) NULL DEFAULT NULL COMMENT '修改用户',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sch_dic_campus
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sch_dic_campus`;
|
||||||
|
CREATE TABLE `sch_dic_campus` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '校区',
|
||||||
|
`sch_id` int(0) NULL DEFAULT NULL COMMENT '学校id',
|
||||||
|
`sort` int(0) NULL DEFAULT NULL COMMENT '序号',
|
||||||
|
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',
|
||||||
|
`create_user_id` int(0) NULL DEFAULT NULL COMMENT '创建用户',
|
||||||
|
`update_date` datetime(0) NULL DEFAULT NULL COMMENT '编辑日期',
|
||||||
|
`update_user_id` int(0) NULL DEFAULT NULL COMMENT '编辑用户',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of sch_dic_campus
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `sch_dic_campus` VALUES (1, '新渔区', 3260, 2, '2026-06-16 10:06:49', 209169, '2026-06-16 10:10:47', 209169);
|
||||||
|
INSERT INTO `sch_dic_campus` VALUES (2, '名宿区', 3260, 1, '2026-06-16 10:08:08', 209169, '2026-06-16 10:10:47', 209169);
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sch_dic_course
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sch_dic_course`;
|
||||||
|
CREATE TABLE `sch_dic_course` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '编码',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '课程名称',
|
||||||
|
`nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '别名',
|
||||||
|
`type` int(0) NULL DEFAULT NULL COMMENT '类型(1基础课程 2选修课程 3专业课程)',
|
||||||
|
`sch_id` int(0) NULL DEFAULT NULL COMMENT '学校id',
|
||||||
|
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_date` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
|
||||||
|
`create_user_id` int(0) NULL DEFAULT NULL COMMENT '创建用户',
|
||||||
|
`update_user_id` int(0) NULL DEFAULT NULL COMMENT '修改用户',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of sch_dic_course
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `sch_dic_course` VALUES (1, 'MATH101', '高等数学', '高数', 3, 3260, '2026-06-16 22:11:35', '2026-06-17 00:40:54', 209169, 209169);
|
||||||
|
INSERT INTO `sch_dic_course` VALUES (2, 'MATH102', '就业指导', NULL, 1, 3260, '2026-06-16 22:29:21', '2026-06-17 00:39:55', 209169, 209169);
|
||||||
|
INSERT INTO `sch_dic_course` VALUES (3, 'MATH103', '中餐冷菜制作', NULL, 2, 3260, '2026-06-16 22:30:02', '2026-06-17 00:39:15', 209169, 209169);
|
||||||
|
INSERT INTO `sch_dic_course` VALUES (4, NULL, '计算机应用基础', NULL, 1, 3260, '2026-06-16 22:30:17', '2026-06-16 22:30:17', 209169, 209169);
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sch_dic_course_division
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sch_dic_course_division`;
|
||||||
|
CREATE TABLE `sch_dic_course_division` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT,
|
||||||
|
`course_id` int(0) NULL DEFAULT NULL,
|
||||||
|
`division_id` int(0) NULL DEFAULT NULL,
|
||||||
|
`sch_id` int(0) NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of sch_dic_course_division
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `sch_dic_course_division` VALUES (3, 3, 5, 3260);
|
||||||
|
INSERT INTO `sch_dic_course_division` VALUES (4, 3, 6, 3260);
|
||||||
|
INSERT INTO `sch_dic_course_division` VALUES (5, 2, 3, 3260);
|
||||||
|
INSERT INTO `sch_dic_course_division` VALUES (6, 2, 4, 3260);
|
||||||
|
INSERT INTO `sch_dic_course_division` VALUES (9, 1, 1, 3260);
|
||||||
|
INSERT INTO `sch_dic_course_division` VALUES (10, 1, 2, 3260);
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sch_dic_course_majors
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sch_dic_course_majors`;
|
||||||
|
CREATE TABLE `sch_dic_course_majors` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT,
|
||||||
|
`course_id` int(0) NULL DEFAULT NULL,
|
||||||
|
`majors_id` int(0) NULL DEFAULT NULL,
|
||||||
|
`sch_id` int(0) NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of sch_dic_course_majors
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `sch_dic_course_majors` VALUES (2, 3, 4, 3260);
|
||||||
|
INSERT INTO `sch_dic_course_majors` VALUES (3, 2, 2, 3260);
|
||||||
|
INSERT INTO `sch_dic_course_majors` VALUES (6, 1, 1, 3260);
|
||||||
|
INSERT INTO `sch_dic_course_majors` VALUES (7, 1, 5, 3260);
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sch_dic_division
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sch_dic_division`;
|
||||||
|
CREATE TABLE `sch_dic_division` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '系部',
|
||||||
|
`sch_id` int(0) NULL DEFAULT NULL COMMENT '学校id',
|
||||||
|
`sort` int(0) NULL DEFAULT NULL COMMENT '序号',
|
||||||
|
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',
|
||||||
|
`create_user_id` int(0) NULL DEFAULT NULL COMMENT '修改日期',
|
||||||
|
`update_date` datetime(0) NULL DEFAULT NULL COMMENT '创建用户',
|
||||||
|
`update_user_id` int(0) NULL DEFAULT NULL COMMENT '修改用户',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 7 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of sch_dic_division
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `sch_dic_division` VALUES (1, '中文系', 3260, 6, '2026-06-16 10:33:45', 209169, '2026-06-16 10:41:12', 209169);
|
||||||
|
INSERT INTO `sch_dic_division` VALUES (2, '历史系', 3260, 5, '2026-06-16 10:34:02', 209169, '2026-06-16 10:41:12', 209169);
|
||||||
|
INSERT INTO `sch_dic_division` VALUES (3, '外国语学院', 3260, 4, '2026-06-16 10:34:23', 209169, '2026-06-16 10:41:12', 209169);
|
||||||
|
INSERT INTO `sch_dic_division` VALUES (4, '新闻传播学院', 3260, 3, '2026-06-16 10:34:32', 209169, '2026-06-16 10:41:12', 209169);
|
||||||
|
INSERT INTO `sch_dic_division` VALUES (5, '哲学系', 3260, 2, '2026-06-16 10:34:41', 209169, '2026-06-16 10:41:12', 209169);
|
||||||
|
INSERT INTO `sch_dic_division` VALUES (6, '经济学院', 3260, 1, '2026-06-16 10:34:49', 209169, '2026-06-16 10:41:12', 209169);
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sch_dic_majors
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sch_dic_majors`;
|
||||||
|
CREATE TABLE `sch_dic_majors` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '专业 ',
|
||||||
|
`sch_id` int(0) NULL DEFAULT NULL COMMENT '学校id',
|
||||||
|
`sort` int(0) NULL DEFAULT NULL COMMENT '序号',
|
||||||
|
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',
|
||||||
|
`update_date` datetime(0) NULL DEFAULT NULL COMMENT '修改日期',
|
||||||
|
`create_user_id` int(0) NULL DEFAULT NULL COMMENT '创建用户',
|
||||||
|
`update_user_id` int(0) NULL DEFAULT NULL COMMENT '修改用户',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of sch_dic_majors
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `sch_dic_majors` VALUES (1, '哲学', 3260, 7, '2026-06-16 16:23:06', '2026-06-16 16:25:13', 209169, 209169);
|
||||||
|
INSERT INTO `sch_dic_majors` VALUES (2, '逻辑学', 3260, 6, '2026-06-16 16:23:31', '2026-06-16 16:25:13', 209169, 209169);
|
||||||
|
INSERT INTO `sch_dic_majors` VALUES (3, '宗教学', 3260, 5, '2026-06-16 16:23:44', '2026-06-16 16:25:13', 209169, 209169);
|
||||||
|
INSERT INTO `sch_dic_majors` VALUES (4, '经济学', 3260, 4, '2026-06-16 16:23:59', '2026-06-16 16:25:13', 209169, 209169);
|
||||||
|
INSERT INTO `sch_dic_majors` VALUES (5, '经济统计学', 3260, 3, '2026-06-16 16:24:12', '2026-06-16 16:25:13', 209169, 209169);
|
||||||
|
INSERT INTO `sch_dic_majors` VALUES (6, '法学', 3260, 2, '2026-06-16 16:24:24', '2026-06-16 16:25:13', 209169, 209169);
|
||||||
|
INSERT INTO `sch_dic_majors` VALUES (7, '新闻学', 3260, 1, '2026-06-16 16:24:38', '2026-06-16 16:25:13', 209169, 209169);
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sch_dic_subject
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sch_dic_subject`;
|
||||||
|
CREATE TABLE `sch_dic_subject` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '编码',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '学科',
|
||||||
|
`enable` bit(1) NULL DEFAULT NULL COMMENT '是否启用',
|
||||||
|
`sort` int(0) NULL DEFAULT NULL COMMENT '序号',
|
||||||
|
`sch_id` int(0) NULL DEFAULT NULL COMMENT '学校id',
|
||||||
|
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建日期',
|
||||||
|
`update_date` datetime(0) NULL DEFAULT NULL COMMENT '修改日期',
|
||||||
|
`create_user_id` int(0) NULL DEFAULT NULL COMMENT '创建用户',
|
||||||
|
`update_user_id` int(0) NULL DEFAULT NULL COMMENT '修改用户',
|
||||||
|
`source` int(0) NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 42 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Records of sch_dic_subject
|
||||||
|
-- ----------------------------
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (5, 'SUB1001', '机器人', b'1', 1, 3260, '2026-06-15 18:00:05', '2026-06-15 22:23:27', 209169, 209169, 1);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (6, 'SUB1002', 'AI', b'1', 2, 3260, '2026-06-15 18:50:10', '2026-06-15 22:22:41', 209169, 209169, 1);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (7, 'SUB01', '语文', b'0', 3, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (26, 'SUB02', '数学', b'0', 4, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (27, 'SUB03', '英语', b'0', 5, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (28, 'SUB04', '物理', b'0', 6, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (29, 'SUB05', '化学', b'0', 7, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (30, 'SUB06', '生物', b'0', 8, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (31, 'SUB07', '历史', b'0', 9, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (32, 'SUB08', '地理', b'0', 10, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (33, 'SUB09', '政治', b'0', 11, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (34, 'SUB10', '艺术', b'0', 12, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (35, 'SUB11', '体育', b'0', 13, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (36, 'SUB12', '心理', b'0', 14, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (37, 'SUB13', '信息', b'0', 15, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (38, 'SUB14', '劳技', b'0', 16, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (39, 'SUB15', '跨学科', b'0', 17, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (40, 'SUB16', '美术', b'0', 18, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
INSERT INTO `sch_dic_subject` VALUES (41, 'SUB17', '音乐', b'0', 19, 3260, '2026-06-15 22:04:42', '2026-06-15 22:22:41', 209169, 209169, 0);
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sch_student
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sch_student`;
|
||||||
|
CREATE TABLE `sch_student` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`account` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '账户',
|
||||||
|
`group_id` int(0) NULL DEFAULT NULL COMMENT '组id',
|
||||||
|
`class_id` int(0) NULL DEFAULT NULL COMMENT '班级id',
|
||||||
|
`stu_id` int(0) NOT NULL COMMENT '学生id',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '学生',
|
||||||
|
`gender` int(0) NULL DEFAULT NULL COMMENT '性别',
|
||||||
|
`status` int(0) NULL DEFAULT NULL COMMENT '状态',
|
||||||
|
`abnormal_status` int(0) NULL DEFAULT NULL COMMENT '异常状态',
|
||||||
|
`invitation_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '邀请码',
|
||||||
|
`sch_id` int(0) NULL DEFAULT NULL COMMENT '学校id',
|
||||||
|
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_date` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
|
||||||
|
`create_user_id` int(0) NULL DEFAULT NULL COMMENT '创建用户',
|
||||||
|
`update_user_id` int(0) NULL DEFAULT NULL COMMENT '修改用户',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
-- ----------------------------
|
||||||
|
-- Table structure for sch_teacher
|
||||||
|
-- ----------------------------
|
||||||
|
DROP TABLE IF EXISTS `sch_teacher`;
|
||||||
|
CREATE TABLE `sch_teacher` (
|
||||||
|
`id` int(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||||
|
`account` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '账户',
|
||||||
|
`group_id` int(0) NULL DEFAULT NULL COMMENT '组id',
|
||||||
|
`tea_id` int(0) NOT NULL COMMENT '教师id',
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '教师',
|
||||||
|
`tel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '联系电话',
|
||||||
|
`gender` int(0) NULL DEFAULT NULL COMMENT '性别 0女 1男',
|
||||||
|
`status` int(0) NULL DEFAULT NULL COMMENT '状态 (0 禁用 1正常)',
|
||||||
|
`sch_id` int(0) NULL DEFAULT NULL COMMENT '学校id',
|
||||||
|
`create_date` datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
`update_date` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
|
||||||
|
`create_user_id` int(0) NULL DEFAULT NULL COMMENT '创建用户',
|
||||||
|
`update_user_id` int(0) NULL DEFAULT NULL COMMENT '修改用户',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
ALTER TABLE `dbschoolclass`.`sch_dic_campus`
|
||||||
|
ADD COLUMN `create_date` datetime(0) NULL COMMENT '创建时间' AFTER `sch_id`,
|
||||||
|
ADD COLUMN `update_date` datetime(0) NULL COMMENT '修改时间' AFTER `create_date`,
|
||||||
|
ADD COLUMN `create_user_id` int(0) NULL COMMENT '创建用户' AFTER `update_date`,
|
||||||
|
ADD COLUMN `update_user_id` int(0) NULL COMMENT '修改用户' AFTER `create_user_id`;
|
||||||
+3
-5
@@ -1,17 +1,15 @@
|
|||||||
package com.bestsch.classicalchinese;
|
package com.bestsch.bschclassmanage;
|
||||||
|
|
||||||
import com.bestsch.bschapistd.config.EnableBschApiStd;
|
|
||||||
import com.bestsch.bschsso.EnableBschSso;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@EnableTransactionManagement
|
@EnableTransactionManagement
|
||||||
@EnableAsync
|
@EnableAsync
|
||||||
@EnableBschSso //用户中心接口
|
@EnableScheduling
|
||||||
@EnableBschApiStd
|
|
||||||
public class ClassicalchineseApplication {
|
public class ClassicalchineseApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.BaseDicGrade;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface BaseDicGradeRepository extends JpaRepository<BaseDicGrade, Integer>, JpaSpecificationExecutor<BaseDicGrade> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.BaseDicSubject;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface BaseDicSubjectRepository extends JpaRepository<BaseDicSubject, Integer>, JpaSpecificationExecutor<BaseDicSubject> {
|
||||||
|
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.BaseSchsystemGrade;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface BaseSchsystemGradeRepository extends JpaRepository<BaseSchsystemGrade, Integer>, JpaSpecificationExecutor<BaseSchsystemGrade> {
|
||||||
|
|
||||||
|
List<BaseSchsystemGrade> findBySchSystemId(Integer schSystemId);
|
||||||
|
|
||||||
|
List<BaseSchsystemGrade> findBySchSystemIdIn(List<Integer> schSystemIds);
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.BaseSchsystem;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface BaseSchsystemRepository extends JpaRepository<BaseSchsystem, Integer>, JpaSpecificationExecutor<BaseSchsystem> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.BaseYearTerm;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface BaseYearTermRepository extends JpaRepository<BaseYearTerm, Integer>, JpaSpecificationExecutor<BaseYearTerm> {
|
||||||
|
|
||||||
|
}
|
||||||
+14
@@ -0,0 +1,14 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.OperationLogRecord;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface OperationLogRecordRepository extends JpaRepository<OperationLogRecord, Integer>, JpaSpecificationExecutor<OperationLogRecord> {
|
||||||
|
Page<OperationLogRecord> findByModule(String module, Pageable pageable);
|
||||||
|
Page<OperationLogRecord> findAllByOrderByOperateTimeDesc(Pageable pageable);
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.BaseSchsystemGrade;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchBinSchsystem;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchBinSchsystemRepository extends JpaRepository<SchBinSchsystem, Integer>, JpaSpecificationExecutor<SchBinSchsystem> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchClass;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchClassHistory;
|
||||||
|
import io.lettuce.core.dynamic.annotation.Param;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchClassHistoryRepository extends JpaRepository<SchClassHistory, Integer>, JpaSpecificationExecutor<SchClassHistory> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchClass;
|
||||||
|
import io.lettuce.core.dynamic.annotation.Param;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchClassRepository extends JpaRepository<SchClass, Integer>, JpaSpecificationExecutor<SchClass> {
|
||||||
|
|
||||||
|
Optional<SchClass> findByIdAndSchId(Integer Id, Integer schId);
|
||||||
|
|
||||||
|
Optional<SchClass> findByClassIdAndSchId(Integer classId, Integer schId);
|
||||||
|
|
||||||
|
@Query(value = "SELECT MAX(sort) FROM sch_class WHERE grade_id = :gradeId AND sch_id = :schId AND graduate = 0", nativeQuery = true)
|
||||||
|
Integer findMaxCodeNumber(@Param("gradeId") Integer gradeId, @Param("schId") Integer schId);
|
||||||
|
|
||||||
|
@Query("SELECT c FROM SchClass c " +
|
||||||
|
"WHERE c.schId = :schId " +
|
||||||
|
"AND (:campusId IS NULL OR c.campusId = :campusId) " +
|
||||||
|
"AND (:divisionId IS NULL OR c.divisionId = :divisionId) " +
|
||||||
|
"AND (:majorsId IS NULL OR c.majorsId = :majorsId) " +
|
||||||
|
"AND (:years IS NULL OR c.enrollYear IN :years)"+
|
||||||
|
"AND c.enrollYear = c.gradeId AND c.graduate = 0")
|
||||||
|
Page<SchClass> findClassesByConditions(@Param("schId") Integer schId,
|
||||||
|
@Param("campusId") Integer campusId,
|
||||||
|
@Param("divisionId") Integer divisionId,
|
||||||
|
@Param("majorsId") Integer majorsId,
|
||||||
|
@Param("years") List<Integer> years,
|
||||||
|
Pageable pageable);
|
||||||
|
|
||||||
|
boolean existsBySchIdAndGroupIdAndName(Integer schId, Integer groupId, String name);
|
||||||
|
|
||||||
|
boolean existsBySchIdAndGroupIdAndNameAndIdNot(Integer schId, Integer groupId, String name, Integer id);
|
||||||
|
|
||||||
|
long countByFirstTeacherIdOrSecondTeacherId(Integer firstTeacherId, Integer secondTeacherId);
|
||||||
|
|
||||||
|
long countByCampusId(Integer campusId);
|
||||||
|
|
||||||
|
long countByDivisionId(Integer divisionId);
|
||||||
|
|
||||||
|
long countByMajorsId(Integer majorsId);
|
||||||
|
|
||||||
|
List<SchClass> findBySchIdAndEnrollYear(Integer schId, Integer enrollYear);
|
||||||
|
|
||||||
|
boolean existsBySchIdAndClassId(Integer schId, Integer classId);
|
||||||
|
|
||||||
|
@Query("SELECT COUNT(c) FROM SchClass c WHERE (c.firstTeacherId IN (:ids) OR c.secondTeacherId IN (:ids)) AND c.schId = :schId AND c.graduate = 0")
|
||||||
|
long countByFirstTeacherIdInOrSecondTeacherIdInAndSchId(
|
||||||
|
@Param("ids") List<Integer> ids,
|
||||||
|
@Param("schId") Integer schId
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据学校ID和年级ID列表,查询最小的注册年份
|
||||||
|
* @param schId 学校ID
|
||||||
|
* @param gradeIds 年级ID列表(可为空)
|
||||||
|
* @return 最小注册年份,如果没有匹配记录则返回 null
|
||||||
|
*/
|
||||||
|
@Query("SELECT MIN(c.enrollYear) FROM SchClass c WHERE c.schId = :schId AND c.gradeId IN :gradeIds")
|
||||||
|
Integer findMinEnrollYear(@Param("schId") Integer schId, @Param("gradeIds") List<Integer> gradeIds);
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.BaseDicGrade;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchClassTeachHistory;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchClassTeachHistoryRepository extends JpaRepository<SchClassTeachHistory, Integer>, JpaSpecificationExecutor<SchClassTeachHistory> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchClassTeach;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchClassTeachRepository extends JpaRepository<SchClassTeach, Integer>, JpaSpecificationExecutor<SchClassTeach> {
|
||||||
|
|
||||||
|
|
||||||
|
List<SchClassTeach> findBySchIdAndClassIdIn(Integer schId, List<Integer> classIds);
|
||||||
|
|
||||||
|
Optional<SchClassTeach> findBySchIdAndClassIdAndSubId(Integer schId, Integer classId, String subId);
|
||||||
|
|
||||||
|
Optional<SchClassTeach> findBySchIdAndId(Integer schId, Integer id);
|
||||||
|
|
||||||
|
List<SchClassTeach> findBySchIdAndClassId(Integer schId, Integer classId);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchDicCampus;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchDicCampusRepository extends JpaRepository<SchDicCampus, Integer>, JpaSpecificationExecutor<SchDicCampus> {
|
||||||
|
|
||||||
|
boolean existsBySchIdAndName(Integer schId, String name);
|
||||||
|
|
||||||
|
boolean existsBySchIdAndNameAndIdNot(Integer schId, String name, Integer id);
|
||||||
|
|
||||||
|
Optional<SchDicCampus> findByIdAndSchId(Integer Id, Integer schId);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchDicCourseDivision;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchDicCourseDivisionRepository extends JpaRepository<SchDicCourseDivision, Integer>, JpaSpecificationExecutor<SchDicCourseDivision> {
|
||||||
|
|
||||||
|
List<SchDicCourseDivision> findByCourseIdAndSchId(Integer courseId, Integer schId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据课程 ID 列表和学校 ID 批量查询关联的学部关系
|
||||||
|
* @param courseIds 课程 ID 列表
|
||||||
|
* @param schId 学校 ID
|
||||||
|
* @return 匹配的关联关系列表
|
||||||
|
*/
|
||||||
|
List<SchDicCourseDivision> findByCourseIdInAndSchId(List<Integer> courseIds, Integer schId);
|
||||||
|
|
||||||
|
void deleteByCourseIdAndSchId(Integer courseId, Integer schId);
|
||||||
|
|
||||||
|
Optional<SchDicCourseDivision> findByIdAndSchId(Integer Id, Integer schId);
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchDicCourseMajors;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchDicCourseMajorsRepository extends JpaRepository<SchDicCourseMajors, Integer>, JpaSpecificationExecutor<SchDicCourseMajors> {
|
||||||
|
|
||||||
|
List<SchDicCourseMajors> findByCourseIdAndSchId(Integer courseId, Integer schId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据课程 ID 列表和学校 ID 批量查询关联的学部关系
|
||||||
|
* @param courseIds 课程 ID 列表
|
||||||
|
* @param schId 学校 ID
|
||||||
|
* @return 匹配的关联关系列表
|
||||||
|
*/
|
||||||
|
List<SchDicCourseMajors> findByCourseIdInAndSchId(List<Integer> courseIds, Integer schId);
|
||||||
|
|
||||||
|
void deleteByCourseIdAndSchId(Integer courseId, Integer schId);
|
||||||
|
|
||||||
|
Optional<SchDicCourseMajors> findByIdAndSchId(Integer Id, Integer schId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchDicCampus;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchDicCourse;
|
||||||
|
import io.lettuce.core.dynamic.annotation.Param;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchDicCourseRepository extends JpaRepository<SchDicCourse, Integer>, JpaSpecificationExecutor<SchDicCourse> {
|
||||||
|
boolean existsBySchIdAndName(Integer schId, String name);
|
||||||
|
boolean existsBySchIdAndNameAndIdNot(Integer schId, String name, Integer id);
|
||||||
|
Optional<SchDicCourse> findByIdAndSchId(Integer Id, Integer schId);
|
||||||
|
@Query(value = "SELECT c FROM SchDicCourse c " +
|
||||||
|
"WHERE c.schId = :schId " +
|
||||||
|
"AND (:type IS NULL OR c.type = :type) " +
|
||||||
|
"AND (:keyword IS NULL OR (c.name LIKE CONCAT('%', :keyword, '%') " +
|
||||||
|
" OR c.nickname LIKE CONCAT('%', :keyword, '%') " +
|
||||||
|
" OR c.code LIKE CONCAT('%', :keyword, '%'))) " +
|
||||||
|
"AND (:divisionId IS NULL OR EXISTS (SELECT 1 FROM SchDicCourseDivision d WHERE d.courseId = c.id AND d.divisionId = :divisionId)) " +
|
||||||
|
"AND (:majorsId IS NULL OR EXISTS (SELECT 1 FROM SchDicCourseMajors m WHERE m.courseId = c.id AND m.majorsId = :majorsId))",
|
||||||
|
countQuery = "SELECT COUNT(c) FROM SchDicCourse c " +
|
||||||
|
"WHERE c.schId = :schId " +
|
||||||
|
"AND (:type IS NULL OR c.type = :type) " +
|
||||||
|
"AND (:keyword IS NULL OR (c.name LIKE CONCAT('%', :keyword, '%') " +
|
||||||
|
" OR c.nickname LIKE CONCAT('%', :keyword, '%') " +
|
||||||
|
" OR c.code LIKE CONCAT('%', :keyword, '%'))) " +
|
||||||
|
"AND (:divisionId IS NULL OR EXISTS (SELECT 1 FROM SchDicCourseDivision d WHERE d.courseId = c.id AND d.divisionId = :divisionId)) " +
|
||||||
|
"AND (:majorsId IS NULL OR EXISTS (SELECT 1 FROM SchDicCourseMajors m WHERE m.courseId = c.id AND m.majorsId = :majorsId))")
|
||||||
|
Page<SchDicCourse> findCoursesByConditions(@Param("schId") Integer schId,
|
||||||
|
@Param("type") Integer type,
|
||||||
|
@Param("keyword") String keyword,
|
||||||
|
@Param("divisionId") Integer divisionId,
|
||||||
|
@Param("majorsId") Integer majorsId,
|
||||||
|
Pageable pageable);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchDicDivision;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchDicDivisionRepository extends JpaRepository<SchDicDivision, Integer>, JpaSpecificationExecutor<SchDicDivision> {
|
||||||
|
boolean existsBySchIdAndName(Integer schId, String name);
|
||||||
|
boolean existsBySchIdAndNameAndIdNot(Integer schId, String name, Integer id);
|
||||||
|
Optional<SchDicDivision> findByIdAndSchId(Integer Id, Integer schId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchDicMajors;
|
||||||
|
import io.lettuce.core.dynamic.annotation.Param;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchDicMajorsRepository extends JpaRepository<SchDicMajors, Integer>, JpaSpecificationExecutor<SchDicMajors> {
|
||||||
|
boolean existsBySchIdAndName(Integer schId, String name);
|
||||||
|
boolean existsBySchIdAndNameAndIdNot(Integer schId, String name, Integer id);
|
||||||
|
Optional<SchDicMajors> findByIdAndSchId(Integer Id, Integer schId);
|
||||||
|
|
||||||
|
@Query("SELECT MAX(m.schsystemLeng) FROM SchDicMajors m WHERE m.schId = :schId")
|
||||||
|
Optional<Integer> findMaxSchsystemLengBySchId(Integer schId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.BaseDicGrade;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchDicSubject;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchDicSubjectRepository extends JpaRepository<SchDicSubject, Integer>, JpaSpecificationExecutor<SchDicSubject> {
|
||||||
|
|
||||||
|
@Query(value = "SELECT MAX(CAST(SUBSTRING(code, 4) AS UNSIGNED)) FROM sch_dic_subject WHERE code LIKE 'SUB%' AND sch_id = ?1", nativeQuery = true)
|
||||||
|
Integer findMaxSubjectCodeNumber(Integer schId);
|
||||||
|
|
||||||
|
Optional<SchDicSubject> findByIdAndSchId(Integer Id, Integer schId);
|
||||||
|
|
||||||
|
boolean existsBySchIdAndSchSystemIdAndName(Integer schId, Integer schSystemId, String name);
|
||||||
|
|
||||||
|
boolean existsBySchIdAndSchSystemIdAndNameAndIdNot(Integer schId, Integer schSystemId, String name, Integer id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchInfo;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchInfoRepository extends JpaRepository<SchInfo, Integer>, JpaSpecificationExecutor<SchInfo> {
|
||||||
|
|
||||||
|
Optional<SchInfo> findBySchId(Integer schId);
|
||||||
|
|
||||||
|
Optional<SchInfo> findBySchSerId(String schSerId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchClassTeachHistory;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchStudentHistory;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchStudentHistoryRepository extends JpaRepository<SchStudentHistory, Integer>, JpaSpecificationExecutor<SchStudentHistory> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchStudent;
|
||||||
|
import io.lettuce.core.dynamic.annotation.Param;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchStudentRepository extends JpaRepository<SchStudent, Integer>, JpaSpecificationExecutor<SchStudent> {
|
||||||
|
|
||||||
|
Optional<SchStudent> findByStuId(Integer stuId);
|
||||||
|
|
||||||
|
List<SchStudent> findByStuIdIn(List<Integer> stuIds);
|
||||||
|
|
||||||
|
boolean existsByAccount(String account);
|
||||||
|
|
||||||
|
Optional<SchStudent> findByAccount(String account);
|
||||||
|
|
||||||
|
Optional<SchStudent> findByIdAndSchId(Integer Id, Integer schId);
|
||||||
|
|
||||||
|
@Query("SELECT s FROM SchStudent s WHERE s.schId = :schId AND s.classId = :classId AND s.abnormalStatus = 1 AND s.transferStatus=1 AND s.status = 1")
|
||||||
|
List<SchStudent> findBySchIdAndClassId(@Param("schId") Integer schId, @Param("classId") Integer classId);
|
||||||
|
|
||||||
|
List<SchStudent> findAllByIdInAndSchId(List<Integer> ids, Integer schId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
boolean existsBySchIdAndClassIdAndName(Integer schId,Integer classId, String name);
|
||||||
|
|
||||||
|
boolean existsBySchIdAndClassIdAndNameAndIdNot(Integer schId,Integer classId, String name, Integer id);
|
||||||
|
|
||||||
|
@Modifying(clearAutomatically = true)
|
||||||
|
@Query("UPDATE SchStudent s SET s.classId = :newClassId, s.groupId = :newClassId, s.updateDate = :updateDate, s.updateUserId = :updateUserId WHERE s.id IN (:ids) AND s.schId = :schId")
|
||||||
|
int batchUpdateClassId(@Param("ids") List<Integer> ids,
|
||||||
|
@Param("newClassId") Integer newClassId,
|
||||||
|
@Param("schId") Integer schId,
|
||||||
|
@Param("updateDate") Date updateDate,
|
||||||
|
@Param("updateUserId") Integer updateUserId);
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("UPDATE SchStudent s SET s.schId = :schId, s.classId = :newClassId,s.groupId = :newClassId, s.updateDate = :updateDate, s.updateUserId = :updateUserId , s.transferStatus =1 WHERE s.id IN :ids")
|
||||||
|
int batchUpdateSchIdAndClassId(@Param("ids") List<Integer> ids,
|
||||||
|
@Param("schId") Integer schId, // 目标学校ID
|
||||||
|
@Param("newClassId") Integer newClassId,
|
||||||
|
@Param("updateDate") Date updateDate,
|
||||||
|
@Param("updateUserId") Integer updateUserId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新学生异常状态,同时记录异常发生时间和修改时间(两者相同)
|
||||||
|
*
|
||||||
|
* @param ids 学生ID列表
|
||||||
|
* @param abnormalStatus 异常状态值
|
||||||
|
* @param schId 学校ID(安全过滤)
|
||||||
|
* @param commonDate 异常时间 / 修改时间
|
||||||
|
* @param updateUserId 操作用户ID
|
||||||
|
* @return 实际更新的行数
|
||||||
|
*/
|
||||||
|
@Modifying(clearAutomatically = true)
|
||||||
|
@Query("UPDATE SchStudent s SET " +
|
||||||
|
"s.abnormalStatus = :abnormalStatus, " +
|
||||||
|
"s.abnormalDate = :commonDate, " +
|
||||||
|
"s.updateDate = :commonDate, " +
|
||||||
|
"s.updateUserId = :updateUserId " +
|
||||||
|
"WHERE s.id IN (:ids) AND s.schId = :schId")
|
||||||
|
int batchUpdateAbnormalStatus(@Param("ids") List<Integer> ids,
|
||||||
|
@Param("abnormalStatus") Integer abnormalStatus,
|
||||||
|
@Param("schId") Integer schId,
|
||||||
|
@Param("commonDate") Date commonDate,
|
||||||
|
@Param("updateUserId") Integer updateUserId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新学生异常状态,同时记录异常发生时间和修改时间(两者相同)
|
||||||
|
*
|
||||||
|
* @param ids 学生ID列表
|
||||||
|
* @param transferStatus 转出状态值
|
||||||
|
* @param schId 学校ID(安全过滤)
|
||||||
|
* @param commonDate 异常时间 / 修改时间
|
||||||
|
* @param updateUserId 操作用户ID
|
||||||
|
* @return 实际更新的行数
|
||||||
|
*/
|
||||||
|
@Modifying(clearAutomatically = true)
|
||||||
|
@Query("UPDATE SchStudent s SET " +
|
||||||
|
"s.transferStatus = :transferStatus, " +
|
||||||
|
"s.abnormalDate = :commonDate, " +
|
||||||
|
"s.updateDate = :commonDate, " +
|
||||||
|
"s.updateUserId = :updateUserId, " +
|
||||||
|
"s.stuClassNo = null " +
|
||||||
|
"WHERE s.id IN (:ids) AND s.schId = :schId")
|
||||||
|
int batchUpdateTransferStatus(@Param("ids") List<Integer> ids,
|
||||||
|
@Param("transferStatus") Integer transferStatus,
|
||||||
|
@Param("schId") Integer schId,
|
||||||
|
@Param("commonDate") Date commonDate,
|
||||||
|
@Param("updateUserId") Integer updateUserId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有转出学生的学校ID(去重)
|
||||||
|
* 转出条件:transfer_status = 0
|
||||||
|
* 关联:s.class_id = c.group_class_id
|
||||||
|
*/
|
||||||
|
@Query(value = "SELECT DISTINCT c.sch_id FROM sch_student s " +
|
||||||
|
"INNER JOIN sch_class c ON s.class_id = c.group_class_id " +
|
||||||
|
"WHERE s.transfer_status = 0 AND s.sch_id = c.sch_id AND s.status=1 ", nativeQuery = true)
|
||||||
|
List<Integer> findDistinctSchIdsByTransferOut();
|
||||||
|
}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacherCustomGroupInGrade;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchTeacherCustomGroupInGradeRepository extends JpaRepository<SchTeacherCustomGroupInGrade, Integer>, JpaSpecificationExecutor<SchTeacherCustomGroupInGrade> {
|
||||||
|
List<SchTeacherCustomGroupInGrade> findByCgGroupIdIn(List<Integer> groupIds);
|
||||||
|
|
||||||
|
void deleteByCgGroupId(Integer groupId);
|
||||||
|
}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacherCustomGroupInSubject;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchTeacherCustomGroupInSubjectRepository extends JpaRepository<SchTeacherCustomGroupInSubject, Integer>, JpaSpecificationExecutor<SchTeacherCustomGroupInSubject> {
|
||||||
|
List<SchTeacherCustomGroupInSubject> findByCgGroupIdIn(List<Integer> groupIds);
|
||||||
|
|
||||||
|
void deleteByCgGroupId(Integer groupId);
|
||||||
|
}
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacherCustomGroup;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacherCustomGroupInTeacher;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchTeacherCustomGroupInTeacherRepository extends JpaRepository<SchTeacherCustomGroupInTeacher, Integer>, JpaSpecificationExecutor<SchTeacherCustomGroupInTeacher> {
|
||||||
|
/**
|
||||||
|
* 根据组ID列表查询所有教师关联
|
||||||
|
* @param groupIds 组ID列表
|
||||||
|
* @return 教师关联列表
|
||||||
|
*/
|
||||||
|
List<SchTeacherCustomGroupInTeacher> findByCgGroupIdIn(List<Integer> groupIds);
|
||||||
|
|
||||||
|
List<SchTeacherCustomGroupInTeacher> findByCgGroupId(Integer groupId);
|
||||||
|
|
||||||
|
List<SchTeacherCustomGroupInTeacher> findByCgGroupIdAndGroupType(Integer groupId, Integer groupType);
|
||||||
|
|
||||||
|
void deleteByCgGroupIdAndGroupType(Integer groupId, Integer groupType);
|
||||||
|
|
||||||
|
void deleteByCgGroupIdAndTeaIdInAndGroupType(Integer groupId, List<Integer> teaIds, Integer groupType);
|
||||||
|
|
||||||
|
void deleteByCgGroupId(Integer groupId);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacherCustomGroup;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchTeacherCustomGroupRepository extends JpaRepository<SchTeacherCustomGroup, Integer>, JpaSpecificationExecutor<SchTeacherCustomGroup> {
|
||||||
|
|
||||||
|
List<SchTeacherCustomGroup> findBySchId(Integer schId);
|
||||||
|
|
||||||
|
List<SchTeacherCustomGroup> findBySchIdAndGroupType(Integer schId, Integer groupType);
|
||||||
|
|
||||||
|
List<SchTeacherCustomGroup> findBySchIdAndGroupTypeAndGroupName(Integer schId, Integer groupType, String groupName);
|
||||||
|
|
||||||
|
boolean existsBySchIdAndGroupTypeAndGroupName(Integer schId, Integer groupType, String groupName);
|
||||||
|
boolean existsBySchIdAndGroupTypeAndGroupNameAndIdNot(Integer schId, Integer groupType, String groupName, Integer id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacherGroup;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.lettuce.core.dynamic.annotation.Param;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchTeacherGroupRepository extends JpaRepository<SchTeacherGroup, Integer>, JpaSpecificationExecutor<SchTeacherGroup> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 teaId 列表查询所有组关联(不限学校)
|
||||||
|
* 适用场景:全局查询(如跨校操作前校验)
|
||||||
|
*/
|
||||||
|
List<SchTeacherGroup> findByTeaIdIn(List<Integer> teaIds);
|
||||||
|
|
||||||
|
|
||||||
|
List<SchTeacherGroup> findByGroupIdAndSchId(Integer groupId, Integer schId);
|
||||||
|
|
||||||
|
|
||||||
|
List<SchTeacherGroup> findByTeaIdAndSchId(Integer teaId, Integer schId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 teaId 列表和学校 ID 查询组关联
|
||||||
|
* 适用场景:查询某教师在指定学校的组归属
|
||||||
|
*/
|
||||||
|
List<SchTeacherGroup> findByTeaIdInAndSchId(List<Integer> teaIds, Integer schId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 teaId 列表、学校 ID 和转入状态查询组关联
|
||||||
|
* 适用场景:只查询转入状态的记录(transferStatus = 1)
|
||||||
|
*/
|
||||||
|
List<SchTeacherGroup> findByTeaIdInAndSchIdAndTransferStatus(List<Integer> teaIds, Integer schId, Integer transferStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据学校 ID 查询该学校所有教师的 teaId(去重)
|
||||||
|
* 适用场景:获取该校所有教师列表
|
||||||
|
*/
|
||||||
|
@Query("SELECT DISTINCT t.teaId FROM SchTeacherGroup t WHERE t.schId = :schId")
|
||||||
|
List<Integer> findTeaIdsBySchId(@Param("schId") Integer schId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验某教师是否属于某学校(根据 teaId 和 schId)
|
||||||
|
*/
|
||||||
|
boolean existsByTeaIdAndSchId(Integer teaId, Integer schId);
|
||||||
|
|
||||||
|
// ==================== 删除方法 ====================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 teaId 列表删除所有学校的关联(谨慎使用)
|
||||||
|
* 适用场景:全局删除(如教师彻底注销)
|
||||||
|
*/
|
||||||
|
@Modifying
|
||||||
|
@Query("DELETE FROM SchTeacherGroup g WHERE g.teaId IN :teaIds")
|
||||||
|
int deleteByTeaIdIn(@Param("teaIds") List<Integer> teaIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 teaId 列表和学校 ID 删除关联(推荐)
|
||||||
|
* 适用场景:转出/删除时只移除该教师在当前学校的组归属
|
||||||
|
*/
|
||||||
|
@Modifying
|
||||||
|
@Query("DELETE FROM SchTeacherGroup g WHERE g.teaId IN :teaIds AND g.schId = :schId")
|
||||||
|
int deleteByTeaIdInAndSchId(@Param("teaIds") List<Integer> teaIds, @Param("schId") Integer schId);
|
||||||
|
|
||||||
|
// ==================== 批量更新方法 ====================
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量更新某学校下教师的转入状态
|
||||||
|
* 适用场景:批量转出/转入
|
||||||
|
*/
|
||||||
|
@Modifying
|
||||||
|
@Query("UPDATE SchTeacherGroup g SET g.transferStatus = :status WHERE g.teaId IN :teaIds AND g.schId = :schId")
|
||||||
|
int batchUpdateTransferStatus(@Param("teaIds") List<Integer> teaIds,
|
||||||
|
@Param("schId") Integer schId,
|
||||||
|
@Param("status") Integer status);
|
||||||
|
|
||||||
|
// 根据学校ID和组ID查询教师 teaId 列表
|
||||||
|
@Query("SELECT DISTINCT t.teaId FROM SchTeacherGroup t WHERE t.schId = :schId AND t.groupId = :groupId")
|
||||||
|
List<Integer> findTeaIdsBySchIdAndGroupId(@Param("schId") Integer schId, @Param("groupId") Integer groupId);
|
||||||
|
|
||||||
|
// 查询某学校下所有不同的组ID
|
||||||
|
@Query("SELECT DISTINCT t.groupId FROM SchTeacherGroup t WHERE t.schId = :schId")
|
||||||
|
List<Integer> findGroupIdsBySchId(@Param("schId") Integer schId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据状态获取学校ID(去重)
|
||||||
|
*/
|
||||||
|
@Query("SELECT DISTINCT g.schId FROM SchTeacherGroup g WHERE g.transferStatus = 0")
|
||||||
|
List<Integer> findSchoolIdsByTransferOut();
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacher;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.TeacherSchVO;
|
||||||
|
import io.lettuce.core.dynamic.annotation.Param;
|
||||||
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
|
import org.springframework.data.jpa.repository.Query;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface SchTeacherRepository extends JpaRepository<SchTeacher, Integer>, JpaSpecificationExecutor<SchTeacher> {
|
||||||
|
|
||||||
|
List<SchTeacher> findByTeaIdIn(List<Integer> teaIds);
|
||||||
|
|
||||||
|
Optional<SchTeacher> findByTeaId(Integer teaId);
|
||||||
|
|
||||||
|
|
||||||
|
@Query(value = "SELECT DISTINCT t.* FROM sch_teacher t " +
|
||||||
|
"INNER JOIN sch_teacher_group g ON t.tea_id = g.tea_id " +
|
||||||
|
"WHERE g.sch_id = :schId " +
|
||||||
|
"AND g.transfer_status = 1 " + // 只查转入状态的教师
|
||||||
|
"AND (:groupId IS NULL OR g.group_id = :groupId) " +
|
||||||
|
"AND (:keyword IS NULL OR t.name LIKE CONCAT('%', :keyword, '%') OR t.account LIKE CONCAT('%', :keyword, '%')) " ,
|
||||||
|
countQuery = "SELECT COUNT(DISTINCT t.id) FROM sch_teacher t " +
|
||||||
|
"INNER JOIN sch_teacher_group g ON t.tea_id = g.tea_id " +
|
||||||
|
"WHERE g.sch_id = :schId " +
|
||||||
|
"AND g.transfer_status = 1 " +
|
||||||
|
"AND (:groupId IS NULL OR g.group_id = :groupId) " +
|
||||||
|
"AND (:keyword IS NULL OR t.name LIKE CONCAT('%', :keyword, '%') OR t.account LIKE CONCAT('%', :keyword, '%'))",
|
||||||
|
nativeQuery = true)
|
||||||
|
Page<SchTeacher> searchTeachersBySchIdAndGroupId(@Param("schId") Integer schId,
|
||||||
|
@Param("groupId") Integer groupId,
|
||||||
|
@Param("keyword") String keyword,
|
||||||
|
Pageable pageable);
|
||||||
|
|
||||||
|
|
||||||
|
@Query(value = "SELECT DISTINCT g.tea_id AS teaId, g.sch_id AS schId, t.name AS teaName, t.id_card AS idCard " +
|
||||||
|
"FROM sch_teacher_group g " +
|
||||||
|
"INNER JOIN sch_teacher t ON t.tea_id = g.tea_id " +
|
||||||
|
"WHERE g.transfer_status = 0 " +
|
||||||
|
"AND t.status = 1 " +
|
||||||
|
"AND (:schId IS NULL OR g.sch_id = :schId) " +
|
||||||
|
"AND (:groupId IS NULL OR g.group_id = :groupId) " +
|
||||||
|
"AND (:keyword IS NULL OR t.name LIKE CONCAT('%', :keyword, '%') OR t.account LIKE CONCAT('%', :keyword, '%')) " +
|
||||||
|
"ORDER BY t.name", //只按教师姓名排序,避免引用未选择列
|
||||||
|
countQuery = "SELECT COUNT(DISTINCT CONCAT(g.tea_id, '_', g.sch_id)) " +
|
||||||
|
"FROM sch_teacher_group g " +
|
||||||
|
"INNER JOIN sch_teacher t ON t.tea_id = g.tea_id " +
|
||||||
|
"WHERE g.transfer_status = 0 " +
|
||||||
|
"AND t.status = 1 " +
|
||||||
|
"AND (:schId IS NULL OR g.sch_id = :schId) " +
|
||||||
|
"AND (:groupId IS NULL OR g.group_id = :groupId) " +
|
||||||
|
"AND (:keyword IS NULL OR t.name LIKE CONCAT('%', :keyword, '%') OR t.account LIKE CONCAT('%', :keyword, '%'))",
|
||||||
|
nativeQuery = true)
|
||||||
|
Page<TeacherSchVO> searchTransferredOutTeachers(@Param("schId") Integer schId,
|
||||||
|
@Param("groupId") Integer groupId,
|
||||||
|
@Param("keyword") String keyword,
|
||||||
|
Pageable pageable);
|
||||||
|
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("UPDATE SchTeacher t SET t.status = :status, t.updateDate = :updateDate, t.updateUserId = :updateUserId WHERE t.id IN :ids")
|
||||||
|
int batchUpdateStatus(@Param("ids") List<Integer> ids,
|
||||||
|
@Param("status") Integer status,
|
||||||
|
@Param("updateDate") Date updateDate,
|
||||||
|
@Param("updateUserId") Integer updateUserId);
|
||||||
|
|
||||||
|
|
||||||
|
List<SchTeacher> findByAccountIn(List<String> accountList);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.UpgradeLog;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public interface UpgradeLogRepository extends JpaRepository<UpgradeLog, Integer>, JpaSpecificationExecutor<UpgradeLog> {
|
||||||
|
boolean existsBySchIdAndSysIdAndYearAndStatus(
|
||||||
|
Integer schId, Integer sysId, Integer year,Boolean status
|
||||||
|
);
|
||||||
|
}
|
||||||
+42
@@ -0,0 +1,42 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository.specification;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.OperationLogRecord;
|
||||||
|
import org.springframework.data.jpa.domain.Specification;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import javax.persistence.criteria.Predicate;
|
||||||
|
|
||||||
|
public class OperationLogSpecifications {
|
||||||
|
|
||||||
|
public static Specification<OperationLogRecord> schIdEquals(Integer schId) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (schId == null || schId <= 0) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
return cb.equal(root.get("schId"), schId);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Specification<OperationLogRecord> IsSystem(boolean IsSystem) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (IsSystem) {
|
||||||
|
return cb.equal(root.get("module"), "系统管理");
|
||||||
|
}else{
|
||||||
|
return cb.notEqual(root.get("module"), "系统管理");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Specification<OperationLogRecord> keywordLike(String keyword) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (!StringUtils.hasText(keyword)) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
String likePattern = "%" + keyword.trim() + "%";
|
||||||
|
Predicate p1 = cb.like(root.get("operator"), likePattern);
|
||||||
|
Predicate p2 = cb.like(root.get("module"), likePattern);
|
||||||
|
Predicate p3 = cb.like(root.get("content"), likePattern);
|
||||||
|
return cb.or(p1, p2, p3);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
+138
@@ -0,0 +1,138 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository.specification;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchClass;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacher;
|
||||||
|
import org.springframework.data.jpa.domain.Specification;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import javax.persistence.criteria.Join;
|
||||||
|
import javax.persistence.criteria.JoinType;
|
||||||
|
import javax.persistence.criteria.Predicate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SchClassSpecifications {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按学校 ID 查询(班级表中直接存储了 schId)
|
||||||
|
*/
|
||||||
|
public static Specification<SchClass> schIdEquals(Integer schId) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (schId == null || schId <= 0) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
return cb.equal(root.get("schId"), schId);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按年级 ID 查询
|
||||||
|
*/
|
||||||
|
public static Specification<SchClass> gradeIdEquals(Integer gradeId) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (gradeId == null || gradeId <= 0) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
return cb.equal(root.get("gradeId"), gradeId);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按班级名称模糊查询
|
||||||
|
*/
|
||||||
|
public static Specification<SchClass> classNameLike(String className) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (!StringUtils.hasText(className)) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
return cb.like(root.get("className"), "%" + className + "%");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按班主任教师 ID 查询(firstTeacherId)
|
||||||
|
*/
|
||||||
|
public static Specification<SchClass> firstTeacherIdEquals(Integer teacherId) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (teacherId == null || teacherId <= 0) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
return cb.equal(root.get("firstTeacherId"), teacherId);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按副班主任教师 ID 查询(secondTeacherId)
|
||||||
|
*/
|
||||||
|
public static Specification<SchClass> secondTeacherIdEquals(Integer teacherId) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (teacherId == null || teacherId <= 0) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
return cb.equal(root.get("secondTeacherId"), teacherId);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按班主任或副班主任教师 ID 查询(任意一个匹配)
|
||||||
|
*/
|
||||||
|
public static Specification<SchClass> teacherIsHeadOrAssistant(Integer teacherId) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (teacherId == null || teacherId <= 0) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
Predicate p1 = cb.equal(root.get("firstTeacherId"), teacherId);
|
||||||
|
Predicate p2 = cb.equal(root.get("secondTeacherId"), teacherId);
|
||||||
|
return cb.or(p1, p2);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按年级名称模糊查询(需关联年级表,假设有 @ManyToOne 关系)
|
||||||
|
* 注意:SchClass 实体中需有 grade 关联字段,例如:@ManyToOne @JoinColumn(name = "grade_id") private SchGrade grade;
|
||||||
|
*/
|
||||||
|
public static Specification<SchClass> gradeNameLike(String gradeName) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (!StringUtils.hasText(gradeName)) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
Join<Object, Object> gradeJoin = root.join("grade", JoinType.INNER);
|
||||||
|
return cb.like(gradeJoin.get("name"), "%" + gradeName + "%");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态组合查询(多条件),便于一次性传入多个参数
|
||||||
|
*/
|
||||||
|
public static Specification<SchClass> dynamicQuery(Integer schId, Integer gradeId, String keyword,
|
||||||
|
Integer teacherId, Boolean isHeadTeacher) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
List<Predicate> predicates = new ArrayList<>();
|
||||||
|
|
||||||
|
if (schId != null && schId > 0) {
|
||||||
|
predicates.add(cb.equal(root.get("schId"), schId));
|
||||||
|
}
|
||||||
|
if (gradeId != null && gradeId > 0) {
|
||||||
|
predicates.add(cb.equal(root.get("gradeId"), gradeId));
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(keyword)) {
|
||||||
|
predicates.add(cb.like(root.get("className"), "%" + keyword + "%"));
|
||||||
|
}
|
||||||
|
if (teacherId != null && teacherId > 0) {
|
||||||
|
if (isHeadTeacher != null && isHeadTeacher) {
|
||||||
|
predicates.add(cb.equal(root.get("firstTeacherId"), teacherId));
|
||||||
|
} else if (isHeadTeacher != null && !isHeadTeacher) {
|
||||||
|
predicates.add(cb.equal(root.get("secondTeacherId"), teacherId));
|
||||||
|
} else {
|
||||||
|
// 没有指定角色,默认查班主任或副班主任任意一个
|
||||||
|
Predicate p1 = cb.equal(root.get("firstTeacherId"), teacherId);
|
||||||
|
Predicate p2 = cb.equal(root.get("secondTeacherId"), teacherId);
|
||||||
|
predicates.add(cb.or(p1, p2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
query.distinct(true);
|
||||||
|
return cb.and(predicates.toArray(new Predicate[0]));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
+94
@@ -0,0 +1,94 @@
|
|||||||
|
package com.bestsch.bschclassmanage.Repository.specification;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacher;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacherGroup;
|
||||||
|
import org.springframework.data.jpa.domain.Specification;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import javax.persistence.criteria.Join;
|
||||||
|
import javax.persistence.criteria.JoinType;
|
||||||
|
import javax.persistence.criteria.Predicate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class SchTeacherSpecifications {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按姓名模糊查询
|
||||||
|
*/
|
||||||
|
public static Specification<SchTeacher> nameLike(String keyword) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (!StringUtils.hasText(keyword)) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
return cb.like(root.get("name"), "%" + keyword + "%");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按状态精确查询(0-正常, 1-禁用等)
|
||||||
|
*/
|
||||||
|
public static Specification<SchTeacher> statusEquals(Integer status) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (status == null || status < 0) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
return cb.equal(root.get("status"), status);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按学校 ID 查询(通过关联表 SchTeacherGroup)
|
||||||
|
*/
|
||||||
|
public static Specification<SchTeacher> belongsToSchool(Integer schId) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (schId == null || schId <= 0) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
Join<SchTeacher, SchTeacherGroup> groupJoin = root.join("schTeacherGroups", JoinType.INNER);
|
||||||
|
query.distinct(true); // 避免因关联导致重复记录
|
||||||
|
return cb.equal(groupJoin.get("schId"), schId);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按组 ID 查询(通过关联表)
|
||||||
|
*/
|
||||||
|
public static Specification<SchTeacher> belongsToGroup(Integer groupId) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
if (groupId == null || groupId <= 0) {
|
||||||
|
return cb.conjunction();
|
||||||
|
}
|
||||||
|
Join<SchTeacher, SchTeacherGroup> groupJoin = root.join("schTeacherGroups", JoinType.INNER);
|
||||||
|
query.distinct(true);
|
||||||
|
return cb.equal(groupJoin.get("groupId"), groupId);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组合查询:支持多条件动态组合(用于复杂搜索)
|
||||||
|
*/
|
||||||
|
public static Specification<SchTeacher> dynamicQuery(Integer schId, Integer groupId, String keyword, Integer status) {
|
||||||
|
return (root, query, cb) -> {
|
||||||
|
List<Predicate> predicates = new ArrayList<>();
|
||||||
|
|
||||||
|
if (schId != null && schId > 0) {
|
||||||
|
Join<SchTeacher, SchTeacherGroup> groupJoin = root.join("schTeacherGroups", JoinType.INNER);
|
||||||
|
predicates.add(cb.equal(groupJoin.get("schId"), schId));
|
||||||
|
}
|
||||||
|
if (groupId != null && groupId > 0) {
|
||||||
|
Join<SchTeacher, SchTeacherGroup> groupJoin = root.join("schTeacherGroups", JoinType.INNER);
|
||||||
|
predicates.add(cb.equal(groupJoin.get("groupId"), groupId));
|
||||||
|
}
|
||||||
|
if (StringUtils.hasText(keyword)) {
|
||||||
|
predicates.add(cb.like(root.get("name"), "%" + keyword + "%"));
|
||||||
|
}
|
||||||
|
if (status != null && status >= 0) {
|
||||||
|
predicates.add(cb.equal(root.get("status"), status));
|
||||||
|
}
|
||||||
|
|
||||||
|
query.distinct(true);
|
||||||
|
return cb.and(predicates.toArray(new Predicate[0]));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.bestsch.bschclassmanage.annotation;
|
||||||
|
|
||||||
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
|
@Target(ElementType.METHOD)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Documented
|
||||||
|
public @interface OperationLog {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作所属模块,如 "教师信息管理"
|
||||||
|
*/
|
||||||
|
String module() default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日志内容模板,支持 SpEL 表达式
|
||||||
|
* 例如:"将教师 #{#teacherName} 的姓名从 #{#oldName} 改为 #{#newName}"
|
||||||
|
* 方法参数可以通过 #参数名 引用,返回值通过 #result 引用
|
||||||
|
*/
|
||||||
|
String description() default "";
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
package com.bestsch.bschclassmanage.aspect;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.utils.OtherUtil;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
|
import org.aspectj.lang.annotation.Around;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.core.annotation.Order;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
@Aspect
|
||||||
|
@Component
|
||||||
|
@Order(1)
|
||||||
|
public class ControllerUserContextAspect {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(ControllerUserContextAspect.class);
|
||||||
|
|
||||||
|
@Around("execution(* com.bestsch.bschclassmanage.controller..*.*(..))")
|
||||||
|
public Object setUserContext(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||||
|
// 1. 从方法参数中提取 BoaUser 和 UserSysRole
|
||||||
|
Object[] args = joinPoint.getArgs();
|
||||||
|
BoaUser boaUser = null;
|
||||||
|
UserSysRole userSysRole = null;
|
||||||
|
|
||||||
|
for (Object arg : args) {
|
||||||
|
if (arg instanceof BoaUser) {
|
||||||
|
boaUser = (BoaUser) arg;
|
||||||
|
} else if (arg instanceof UserSysRole) {
|
||||||
|
userSysRole = (UserSysRole) arg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 填充 UserContext
|
||||||
|
populateUserContext(boaUser, userSysRole);
|
||||||
|
|
||||||
|
try {
|
||||||
|
return joinPoint.proceed();
|
||||||
|
} finally {
|
||||||
|
UserContext.clear();
|
||||||
|
log.debug("UserContext cleared for {}", joinPoint.getSignature().toShortString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HttpServletRequest getCurrentHttpRequest() {
|
||||||
|
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||||
|
return attributes != null ? attributes.getRequest() : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void populateUserContext(BoaUser boaUser, UserSysRole userSysRole) {
|
||||||
|
if (boaUser != null) {
|
||||||
|
UserContext.setUserId(boaUser.getId());
|
||||||
|
UserContext.setUserName(boaUser.getName() != null ? boaUser.getName() : "unknown");
|
||||||
|
log.debug("UserContext set from parameter/session: id={}, name={}", boaUser.getId(), boaUser.getName());
|
||||||
|
} else {
|
||||||
|
UserContext.setUserName("anonymous");
|
||||||
|
log.warn("No BoaUser found, using anonymous");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (userSysRole != null) {
|
||||||
|
UserContext.setRoleId(userSysRole.getRoleId());
|
||||||
|
UserContext.setSchId(userSysRole.getSchId());
|
||||||
|
log.debug("UserContext set roleId={}, schId={}", userSysRole.getRoleId(), userSysRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
String clientIp = OtherUtil.getClientIp();
|
||||||
|
UserContext.setIp(clientIp);
|
||||||
|
log.debug("Client IP set: {}", clientIp);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
package com.bestsch.bschclassmanage.aspect;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.annotation.OperationLog;
|
||||||
|
import com.bestsch.bschclassmanage.entity.OperationLogRecord;
|
||||||
|
import com.bestsch.bschclassmanage.service.ILogService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.LogContextHolder;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
|
import org.aspectj.lang.annotation.Around;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
import org.aspectj.lang.reflect.MethodSignature;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.core.DefaultParameterNameDiscoverer;
|
||||||
|
import org.springframework.core.annotation.Order;
|
||||||
|
import org.springframework.expression.EvaluationContext;
|
||||||
|
import org.springframework.expression.Expression;
|
||||||
|
import org.springframework.expression.ExpressionParser;
|
||||||
|
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
||||||
|
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Aspect
|
||||||
|
@Component
|
||||||
|
@Order(2)
|
||||||
|
public class OperationLogAspect {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ILogService logService;
|
||||||
|
|
||||||
|
private final ExpressionParser parser = new SpelExpressionParser();
|
||||||
|
private final DefaultParameterNameDiscoverer discoverer = new DefaultParameterNameDiscoverer();
|
||||||
|
|
||||||
|
@Around("@annotation(operationLog)")
|
||||||
|
public Object logAround(ProceedingJoinPoint joinPoint, OperationLog operationLog) throws Throwable {
|
||||||
|
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||||
|
Method method = signature.getMethod();
|
||||||
|
Object[] args = joinPoint.getArgs();
|
||||||
|
|
||||||
|
// 从 UserContext 获取用户信息(由 ControllerAspect 设置)
|
||||||
|
String ip = UserContext.getIp();
|
||||||
|
String operator = UserContext.getUserName();
|
||||||
|
Integer userId = UserContext.getUserId();
|
||||||
|
Integer schId = UserContext.getSchId();
|
||||||
|
|
||||||
|
Object result = null;
|
||||||
|
String content = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 1. 先执行业务方法(内部会调用 LogContextHolder.setDescription)
|
||||||
|
result = joinPoint.proceed();
|
||||||
|
|
||||||
|
// 2. 业务方法执行后,尝试获取动态描述
|
||||||
|
String dynamicDesc = LogContextHolder.getDescription();
|
||||||
|
if (StringUtils.hasText(dynamicDesc)) {
|
||||||
|
content = dynamicDesc;
|
||||||
|
} else {
|
||||||
|
// 无动态描述,则解析 SpEL 模板(此时 result 可用于 #result)
|
||||||
|
content = resolveDescription(operationLog.description(), method, args, result);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
// 3. 清理 ThreadLocal(在业务方法执行后)
|
||||||
|
LogContextHolder.clear();
|
||||||
|
|
||||||
|
// 4. 保存日志(确保 content 非空)
|
||||||
|
if (content != null) {
|
||||||
|
saveLogAsync(ip, operator, userId, schId, operationLog.module(), content);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析日志描述:优先从 ThreadLocal 获取动态描述,否则解析 SpEL 模板
|
||||||
|
*/
|
||||||
|
private String resolveDescription(String template, Method method, Object[] args, Object result) {
|
||||||
|
// 优先从 ThreadLocal 获取动态描述
|
||||||
|
String dynamicDesc = LogContextHolder.getDescription();
|
||||||
|
if (StringUtils.hasText(dynamicDesc)) {
|
||||||
|
return dynamicDesc;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 没有动态描述,则解析 SpEL
|
||||||
|
if (!StringUtils.hasText(template)) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
EvaluationContext context = new StandardEvaluationContext();
|
||||||
|
String[] paramNames = discoverer.getParameterNames(method);
|
||||||
|
if (paramNames != null) {
|
||||||
|
for (int i = 0; i < paramNames.length; i++) {
|
||||||
|
context.setVariable(paramNames[i], args[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (result != null) {
|
||||||
|
context.setVariable("result", result);
|
||||||
|
}
|
||||||
|
|
||||||
|
org.springframework.expression.common.TemplateParserContext parserContext =
|
||||||
|
new org.springframework.expression.common.TemplateParserContext("#{", "}");
|
||||||
|
Expression exp = parser.parseExpression(template, parserContext);
|
||||||
|
return exp.getValue(context, String.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Async
|
||||||
|
public void saveLogAsync(String ip,String operator,Integer operatorId,Integer schId, String module, String content) {
|
||||||
|
try { OperationLogRecord log = new OperationLogRecord();
|
||||||
|
log.setOperator(operator);
|
||||||
|
log.setOperatorId(operatorId);
|
||||||
|
log.setIp(ip);
|
||||||
|
log.setSchId(schId);
|
||||||
|
log.setModule(module);
|
||||||
|
log.setContent(content);
|
||||||
|
log.setOperateTime(LocalDateTime.now());
|
||||||
|
logService.save(log);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace(); // 生产环境建议用日志输出
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.bestsch.bschclassmanage.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
|
||||||
|
import java.util.concurrent.Executor;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableAsync // 启用异步处理
|
||||||
|
public class AsyncConfig {
|
||||||
|
|
||||||
|
@Bean(name = "logExecutor")
|
||||||
|
public Executor logExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
executor.setCorePoolSize(2); // 核心线程数
|
||||||
|
executor.setMaxPoolSize(5); // 最大线程数
|
||||||
|
executor.setQueueCapacity(100); // 任务队列容量
|
||||||
|
executor.setThreadNamePrefix("log-"); // 线程名称前缀
|
||||||
|
executor.initialize(); // 初始化
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
-5
@@ -1,9 +1,8 @@
|
|||||||
package com.bestsch.classicalchinese.config;
|
package com.bestsch.bschclassmanage.config;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
@@ -12,9 +11,9 @@ public enum Config {
|
|||||||
|
|
||||||
Inst;
|
Inst;
|
||||||
|
|
||||||
public static final String API_PATH = "/api/";
|
public static final String API_PATH = "/api";
|
||||||
public static final String MOBILEAPI_PATH = "/mobiapi/";
|
public static final String MOBILEAPI_PATH = "/mobiapi";
|
||||||
public static final String OAPI = "/oapi/";
|
public static final String OAPI = "/oapi";
|
||||||
|
|
||||||
@Value("${FILE_WEB_PATH}")
|
@Value("${FILE_WEB_PATH}")
|
||||||
public String FILE_WEB_PATH;
|
public String FILE_WEB_PATH;
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.bestsch.bschclassmanage.config;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.controller.Handler.UserSysRoleArgumentResolver;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class DWebMvcConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
|
||||||
|
resolvers.add(new UserSysRoleArgumentResolver()); // 无参构造
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.bestsch.classicalchinese.config;
|
package com.bestsch.bschclassmanage.config;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
+10
-6
@@ -1,4 +1,4 @@
|
|||||||
package com.bestsch.classicalchinese.config;
|
package com.bestsch.bschclassmanage.config;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.parser.ParserConfig;
|
import com.alibaba.fastjson.parser.ParserConfig;
|
||||||
@@ -54,15 +54,19 @@ public class RedisConfig extends CachingConfigurerSupport {
|
|||||||
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
||||||
RedisTemplate<Object, Object> template = new RedisTemplate<>();
|
RedisTemplate<Object, Object> template = new RedisTemplate<>();
|
||||||
|
|
||||||
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class);
|
// 使用 FastJsonRedisSerializer(会自动存储 @type 字段)
|
||||||
|
FastJsonRedisSerializer<Object> fastJsonSerializer = new FastJsonRedisSerializer<>(Object.class);
|
||||||
|
// 允许反序列化 com.bestsch 包下的类(安全)
|
||||||
|
ParserConfig.getGlobalInstance().addAccept("com.bestsch");
|
||||||
|
|
||||||
template.setValueSerializer(jackson2JsonRedisSerializer);
|
template.setValueSerializer(fastJsonSerializer);
|
||||||
template.setHashValueSerializer(jackson2JsonRedisSerializer);
|
template.setHashValueSerializer(fastJsonSerializer);
|
||||||
ParserConfig.getGlobalInstance().addAccept("com.bestsch.modules.system.service.dto");
|
// key 使用 String 序列化
|
||||||
// key的序列化采用StringRedisSerializer
|
|
||||||
template.setKeySerializer(new StringRedisSerializer());
|
template.setKeySerializer(new StringRedisSerializer());
|
||||||
template.setHashKeySerializer(new StringRedisSerializer());
|
template.setHashKeySerializer(new StringRedisSerializer());
|
||||||
template.setConnectionFactory(redisConnectionFactory);
|
template.setConnectionFactory(redisConnectionFactory);
|
||||||
|
|
||||||
|
log.info("RedisTemplate value serializer: {}", fastJsonSerializer.getClass());
|
||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.PageVO;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
public class BaseController {
|
||||||
|
/**
|
||||||
|
* 根据请求参数构建PageVO对象,设置当前页和每页大小,并提供默认值。
|
||||||
|
* @param page 页码字符串(从1开始)
|
||||||
|
* @param pageSize 每页大小字符串
|
||||||
|
* @return PageVO对象
|
||||||
|
*/
|
||||||
|
protected PageVO getPageVO(String page, String pageSize) {
|
||||||
|
int defaultPage = 1;
|
||||||
|
int defaultSize = 10;
|
||||||
|
int maxSize = 100; // 可配置
|
||||||
|
|
||||||
|
int current = defaultPage;
|
||||||
|
int size = defaultSize;
|
||||||
|
|
||||||
|
if (StringUtils.isNumeric(page)) {
|
||||||
|
try {
|
||||||
|
current = Integer.parseInt(page);
|
||||||
|
if (current < 1) {
|
||||||
|
current = defaultPage;
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException ignored) {
|
||||||
|
// 保持默认
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StringUtils.isNumeric(pageSize)) {
|
||||||
|
try {
|
||||||
|
size = Integer.parseInt(pageSize);
|
||||||
|
if (size < 1) {
|
||||||
|
size = defaultSize;
|
||||||
|
} else if (size > maxSize) {
|
||||||
|
size = maxSize;
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException ignored) {
|
||||||
|
// 保持默认
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PageVO pageVO = new PageVO();
|
||||||
|
pageVO.setCurrent(current);
|
||||||
|
pageVO.setPageSize(size);
|
||||||
|
return pageVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 安全地将字符串转换为Integer,若转换失败返回null。
|
||||||
|
* @param str 待转换字符串
|
||||||
|
* @return Integer值或null
|
||||||
|
*/
|
||||||
|
public static Integer getIntByString(String str) {
|
||||||
|
if (str == null || str.trim().isEmpty() || "null".equalsIgnoreCase(str.trim())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return Integer.parseInt(str.trim());
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return null; // 静默失败,不抛异常
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.Handler;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.springframework.core.MethodParameter; // ✅ 正确包
|
||||||
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
import org.springframework.web.bind.support.WebDataBinderFactory;
|
||||||
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
|
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||||
|
import org.springframework.web.method.support.ModelAndViewContainer;
|
||||||
|
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
@RestControllerAdvice
|
||||||
|
public class UserSysRoleArgumentResolver implements HandlerMethodArgumentResolver {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supportsParameter(MethodParameter parameter) {
|
||||||
|
return parameter.getParameterType().equals(UserSysRole.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
|
||||||
|
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
|
||||||
|
// 优先从 Header 中获取 currentrole(生产环境由网关/门户注入)
|
||||||
|
String raw = webRequest.getHeader("currentrole");
|
||||||
|
boolean fromQuery = false;
|
||||||
|
if (raw == null) {
|
||||||
|
// 回退:支持以 URL 查询参数 currentrole 传入(便于调试/测试)
|
||||||
|
raw = webRequest.getParameter("currentrole");
|
||||||
|
fromQuery = true;
|
||||||
|
}
|
||||||
|
if (raw == null) {
|
||||||
|
return null; // 或抛异常
|
||||||
|
}
|
||||||
|
// Header 中的值通常是 URL 编码的,需要解码;URL 查询参数已被容器自动解码,无需再解
|
||||||
|
String decoded = fromQuery ? raw : URLDecoder.decode(raw, StandardCharsets.UTF_8.name());
|
||||||
|
// 反序列化 JSON → UserSysRole
|
||||||
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
return mapper.readValue(decoded, UserSysRole.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
+33
@@ -0,0 +1,33 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.Handler;
|
||||||
|
|
||||||
|
import com.yunhai.platform.utils.exception.ErrorCode;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||||
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@RestControllerAdvice
|
||||||
|
public class ValidationExceptionHandler {
|
||||||
|
|
||||||
|
@ExceptionHandler(MethodArgumentNotValidException.class)
|
||||||
|
public ResponseEntity<Map<String, Object>> handleValidationExceptions(MethodArgumentNotValidException ex) {
|
||||||
|
List<String> msgList = new ArrayList<>();
|
||||||
|
ex.getBindingResult().getAllErrors().forEach(error -> {
|
||||||
|
String errorMessage = error.getDefaultMessage();
|
||||||
|
msgList.add(errorMessage);
|
||||||
|
});
|
||||||
|
|
||||||
|
Map<String, Object> response = new LinkedHashMap<>();
|
||||||
|
response.put("code", ErrorCode.ERROR.getCode());
|
||||||
|
response.put("msg", String.join(";", msgList));
|
||||||
|
response.put("data", null);
|
||||||
|
response.put("timeNow", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||||
|
|
||||||
|
return new ResponseEntity(response, HttpStatus.BAD_REQUEST);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.controller.BaseController;
|
||||||
|
import com.bestsch.bschclassmanage.entity.OperationLogRecord;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.PageVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.ILogService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/log/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class LogController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ILogService logService; // 使用接口
|
||||||
|
|
||||||
|
@GetMapping("systemSearch")
|
||||||
|
public PageVO<OperationLogRecord> systemSearch(UserSysRole curRole,
|
||||||
|
@RequestParam(required = false) String keyword,
|
||||||
|
Pageable pageable) {
|
||||||
|
return logService.search(curRole.getSchId(),keyword,true,pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("search")
|
||||||
|
public PageVO<OperationLogRecord> search(UserSysRole curRole,
|
||||||
|
@RequestParam(required = false) String keyword,
|
||||||
|
Pageable pageable) {
|
||||||
|
return logService.search(curRole.getSchId(),keyword,false,pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+8
-11
@@ -1,12 +1,11 @@
|
|||||||
package com.bestsch.classicalchinese.controller.api;
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
import com.bestsch.openapi.BoaModule;
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
import com.bestsch.openapi.BoaUser;
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
import com.bestsch.openapi.BschBaseOpenApi;
|
import com.yunhai.platform.openapi.client.YschBaseOpenApi;
|
||||||
import com.bestsch.openapi.UserSysRole;
|
import com.yunhai.platform.utils.model.BoaModule;
|
||||||
import com.bestsch.classicalchinese.config.Config;
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -20,15 +19,13 @@ import java.util.List;
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(Config.API_PATH)
|
@RequestMapping(Config.API_PATH)
|
||||||
@CrossOrigin(origins = {"*", "*"}, allowCredentials = "true")
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
public class LoginUserController {
|
public class LoginUserController {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private BschBaseOpenApi bschBaseOpenApi;
|
|
||||||
|
|
||||||
@GetMapping("GetUserMod")
|
@GetMapping("GetUserMod")
|
||||||
public List<BoaModule> getUserMod(BoaUser authUserWithDept, UserSysRole curRole) {
|
public List<BoaModule> getUserMod(BoaUser authUserWithDept, UserSysRole curRole) {
|
||||||
return bschBaseOpenApi.getUserModule(curRole.getUserId(),curRole.getSchId());
|
return YschBaseOpenApi.getUserModule(authUserWithDept.getId(),curRole.getSchId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("GetUserInfo")
|
@GetMapping("GetUserInfo")
|
||||||
@@ -0,0 +1,285 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchClass;
|
||||||
|
import com.bestsch.bschclassmanage.model.excel.ImportRuleExcelColumn;
|
||||||
|
import com.bestsch.bschclassmanage.model.excel.SchClassExcelColumn;
|
||||||
|
import com.bestsch.bschclassmanage.model.excel.SchHeightClassExcelColumn;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.BaseSchClassVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.HigherSchClassVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.PageVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SelectIntVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.*;
|
||||||
|
import com.bestsch.bschclassmanage.utils.EasyPoiUtils;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/schclass/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchClassController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchClassService schClassService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IComSchTreeService comSchTreeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBaseSchsystemGradeService baseSchsystemGradeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchTeacherService schTeacherService;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchDicCampusService schDicCampusService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchDicDivisionService schDicDivisionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchDicMajorsService schDicMajorsService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("searcBaseSchClass")
|
||||||
|
public List<BaseSchClassVO> searcBaseSchClass(UserSysRole curRole,
|
||||||
|
@RequestParam(required = false) Integer schsystemId,
|
||||||
|
@RequestParam(required = false) Integer gradeId) {
|
||||||
|
return schClassService.searcBaseSchClass(curRole.getSchId(),schsystemId,gradeId,null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("addBaseSchClass")
|
||||||
|
public void addBaseSchClass(BoaUser authUserWithDept, UserSysRole curRole, Integer gradeId, Integer number) {
|
||||||
|
schClassService.addBaseSchClass(UserContext.getCurrentUserInfo(),gradeId,number);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("editClassName")
|
||||||
|
public void editClassName(BoaUser authUserWithDept, UserSysRole curRole,Integer id,String cname) {
|
||||||
|
schClassService.editClassName(UserContext.getCurrentUserInfo(),id,cname);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("editClassFirstTeacher")
|
||||||
|
public void editClassfirstTeacher(BoaUser authUserWithDept, UserSysRole curRole,Integer id,Integer firstTeacherId) {
|
||||||
|
schClassService.editClassFirstTeacher(UserContext.getCurrentUserInfo(),id,firstTeacherId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("editClassSecondTeacher")
|
||||||
|
public void editClassSecondTeacher(BoaUser authUserWithDept, UserSysRole curRole,Integer id,Integer secondTeacherId) {
|
||||||
|
schClassService.editClassSecondTeacher(UserContext.getCurrentUserInfo(),id,secondTeacherId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("editClassCampus")
|
||||||
|
public void editClassCampus(BoaUser authUserWithDept, UserSysRole curRole,Integer id,Integer campusId) {
|
||||||
|
schClassService.editClassCampus(UserContext.getCurrentUserInfo(),id,campusId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("searcHigherSchClass")
|
||||||
|
public PageVO<HigherSchClassVO> searcHigherSchClass(UserSysRole curRole,
|
||||||
|
@RequestParam(required = false) Integer year,
|
||||||
|
@RequestParam(required = false) Integer campusId,
|
||||||
|
@RequestParam(required = false) Integer divisionId,
|
||||||
|
@RequestParam(required = false) Integer majorsId,
|
||||||
|
Pageable pageable) {
|
||||||
|
return schClassService.searcHigherSchClass(curRole.getSchId(),year,campusId,divisionId,majorsId,pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("saveHigherSchClass")
|
||||||
|
public void addHigherSchClass(BoaUser authUserWithDept, UserSysRole curRole,@RequestBody SchClass model) {
|
||||||
|
schClassService.saveHigherSchClass(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("delete/{id}")
|
||||||
|
public void deleteSchClass(BoaUser authUserWithDept, UserSysRole curRole,@PathVariable Integer id) {
|
||||||
|
schClassService.deleteSchClass(UserContext.getCurrentUserInfo(),id,curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("select")
|
||||||
|
public List<SelectIntVO> getClassSelect(UserSysRole curRole, @RequestParam Integer gradeId) {
|
||||||
|
return schClassService.getClassSelect(curRole.getSchId(),gradeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("selectBySchIdAndGradeId")
|
||||||
|
public List<SelectIntVO> getClassSelect(@RequestParam Integer schId, @RequestParam Integer gradeId) {
|
||||||
|
return schClassService.getClassSelect(schId,gradeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("downloadTemplate")
|
||||||
|
public void downloadTemplate(HttpServletResponse response,Integer schId) {
|
||||||
|
String fileName="班级导入模板";
|
||||||
|
List<Map<String, Object>> sheets = new ArrayList<>();
|
||||||
|
|
||||||
|
List<SchClassExcelColumn> classList=new ArrayList<>();
|
||||||
|
{
|
||||||
|
SchClassExcelColumn column=new SchClassExcelColumn();
|
||||||
|
column.setGradeName("示例:初一");
|
||||||
|
column.setClazzName("示例:1班");
|
||||||
|
column.setClazzCName("示例:一班");
|
||||||
|
column.setBzr("示例:张三");
|
||||||
|
classList.add(column);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> gradeNames=baseSchsystemGradeService.getGradeSelect(schId,null,null)
|
||||||
|
.stream().map(s->s.getName()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<String> teaNames=schTeacherService.getSchTeacherList(schId).stream().map(s->s.getName()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<ImportRuleExcelColumn> ruleList = new ArrayList<>();
|
||||||
|
|
||||||
|
ImportRuleExcelColumn rule1 = new ImportRuleExcelColumn();
|
||||||
|
rule1.setRuleItem("年级");
|
||||||
|
rule1.setDescription("必填");
|
||||||
|
rule1.setContent(String.join("、",gradeNames));
|
||||||
|
ruleList.add(rule1);
|
||||||
|
|
||||||
|
ImportRuleExcelColumn rule2 = new ImportRuleExcelColumn();
|
||||||
|
rule2.setRuleItem("班级");
|
||||||
|
rule2.setDescription("必填");
|
||||||
|
rule2.setContent("1班、2班、3班~n班");
|
||||||
|
ruleList.add(rule2);
|
||||||
|
|
||||||
|
ImportRuleExcelColumn rule3 = new ImportRuleExcelColumn();
|
||||||
|
rule3.setRuleItem("班主任、副班主任");
|
||||||
|
rule3.setDescription("选填");
|
||||||
|
rule3.setContent(String.join("、",teaNames));
|
||||||
|
ruleList.add(rule3);
|
||||||
|
|
||||||
|
ExportParams params1 = new ExportParams("班级导入",comSchTreeService.getSchoolName(schId));
|
||||||
|
Map<String, Object> sheet1 = new HashMap<>();
|
||||||
|
sheet1.put("title",params1);
|
||||||
|
sheet1.put("entity", SchClassExcelColumn.class);
|
||||||
|
sheet1.put("data", classList);
|
||||||
|
sheets.add(sheet1);
|
||||||
|
|
||||||
|
ExportParams params2 = new ExportParams("导入规则", "导入规则");
|
||||||
|
|
||||||
|
Map<String, Object> sheet2 = new HashMap<>();
|
||||||
|
sheet2.put("title", params2);
|
||||||
|
sheet2.put("entity", ImportRuleExcelColumn.class);
|
||||||
|
sheet2.put("data", ruleList);
|
||||||
|
sheets.add(sheet2);
|
||||||
|
|
||||||
|
Workbook workbook = ExcelExportUtil.exportExcel(sheets, ExcelType.HSSF);
|
||||||
|
EasyPoiUtils.downLoadExcel(fileName + ".xls", response, workbook);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("importClasses")
|
||||||
|
public void importClasses(BoaUser authUserWithDept, UserSysRole curRole, @RequestPart("file") MultipartFile file) {
|
||||||
|
schClassService.importClasses(UserContext.getCurrentUserInfo(),file);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("downloadHeightTemplate")
|
||||||
|
public void downloadHeightTemplate(HttpServletResponse response,Integer schId) {
|
||||||
|
String fileName="班级导入模板";
|
||||||
|
List<Map<String, Object>> sheets = new ArrayList<>();
|
||||||
|
|
||||||
|
List<SchHeightClassExcelColumn> classList=new ArrayList<>();
|
||||||
|
{
|
||||||
|
SchHeightClassExcelColumn column=new SchHeightClassExcelColumn();
|
||||||
|
column.setGradeName("示例:2026级");
|
||||||
|
column.setClazzCode("");
|
||||||
|
column.setClazzName("示例:南校1班");
|
||||||
|
column.setClazzCName("");
|
||||||
|
column.setCampus("示例:南校区");
|
||||||
|
column.setDivistion("示例:信息工程");
|
||||||
|
column.setDivistion("示例:软件开发");
|
||||||
|
column.setBzr("示例:张三");
|
||||||
|
classList.add(column);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<String> campusNames=schDicCampusService.getSchDicCampusCacheList(schId).stream().map(s->s.getName()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<String> divisionNames=schDicDivisionService.getSchDicDivisionCacheList(schId).stream().map(s->s.getName()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<String> majorsNames=schDicMajorsService.getSchDicMajorsCacheList(schId).stream().map(s->s.getName()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
List<String> teaNames=schTeacherService.getSchTeacherList(schId).stream().map(s->s.getName()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<ImportRuleExcelColumn> ruleList = new ArrayList<>();
|
||||||
|
|
||||||
|
ImportRuleExcelColumn rule1 = new ImportRuleExcelColumn();
|
||||||
|
rule1.setRuleItem("校区");
|
||||||
|
rule1.setDescription("选填");
|
||||||
|
rule1.setContent(String.join("、",campusNames));
|
||||||
|
ruleList.add(rule1);
|
||||||
|
|
||||||
|
ImportRuleExcelColumn rule2 = new ImportRuleExcelColumn();
|
||||||
|
rule2.setRuleItem("系部");
|
||||||
|
rule2.setDescription("必填");
|
||||||
|
rule2.setContent(String.join("、",divisionNames));
|
||||||
|
ruleList.add(rule2);
|
||||||
|
|
||||||
|
ImportRuleExcelColumn rule3 = new ImportRuleExcelColumn();
|
||||||
|
rule3.setRuleItem("专业");
|
||||||
|
rule3.setDescription("必填");
|
||||||
|
rule3.setContent(String.join("、",majorsNames));
|
||||||
|
ruleList.add(rule3);
|
||||||
|
|
||||||
|
ImportRuleExcelColumn rule4 = new ImportRuleExcelColumn();
|
||||||
|
rule4.setRuleItem("班主任");
|
||||||
|
rule4.setDescription("选填");
|
||||||
|
rule4.setContent(String.join("、",teaNames));
|
||||||
|
ruleList.add(rule4);
|
||||||
|
|
||||||
|
ExportParams params1 = new ExportParams("班级导入",comSchTreeService.getSchoolName(schId));
|
||||||
|
Map<String, Object> sheet1 = new HashMap<>();
|
||||||
|
sheet1.put("title",params1);
|
||||||
|
sheet1.put("entity", SchHeightClassExcelColumn.class);
|
||||||
|
sheet1.put("data", classList);
|
||||||
|
sheets.add(sheet1);
|
||||||
|
|
||||||
|
ExportParams params2 = new ExportParams("导入规则", "导入规则");
|
||||||
|
|
||||||
|
Map<String, Object> sheet2 = new HashMap<>();
|
||||||
|
sheet2.put("title", params2);
|
||||||
|
sheet2.put("entity", ImportRuleExcelColumn.class);
|
||||||
|
sheet2.put("data", ruleList);
|
||||||
|
sheets.add(sheet2);
|
||||||
|
|
||||||
|
Workbook workbook = ExcelExportUtil.exportExcel(sheets, ExcelType.HSSF);
|
||||||
|
EasyPoiUtils.downLoadExcel(fileName + ".xls", response, workbook);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("importHeightClasses")
|
||||||
|
public void importHeightClasses(BoaUser authUserWithDept, UserSysRole curRole, @RequestPart("file") MultipartFile file) {
|
||||||
|
schClassService.importHeightClasses(UserContext.getCurrentUserInfo(),file);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("backupAllSnapshot")
|
||||||
|
public void backupAllSnapshot() {
|
||||||
|
schClassService.backupAllSnapshot();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("upgradeAllClasses")
|
||||||
|
public void upgradeAllClasses() {
|
||||||
|
schClassService.upgradeAllClasses();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+161
@@ -0,0 +1,161 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.enums.CustomGroupType;
|
||||||
|
import com.bestsch.bschclassmanage.model.dto.AddMemberDTO;
|
||||||
|
import com.bestsch.bschclassmanage.model.dto.SchCustomGroupDTO;
|
||||||
|
import com.bestsch.bschclassmanage.model.dto.SetLeaderDTO;
|
||||||
|
import com.bestsch.bschclassmanage.model.excel.CustomGroupExcelColumn;
|
||||||
|
import com.bestsch.bschclassmanage.model.excel.ImportRuleExcelColumn;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SchCustomGroupVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.*;
|
||||||
|
import com.bestsch.bschclassmanage.utils.EasyPoiUtils;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/group/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchCustomGroupController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchCustomGroupService schCustomGroupService; // 使用接口
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBaseSchsystemGradeService baseSchsystemGradeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchDicSubjectService schDicSubjectService; //使用接口
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IComSchTreeService comSchTreeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchTeacherService schTeacherService;
|
||||||
|
|
||||||
|
@GetMapping("getSchCustomGroup")
|
||||||
|
public List<SchCustomGroupVO> getSchCustomGroup(UserSysRole curRole, @RequestParam Integer type) {
|
||||||
|
return schCustomGroupService.getSchCustomGroup(curRole.getSchId(),type);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("saveSchCustomGroup")
|
||||||
|
public void saveSchCustomGroup(BoaUser authUserWithDept, UserSysRole curRole, @Valid @RequestBody SchCustomGroupDTO dto) {
|
||||||
|
schCustomGroupService.saveSchCustomGroup(UserContext.getCurrentUserInfo(),dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("saveMembers")
|
||||||
|
public void saveMembers(BoaUser authUserWithDept, UserSysRole curRole,@Valid @RequestBody AddMemberDTO dto) {
|
||||||
|
schCustomGroupService.saveMembers(UserContext.getCurrentUserInfo(),dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("setLeaders")
|
||||||
|
public void setLeaders(BoaUser authUserWithDept, UserSysRole curRole,@Valid @RequestBody SetLeaderDTO dto) {
|
||||||
|
schCustomGroupService.setLeaders(UserContext.getCurrentUserInfo(),dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("deleteSchCustomGroup")
|
||||||
|
public void deleteSchCustomGroup(UserSysRole curRole,@RequestParam Integer groupId) {
|
||||||
|
schCustomGroupService.deleteSchCustomGroup(UserContext.getCurrentUserInfo(),groupId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("downloadTemplate")
|
||||||
|
public void downloadTemplate(HttpServletResponse response, Integer schId) {
|
||||||
|
String fileName = "教师分组导入模板";
|
||||||
|
List<Map<String, Object>> sheets = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
List<CustomGroupExcelColumn> list = new ArrayList<>();
|
||||||
|
{
|
||||||
|
CustomGroupExcelColumn column = new CustomGroupExcelColumn();
|
||||||
|
column.setGroupName("示例:语文组");
|
||||||
|
column.setGroupType("示例:年级组");
|
||||||
|
column.setGradeBin("示例:高一年级");
|
||||||
|
column.setGradeBin("示例:语文,数学");
|
||||||
|
column.setLeaderName("示例:张三");
|
||||||
|
column.setMemberName("示例:张三");
|
||||||
|
list.add(column);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> teaNames=schTeacherService.getSchTeacherList(schId).stream().map(s->s.getName()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<String> gradeNames=baseSchsystemGradeService.getGradeSelect(schId,null,null)
|
||||||
|
.stream().map(s->s.getName()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<String> subjectNames=schDicSubjectService.getSchSubList(schId,null)
|
||||||
|
.stream().map(s->s.getName()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<String> groupNames=CustomGroupType.list().stream()
|
||||||
|
.map(s->s.getName()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
ExportParams params1 = new ExportParams("自定义组导入",comSchTreeService.getSchoolName(schId));
|
||||||
|
Map<String, Object> sheet1 = new HashMap<>();
|
||||||
|
sheet1.put("title",params1);
|
||||||
|
sheet1.put("entity", CustomGroupExcelColumn.class);
|
||||||
|
sheet1.put("data", list);
|
||||||
|
sheets.add(sheet1);
|
||||||
|
|
||||||
|
List<ImportRuleExcelColumn> ruleList = new ArrayList<>();
|
||||||
|
|
||||||
|
ImportRuleExcelColumn rule1 = new ImportRuleExcelColumn();
|
||||||
|
rule1.setRuleItem("组长/组员");
|
||||||
|
rule1.setDescription("多选");
|
||||||
|
rule1.setContent(String.join(",",teaNames));
|
||||||
|
ruleList.add(rule1);
|
||||||
|
|
||||||
|
ImportRuleExcelColumn rule2 = new ImportRuleExcelColumn();
|
||||||
|
rule2.setRuleItem("年级");
|
||||||
|
rule2.setDescription("多选");
|
||||||
|
rule2.setContent(String.join(",",gradeNames));
|
||||||
|
ruleList.add(rule2);
|
||||||
|
|
||||||
|
ImportRuleExcelColumn rule3 = new ImportRuleExcelColumn();
|
||||||
|
rule3.setRuleItem("学科");
|
||||||
|
rule3.setDescription("多选");
|
||||||
|
rule3.setContent(String.join(",",subjectNames));
|
||||||
|
ruleList.add(rule3);
|
||||||
|
|
||||||
|
ImportRuleExcelColumn rule4 = new ImportRuleExcelColumn();
|
||||||
|
rule4.setRuleItem("组类型");
|
||||||
|
rule4.setDescription("单选");
|
||||||
|
rule4.setContent(String.join(",",groupNames));
|
||||||
|
ruleList.add(rule4);
|
||||||
|
|
||||||
|
ExportParams params2 = new ExportParams("导入规则", "导入规则");
|
||||||
|
|
||||||
|
Map<String, Object> sheet2 = new HashMap<>();
|
||||||
|
sheet2.put("title", params2);
|
||||||
|
sheet2.put("entity", ImportRuleExcelColumn.class);
|
||||||
|
sheet2.put("data", ruleList);
|
||||||
|
sheets.add(sheet2);
|
||||||
|
|
||||||
|
Workbook workbook = ExcelExportUtil.exportExcel(sheets, ExcelType.HSSF);
|
||||||
|
EasyPoiUtils.downLoadExcel(fileName + ".xls", response, workbook);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("importCustomGroup")
|
||||||
|
public void importCustomGroup(BoaUser authUserWithDept, UserSysRole curRole, @RequestPart("file") MultipartFile file) {
|
||||||
|
schCustomGroupService.importCustomGroup(UserContext.getCurrentUserInfo(),file);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchDicCampus;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SelectIntVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchDicCampusService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/campus/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchDicCampusController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchDicCampusService schDicCampusService; // 使用接口
|
||||||
|
|
||||||
|
@GetMapping("list")
|
||||||
|
public List<SchDicCampus> getSchDicCampusCacheList(UserSysRole curRole) {
|
||||||
|
return schDicCampusService.getSchDicCampusCacheList(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("save")
|
||||||
|
public void saveSchCampus(BoaUser authUserWithDept, UserSysRole curRole, @Valid @RequestBody SchDicCampus model) {
|
||||||
|
schDicCampusService.saveSchCampus(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("sort")
|
||||||
|
public void sortSchCampus(BoaUser authUserWithDept, UserSysRole curRole, @RequestBody List<Integer> ids) {
|
||||||
|
schDicCampusService.sortSchCampus(UserContext.getCurrentUserInfo(),ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("delete/{id}")
|
||||||
|
public void delete(BoaUser authUserWithDept, UserSysRole curRole,@PathVariable Integer id) {
|
||||||
|
schDicCampusService.delete(UserContext.getCurrentUserInfo(),id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("select")
|
||||||
|
public List<SelectIntVO> select(UserSysRole curRole) {
|
||||||
|
return schDicCampusService.select(curRole.getSchId());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.controller.BaseController;
|
||||||
|
import com.bestsch.bschclassmanage.enums.CourseType;
|
||||||
|
import com.bestsch.bschclassmanage.model.dto.SchDicCourseDTO;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.PageVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SchDicCourseVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SelectIntVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchDicCourseService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/course/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchDicCourseController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchDicCourseService schDicCourseService; // 使用接口
|
||||||
|
|
||||||
|
@GetMapping("search")
|
||||||
|
public PageVO<SchDicCourseVO> search(UserSysRole curRole,
|
||||||
|
@RequestParam(required = false) Integer type,
|
||||||
|
@RequestParam(required = false) String keyword,
|
||||||
|
@RequestParam(required = false) Integer divisionId,
|
||||||
|
@RequestParam(required = false) Integer majorsId,
|
||||||
|
Pageable pageable) {
|
||||||
|
return schDicCourseService.search(curRole.getSchId(),type,keyword,divisionId,majorsId,pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("save")
|
||||||
|
public void saveSchMajors(BoaUser authUserWithDept, UserSysRole curRole, @Valid @RequestBody SchDicCourseDTO dto) {
|
||||||
|
schDicCourseService.saveSchCourse(UserContext.getCurrentUserInfo(),dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("delete/{id}")
|
||||||
|
public void delete(BoaUser authUserWithDept, UserSysRole curRole, @PathVariable Integer id) {
|
||||||
|
schDicCourseService.delete(UserContext.getCurrentUserInfo(),id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("typeSelect")
|
||||||
|
public List<SelectIntVO> typeSelect() {
|
||||||
|
return CourseType.select();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchDicDivision;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SelectIntVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchDicDivisionService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/division/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchDicDivisionController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchDicDivisionService schDicDivisionService; // 使用接口
|
||||||
|
|
||||||
|
@GetMapping("list")
|
||||||
|
public List<SchDicDivision> getSchDicDivisionCacheList(UserSysRole curRole) {
|
||||||
|
return schDicDivisionService.getSchDicDivisionCacheList(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("save")
|
||||||
|
public void saveSchDivision(BoaUser authUserWithDept, UserSysRole curRole, @Valid @RequestBody SchDicDivision model) {
|
||||||
|
schDicDivisionService.saveSchDivision(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("sort")
|
||||||
|
public void sortSchDivision(BoaUser authUserWithDept, UserSysRole curRole,@RequestBody List<Integer> ids) {
|
||||||
|
schDicDivisionService.sortSchDivision(UserContext.getCurrentUserInfo(),ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("delete/{id}")
|
||||||
|
public void delete(BoaUser authUserWithDept, UserSysRole curRole, @PathVariable Integer id) {
|
||||||
|
schDicDivisionService.delete(UserContext.getCurrentUserInfo(),id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("select")
|
||||||
|
public List<SelectIntVO> select(UserSysRole curRole) {
|
||||||
|
return schDicDivisionService.select(curRole.getSchId());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchDicMajors;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SelectIntVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchDicMajorsService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/majors/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchDicMajorsController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchDicMajorsService schDicMajorsService; // 使用接口
|
||||||
|
|
||||||
|
@GetMapping("list")
|
||||||
|
public List<SchDicMajors> getSchDicMajorsList(UserSysRole curRole,
|
||||||
|
@RequestParam(required = false)String keyword) {
|
||||||
|
return schDicMajorsService.getSchDicMajorsList(curRole.getSchId(),keyword);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("save")
|
||||||
|
public void saveSchMajors(BoaUser authUserWithDept, UserSysRole curRole, @Valid @RequestBody SchDicMajors model) {
|
||||||
|
schDicMajorsService.saveSchMajors(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("sort")
|
||||||
|
public void sortSchMajors(BoaUser authUserWithDept, UserSysRole curRole, @RequestBody List<Integer> ids) {
|
||||||
|
schDicMajorsService.sortSchMajors(UserContext.getCurrentUserInfo(),ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("delete/{id}")
|
||||||
|
public void delete(BoaUser authUserWithDept, UserSysRole curRole,@PathVariable Integer id) {
|
||||||
|
schDicMajorsService.delete(UserContext.getCurrentUserInfo(),id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("select")
|
||||||
|
public List<SelectIntVO> select(UserSysRole curRole) {
|
||||||
|
return schDicMajorsService.select(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SelectIntVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.IBaseSchsystemGradeService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/grade/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchGradeController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBaseSchsystemGradeService baseSchsystemGradeService; // 使用接口
|
||||||
|
|
||||||
|
@GetMapping("select")
|
||||||
|
public List<SelectIntVO> getGradeSelect(UserSysRole curRole) {
|
||||||
|
return baseSchsystemGradeService.getGradeSelect(curRole.getSchId(),null,null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("selectBySchsystemId")
|
||||||
|
public List<SelectIntVO> getGradeSelect(UserSysRole curRole,@RequestParam Integer schsystemId) {
|
||||||
|
return baseSchsystemGradeService.getGradeSelect(curRole.getSchId(),schsystemId,null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("selectBySchId")
|
||||||
|
public List<SelectIntVO> getGradeSelect(@RequestParam Integer schId) {
|
||||||
|
return baseSchsystemGradeService.getGradeSelect(schId,null,null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("selectByMajorsId")
|
||||||
|
public List<SelectIntVO> getGradeByMajorsId(UserSysRole curRole,@RequestParam Integer majorsId) {
|
||||||
|
return baseSchsystemGradeService.getGradeByMajorsId(curRole.getSchId(),majorsId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,233 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.controller.BaseController;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchClass;
|
||||||
|
import com.bestsch.bschclassmanage.enums.StuAbnormalStatus;
|
||||||
|
import com.bestsch.bschclassmanage.model.dto.StuAbnormalStatusDTO;
|
||||||
|
import com.bestsch.bschclassmanage.model.dto.StuTransferClassDTO;
|
||||||
|
import com.bestsch.bschclassmanage.model.excel.ImportRuleExcelColumn;
|
||||||
|
import com.bestsch.bschclassmanage.model.excel.StudentExcelColumn;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.PageVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SchStudentVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SelectIntVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.IBaseSchsystemGradeService;
|
||||||
|
import com.bestsch.bschclassmanage.service.IComSchTreeService;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchClassService;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchStudentService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.EasyPoiUtils;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/student/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchStudentController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchStudentService schStudentService; // 使用接口
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBaseSchsystemGradeService baseSchsystemGradeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchClassService schClassService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IComSchTreeService comSchTreeService; // 使用接口
|
||||||
|
|
||||||
|
@GetMapping("baseSchSearch")
|
||||||
|
public PageVO<SchStudentVO> searchBaseSchStudentVO(UserSysRole curRole,
|
||||||
|
@RequestParam(required = false) Integer schsystemId,
|
||||||
|
@RequestParam(required = false) Integer gradeId,
|
||||||
|
@RequestParam(required = false) Integer classId,
|
||||||
|
@RequestParam(required = false) String keyword,
|
||||||
|
Pageable pageable) {
|
||||||
|
return schStudentService.searchBaseSchStudentVO(curRole.getSchId(),schsystemId,gradeId,classId,keyword,true,pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("higherSchSearch")
|
||||||
|
public PageVO<SchStudentVO> searchHigherSchStudentVO(UserSysRole curRole,
|
||||||
|
@RequestParam(required = false) Integer year,
|
||||||
|
@RequestParam(required = false) Integer classId,
|
||||||
|
@RequestParam(required = false) String keyword,
|
||||||
|
Pageable pageable) {
|
||||||
|
return schStudentService.searchHigherSchStudentVO(curRole.getSchId(),year,classId,keyword,true,pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("baseSchAbnormalSearch")
|
||||||
|
public PageVO<SchStudentVO> baseSchAbnormalSearch(UserSysRole curRole,
|
||||||
|
@RequestParam(required = false) Integer schsystemId,
|
||||||
|
@RequestParam(required = false) Integer gradeId,
|
||||||
|
@RequestParam(required = false) Integer classId,
|
||||||
|
@RequestParam(required = false) String keyword,
|
||||||
|
Pageable pageable) {
|
||||||
|
return schStudentService.searchBaseSchStudentVO(curRole.getSchId(),schsystemId,gradeId,classId,keyword,false,pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("higherSchAbnormalSearch")
|
||||||
|
public PageVO<SchStudentVO> higherSchAbnormalSearch(UserSysRole curRole,
|
||||||
|
@RequestParam(required = false) Integer year,
|
||||||
|
@RequestParam(required = false) Integer classId,
|
||||||
|
@RequestParam(required = false) String keyword,
|
||||||
|
Pageable pageable) {
|
||||||
|
return schStudentService.searchHigherSchStudentVO(curRole.getSchId(),year,classId,keyword,false,pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("searchSchClassStudent")
|
||||||
|
public List<SchStudentVO> searchSchClassStudentVO(UserSysRole curRole,
|
||||||
|
@RequestParam Integer gradeId,
|
||||||
|
@RequestParam Integer classId) {
|
||||||
|
return schStudentService.searchSchClassStudentVO(curRole.getSchId(),gradeId,classId,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("save")
|
||||||
|
public void saveStudent(BoaUser authUserWithDept, UserSysRole curRole,@Valid @RequestBody SchStudentVO model) {
|
||||||
|
schStudentService.saveStudent(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("delete/{ids}")
|
||||||
|
public void deleteStudent(BoaUser authUserWithDept, UserSysRole curRole,@PathVariable String ids) {
|
||||||
|
schStudentService.deleteStudent(UserContext.getCurrentUserInfo(),ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("abnormal")
|
||||||
|
public List<SelectIntVO> abnormal() {
|
||||||
|
return StuAbnormalStatus.select();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("transferClass")
|
||||||
|
public void transferClass(BoaUser authUserWithDept, UserSysRole curRole, @Valid @RequestBody StuTransferClassDTO model) {
|
||||||
|
schStudentService.transferClass(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("setAbnormalStatus")
|
||||||
|
public void setAbnormalStatus(BoaUser authUserWithDept, UserSysRole curRole, @Valid @RequestBody StuAbnormalStatusDTO model) {
|
||||||
|
schStudentService.setAbnormalStatus(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("setTransferOut/{ids}")
|
||||||
|
public void setTransferOut(BoaUser authUserWithDept, UserSysRole curRole,@PathVariable String ids){
|
||||||
|
schStudentService.setTransferOut(UserContext.getCurrentUserInfo(),ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("setTransferIn")
|
||||||
|
public void setTransferIn(BoaUser authUserWithDept, UserSysRole curRole,@Valid @RequestBody StuTransferClassDTO model) {
|
||||||
|
schStudentService.setTransferIn(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("transferOutSchSelect")
|
||||||
|
public List<SelectIntVO> transferOutSchSelect(){
|
||||||
|
return schStudentService.transferOutSchSelect();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("searchTransferOut")
|
||||||
|
public PageVO<SchStudentVO> searchTransferOutStudent(@RequestParam(required = false) Integer schId,
|
||||||
|
@RequestParam(required = false) Integer gradeId,
|
||||||
|
@RequestParam(required = false) Integer classId,
|
||||||
|
@RequestParam(required = false) String keyword,
|
||||||
|
Pageable pageable) {
|
||||||
|
return schStudentService.searchTransferOutStudent(schId,gradeId,classId,keyword,pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("downloadTemplate")
|
||||||
|
public void downloadTemplate(HttpServletResponse response,Integer schId) {
|
||||||
|
String fileName="学生导入模板";
|
||||||
|
List<Map<String, Object>> sheets = new ArrayList<>();
|
||||||
|
|
||||||
|
List<StudentExcelColumn> stuList=new ArrayList<>();
|
||||||
|
{
|
||||||
|
StudentExcelColumn column=new StudentExcelColumn();
|
||||||
|
column.setGradeName("示例:初一");
|
||||||
|
column.setClazzName("示例:1班");
|
||||||
|
column.setStuName("示例:小明");
|
||||||
|
column.setAccount ("示例:430********4321");
|
||||||
|
column.setPassword ("示例:p123456@");
|
||||||
|
column.setIdCard("示例:430********4321");
|
||||||
|
column.setClazzNo("示例:01");
|
||||||
|
column.setGender("示例:男");
|
||||||
|
stuList.add(column);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SelectIntVO> gradeList=baseSchsystemGradeService.getGradeSelect(schId,null,null)
|
||||||
|
.stream().collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<SchClass> schClassList=schClassService.getSchClassCacheList(schId);
|
||||||
|
|
||||||
|
List<ImportRuleExcelColumn> ruleList = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
for(SelectIntVO grade:gradeList){
|
||||||
|
ImportRuleExcelColumn rule = new ImportRuleExcelColumn();
|
||||||
|
rule.setRuleItem(grade.getName());
|
||||||
|
rule.setDescription("选择班级:");
|
||||||
|
List<String> clazzNames=schClassList.stream()
|
||||||
|
.filter(s->s.getGradeId().equals(grade.getId()))
|
||||||
|
.map(s->s.getName())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
rule.setContent(clazzNames.isEmpty() ? "暂无班级":String.join("、",clazzNames));
|
||||||
|
ruleList.add(rule);
|
||||||
|
}
|
||||||
|
|
||||||
|
ExportParams params1 = new ExportParams("学生导入",comSchTreeService.getSchoolName(schId));
|
||||||
|
|
||||||
|
Map<String, Object> sheet1 = new HashMap<>();
|
||||||
|
sheet1.put("title",params1);
|
||||||
|
sheet1.put("entity", StudentExcelColumn.class);
|
||||||
|
sheet1.put("data", stuList);
|
||||||
|
sheets.add(sheet1);
|
||||||
|
|
||||||
|
ExportParams params2 = new ExportParams("导入规则", "导入规则");
|
||||||
|
|
||||||
|
Map<String, Object> sheet2 = new HashMap<>();
|
||||||
|
sheet2.put("title", params2);
|
||||||
|
sheet2.put("entity", ImportRuleExcelColumn.class);
|
||||||
|
sheet2.put("data", ruleList);
|
||||||
|
sheets.add(sheet2);
|
||||||
|
|
||||||
|
Workbook workbook = ExcelExportUtil.exportExcel(sheets, ExcelType.HSSF);
|
||||||
|
EasyPoiUtils.downLoadExcel(fileName + ".xls", response, workbook);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("studentClassNoTemplate")
|
||||||
|
public void studentClassNoTemplate(HttpServletResponse response, Integer schId,
|
||||||
|
@RequestParam(required = false) Integer schsystemId,
|
||||||
|
@RequestParam(required = false) Integer gradeId,
|
||||||
|
@RequestParam(required = false) Integer classId){
|
||||||
|
schStudentService.studentClassNoTemplate(response,schId,schsystemId,gradeId,classId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("importStudents")
|
||||||
|
public void importStudents(BoaUser authUserWithDept, UserSysRole curRole, @RequestPart("file") MultipartFile file) {
|
||||||
|
schStudentService.importStudents(UserContext.getCurrentUserInfo(),file);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("importStudentClassNo")
|
||||||
|
public void importStudentClassNo(BoaUser authUserWithDept, UserSysRole curRole, @RequestPart("file") MultipartFile file,
|
||||||
|
@RequestParam(required = false) Integer schsystemId,
|
||||||
|
@RequestParam(required = false) Integer gradeId,
|
||||||
|
@RequestParam(required = false) Integer classId) {
|
||||||
|
schStudentService.importStudentClassNo(UserContext.getCurrentUserInfo(),file,schsystemId,gradeId,classId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchDicSubject;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SelectStrVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchDicSubjectService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/subject/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchSubjectController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchDicSubjectService schDicSubjectService; // 使用接口
|
||||||
|
|
||||||
|
@GetMapping("list")
|
||||||
|
public List<SchDicSubject> getSchSubList(UserSysRole curRole, Integer schSystemId) {
|
||||||
|
return schDicSubjectService.getSchSubList(curRole.getSchId(),schSystemId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("save")
|
||||||
|
public void saveSchSub(BoaUser authUserWithDept,UserSysRole curRole,@Valid @RequestBody SchDicSubject model) {
|
||||||
|
schDicSubjectService.saveSchSub(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("sort")
|
||||||
|
public void schSubSort(BoaUser authUserWithDept, UserSysRole curRole, Integer schSystemId, @RequestBody List<String> subIds) {
|
||||||
|
schDicSubjectService.schSubSort(UserContext.getCurrentUserInfo(),subIds,schSystemId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("delete/{id}")
|
||||||
|
public void delSchSub(BoaUser authUserWithDept, UserSysRole curRole,@PathVariable Integer id) {
|
||||||
|
UserContext.UserInfo user=UserContext.getCurrentUserInfo();
|
||||||
|
schDicSubjectService.delSchSub(user,id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("select")
|
||||||
|
public List<SelectStrVO> select(UserSysRole curRole,@RequestParam(required = false) Integer schSystemId) {
|
||||||
|
return schDicSubjectService.select(curRole.getSchId(),schSystemId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,181 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.controller.BaseController;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchClassTeach;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.*;
|
||||||
|
import com.bestsch.bschclassmanage.service.*;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/teachs/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchTeachController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchClassTeachService schClassTeachService; //使用接口
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchDicSubjectService schDicSubjectService; //使用接口
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchClassService schClassService; //使用接口
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchTeacherService schTeacherService; //使用接口
|
||||||
|
|
||||||
|
@GetMapping("search")
|
||||||
|
public SchTeachMapVO getSchTeachMapVO(UserSysRole curRole,
|
||||||
|
@RequestParam(required = true) Integer schsystemId,
|
||||||
|
@RequestParam(required = false) Integer gradeId) {
|
||||||
|
return schClassTeachService.getSchTeachMapVO(curRole.getSchId(),schsystemId,gradeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getSchClassTeach")
|
||||||
|
public List<SchTeachMapIdVO> getSchClassTeachMapVO(UserSysRole curRole, @RequestParam Integer gradeId,@RequestParam Integer classId) {
|
||||||
|
return schClassTeachService.getSchClassTeachMapVO(curRole.getSchId(),gradeId,classId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("save")
|
||||||
|
public void saveTeach(BoaUser authUserWithDept, UserSysRole curRole,@Valid @RequestBody SchClassTeach model) {
|
||||||
|
schClassTeachService.saveTeach(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("delete/{id}")
|
||||||
|
public void delTeachById(BoaUser authUserWithDept, UserSysRole curRole, @PathVariable Integer id) {
|
||||||
|
schClassTeachService.delTeachById(UserContext.getCurrentUserInfo(),id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("delClassTeach")
|
||||||
|
public void delClassTeach(BoaUser authUserWithDept, UserSysRole curRole,@RequestParam Integer classId) {
|
||||||
|
schClassTeachService.delClassTeach(UserContext.getCurrentUserInfo(),classId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("delBatch")
|
||||||
|
public void delBatch(BoaUser authUserWithDept, UserSysRole curRole,@RequestParam Integer schsystemId, @RequestParam(required = false) Integer gradeId) {
|
||||||
|
schClassTeachService.delBatch(UserContext.getCurrentUserInfo(),schsystemId,gradeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("downloadTemplate")
|
||||||
|
public void downloadTemplate(HttpServletResponse response,@RequestParam Integer schId,@RequestParam Integer schsystemId, @RequestParam(required = false) Integer gradeId) throws IOException {
|
||||||
|
|
||||||
|
// 2. 获取科目和班级
|
||||||
|
List<SelectStrVO> subList = schDicSubjectService.select(schId, schsystemId);
|
||||||
|
if (subList == null) subList = Collections.emptyList();
|
||||||
|
List<BaseSchClassVO> schClassList = schClassService.searcBaseSchClass(schId, schsystemId, gradeId,null);
|
||||||
|
if (schClassList == null) schClassList = Collections.emptyList();
|
||||||
|
|
||||||
|
// 3. 创建工作簿
|
||||||
|
Workbook workbook = new HSSFWorkbook(); // 或 XSSFWorkbook
|
||||||
|
Sheet sheet = workbook.createSheet("教师任教导入");
|
||||||
|
|
||||||
|
// 4. 构建表头
|
||||||
|
Row headerRow = sheet.createRow(0);
|
||||||
|
int colIdx = 0;
|
||||||
|
headerRow.createCell(colIdx++).setCellValue("年级");
|
||||||
|
headerRow.createCell(colIdx++).setCellValue("班级");
|
||||||
|
for (SelectStrVO sub : subList) {
|
||||||
|
headerRow.createCell(colIdx++).setCellValue(sub.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 填充数据行
|
||||||
|
int rowIdx = 1;
|
||||||
|
for (BaseSchClassVO clzz : schClassList) {
|
||||||
|
Row row = sheet.createRow(rowIdx++);
|
||||||
|
colIdx = 0;
|
||||||
|
row.createCell(colIdx++).setCellValue(clzz.getGradeName());
|
||||||
|
row.createCell(colIdx++).setCellValue(clzz.getName());
|
||||||
|
for (int i = 0; i < subList.size(); i++) {
|
||||||
|
row.createCell(colIdx++).setCellValue("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 6. 自动调整列宽(可选)
|
||||||
|
for (int i = 0; i < 2 + subList.size(); i++) {
|
||||||
|
sheet.autoSizeColumn(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. 下载
|
||||||
|
String fileName = "教师任教导入模板.xls";
|
||||||
|
response.setContentType("application/vnd.ms-excel");
|
||||||
|
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
|
||||||
|
workbook.write(response.getOutputStream());
|
||||||
|
workbook.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("export")
|
||||||
|
public void export(HttpServletResponse response,@RequestParam Integer schId,@RequestParam Integer schsystemId, @RequestParam(required = false) Integer gradeId) throws IOException {
|
||||||
|
|
||||||
|
// 2. 获取科目和班级
|
||||||
|
List<SelectStrVO> subList = schDicSubjectService.select(schId, schsystemId);
|
||||||
|
if (subList == null) subList = Collections.emptyList();
|
||||||
|
List<BaseSchClassVO> schClassList = schClassService.searcBaseSchClass(schId, schsystemId, gradeId,null);
|
||||||
|
if (schClassList == null) schClassList = Collections.emptyList();
|
||||||
|
Map<Integer,String> schTeacherMap=schTeacherService.toIdAndNameMap(schId);
|
||||||
|
List<SchClassTeach> schClassTeachList=schClassTeachService.getSchClassTeachCacheList(schId,gradeId,null);
|
||||||
|
|
||||||
|
// 3. 创建工作簿
|
||||||
|
Workbook workbook = new HSSFWorkbook(); // 或 XSSFWorkbook
|
||||||
|
Sheet sheet = workbook.createSheet("教师任教导出");
|
||||||
|
|
||||||
|
// 4. 构建表头
|
||||||
|
Row headerRow = sheet.createRow(0);
|
||||||
|
int colIdx = 0;
|
||||||
|
headerRow.createCell(colIdx++).setCellValue("年级");
|
||||||
|
headerRow.createCell(colIdx++).setCellValue("班级");
|
||||||
|
for (SelectStrVO sub : subList) {
|
||||||
|
headerRow.createCell(colIdx++).setCellValue(sub.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 填充数据行
|
||||||
|
int rowIdx = 1;
|
||||||
|
for (BaseSchClassVO clzz : schClassList) {
|
||||||
|
Row row = sheet.createRow(rowIdx++);
|
||||||
|
colIdx = 0;
|
||||||
|
row.createCell(colIdx++).setCellValue(clzz.getGradeName());
|
||||||
|
row.createCell(colIdx++).setCellValue(clzz.getName());
|
||||||
|
for (SelectStrVO sub:subList) {
|
||||||
|
Optional<SchClassTeach> classTeachOpt= schClassTeachList.stream().filter(s->s.getClassId().equals(clzz.getClassId())&&s.getSubId().equals(sub.getId())).findFirst();
|
||||||
|
row.createCell(colIdx++).setCellValue(classTeachOpt.isPresent()?schTeacherMap.get(classTeachOpt.get().getTeaId()):"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 6. 自动调整列宽(可选)
|
||||||
|
for (int i = 0; i < 2 + subList.size(); i++) {
|
||||||
|
sheet.autoSizeColumn(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7. 下载
|
||||||
|
String fileName = "教师任教导出.xls";
|
||||||
|
response.setContentType("application/vnd.ms-excel");
|
||||||
|
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
|
||||||
|
workbook.write(response.getOutputStream());
|
||||||
|
workbook.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("importTeach")
|
||||||
|
public void importTeach(BoaUser authUserWithDept, UserSysRole curRole, @RequestPart("file") MultipartFile file,@RequestParam Integer schsystemId, @RequestParam(required = false) Integer gradeId) {
|
||||||
|
schClassTeachService.importTeach(UserContext.getCurrentUserInfo(),file,schsystemId,gradeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.controller.BaseController;
|
||||||
|
import com.bestsch.bschclassmanage.model.dto.SchTeacherDTO;
|
||||||
|
import com.bestsch.bschclassmanage.model.dto.TeaTransferGroupDTO;
|
||||||
|
import com.bestsch.bschclassmanage.model.dto.TeaTransferInGroupDTO;
|
||||||
|
import com.bestsch.bschclassmanage.model.excel.TeacherExcelColumn;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.PageVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SchTeacherTOutVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SchTeacherVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SelectIntVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.IComSchTreeService;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchTeacherService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.EasyPoiUtils;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/teacher/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchTeacherController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchTeacherService schTeacherService; // 使用接口
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IComSchTreeService comSchTreeService; // 使用接口
|
||||||
|
|
||||||
|
@GetMapping("search")
|
||||||
|
public PageVO<SchTeacherVO> searchSchTeacher(UserSysRole curRole,
|
||||||
|
@RequestParam(required = false) Integer groupId,
|
||||||
|
@RequestParam(required = false) String keyword,
|
||||||
|
Pageable pageable) {
|
||||||
|
return schTeacherService.searchSchTeacher(curRole.getSchId(),groupId,keyword,pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("searchTransferOut")
|
||||||
|
public PageVO<SchTeacherTOutVO> searchTransferOutTeacher(@RequestParam(required = false) Integer schId,
|
||||||
|
@RequestParam(required = false) Integer groupId,
|
||||||
|
@RequestParam(required = false) String keyword,
|
||||||
|
Pageable pageable) {
|
||||||
|
return schTeacherService.searchTransferOutTeacher(schId,groupId,keyword,pageable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("save")
|
||||||
|
public void saveTeacher(BoaUser authUserWithDept, UserSysRole curRole, @Valid @RequestBody SchTeacherDTO model) {
|
||||||
|
schTeacherService.saveTeacher(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("delete/{ids}")
|
||||||
|
public void deleteTeacher(BoaUser authUserWithDept, UserSysRole curRole,@PathVariable String ids ) {
|
||||||
|
schTeacherService.deleteTeacher(UserContext.getCurrentUserInfo(),ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("moveGroup")
|
||||||
|
public void moveGroup(BoaUser authUserWithDept, UserSysRole curRole,@Valid @RequestBody TeaTransferGroupDTO model) {
|
||||||
|
schTeacherService.moveGroup(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("setStatus")
|
||||||
|
public void setTeacherStatus(BoaUser authUserWithDept, UserSysRole curRole, String ids,Integer status){
|
||||||
|
schTeacherService.setTeacherStatus(UserContext.getCurrentUserInfo(),ids,status);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("groupSelect") // 当前用户
|
||||||
|
public List<SelectIntVO> toTeacherGroupSelect(UserSysRole curRole) {
|
||||||
|
return schTeacherService.toTeacherGroupSelect(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("groupSelectBySchId")
|
||||||
|
public List<SelectIntVO> toTeacherGroupSelect(@RequestParam Integer schId) {
|
||||||
|
return schTeacherService.toTeacherGroupSelect(schId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("select")
|
||||||
|
public List<SelectIntVO> toIdAndNameSelect(UserSysRole curRole,@RequestParam(required = false) Integer groupId) {
|
||||||
|
return schTeacherService.toIdAndNameSelect(groupId,curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("transferOutSchSelect")
|
||||||
|
public List<SelectIntVO> transferOutSchSelect() {
|
||||||
|
return schTeacherService.transferOutSchSelect();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("setTransferOut/{ids}")
|
||||||
|
public void setTransferOut(BoaUser authUserWithDept, UserSysRole curRole,@PathVariable String ids){
|
||||||
|
schTeacherService.setTransferOut(UserContext.getCurrentUserInfo(),ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("setTransferIn")
|
||||||
|
public void setTransferIn(BoaUser authUserWithDept, UserSysRole curRole,@Valid @RequestBody TeaTransferInGroupDTO model) {
|
||||||
|
schTeacherService.setTransferIn(UserContext.getCurrentUserInfo(),model);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("downloadTemplate")
|
||||||
|
public void downloadTemplate(UserSysRole curRole,HttpServletResponse response) {
|
||||||
|
List<TeacherExcelColumn> list=new ArrayList<>();
|
||||||
|
String fileName="教师导入模板";
|
||||||
|
String titleName ="教师信息导入" ;
|
||||||
|
ExportParams exportParams = new ExportParams(titleName, "");
|
||||||
|
List<SelectIntVO> teaGroupNameList = comSchTreeService.getTeaGroupNameList(curRole.getSchId(),null);
|
||||||
|
for (SelectIntVO group:teaGroupNameList)
|
||||||
|
{
|
||||||
|
TeacherExcelColumn column=new TeacherExcelColumn();
|
||||||
|
column.setGroupName(group.getName());
|
||||||
|
column.setAccount("");
|
||||||
|
column.setPassword("");
|
||||||
|
column.setTeaName("");
|
||||||
|
column.setIdCard("");
|
||||||
|
column.setTel("");
|
||||||
|
column.setGender("");
|
||||||
|
list.add(column);
|
||||||
|
}
|
||||||
|
Workbook workbook2 = ExcelExportUtil.exportExcel(exportParams, TeacherExcelColumn.class, list);
|
||||||
|
EasyPoiUtils.downLoadExcel(fileName + ".xls", response, workbook2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("importTeachers")
|
||||||
|
public void importTeachers(BoaUser authUserWithDept, UserSysRole curRole,@RequestPart("file") MultipartFile file) {
|
||||||
|
schTeacherService.importTeachers(UserContext.getCurrentUserInfo(),file);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.BaseTree;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SchSystemTreeVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SelectIntVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.IComSchTreeService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/tree/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchTreeController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IComSchTreeService comSchTreeService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("getGroupTree")
|
||||||
|
public List<BaseTree> getGroupTree()
|
||||||
|
{
|
||||||
|
return comSchTreeService.getGroupTree();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getTeacherTree")
|
||||||
|
public BaseTree getTeacherTree(UserSysRole curRole)
|
||||||
|
{
|
||||||
|
return comSchTreeService.getTeacherTree(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("getSchoolList")
|
||||||
|
public List<SelectIntVO> getSchoolList()
|
||||||
|
{
|
||||||
|
return comSchTreeService.getSchoolList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getGradeTree")
|
||||||
|
public SchSystemTreeVO getGradeTree(UserSysRole curRole)
|
||||||
|
{
|
||||||
|
return comSchTreeService.getGradeTree(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getClassTree")
|
||||||
|
public SchSystemTreeVO getClassTree(UserSysRole curRole)
|
||||||
|
{
|
||||||
|
return comSchTreeService.getClassTree(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getClassHistoryTree")
|
||||||
|
public SchSystemTreeVO getClassHistoryTree(UserSysRole curRole)
|
||||||
|
{
|
||||||
|
return comSchTreeService.getClassHistoryTree(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("getHigherSchGradeTree")
|
||||||
|
public SchSystemTreeVO getHigherSchGradeTree(UserSysRole curRole)
|
||||||
|
{
|
||||||
|
return comSchTreeService.getHigherSchGradeTree(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getHigherSchClassTree")
|
||||||
|
public SchSystemTreeVO getHigherSchClassTree(UserSysRole curRole)
|
||||||
|
{
|
||||||
|
return comSchTreeService.getHigherSchClassTree(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("getTeaTree")
|
||||||
|
public BaseTree getTeaTree(UserSysRole curRole)
|
||||||
|
{
|
||||||
|
return comSchTreeService.getTeaTree(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.annotation.OperationLog;
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchBinSchsystem;
|
||||||
|
import com.bestsch.bschclassmanage.enums.UserRole;
|
||||||
|
import com.bestsch.bschclassmanage.enums.UserType;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.AcademicStageSchsystemVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.SelectIntVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.IComSchTreeService;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchBinSchsystemService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.LogContextHolder;
|
||||||
|
import com.bestsch.bschclassmanage.utils.OtherUtil;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/schsystem/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchsystemController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchBinSchsystemService schBinSchsystemService; // 使用接口
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IComSchTreeService comSchTreeService; // 使用接口
|
||||||
|
/**
|
||||||
|
* 获取学段枚举 + 学制列表
|
||||||
|
* @return 学段分组后的学制列表
|
||||||
|
*/
|
||||||
|
@GetMapping("list")
|
||||||
|
public List<AcademicStageSchsystemVO> getAcademicStageSchsystemList(BoaUser authUserWithDept, UserSysRole curRole,
|
||||||
|
@RequestParam(required = false) Integer schId) {
|
||||||
|
|
||||||
|
int roleId = curRole.getRoleId();
|
||||||
|
boolean isSuperAdmin = UserType.SUPER_ADMINISTRATOR.getId().equals(authUserWithDept.getType());
|
||||||
|
boolean isAreaAdmin = UserRole.AREAADMIN.getValue().equals(roleId);
|
||||||
|
|
||||||
|
if (!isSuperAdmin && !isAreaAdmin) {
|
||||||
|
throw new NullPointerException("无权操作,仅超级管理员或学校管理员可设置学制");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 确定最终操作的学校ID,并校验
|
||||||
|
Integer targetSchId;
|
||||||
|
if (isAreaAdmin) {
|
||||||
|
// 区域管理员:强制使用自己所属的学校,忽略前端传入的schId
|
||||||
|
targetSchId = curRole.getSchId();
|
||||||
|
if (targetSchId == null || targetSchId <= 0) {
|
||||||
|
throw new NullPointerException("当前学校管理员未关联有效的学校");
|
||||||
|
}
|
||||||
|
} else { // 超管
|
||||||
|
if (schId == null || schId <= 0) {
|
||||||
|
throw new NullPointerException("学校ID不能为空且必须为正整数");
|
||||||
|
}
|
||||||
|
targetSchId = schId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return schBinSchsystemService.getAcademicStageSchsystemList(targetSchId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getType")
|
||||||
|
public Integer getSchType(UserSysRole curRole) {
|
||||||
|
return schBinSchsystemService.getSchType(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校选择学制
|
||||||
|
* @return 学段分组后的学制列表
|
||||||
|
*/
|
||||||
|
@PostMapping("save")
|
||||||
|
@OperationLog(module = "绑定学制")
|
||||||
|
public void saveSchBinSchsystem(BoaUser authUserWithDept, UserSysRole curRole,
|
||||||
|
@RequestParam(required = false) Integer schId,
|
||||||
|
@RequestParam("schsystemIds") String schsystemIdsStr) {
|
||||||
|
|
||||||
|
UserContext.UserInfo user= UserContext.getCurrentUserInfo();
|
||||||
|
// 2. 角色权限校验
|
||||||
|
int roleId = user.getRoleId();
|
||||||
|
boolean isSuperAdmin = UserType.SUPER_ADMINISTRATOR.getId().equals(authUserWithDept.getType());
|
||||||
|
boolean isAreaAdmin = UserRole.AREAADMIN.getValue().equals(roleId);
|
||||||
|
|
||||||
|
if (!isSuperAdmin && !isAreaAdmin) {
|
||||||
|
throw new NullPointerException("无权操作,仅超级管理员或学校管理员可设置学制");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 确定最终操作的学校ID,并校验
|
||||||
|
Integer targetSchId;
|
||||||
|
if (isAreaAdmin) {
|
||||||
|
// 区域管理员:强制使用自己所属的学校,忽略前端传入的schId
|
||||||
|
targetSchId = curRole.getSchId();
|
||||||
|
if (targetSchId == null || targetSchId <= 0) {
|
||||||
|
throw new NullPointerException("当前学校管理员未关联有效的学校");
|
||||||
|
}
|
||||||
|
} else { // 超管
|
||||||
|
if (schId == null || schId <= 0) {
|
||||||
|
throw new NullPointerException("学校ID不能为空且必须为正整数");
|
||||||
|
}
|
||||||
|
targetSchId = schId;
|
||||||
|
}
|
||||||
|
String schName= comSchTreeService.getSchoolName(targetSchId);
|
||||||
|
// 4. 转换学制ID数组
|
||||||
|
Integer[] schsystemIds = OtherUtil.convertToArray(schsystemIdsStr);
|
||||||
|
|
||||||
|
List<String> schsystemNames= schBinSchsystemService.selectSchBinSchsystem(targetSchId)
|
||||||
|
.stream().filter(s-> Arrays.asList(schsystemIds).contains(s.getId()))
|
||||||
|
.map(s->s.getName()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
LogContextHolder.setDescription(String.format("为学校 %d 绑定学制:%s", schName,String.join(",",schsystemNames) ));
|
||||||
|
if (schsystemIds == null || schsystemIds.length == 0) {
|
||||||
|
throw new NullPointerException("学制ID列表无效");
|
||||||
|
}
|
||||||
|
SchBinSchsystem entity=new SchBinSchsystem();
|
||||||
|
OtherUtil.setBaseEntityValue(user, entity);
|
||||||
|
entity.setSchId(targetSchId);
|
||||||
|
// 5. 调用服务
|
||||||
|
schBinSchsystemService.saveSchBinSchsystem(entity, schsystemIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("select")
|
||||||
|
public List<SelectIntVO> selectSchBinSchsystem(UserSysRole curRole) {
|
||||||
|
return schBinSchsystemService.selectSchBinSchsystem(curRole.getSchId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.entity.BaseYearTerm;
|
||||||
|
import com.bestsch.bschclassmanage.model.dto.BaseYearTermDTO;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.BaseYearTermVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.IBaseYearTermService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.UserContext;
|
||||||
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.API_PATH+"/yearterm/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SystemYearTermController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBaseYearTermService baseYearTermService; // 使用接口
|
||||||
|
|
||||||
|
@GetMapping("list")
|
||||||
|
public List<BaseYearTermVO> getAllYearTerm() {
|
||||||
|
return baseYearTermService.getAllYearTermVO();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("add")
|
||||||
|
public void createYearTerm(BoaUser authUserWithDept, UserSysRole curRole,
|
||||||
|
@Valid @RequestBody BaseYearTermDTO dto) {
|
||||||
|
BaseYearTerm entity = new BaseYearTerm();
|
||||||
|
entity.setCreateDate(new Date());
|
||||||
|
entity.setCreateUserId(authUserWithDept.getId());
|
||||||
|
BeanUtils.copyProperties(dto, entity);
|
||||||
|
baseYearTermService.createNowYearTerm(UserContext.getCurrentUserInfo(),entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("edit")
|
||||||
|
public void updateYearTerm(BoaUser authUserWithDept, UserSysRole curRole,
|
||||||
|
@Valid @RequestBody BaseYearTermDTO dto) {
|
||||||
|
BaseYearTerm entity = new BaseYearTerm();
|
||||||
|
entity.setUpdateDate(new Date());
|
||||||
|
entity.setUpdateUserId(authUserWithDept.getId());
|
||||||
|
BeanUtils.copyProperties(dto, entity);
|
||||||
|
baseYearTermService.updateYearTerm(UserContext.getCurrentUserInfo(),entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+9
-11
@@ -1,11 +1,11 @@
|
|||||||
package com.bestsch.classicalchinese.controller.api;
|
package com.bestsch.bschclassmanage.controller.api;
|
||||||
|
|
||||||
|
|
||||||
import com.bestsch.openapi.BoaModule;
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
import com.bestsch.openapi.BoaUser;
|
import com.bestsch.bschclassmanage.model.tool.UserSysRole;
|
||||||
import com.bestsch.openapi.BschBaseOpenApi;
|
import com.yunhai.platform.openapi.client.YschBaseOpenApi;
|
||||||
import com.bestsch.classicalchinese.config.Config;
|
import com.yunhai.platform.utils.model.BoaModule;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import com.yunhai.platform.utils.model.BoaUser;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -18,15 +18,13 @@ import java.util.List;
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(Config.API_PATH +"/base/")
|
@RequestMapping(Config.API_PATH +"/base/")
|
||||||
@CrossOrigin(origins = {"*", "*"}, allowCredentials = "true")
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
public class UserController {
|
public class UserController {
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private BschBaseOpenApi bschBaseOpenApi;
|
|
||||||
|
|
||||||
@GetMapping("getUserMod")
|
@GetMapping("getUserMod")
|
||||||
public List<BoaModule> getUserMod(BoaUser authUserWithDept) {
|
public List<BoaModule> getUserMod(BoaUser authUserWithDept, UserSysRole curRole) {
|
||||||
return bschBaseOpenApi.getUserModule(authUserWithDept.getId());
|
return YschBaseOpenApi.getUserModule(authUserWithDept.getId(),curRole.getSchId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("getUserInfo")
|
@GetMapping("getUserInfo")
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.oapi.oa;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.oa.SchInfoVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.OAPI+"/SchGroup/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchGroupController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.oapi.oa;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.oa.SchInfoVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.OAPI+"/SchInfo/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SchInfoController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchInfoService schInfoService;
|
||||||
|
|
||||||
|
@GetMapping("GetSchlist")
|
||||||
|
public ResponseEntity<List<SchInfoVO>> GetSchlist(@RequestParam(required = false)String SchIDArr) {
|
||||||
|
return ResponseEntity.ok(schInfoService.getSchVOList(SchIDArr));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("GetSchFirst")
|
||||||
|
public ResponseEntity<SchInfoVO> GetSchFirst(@RequestParam String SchID) {
|
||||||
|
return ResponseEntity.ok(schInfoService.GetSchFirst(SchID));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.oapi.oa;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.Repository.SchTeacherRepository;
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacher;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacherGroup;
|
||||||
|
import com.bestsch.bschclassmanage.enums.UserGender;
|
||||||
|
import com.bestsch.bschclassmanage.enums.UserRole;
|
||||||
|
import com.bestsch.bschclassmanage.model.oa.TeaInfoVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.oa.SchInfoVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchInfoService;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchTeacherService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.OtherUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.OAPI+"/OATea/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class TeainfoController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchTeacherService schTeacherService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SchTeacherRepository schTeacherRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchInfoService schInfoService;
|
||||||
|
|
||||||
|
@GetMapping("GetTeainfo")
|
||||||
|
public ResponseEntity<TeaInfoVO> getTeainfo(@RequestParam Integer uid) {
|
||||||
|
// 1. 参数校验
|
||||||
|
if (uid == null) {
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 直接使用 uid 查询
|
||||||
|
return schTeacherRepository.findByTeaId(uid) // 假设 findByTeaId 返回 Optional<SchTeacher>
|
||||||
|
.map(this::convertToTeaInfoVO) // 将 SchTeacher 转为 TeaInfoVO
|
||||||
|
.map(ResponseEntity::ok)
|
||||||
|
.orElse(ResponseEntity.notFound().build());
|
||||||
|
}
|
||||||
|
|
||||||
|
private TeaInfoVO convertToTeaInfoVO(SchTeacher teacher) {
|
||||||
|
if (teacher == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
TeaInfoVO vo = new TeaInfoVO();
|
||||||
|
|
||||||
|
// 直接映射
|
||||||
|
vo.setAccount(teacher.getAccount());
|
||||||
|
vo.setName(teacher.getName());
|
||||||
|
vo.setTeaIDCard(teacher.getIdCard());
|
||||||
|
vo.setTel(teacher.getTel());
|
||||||
|
vo.setTeaNo(teacher.getSort());
|
||||||
|
vo.setRole(UserRole.TEACHER_USER.getValue());
|
||||||
|
|
||||||
|
if (teacher.getGender() != null) {
|
||||||
|
String sex = UserGender.nameById(teacher.getGender());
|
||||||
|
vo.setTeaSex(sex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TeaSerID 使用 teaId(转为字符串)或 id
|
||||||
|
if (teacher.getTeaId() != null) {
|
||||||
|
vo.setTeaSerID(teacher.getTeaId().toString());
|
||||||
|
} else {
|
||||||
|
vo.setTeaSerID(teacher.getId().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SchTeacherGroup> groupList=teacher.getGroupList();
|
||||||
|
if(groupList==null||groupList.isEmpty())
|
||||||
|
return null;
|
||||||
|
|
||||||
|
// 其他字段默认 null(或根据业务设置默认值)
|
||||||
|
SchInfoVO schInfoVO= schInfoService.GetSchFirst(groupList.stream().findFirst().get().getSchId());
|
||||||
|
|
||||||
|
vo.setSchSerID(schInfoVO==null?null:schInfoVO.getSchSerId());
|
||||||
|
vo.setGroupID(groupList.stream().findFirst().get().getGroupId());
|
||||||
|
vo.setSchSerIDs(schInfoVO==null?null:schInfoVO.getSchSerId());
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("GetArrTeainfo")
|
||||||
|
public ResponseEntity<List<TeaInfoVO>> getArrTeainfo(@RequestBody String userIds) {
|
||||||
|
// 1. 参数校验
|
||||||
|
if (userIds == null) {
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Integer> uids= Arrays.asList(OtherUtil.convertToArray(userIds));
|
||||||
|
|
||||||
|
List<SchTeacher> teachers = schTeacherRepository.findByTeaIdIn(uids);
|
||||||
|
List<TeaInfoVO> voList = teachers.stream()
|
||||||
|
.map(this::convertToTeaInfoVO)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
return voList.isEmpty() ? ResponseEntity.noContent().build() : ResponseEntity.ok(voList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("GetSchTeainfo")
|
||||||
|
public ResponseEntity<List<TeaInfoVO>> getSchTeainfo(@RequestParam String SchSerID) {
|
||||||
|
// 1. 参数校验
|
||||||
|
if (SchSerID == null) {
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
SchInfoVO schInfoVO= schInfoService.GetSchFirst(SchSerID);
|
||||||
|
if(schInfoVO==null)
|
||||||
|
{
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
|
Integer schId=schInfoVO.getUserSchSerId();
|
||||||
|
|
||||||
|
List<SchTeacher> teachers = schTeacherService.getSchTeacherList(schId);
|
||||||
|
|
||||||
|
List<TeaInfoVO> voList = teachers.stream()
|
||||||
|
.map(this::convertToTeaInfoVO)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
return voList.isEmpty() ? ResponseEntity.noContent().build() : ResponseEntity.ok(voList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("GetSchTeaList")
|
||||||
|
public ResponseEntity<List<TeaInfoVO>> getSchTeaList(@RequestParam String SchSerID) {
|
||||||
|
return getSchTeainfo(SchSerID);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,177 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.oapi.oa;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.Repository.SchStudentRepository;
|
||||||
|
import com.bestsch.bschclassmanage.Repository.SchTeacherRepository;
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchStudent;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacher;
|
||||||
|
import com.bestsch.bschclassmanage.entity.SchTeacherGroup;
|
||||||
|
import com.bestsch.bschclassmanage.enums.UserRole;
|
||||||
|
import com.bestsch.bschclassmanage.enums.UserType;
|
||||||
|
import com.bestsch.bschclassmanage.model.oa.UserInfoVO;
|
||||||
|
import com.bestsch.bschclassmanage.model.vo.oa.SchInfoVO;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchInfoService;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchStudentService;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISchTeacherService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.OAPI + "/UserInfo/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class UserInfoController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchTeacherService schTeacherService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchStudentService schStudentService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SchTeacherRepository schTeacherRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SchStudentRepository schStudentRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchInfoService schInfoService;
|
||||||
|
|
||||||
|
@GetMapping("GetUserList")
|
||||||
|
public ResponseEntity<List<UserInfoVO>> getUserList(@RequestParam String SchSerID) {
|
||||||
|
// 1. 参数校验
|
||||||
|
if (SchSerID == null || SchSerID.trim().isEmpty()) {
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
SchInfoVO schInfoVO = schInfoService.GetSchFirst(SchSerID);
|
||||||
|
if (schInfoVO == null) {
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
|
Integer schId = schInfoVO.getUserSchSerId();
|
||||||
|
|
||||||
|
// 2. 获取教师和学生列表(判空)
|
||||||
|
List<SchTeacher> teachers = schTeacherService.getSchTeacherCacheList(schId);
|
||||||
|
List<SchStudent> students = schStudentService.getSchGradeClassStudentCacheList(schId, null, null, null);
|
||||||
|
|
||||||
|
// 3. 转换为 UserInfoVO
|
||||||
|
List<UserInfoVO> voList = new ArrayList<>();
|
||||||
|
if (teachers != null) {
|
||||||
|
voList.addAll(teachers.stream()
|
||||||
|
.map(this::convertToUserInfoVO)
|
||||||
|
.filter(vo -> vo != null) // 过滤转换失败的
|
||||||
|
.collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
if (students != null) {
|
||||||
|
voList.addAll(students.stream()
|
||||||
|
.map(this::convertToUserInfoVO)
|
||||||
|
.filter(vo -> vo != null)
|
||||||
|
.collect(Collectors.toList()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 返回结果
|
||||||
|
return voList.isEmpty() ? ResponseEntity.noContent().build() : ResponseEntity.ok(voList);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===== 转换教师 =====
|
||||||
|
private UserInfoVO convertToUserInfoVO(SchTeacher teacher) {
|
||||||
|
if (teacher == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
UserInfoVO vo = new UserInfoVO();
|
||||||
|
// 基础字段
|
||||||
|
vo.setUids(teacher.getAccount());
|
||||||
|
vo.setName(teacher.getName());
|
||||||
|
vo.setIDCard(teacher.getIdCard());
|
||||||
|
vo.setTel(teacher.getTel());
|
||||||
|
vo.setNo(teacher.getSort());
|
||||||
|
vo.setSex(teacher.getGender());
|
||||||
|
vo.setUserID(teacher.getTeaId()); // 教师用户ID
|
||||||
|
vo.setUsertype(1); // 假设教师类型为1
|
||||||
|
|
||||||
|
// 获取学校ID和组ID
|
||||||
|
List<SchTeacherGroup> groupList = teacher.getGroupList();
|
||||||
|
if (groupList != null && !groupList.isEmpty()) {
|
||||||
|
SchTeacherGroup firstGroup = groupList.get(0);
|
||||||
|
vo.setGroupID(firstGroup.getGroupId());
|
||||||
|
// 通过组获取学校信息
|
||||||
|
SchInfoVO schInfo = schInfoService.GetSchFirst(firstGroup.getSchId());
|
||||||
|
// 若没有直接按组查学校的方法,可改为通过组的schId查
|
||||||
|
if (schInfo != null) {
|
||||||
|
vo.setSchSerID(schInfo.getSchSerId());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 无分组,可能是管理员或特殊用户,可设置默认或 null
|
||||||
|
vo.setGroupID(null);
|
||||||
|
vo.setSchSerID(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 其他字段(如 Photo, SerID 等)如果 SchTeacher 没有,可置 null 或从别处获取
|
||||||
|
vo.setPhoto(null); // 可根据 teacher 的某字段补充
|
||||||
|
vo.setSerID(null);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===== 转换学生 =====
|
||||||
|
private UserInfoVO convertToUserInfoVO(SchStudent student) {
|
||||||
|
if (student == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
UserInfoVO vo = new UserInfoVO();
|
||||||
|
vo.setUids(student.getAccount());
|
||||||
|
vo.setName(student.getName());
|
||||||
|
vo.setIDCard(student.getIdCard());
|
||||||
|
vo.setTel(null); // 学生表可能无电话,如有则补充
|
||||||
|
vo.setNo(null); // 学生表没有 No 字段,可置 null 或从 stuClassNo 转换
|
||||||
|
vo.setSex(student.getGender());
|
||||||
|
vo.setUserID(student.getStuId()); // 学生用户ID
|
||||||
|
vo.setUsertype(UserRole.STU_USER.getValue()); // 假设学生类型为2
|
||||||
|
|
||||||
|
vo.setGroupID(student.getGroupId());
|
||||||
|
|
||||||
|
SchInfoVO schInfo = schInfoService.GetSchFirst(student.getSchId());
|
||||||
|
// 若没有直接按组查学校的方法,可改为通过组的schId查
|
||||||
|
if (schInfo != null) {
|
||||||
|
vo.setSchSerID(schInfo.getSchSerId());
|
||||||
|
}
|
||||||
|
|
||||||
|
vo.setPhoto(null);
|
||||||
|
vo.setSerID(null);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("getUserIdList")
|
||||||
|
public ResponseEntity<List<UserInfoVO>> getUserIdList(@RequestParam Integer userid) {
|
||||||
|
if (userid == null) {
|
||||||
|
return ResponseEntity.badRequest().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
Optional<SchTeacher> teacherOpt = schTeacherRepository.findByTeaId(userid);
|
||||||
|
if (teacherOpt.isPresent()) {
|
||||||
|
UserInfoVO vo = convertToUserInfoVO(teacherOpt.get());
|
||||||
|
if (vo != null) {
|
||||||
|
return ResponseEntity.ok(Collections.singletonList(vo));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Optional<SchStudent> studentOpt = schStudentRepository.findByStuId(userid);
|
||||||
|
if (studentOpt.isPresent()) {
|
||||||
|
UserInfoVO vo = convertToUserInfoVO(studentOpt.get());
|
||||||
|
if (vo != null) {
|
||||||
|
return ResponseEntity.ok(Collections.singletonList(vo));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseEntity.notFound().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.oapi.sync;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.BaseGroup;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISyncGroupService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.OtherUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.OAPI+"/group/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SyncGroupController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISyncGroupService syncGroupService;
|
||||||
|
|
||||||
|
@PostMapping("AddGroup")
|
||||||
|
public void AddGroup(@RequestBody String jsonString) {
|
||||||
|
|
||||||
|
//判断 2,"学校组" 4, "班级组"
|
||||||
|
BaseGroup group = OtherUtil.jsonParseObject(jsonString, BaseGroup.class);
|
||||||
|
syncGroupService.syncAddOrUpdate(group);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("UpdateGroup")
|
||||||
|
public void UpdateGroup(@RequestBody String jsonString) {
|
||||||
|
BaseGroup group = OtherUtil.jsonParseObject(jsonString, BaseGroup.class);
|
||||||
|
syncGroupService.syncAddOrUpdate(group);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("DeleteGroup")
|
||||||
|
public void DeleteGroup(@RequestBody String jsonString) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
package com.bestsch.bschclassmanage.controller.oapi.sync;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.config.Config;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.BaseGroup;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.BaseUser;
|
||||||
|
import com.bestsch.bschclassmanage.model.tool.DeleteUser;
|
||||||
|
import com.bestsch.bschclassmanage.service.ISyncUserService;
|
||||||
|
import com.bestsch.bschclassmanage.service.impl.sync.SyncGroupService;
|
||||||
|
import com.bestsch.bschclassmanage.service.impl.sync.SyncUserService;
|
||||||
|
import com.bestsch.bschclassmanage.utils.OtherUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(Config.OAPI+"/user/")
|
||||||
|
@CrossOrigin(originPatterns = {"*"}, allowCredentials = "true")
|
||||||
|
public class SyncUserController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISyncUserService syncUserService;
|
||||||
|
|
||||||
|
@PostMapping("AddUser")
|
||||||
|
public void AddUser(@RequestBody String jsonString) {
|
||||||
|
List<BaseUser> userlist = OtherUtil.jsonParseList(jsonString, BaseUser.class);
|
||||||
|
syncUserService.syncAddOrUpdate(userlist);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("UpdateUser")
|
||||||
|
public void UpdateUser(@RequestBody String jsonString) {
|
||||||
|
List<BaseUser> userList = OtherUtil.jsonParseList(jsonString, BaseUser.class);
|
||||||
|
syncUserService.syncAddOrUpdate(userList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("DeleteUser")
|
||||||
|
public void DeleteUser(@RequestBody String jsonString) {
|
||||||
|
List<DeleteUser> deleteUserList= OtherUtil.jsonParseList(jsonString, DeleteUser.class);
|
||||||
|
syncUserService.deleteUser(deleteUserList);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础-字典-年级表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "base_dic_grade")
|
||||||
|
public class BaseDicGrade {
|
||||||
|
/**
|
||||||
|
* 主键(更新时必须提供)
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = Update.class)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级名称
|
||||||
|
*/
|
||||||
|
@Column(name = "name", length = 255)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级编码
|
||||||
|
*/
|
||||||
|
@Column(name = "code")
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组(内部接口)
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础-字典-学科表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "base_dic_subject")
|
||||||
|
public class BaseDicSubject {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = Update.class, message = "更新时ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学科名称(不能为空,长度不超过255)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "学科名称不能为空")
|
||||||
|
@Size(max = 255, message = "学科名称长度不能超过255")
|
||||||
|
@Column(name = "name", length = 255, nullable = false)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学科编码(可为空,长度不超过255)
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "学科编码长度不能超过255")
|
||||||
|
@Column(name = "code", length = 255)
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序号(无符号两位整数,范围 0~99,可为空)
|
||||||
|
*/
|
||||||
|
@Min(value = 0, message = "序号最小为0")
|
||||||
|
@Max(value = 99, message = "序号最大为99")
|
||||||
|
@Column(name = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.model.entityField.DbFieldNames;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@MappedSuperclass
|
||||||
|
public abstract class BaseEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = BaseSchsystem.Update.class, message = "更新时ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校id
|
||||||
|
*/
|
||||||
|
@Column(name = DbFieldNames.schId)
|
||||||
|
private Integer schId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(name = DbFieldNames.create_date)
|
||||||
|
private Date createDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@Column(name = DbFieldNames.update_date)
|
||||||
|
private Date updateDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户
|
||||||
|
*/
|
||||||
|
@Column(name = DbFieldNames.create_user_id)
|
||||||
|
private Integer createUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户
|
||||||
|
*/
|
||||||
|
@Column(name = DbFieldNames.update_user_id)
|
||||||
|
private Integer updateUserId;
|
||||||
|
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础-学校学制表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "base_sch_system")
|
||||||
|
public class BaseSchsystem {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = Update.class, message = "更新时ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学制名称(长度不超过255)
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "学制名称长度不能超过255")
|
||||||
|
@Column(name = "name", length = 255)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学段编码(0学前 1小学 2初中 3高中 4高等)
|
||||||
|
*/
|
||||||
|
@Min(value = 0, message = "学段编码最小为0")
|
||||||
|
@Max(value = 4, message = "学段编码最大为4")
|
||||||
|
@Column(name = "academic_stage")
|
||||||
|
private Integer academicStage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始年级编码
|
||||||
|
*/
|
||||||
|
@Column(name = "start_grade_code")
|
||||||
|
private Integer startGradeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束年级编码
|
||||||
|
*/
|
||||||
|
@Column(name = "end_grade_code")
|
||||||
|
private Integer endGradeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 毕业年长度
|
||||||
|
*/
|
||||||
|
@Min(value = 0, message = "毕业年长度不能为负数")
|
||||||
|
@Column(name = "graduation_leng")
|
||||||
|
private Integer graduationLeng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教育类型(1基础教育 2职业教育)
|
||||||
|
*/
|
||||||
|
@Min(value = 1, message = "教育类型最小为1")
|
||||||
|
@Max(value = 2, message = "教育类型最大为2")
|
||||||
|
@Column(name = "type")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础-学制年级表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "base_sch_system_grade")
|
||||||
|
public class BaseSchsystemGrade {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = Update.class, message = "更新时ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学制id
|
||||||
|
*/
|
||||||
|
@Column(name = "sch_system_id")
|
||||||
|
private Integer schSystemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级id
|
||||||
|
*/
|
||||||
|
@Column(name = "grade_id")
|
||||||
|
private Integer gradeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级别称(长度不超过255)
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "年级别称长度不能超过255")
|
||||||
|
@Column(name = "grade_nickname", length = 255)
|
||||||
|
private String gradeNickname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学年学期表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "base_year_term")
|
||||||
|
public class BaseYearTerm {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = Update.class, message = "更新时ID不能为空")
|
||||||
|
@Column(name = "id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学年
|
||||||
|
*/
|
||||||
|
@Column(name = "year")
|
||||||
|
private Integer year;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学年开始日期
|
||||||
|
*/
|
||||||
|
@Column(name = "year_start_date")
|
||||||
|
private Date yearStartDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学年结束日期
|
||||||
|
*/
|
||||||
|
@Column(name = "year_end_date")
|
||||||
|
private Date yearEndDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第一学期开始日期
|
||||||
|
*/
|
||||||
|
@Column(name = "first_term_start_date")
|
||||||
|
private Date firstTermStartDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第一学期结束日期
|
||||||
|
*/
|
||||||
|
@Column(name = "first_term_end_date")
|
||||||
|
private Date firstTermEndDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第二学期开始日期
|
||||||
|
*/
|
||||||
|
@Column(name = "second_term_Start_date")
|
||||||
|
private Date secondTermStartDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第二学期结束日期
|
||||||
|
*/
|
||||||
|
@Column(name = "second_term_end_date")
|
||||||
|
private Date secondTermEndDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 升级日期
|
||||||
|
*/
|
||||||
|
@Column(name = "upgrade_date")
|
||||||
|
private Date upgradeDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(name = "create_date")
|
||||||
|
private Date createDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@Column(name = "update_date")
|
||||||
|
private Date updateDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户
|
||||||
|
*/
|
||||||
|
@Column(name = "create_user_id")
|
||||||
|
private Integer createUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户
|
||||||
|
*/
|
||||||
|
@Column(name = "update_user_id")
|
||||||
|
private Integer updateUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public static interface SchStuentRepository extends JpaRepository<SchTeacher, Integer>, JpaSpecificationExecutor<SchTeacher> {
|
||||||
|
|
||||||
|
boolean existsBySchIdAndName(Integer schId, String name);
|
||||||
|
|
||||||
|
boolean existsBySchIdAndNameAndIdNot(Integer schId, String name, Integer id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础-字典-年级表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "operation_log")
|
||||||
|
public class OperationLogRecord {
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Column(nullable = false)
|
||||||
|
private Integer operatorId;
|
||||||
|
|
||||||
|
@Column(nullable = false)
|
||||||
|
private LocalDateTime operateTime; // 操作时间
|
||||||
|
|
||||||
|
|
||||||
|
@Column(nullable = false)
|
||||||
|
private String operator; // 操作人
|
||||||
|
|
||||||
|
|
||||||
|
@Column(nullable = false)
|
||||||
|
private String ip; // 客户端IP
|
||||||
|
|
||||||
|
@Column(nullable = false)
|
||||||
|
private String module; // 模块名称
|
||||||
|
|
||||||
|
@Column(nullable = false, length = 3000)
|
||||||
|
private String content; // 操作内容
|
||||||
|
|
||||||
|
@Column(nullable = false)
|
||||||
|
private Integer schId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组(内部接口)
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校绑定学制表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_bin_sch_system")
|
||||||
|
public class SchBinSchsystem extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学制id(不能为空)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "学制id不能为空")
|
||||||
|
@Column(name = "sch_system_id", nullable = false)
|
||||||
|
private Integer schSystemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校班级表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_class")
|
||||||
|
public class SchClass extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级编码
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "班级编码长度不能超过255")
|
||||||
|
@Column(name = "code", length = 255)
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组id(不能为空)年级组 or 年届组
|
||||||
|
*/
|
||||||
|
@NotNull(message = "年级组id不能为空")
|
||||||
|
@Column(name = "group_grade_id", nullable = false)
|
||||||
|
private Integer groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组id(不能为空)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "班级组id不能为空")
|
||||||
|
@Column(name = "group_class_id", nullable = false)
|
||||||
|
private Integer classId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级名称(不能为空)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "班级名称不能为空")
|
||||||
|
@Size(max = 255, message = "班级名称长度不能超过255")
|
||||||
|
@Column(name = "name", length = 255, nullable = false)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级别称
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "班级别称长度不能超过255")
|
||||||
|
@Column(name = "cname", length = 255)
|
||||||
|
private String cname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班主任
|
||||||
|
*/
|
||||||
|
@Column(name = "first_teacher_id")
|
||||||
|
private Integer firstTeacherId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 副班主任
|
||||||
|
*/
|
||||||
|
@Column(name = "second_teacher_id")
|
||||||
|
private Integer secondTeacherId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级id
|
||||||
|
*/
|
||||||
|
@Column(name = "grade_id")
|
||||||
|
private Integer gradeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校区id
|
||||||
|
*/
|
||||||
|
@Column(name = "campus_id")
|
||||||
|
private Integer campusId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系部id
|
||||||
|
*/
|
||||||
|
@Column(name = "division_id")
|
||||||
|
private Integer divisionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 专业id
|
||||||
|
*/
|
||||||
|
@Column(name = "majors_id")
|
||||||
|
private Integer majorsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册年份
|
||||||
|
*/
|
||||||
|
@Column(name = "enroll_year")
|
||||||
|
private Integer enrollYear;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否毕业(默认0)
|
||||||
|
*/
|
||||||
|
@Column(name = "graduate")
|
||||||
|
private Boolean graduate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序号 K12班 根据 sort 定位 职业 班 sort 排序
|
||||||
|
*/
|
||||||
|
@Column(name = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校班级表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_class_history")
|
||||||
|
public class SchClassHistory extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学年
|
||||||
|
*/
|
||||||
|
@Column(name = "year", nullable = false)
|
||||||
|
private Integer year;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学期:1-第一学期,2-第二学期
|
||||||
|
*/
|
||||||
|
@Column(name = "term", nullable = false)
|
||||||
|
private Integer term;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级编码
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "班级编码长度不能超过255")
|
||||||
|
@Column(name = "code", length = 255)
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组id(不能为空)年级组 or 年届组
|
||||||
|
*/
|
||||||
|
@NotNull(message = "年级组id不能为空")
|
||||||
|
@Column(name = "group_grade_id", nullable = false)
|
||||||
|
private Integer groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组id(不能为空)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "班级组id不能为空")
|
||||||
|
@Column(name = "group_class_id", nullable = false)
|
||||||
|
private Integer classId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级名称(不能为空)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "班级名称不能为空")
|
||||||
|
@Size(max = 255, message = "班级名称长度不能超过255")
|
||||||
|
@Column(name = "name", length = 255, nullable = false)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级别称
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "班级别称长度不能超过255")
|
||||||
|
@Column(name = "cname", length = 255)
|
||||||
|
private String cname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班主任
|
||||||
|
*/
|
||||||
|
@Column(name = "first_teacher_id")
|
||||||
|
private Integer firstTeacherId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 副班主任
|
||||||
|
*/
|
||||||
|
@Column(name = "second_teacher_id")
|
||||||
|
private Integer secondTeacherId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级id
|
||||||
|
*/
|
||||||
|
@Column(name = "grade_id")
|
||||||
|
private Integer gradeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校区id
|
||||||
|
*/
|
||||||
|
@Column(name = "campus_id")
|
||||||
|
private Integer campusId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系部id
|
||||||
|
*/
|
||||||
|
@Column(name = "division_id")
|
||||||
|
private Integer divisionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 专业id
|
||||||
|
*/
|
||||||
|
@Column(name = "majors_id")
|
||||||
|
private Integer majorsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册年份
|
||||||
|
*/
|
||||||
|
@Column(name = "enroll_year")
|
||||||
|
private Integer enrollYear;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否毕业(默认0)
|
||||||
|
*/
|
||||||
|
@Column(name = "graduate")
|
||||||
|
private Boolean graduate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序号 K12班 根据 sort 定位 职业 班 sort 排序
|
||||||
|
*/
|
||||||
|
@Column(name = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校班级任教表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_class_teach")
|
||||||
|
public class SchClassTeach extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级id
|
||||||
|
*/
|
||||||
|
@Column(name = "grade_id")
|
||||||
|
private Integer gradeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学科id(长度不超过255)
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "学科id长度不能超过255")
|
||||||
|
@Column(name = "sub_id", length = 255)
|
||||||
|
private String subId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级id
|
||||||
|
*/
|
||||||
|
@Column(name = "class_id")
|
||||||
|
private Integer classId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教师id
|
||||||
|
*/
|
||||||
|
@Column(name = "tea_id")
|
||||||
|
private Integer teaId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校班级任教表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_class_teach_history")
|
||||||
|
public class SchClassTeachHistory extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学年
|
||||||
|
*/
|
||||||
|
@Column(name = "year", nullable = false)
|
||||||
|
private Integer year;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学期:1-第一学期,2-第二学期
|
||||||
|
*/
|
||||||
|
@Column(name = "term", nullable = false)
|
||||||
|
private Integer term;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级id
|
||||||
|
*/
|
||||||
|
@Column(name = "grade_id")
|
||||||
|
private Integer gradeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学科id(长度不超过255)
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "学科id长度不能超过255")
|
||||||
|
@Column(name = "sub_id", length = 255)
|
||||||
|
private String subId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级id
|
||||||
|
*/
|
||||||
|
@Column(name = "class_id")
|
||||||
|
private Integer classId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教师id
|
||||||
|
*/
|
||||||
|
@Column(name = "tea_id")
|
||||||
|
private Integer teaId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.model.entityField.EntityFieldNames;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校-字典-校区表
|
||||||
|
*/
|
||||||
|
@JsonIgnoreProperties({EntityFieldNames.schId , EntityFieldNames.createDate, EntityFieldNames.updateDate, EntityFieldNames.createUserId, EntityFieldNames.updateUserId })
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_dic_campus")
|
||||||
|
public class SchDicCampus extends BaseEntity{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校区名称(不能为空)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "校区名称不能为空")
|
||||||
|
@Size(max = 255, message = "校区名称长度不能超过255")
|
||||||
|
@Column(name = "name", length = 255, nullable = false)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序号(无符号整数,最小0)
|
||||||
|
*/
|
||||||
|
@Min(value = 0, message = "序号不能为负数")
|
||||||
|
@Column(name = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校-字典-课程表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_dic_course")
|
||||||
|
public class SchDicCourse extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程名称(不能为空)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "课程名称不能为空")
|
||||||
|
@Size(max = 255, message = "课程名称长度不能超过255")
|
||||||
|
@Column(name = "name", length = 255, nullable = false)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程别称
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "课程别称长度不能超过255")
|
||||||
|
@Column(name = "nickname", length = 255)
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程编码
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "课程编码长度不能超过255")
|
||||||
|
@Column(name = "code", length = 255)
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程类型(1公共课 2选修课 3专业课)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "课程类型不能为空")
|
||||||
|
@Min(value = 1, message = "课程类型最小为1")
|
||||||
|
@Max(value = 3, message = "课程类型最大为3")
|
||||||
|
@Column(name = "type")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程关联系部表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_dic_course_division")
|
||||||
|
public class SchDicCourseDivision{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = Update.class, message = "更新时ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程id
|
||||||
|
*/
|
||||||
|
@Column(name = "course_id")
|
||||||
|
private Integer courseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系部id
|
||||||
|
*/
|
||||||
|
@Column(name = "division_id")
|
||||||
|
private Integer divisionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校id
|
||||||
|
*/
|
||||||
|
@Column(name = "sch_id")
|
||||||
|
private Integer schId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程关联专业表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_dic_course_majors")
|
||||||
|
public class SchDicCourseMajors {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = Update.class, message = "更新时ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 课程id
|
||||||
|
*/
|
||||||
|
@Column(name = "course_id")
|
||||||
|
private Integer courseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 专业id
|
||||||
|
*/
|
||||||
|
@Column(name = "majors_id")
|
||||||
|
private Integer majorsId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校id
|
||||||
|
*/
|
||||||
|
@Column(name = "sch_id")
|
||||||
|
private Integer schId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.model.entityField.EntityFieldNames;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校-字典-系部表
|
||||||
|
*/
|
||||||
|
@JsonIgnoreProperties({EntityFieldNames.schId , EntityFieldNames.createDate, EntityFieldNames.updateDate, EntityFieldNames.createUserId, EntityFieldNames.updateUserId })
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_dic_division")
|
||||||
|
public class SchDicDivision extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系部名称
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "系部名称长度不能超过255")
|
||||||
|
@Column(name = "name", length = 255)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序号(无符号整数,最小0)
|
||||||
|
*/
|
||||||
|
@Min(value = 0, message = "序号不能为负数")
|
||||||
|
@Column(name = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.model.entityField.EntityFieldNames;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校-字典-专业表
|
||||||
|
*/
|
||||||
|
@JsonIgnoreProperties({EntityFieldNames.schId , EntityFieldNames.createDate, EntityFieldNames.updateDate, EntityFieldNames.createUserId, EntityFieldNames.updateUserId })
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_dic_majors")
|
||||||
|
public class SchDicMajors extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代码
|
||||||
|
*/
|
||||||
|
@Size(max = 100, message = "专业名称长度不能超过50")
|
||||||
|
@Column(name = "code")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 专业名称(原表注释误写为“校区名称”,此处纠正)
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "专业名称长度不能超过255")
|
||||||
|
@Column(name = "name", length = 255)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学制(无符号整数,最小0)
|
||||||
|
*/
|
||||||
|
@Min(value = 1, message = "学制长度大于0")
|
||||||
|
@Column(name = "schsystem_leng")
|
||||||
|
private Integer schsystemLeng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序号(无符号整数,最小0)
|
||||||
|
*/
|
||||||
|
@Min(value = 0, message = "序号不能为负数")
|
||||||
|
@Column(name = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.model.entityField.EntityFieldNames;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校-字典-学科表
|
||||||
|
*/
|
||||||
|
@JsonIgnoreProperties({EntityFieldNames.schId , EntityFieldNames.createDate, EntityFieldNames.updateDate, EntityFieldNames.createUserId, EntityFieldNames.updateUserId })
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_dic_subject")
|
||||||
|
public class SchDicSubject extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学制id(不能为空)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "学制id不能为空")
|
||||||
|
@Column(name = "sch_system_id", nullable = false)
|
||||||
|
private Integer schSystemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学科名称(不能为空)
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "学科名称不能为空")
|
||||||
|
@Size(max = 255, message = "学科名称长度不能超过255")
|
||||||
|
@Column(name = "name", length = 255, nullable = false)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学科编码
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "学科编码长度不能超过255")
|
||||||
|
@Column(name = "code", length = 255)
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否启用(默认启用)
|
||||||
|
*/
|
||||||
|
@Column(name = "enable")
|
||||||
|
private Boolean enable = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校id
|
||||||
|
*/
|
||||||
|
@Column(name = "sch_id")
|
||||||
|
private Integer schId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*数据来源 0 系统 1学校
|
||||||
|
*/
|
||||||
|
@Min(value = 0, message = "数据来源不能为负数")
|
||||||
|
@Column(name = "source")
|
||||||
|
private Integer source;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序号(无符号整数,最小0)
|
||||||
|
*/
|
||||||
|
@Min(value = 0, message = "序号不能为负数")
|
||||||
|
@Column(name = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学校班级表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_info")
|
||||||
|
public class SchInfo {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = BaseSchsystem.Update.class, message = "更新时ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Column(name = "sch_id", nullable = false)
|
||||||
|
private Integer schId;
|
||||||
|
|
||||||
|
@Column(name = "name", length = 255, nullable = false)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Column(name = "sch_serid", length = 50)
|
||||||
|
private String schSerId;
|
||||||
|
|
||||||
|
@Column(name = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_student")
|
||||||
|
public class SchStudent extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id(不能为空)
|
||||||
|
*/
|
||||||
|
@Column(name = "stu_id")
|
||||||
|
private Integer stuId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生账户
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "学生账户长度不能超过255")
|
||||||
|
@Column(name = "account", length = 255)
|
||||||
|
private String account;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "学生班级学号长度不能超过255")
|
||||||
|
@Column(name = "stu_class_no", length = 255)
|
||||||
|
private String stuClassNo;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生姓名
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "学生姓名长度不能超过255")
|
||||||
|
@Column(name = "name", length = 255)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别(0未知 1男 2女等,根据业务定义)
|
||||||
|
*/
|
||||||
|
@Column(name = "gender")
|
||||||
|
private Integer gender;
|
||||||
|
|
||||||
|
@Size(max = 255, message = "身份证长度不能超过18")
|
||||||
|
@Column(name = "id_card", length = 18)
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组id(班级)
|
||||||
|
*/
|
||||||
|
@Column(name = "group_id")
|
||||||
|
private Integer groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级id
|
||||||
|
*/
|
||||||
|
@Column(name = "class_id")
|
||||||
|
private Integer classId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0禁用 1正常)
|
||||||
|
*/
|
||||||
|
@Column(name = "status")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常状态(正常、休学、出国、留学、复学、停学、自愿退学、自愿留级、自愿降级、其他)
|
||||||
|
*/
|
||||||
|
@Column(name = "abnormal_status")
|
||||||
|
private Integer abnormalStatus;
|
||||||
|
|
||||||
|
@Column(name = "abnormal_date")
|
||||||
|
private Date abnormalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转入状态(转出0,转入1)
|
||||||
|
*/
|
||||||
|
@Column(name = "transfer_status")
|
||||||
|
private Integer transferStatus;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邀请码
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "邀请码长度不能超过255")
|
||||||
|
@Column(name = "invitation_code", length = 255)
|
||||||
|
private String invitationCode;
|
||||||
|
|
||||||
|
@Column(name = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_student_history")
|
||||||
|
public class SchStudentHistory extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学年
|
||||||
|
*/
|
||||||
|
@Column(name = "year", nullable = false)
|
||||||
|
private Integer year;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学期:1-第一学期,2-第二学期
|
||||||
|
*/
|
||||||
|
@Column(name = "term", nullable = false)
|
||||||
|
private Integer term;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id(不能为空)
|
||||||
|
*/
|
||||||
|
@Column(name = "stu_id")
|
||||||
|
private Integer stuId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生账户
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "学生账户长度不能超过255")
|
||||||
|
@Column(name = "account", length = 255)
|
||||||
|
private String account;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "学生班级学号长度不能超过255")
|
||||||
|
@Column(name = "stu_class_no", length = 255)
|
||||||
|
private String stuClassNo;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学生姓名
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "学生姓名长度不能超过255")
|
||||||
|
@Column(name = "name", length = 255)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别(0未知 1男 2女等,根据业务定义)
|
||||||
|
*/
|
||||||
|
@Column(name = "gender")
|
||||||
|
private Integer gender;
|
||||||
|
|
||||||
|
@Size(max = 255, message = "身份证长度不能超过18")
|
||||||
|
@Column(name = "id_card", length = 18)
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组id(班级)
|
||||||
|
*/
|
||||||
|
@Column(name = "group_id")
|
||||||
|
private Integer groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级Id
|
||||||
|
*/
|
||||||
|
@Column(name = "grade_id")
|
||||||
|
private Integer gradeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班级id
|
||||||
|
*/
|
||||||
|
@Column(name = "class_id")
|
||||||
|
private Integer classId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0禁用 1正常)
|
||||||
|
*/
|
||||||
|
@Column(name = "status")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异常状态(正常、休学、出国、留学、复学、停学、自愿退学、自愿留级、自愿降级、其他)
|
||||||
|
*/
|
||||||
|
@Column(name = "abnormal_status")
|
||||||
|
private Integer abnormalStatus;
|
||||||
|
|
||||||
|
@Column(name = "abnormal_date")
|
||||||
|
private Date abnormalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转入状态(转出0,转入1)
|
||||||
|
*/
|
||||||
|
@Column(name = "transfer_status")
|
||||||
|
private Integer transferStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邀请码
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "邀请码长度不能超过255")
|
||||||
|
@Column(name = "invitation_code", length = 255)
|
||||||
|
private String invitationCode;
|
||||||
|
|
||||||
|
@Column(name = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.model.entityField.DbFieldNames;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教师表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_teacher")
|
||||||
|
public class SchTeacher {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = BaseSchsystem.Update.class, message = "更新时ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id(不能为空)
|
||||||
|
*/
|
||||||
|
@Column(name = "tea_id")
|
||||||
|
private Integer teaId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教师账户
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "教师账户长度不能超过255")
|
||||||
|
@Column(name = "account", length = 255)
|
||||||
|
private String account;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教师姓名
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "教师姓名长度不能超过255")
|
||||||
|
@Column(name = "name", length = 255)
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 性别(0未知 1男 2女等,根据业务定义)
|
||||||
|
*/
|
||||||
|
@Column(name = "gender")
|
||||||
|
private Integer gender;
|
||||||
|
|
||||||
|
@Pattern(regexp = "^$|^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[\\dXx]$",
|
||||||
|
message = "身份证号码格式不正确(若填写必须为18位有效格式)")
|
||||||
|
@Column(name = "id_card", length = 18)
|
||||||
|
private String idCard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "联系电话长度不能超过255")
|
||||||
|
@Column(name = "tel", length = 255)
|
||||||
|
private String tel;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态(0禁用 1正常)
|
||||||
|
*/
|
||||||
|
@Column(name = "status")
|
||||||
|
private int status;
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@Column(name = DbFieldNames.create_date)
|
||||||
|
private Date createDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@Column(name = DbFieldNames.update_date)
|
||||||
|
private Date updateDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户
|
||||||
|
*/
|
||||||
|
@Column(name = DbFieldNames.create_user_id)
|
||||||
|
private Integer createUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户
|
||||||
|
*/
|
||||||
|
@Column(name = DbFieldNames.update_user_id)
|
||||||
|
private Integer updateUserId;
|
||||||
|
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
private List<SchTeacherGroup> groupList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import com.bestsch.bschclassmanage.model.entityField.DbFieldNames;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教师 年级学科组
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_teacher_custom_group")
|
||||||
|
public class SchTeacherCustomGroup extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组名
|
||||||
|
*/
|
||||||
|
@Size(max = 255, message = "组名长度不能超过255")
|
||||||
|
@Column(name = "group_name", length = 255)
|
||||||
|
private String groupName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型 1年级组 2教研组 3备课组
|
||||||
|
*/
|
||||||
|
@Column(name = "group_type", nullable = false)
|
||||||
|
private Integer groupType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组长
|
||||||
|
*/
|
||||||
|
@Column(name = "leader_id")
|
||||||
|
private Integer leaderId;
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "sort")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础-学制年级表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_teacher_custom_group_in_grade")
|
||||||
|
public class SchTeacherCustomGroupInGrade {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = Update.class, message = "更新时ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级学科组ID
|
||||||
|
*/
|
||||||
|
@Column(name = "cg_group_id")
|
||||||
|
private Integer cgGroupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级id
|
||||||
|
*/
|
||||||
|
@Column(name = "grade_id")
|
||||||
|
private Integer gradeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础-学制年级表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_teacher_custom_group_in_subject")
|
||||||
|
public class SchTeacherCustomGroupInSubject {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = Update.class, message = "更新时ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级学科组ID
|
||||||
|
*/
|
||||||
|
@Column(name = "cg_group_id")
|
||||||
|
private Integer cgGroupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 学科ID
|
||||||
|
*/
|
||||||
|
@Column(name = "sub_id")
|
||||||
|
private String subId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础-学制年级表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_teacher_custom_group_in_teacher")
|
||||||
|
public class SchTeacherCustomGroupInTeacher {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = Update.class, message = "更新时ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年级 教研 备课组ID
|
||||||
|
*/
|
||||||
|
@Column(name = "cg_group_id")
|
||||||
|
private Integer cgGroupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1 组长 2组员
|
||||||
|
*/
|
||||||
|
@Column(name = "group_type")
|
||||||
|
private Integer groupType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教师ID
|
||||||
|
*/
|
||||||
|
@Column(name = "tea_id")
|
||||||
|
private Integer teaId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 教师组
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "sch_teacher_group")
|
||||||
|
public class SchTeacherGroup {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@NotNull(groups = BaseSchsystem.Update.class, message = "更新时ID不能为空")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id(不能为空)
|
||||||
|
*/
|
||||||
|
@NotNull(message = "教师id不能为空")
|
||||||
|
@Column(name = "tea_id", nullable = false)
|
||||||
|
private Integer teaId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "组id不能为空")
|
||||||
|
@Column(name = "group_id")
|
||||||
|
private Integer groupId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转入状态(转出0,转入1)
|
||||||
|
*/
|
||||||
|
@Column(name = "transfer_status")
|
||||||
|
private Integer transferStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组id
|
||||||
|
*/
|
||||||
|
@NotNull(message = "学校id不能为空")
|
||||||
|
@Column(name = "schId")
|
||||||
|
private Integer schId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新校验分组
|
||||||
|
*/
|
||||||
|
public @interface Update {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.bestsch.bschclassmanage.entity;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 基础-字典-年级表
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "upgrade_log")
|
||||||
|
public class UpgradeLog {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@Column(name = "sch_id", nullable = false)
|
||||||
|
private Integer schId;
|
||||||
|
|
||||||
|
@Column(name = "sys_id", nullable = false)
|
||||||
|
private Integer sysId;
|
||||||
|
|
||||||
|
@Column(nullable = false)
|
||||||
|
private Integer year;
|
||||||
|
|
||||||
|
@Column(name = "upgrade_time", nullable = false)
|
||||||
|
private Date upgradeTime;
|
||||||
|
|
||||||
|
@Column(name = "status", nullable = false)
|
||||||
|
private Boolean status;
|
||||||
|
|
||||||
|
// 建议提供一个便捷构造方法
|
||||||
|
public UpgradeLog(Integer schId, Integer sysId, Integer year, Date upgradeTime,Boolean status) {
|
||||||
|
this.schId = schId;
|
||||||
|
this.sysId = sysId;
|
||||||
|
this.year = year;
|
||||||
|
this.upgradeTime = upgradeTime;
|
||||||
|
this.status=status;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.bestsch.bschclassmanage.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum AcademicStage
|
||||||
|
{
|
||||||
|
PRESCHOOL(0, "学前"),
|
||||||
|
PRIMARY(1, "小学"),
|
||||||
|
JUNIOR(2, "初中"),//106
|
||||||
|
SENIOR(3, "高中"),//108
|
||||||
|
HIGHER_EDUCATION(4, "高等");
|
||||||
|
|
||||||
|
private Integer key;
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
public static List<AcademicStage> list()
|
||||||
|
{
|
||||||
|
return new ArrayList<>(EnumSet.allOf(AcademicStage.class));
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user