@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="true" />
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="StudentManagerSystemApi" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||
<module name="StudentManagerSystemApi" options="-parameters" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="ContinueStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
||||
@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="aliyun" />
|
||||
<option name="name" value="aliyun" />
|
||||
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="17" project-jdk-type="JavaSDK" />
|
||||
</project>
|
||||
@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<!-- Spring Boot 启动父依赖 -->
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.cow.horse</groupId>
|
||||
<artifactId>StudentManagerSystemApi</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>StudentManagerSystemApi</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
|
||||
<properties>
|
||||
<mybatis-spring-boot>1.2.0</mybatis-spring-boot>
|
||||
<mysql-connector>5.1.39</mysql-connector>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- 阿里fastjson包JSON转换-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.62</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Boot Web 依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- MySQL 连接驱动依赖 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.47</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.mchange</groupId>
|
||||
<artifactId>c3p0</artifactId>
|
||||
<version>0.9.5.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 分页插件 -->
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.4.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Boot Mybatis 依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- Junit -->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
</dependency>
|
||||
|
||||
<!--token-->
|
||||
<dependency>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<defaultGoal>compile</defaultGoal>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/webapp</directory>
|
||||
<targetPath>META-INF/resources</targetPath>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>aliyun</id>
|
||||
<name>aliyun</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||
<layout>default</layout>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>never</updatePolicy>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>never</updatePolicy>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>aliyun</id>
|
||||
<name>aliyun</name>
|
||||
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
@ -0,0 +1,79 @@
|
||||
package com.cow.horse.dao.Course;
|
||||
|
||||
import com.github.pagehelper.PageRowBounds;
|
||||
import com.cow.horse.dto.Course;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 课程信息mapper层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/11 15:02
|
||||
**/
|
||||
@Mapper
|
||||
public interface CourseMapper {
|
||||
/**
|
||||
* description: 新增课程信息
|
||||
* @param course
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @Date 2020/3/4 23:05
|
||||
*/
|
||||
void addCourse(Course course);
|
||||
|
||||
/**
|
||||
* description: 删除课程信息
|
||||
*
|
||||
* @param ids
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void delete(@Param("ids") List<Long> ids);
|
||||
|
||||
/**
|
||||
* description: 修改课程信息
|
||||
*
|
||||
* @param course
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void update(Course course);
|
||||
/**
|
||||
* description: 获取课程信息
|
||||
* param: rowBounds
|
||||
* param: condition
|
||||
* return: List<Course>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/11 15:03
|
||||
*/
|
||||
List<Course> getCourseList(PageRowBounds rowBounds, @Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 查看课程最大id
|
||||
* return: Integer
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/11 15:03
|
||||
*/
|
||||
String checkCodeCount(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 根据专业、学期获取课程列表
|
||||
* @param: condition
|
||||
* return: List<Course>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/31 22:29
|
||||
*/
|
||||
List<Course> getCourseByMap(@Param("condition") Map<String, Object> condition);
|
||||
|
||||
/**
|
||||
* description: 根据课程id获取课程信息
|
||||
* @param: String
|
||||
* return: Course
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/31 22:29
|
||||
*/
|
||||
Course getCourseById(@Param("courseId") String courseId);
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
package com.cow.horse.dao.Score;
|
||||
|
||||
import com.github.pagehelper.PageRowBounds;
|
||||
import com.cow.horse.dto.Course;
|
||||
import com.cow.horse.dto.Score;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 分数信息 Mapper层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/14 16:25
|
||||
**/
|
||||
@Mapper
|
||||
public interface ScoreMapper {
|
||||
/**
|
||||
* description: 教师用户根据专业等获取课程信息
|
||||
* param: rowBounds
|
||||
* param: condition
|
||||
* return: List<Course>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/11 15:03
|
||||
*/
|
||||
List<Course> getCourseByMap(PageRowBounds rowBounds, @Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 管理员用户根据专业、班级查询所有分数信息
|
||||
* @param: condition
|
||||
* return: List<Course>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/1 11:27
|
||||
*/
|
||||
List<Course> getCourseByAdmin(PageRowBounds rowBounds, @Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 学生用户根据学生id获取所有分数信息
|
||||
* @param: condition
|
||||
* return: List<Course>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/1 17:37
|
||||
*/
|
||||
List<Course> getCourseByStudent(PageRowBounds rowBounds, @Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 根据学生id和课程名获取分数信息
|
||||
* @param: condition
|
||||
* return: Course
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/1 11:36
|
||||
*/
|
||||
Course getScoreById(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 录入成绩
|
||||
* @param: Score
|
||||
* return: void
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/19 16:23
|
||||
*/
|
||||
void addEntry(Score score);
|
||||
/**
|
||||
* description: 修改成绩
|
||||
* @param: Score
|
||||
* return: void
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/20 11:52
|
||||
*/
|
||||
void updateEntry(Score score);
|
||||
/**
|
||||
* description: 查看是否录入成绩
|
||||
* return: Integer
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/11 15:03
|
||||
*/
|
||||
Integer checkCount(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 教师用户获取导出成绩列表
|
||||
* @param: condition
|
||||
* return: List<Course>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/21 16:27
|
||||
*/
|
||||
List<Course> getExportList(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 管理员用户获取导出成绩列表
|
||||
* @param: condition
|
||||
* return: List<Course>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/21 16:27
|
||||
*/
|
||||
List<Course> getExportListByAdmin(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 学生用户获取导出成绩列表
|
||||
* @param: condition
|
||||
* return: List<Course>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/1 17:38
|
||||
*/
|
||||
List<Course> getExportListByStudent(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 根据学生id获取所有课程的绩点和学分
|
||||
* @param: condition
|
||||
* return: List<Course>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/12 23:03
|
||||
*/
|
||||
List<Course> getStudentTotal(@Param("condition") Map<String, Object> condition);
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package com.cow.horse.dao.TeacherCourse;
|
||||
|
||||
import com.cow.horse.domain.TeacherCourse;
|
||||
import com.cow.horse.dto.Course;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 教师课程Mapper层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/29 15:13
|
||||
**/
|
||||
@Mapper
|
||||
public interface TeacherCourseMapper {
|
||||
/**
|
||||
* description: 新增
|
||||
* @param teacherCourse
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
void add(TeacherCourse teacherCourse);
|
||||
|
||||
/**
|
||||
* description: 删除
|
||||
*
|
||||
* @param ids
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void delete(@Param("ids") List<Integer> ids);
|
||||
|
||||
/**
|
||||
* description: 修改
|
||||
*
|
||||
* @param teacherCourse
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void update(TeacherCourse teacherCourse);
|
||||
|
||||
/**
|
||||
* description: 根据教师id获取教师课程信息
|
||||
* @param: String
|
||||
* return: List<TeacherCourse>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/29 14:33
|
||||
*/
|
||||
List<TeacherCourse> getCourseListById(@Param("id") String id);
|
||||
/**
|
||||
* description: 获取教师id和专业获取班级、课程名
|
||||
* @param:
|
||||
* return:
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/4 20:54
|
||||
*/
|
||||
List<TeacherCourse> getGradeInfoByMap(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 根据专业、班级和课程名获取所授课的教师id
|
||||
* @param: condition
|
||||
* return: String
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/7 16:17
|
||||
*/
|
||||
String getTeacherId(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 课程表中获取课程详细信息
|
||||
* @param: condition
|
||||
* return: TeacherCourse
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/9 17:31
|
||||
*/
|
||||
Course getCourseInfo(@Param("condition") Map<String, Object> condition);
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.cow.horse.dao.Upload;
|
||||
|
||||
import com.cow.horse.domain.Upload;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 上传
|
||||
* Author: cow.horse
|
||||
* Date: 2020/4/29 12:47
|
||||
**/
|
||||
@Mapper
|
||||
public interface UploadMapper {
|
||||
/**
|
||||
* description: 上传头像
|
||||
*
|
||||
* @param: condition
|
||||
* return: void
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/29 11:41
|
||||
*/
|
||||
void add(Upload upload);
|
||||
/**
|
||||
* description: 获取头像
|
||||
* @param: condition
|
||||
* return: String
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/29 14:03
|
||||
*/
|
||||
String getHead(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 根据用户id和等级查询用户是否存在
|
||||
* @param: condition
|
||||
* return: Integer
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/29 14:19
|
||||
*/
|
||||
Integer checkCount(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 修改用户头像
|
||||
* @param: upload
|
||||
* return: void
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/29 14:21
|
||||
*/
|
||||
void update(Upload upload);
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
package com.cow.horse.dao.User;
|
||||
|
||||
import com.github.pagehelper.PageRowBounds;
|
||||
import com.cow.horse.dto.User;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 管理员账号Mapper层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/28 11:08
|
||||
**/
|
||||
@Mapper
|
||||
public interface AdminMapper {
|
||||
/**
|
||||
* description: 新增管理员账号信息
|
||||
* @param user
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
void add(User user);
|
||||
|
||||
/**
|
||||
* description: 删除管理员账号
|
||||
*
|
||||
* @param ids
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void delete(@Param("ids") List<Integer> ids);
|
||||
|
||||
/**
|
||||
* description: 修改管理员账号
|
||||
*
|
||||
* @param user
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void update(User user);
|
||||
|
||||
/**
|
||||
* description: 获取管理员账号信息列表
|
||||
* @param rowBounds
|
||||
* @author cow.horse
|
||||
* @return java.util.List<com.zjh.sms.dto.User>
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
List<User> getAdminList(PageRowBounds rowBounds, @Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 根据管理员id获取管理员信息
|
||||
* @param: String
|
||||
* return: User
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/30 23:43
|
||||
*/
|
||||
User getUserById(@Param("id") String id);
|
||||
/**
|
||||
* description: 查看管理员人数
|
||||
* return: Integer
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/11 15:03
|
||||
*/
|
||||
Integer checkCodeCount();
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package com.cow.horse.dao.User;
|
||||
|
||||
import com.github.pagehelper.PageRowBounds;
|
||||
import com.cow.horse.dto.User;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 学生用户mapper层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/7 15:11
|
||||
**/
|
||||
@Mapper
|
||||
public interface StudentMapper {
|
||||
/**
|
||||
* description: 新增学生账号信息
|
||||
* @param user
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
void addStudent(User user);
|
||||
|
||||
/**
|
||||
* description: 删除学生账号
|
||||
*
|
||||
* @param ids
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void delete(@Param("ids") List<String> ids);
|
||||
|
||||
/**
|
||||
* description: 修改学生账号
|
||||
*
|
||||
* @param user
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void update(User user);
|
||||
|
||||
/**
|
||||
* description: 获取学生账号信息列表
|
||||
* @param rowBounds
|
||||
* @author cow.horse
|
||||
* @return java.util.List<com.zjh.sms.dto.User>
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
List<User> getStudentList(PageRowBounds rowBounds, @Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description:
|
||||
* @param:
|
||||
* return:
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/27 22:14
|
||||
*/
|
||||
List<User> getStudentTree();
|
||||
/**
|
||||
* description: 根据专业获取该专业下的所有班级
|
||||
* @param: String
|
||||
* return: List<String>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/28 11:46
|
||||
*/
|
||||
List<String> getGradeByProfession(@Param("code") String code);
|
||||
/**
|
||||
* description: 查看人数
|
||||
* return: Integer
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/11 15:03
|
||||
*/
|
||||
Integer checkCodeCount(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 根据id获取管理员信息
|
||||
* @param:
|
||||
* return:
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/30 23:43
|
||||
*/
|
||||
User getUserById(@Param("id") String id);
|
||||
/**
|
||||
* description: 根据id获取学生信息
|
||||
* @param:
|
||||
* return:
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/7 21:13
|
||||
*/
|
||||
User getStudentById(@Param("id") String id);
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.cow.horse.dao.User;
|
||||
|
||||
import com.github.pagehelper.PageRowBounds;
|
||||
import com.cow.horse.dto.User;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 教师用户mapper层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/7 15:11
|
||||
**/
|
||||
@Mapper
|
||||
public interface TeacherMapper {
|
||||
|
||||
/**
|
||||
* description: 新增教师账号信息
|
||||
* @param user
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
void addTeacher(User user);
|
||||
|
||||
/**
|
||||
* description: 删除教师账号
|
||||
*
|
||||
* @param ids
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void delete(@Param("ids") List<Integer> ids);
|
||||
|
||||
/**
|
||||
* description: 修改教师账号
|
||||
*
|
||||
* @param user
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void update(User user);
|
||||
|
||||
/**
|
||||
* description: 获取教师账号信息列表
|
||||
* @param rowBounds
|
||||
* @author cow.horse
|
||||
* @return java.util.List<com.zjh.sms.dto.User>
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
List<User> getTeacherList(PageRowBounds rowBounds, @Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description:
|
||||
* @param:
|
||||
* return:
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/30 23:43
|
||||
*/
|
||||
User getUserById(@Param("id") String id);
|
||||
/**
|
||||
* description: 查看人数
|
||||
* return: Integer
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/11 15:03
|
||||
*/
|
||||
Integer checkCodeCount();
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package com.cow.horse.dao.User;
|
||||
|
||||
import com.cow.horse.dto.User;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 登陆用户mapper层
|
||||
* Author: cow.horse
|
||||
* Date2019/10/21 21:08
|
||||
**/
|
||||
@Mapper
|
||||
public interface UserMapper {
|
||||
/**
|
||||
* description: 根据学生用户、密码登陆
|
||||
* @params: condition
|
||||
* @return: com.zjh.sms.dto.User
|
||||
* @Author: cow.horse
|
||||
* @Date: 2021/10/21 21:05
|
||||
*/
|
||||
User getStudentInfo(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 根据老师用户、密码登陆
|
||||
* @params: condition
|
||||
* @return: com.zjh.sms.dto.User
|
||||
* @Author: cow.horse
|
||||
* @Date: 2021/10/21 21:05
|
||||
*/
|
||||
User getTeacherInfo(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 根据管理员用户、密码登陆
|
||||
* @params: condition
|
||||
* @return: com.zjh.sms.dto.User
|
||||
* @Author: cow.horse
|
||||
* @Date: 2021/10/21 21:05
|
||||
*/
|
||||
User getAdminInfo(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 修改密码
|
||||
* @params: condition
|
||||
* @return: void
|
||||
* @Author: cow.horse
|
||||
* @Date: 2022/3/4 23:05
|
||||
*/
|
||||
void update(@Param("condition") Map<String, Object> condition);
|
||||
/**
|
||||
* description: 查询是否与原密码相同
|
||||
* @params: condition
|
||||
* @return: Integer
|
||||
* @Author: cow.horse
|
||||
* @Date: 2022/3/4 23:05
|
||||
*/
|
||||
Integer checkPasswordCount(@Param("condition") Map<String, Object> condition);
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.cow.horse.dao.WeekCourse;
|
||||
|
||||
import com.cow.horse.domain.WeekCourse;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 课程表具体安排Mapper层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/4/7 16:46
|
||||
**/
|
||||
@Mapper
|
||||
public interface WeekCourseMapper {
|
||||
/**
|
||||
* description: 新增week表数据
|
||||
* @param weekCourse
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
void add(WeekCourse weekCourse);
|
||||
/**
|
||||
* description: 修改week表
|
||||
* @param: WeekCourse
|
||||
* return: void
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/7 17:46
|
||||
*/
|
||||
void update(WeekCourse weekCourse);
|
||||
/**
|
||||
* description: 根据专业班级获取课程表信息
|
||||
* @param: condition
|
||||
* return: List<WeekCourse>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/7 17:16
|
||||
*/
|
||||
List<WeekCourse> getWeekCourse(@Param("condition") Map<String, Object> condition);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.cow.horse.service.Course;
|
||||
|
||||
import com.cow.horse.dto.Course;
|
||||
import com.cow.horse.utils.PagingResult;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 课程信息service层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/11 14:49
|
||||
**/
|
||||
public interface CourseService {
|
||||
/**
|
||||
* description: 新增课程信息
|
||||
* @param course
|
||||
* return void
|
||||
* @author cow.horse
|
||||
* @Date 2020/3/4 23:05
|
||||
*/
|
||||
void addCourse(Course course);
|
||||
/**
|
||||
* description: 删除课程信息
|
||||
*
|
||||
* @param ids
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void delete(List<Long> ids);
|
||||
|
||||
/**
|
||||
* description: 修改课程信息
|
||||
*
|
||||
* @param course
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void update(Course course);
|
||||
/**
|
||||
* description: 查询课程信息
|
||||
* @param: rowBounds
|
||||
* @param: condition
|
||||
* return: com.jw.zjh.sms.utils.PagingResult
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/11 14:49
|
||||
*/
|
||||
PagingResult<Course> getCourseList(RowBounds rowBounds, Map<String, Object> condition);
|
||||
/**
|
||||
* description: 根据专业、学期获取课程列表
|
||||
* @param: Map<String, Object> condition
|
||||
* return: List<Course>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/31 22:28
|
||||
*/
|
||||
List<Course> getCourseByMap(Map<String, Object> condition);
|
||||
}
|
||||
|
||||
@ -0,0 +1,99 @@
|
||||
package com.cow.horse.service.Course.impl;
|
||||
|
||||
import com.cow.horse.dao.Course.CourseMapper;
|
||||
import com.cow.horse.dao.CourseInfo.CourseInfoMapper;
|
||||
import com.cow.horse.dao.Profession.ProfessionMapper;
|
||||
import com.cow.horse.domain.CourseInfo;
|
||||
import com.cow.horse.domain.Profession;
|
||||
import com.cow.horse.dto.Course;
|
||||
import com.cow.horse.service.Course.CourseService;
|
||||
import com.cow.horse.utils.PagingResult;
|
||||
import com.github.pagehelper.PageRowBounds;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 课程信息业务层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/11 14:49
|
||||
**/
|
||||
@Service
|
||||
public class CourseServiceImpl implements CourseService {
|
||||
@Resource
|
||||
private CourseMapper courseMapper;
|
||||
@Resource
|
||||
private CourseInfoMapper courseInfoMapper;
|
||||
@Resource
|
||||
private ProfessionMapper professionMapper;
|
||||
|
||||
@Override
|
||||
public void addCourse(Course course) {
|
||||
Profession profession = professionMapper.getProfessionIdByName(course.getProfession());
|
||||
String id = "";
|
||||
String str = course.getYear().toString() + "0" + profession.getId() + course.getTerm();
|
||||
Map<String, Object> condition = new HashMap<>();
|
||||
condition.put("profession", course.getProfession());
|
||||
condition.put("year", course.getYear());
|
||||
String value = courseMapper.checkCodeCount(condition);
|
||||
String strValue = "";
|
||||
if (value != null) {
|
||||
int num = Integer.parseInt(value.substring(value.length() - 3)) + 1;
|
||||
if (num < 10) {
|
||||
strValue = "00" + Integer.toString(num);
|
||||
} else if (num < 100) {
|
||||
strValue = "0" + Integer.toString(num);
|
||||
} else {
|
||||
strValue = Integer.toString(num);
|
||||
}
|
||||
} else {
|
||||
strValue = "001";
|
||||
}
|
||||
id = str + strValue;
|
||||
course.setId(id);
|
||||
courseMapper.addCourse(course);
|
||||
|
||||
courseInfoMapper.deleteInfo(id);
|
||||
// 新增课程的周数等
|
||||
CourseInfo courseInfo = new CourseInfo();
|
||||
courseInfo.setStart(1);
|
||||
courseInfo.setEnd(25);
|
||||
courseInfo.setCourseId(id);
|
||||
courseInfo.setProfession(course.getProfession());
|
||||
courseInfoMapper.addCourseInfo(courseInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(List<Long> ids) {
|
||||
courseMapper.delete(ids);
|
||||
for (Long id : ids) {
|
||||
courseInfoMapper.deleteInfo(Long.toString(id));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Course course) {
|
||||
courseMapper.update(course);
|
||||
CourseInfo courseInfo = new CourseInfo();
|
||||
courseInfo.setProfession(course.getProfession());
|
||||
courseInfo.setCourseId(course.getId());
|
||||
courseInfoMapper.updateCourseInfo(courseInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PagingResult<Course> getCourseList(RowBounds rowBounds, Map<String, Object> condition) {
|
||||
PageRowBounds pageRowBounds = new PageRowBounds(rowBounds.getOffset(), rowBounds.getLimit());
|
||||
List<Course> CourseList = courseMapper.getCourseList(pageRowBounds, condition);
|
||||
return new PagingResult<>(CourseList, pageRowBounds.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Course> getCourseByMap(Map<String, Object> condition) {
|
||||
return courseMapper.getCourseByMap(condition);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.cow.horse.service.Profession;
|
||||
|
||||
import com.cow.horse.domain.Profession;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description 专业信息Service层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/31 17:31
|
||||
**/
|
||||
public interface ProfessionService {
|
||||
/**
|
||||
* description: 获取专业
|
||||
* return:
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/31 17:31
|
||||
*/
|
||||
List<Profession> getProfessionList();
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.cow.horse.service.Profession.impl;
|
||||
|
||||
import com.cow.horse.dao.Profession.ProfessionMapper;
|
||||
import com.cow.horse.domain.Profession;
|
||||
import com.cow.horse.service.Profession.ProfessionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/31 17:33
|
||||
**/
|
||||
@Service
|
||||
public class ProfessionServiceImpl implements ProfessionService {
|
||||
@Resource
|
||||
private ProfessionMapper professionMapper;
|
||||
|
||||
@Override
|
||||
public List<Profession> getProfessionList() {
|
||||
return professionMapper.getProfessionList();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,232 @@
|
||||
package com.cow.horse.service.Score.impl;
|
||||
|
||||
import com.cow.horse.dao.Score.ScoreMapper;
|
||||
import com.cow.horse.dto.Course;
|
||||
import com.cow.horse.dto.Score;
|
||||
import com.cow.horse.service.Score.ScoreService;
|
||||
import com.cow.horse.utils.PagingResult;
|
||||
import com.github.pagehelper.PageRowBounds;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Description
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/13 15:49
|
||||
**/
|
||||
@Service
|
||||
public class ScoreServiceImpl implements ScoreService {
|
||||
@Autowired
|
||||
private ScoreMapper scoreMapper;
|
||||
|
||||
@Override
|
||||
public PagingResult<Course> getCourseList(RowBounds rowBounds, Map<String, Object> condition) {
|
||||
PageRowBounds pageRowBounds = new PageRowBounds(rowBounds.getOffset(), rowBounds.getLimit());
|
||||
List<Course> courseList = new ArrayList<>();
|
||||
switch (condition.get("level").toString()) {
|
||||
case "0":
|
||||
courseList = scoreMapper.getCourseByAdmin(pageRowBounds, condition);
|
||||
for (Course course : courseList) {
|
||||
adminCourseMethod(course);
|
||||
}
|
||||
break;
|
||||
case "1":
|
||||
courseList = scoreMapper.getCourseByMap(pageRowBounds, condition);
|
||||
break;
|
||||
case "2":
|
||||
courseList = scoreMapper.getCourseByStudent(pageRowBounds, condition);
|
||||
}
|
||||
return new PagingResult<>(courseList, pageRowBounds.getTotal());
|
||||
}
|
||||
|
||||
private void adminCourseMethod(Course course) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", course.getNo());
|
||||
map.put("courseName", course.getName());
|
||||
Course courseById = scoreMapper.getScoreById(map);
|
||||
if (courseById != null) {
|
||||
course.setCreditsByUser(courseById.getCreditsByUser());
|
||||
course.setPointByUser(courseById.getPointByUser());
|
||||
course.setScoreByUser(courseById.getScoreByUser());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEntry(List<Score> list) {
|
||||
for (Score score : list) {
|
||||
// string转double
|
||||
double scoreByUser = Double.parseDouble(score.getScoreByUser());
|
||||
BigDecimal bg = new BigDecimal((scoreByUser/10-5));
|
||||
// 取两位有效数字
|
||||
double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
String point = scoreByUser > 59 ? String.valueOf(f1):"0";
|
||||
String credits = scoreByUser >= score.getScore()*0.6 ? score.getCredits() : "0.00";
|
||||
score.setPointByUser(point);
|
||||
score.setCreditsByUser(credits);
|
||||
score.setCourseId(Long.toString(score.getId()));
|
||||
Map<String, Object> condition = new HashMap<>();
|
||||
condition.put("StudentId", score.getNo());
|
||||
condition.put("CourseName", score.getName());
|
||||
Integer num = scoreMapper.checkCount(condition);
|
||||
if (num == 0) {
|
||||
scoreMapper.addEntry(score);
|
||||
} else {
|
||||
scoreMapper.updateEntry(score);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Course> getExportList(Map<String, Object> condition) {
|
||||
List<Course> courseList = new ArrayList<>();
|
||||
switch (condition.get("level").toString()) {
|
||||
case "0":
|
||||
courseList = scoreMapper.getExportListByAdmin(condition);
|
||||
for (Course course : courseList) {
|
||||
adminCourseMethod(course);
|
||||
}
|
||||
break;
|
||||
case "1":
|
||||
courseList = scoreMapper.getExportList(condition);
|
||||
break;
|
||||
case "2":
|
||||
courseList = scoreMapper.getExportListByStudent(condition);
|
||||
}
|
||||
return courseList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getUserNum(Map<String, Object> condition) {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
List<Course> courseList = new ArrayList<>();
|
||||
switch (condition.get("level").toString()) {
|
||||
case "0":
|
||||
courseList = scoreMapper.getExportListByAdmin(condition);
|
||||
for (Course course : courseList) {
|
||||
adminCourseMethod(course);
|
||||
}
|
||||
list = dealScore(courseList);
|
||||
break;
|
||||
case "1":
|
||||
courseList = scoreMapper.getExportList(condition);
|
||||
list = dealScore(courseList);
|
||||
break;
|
||||
case "2":
|
||||
courseList = scoreMapper.getExportListByStudent(condition);
|
||||
list = dealScore(courseList);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getUserTotal(Map<String, Object> condition) {
|
||||
String level = condition.get("level").toString();
|
||||
if (level.equals("2")) {
|
||||
List<Course> list = scoreMapper.getStudentTotal(condition);
|
||||
double credits = 0.00;
|
||||
double point = 0.00;
|
||||
for (Course course : list) {
|
||||
double a = Double.parseDouble(course.getCreditsByUser());
|
||||
credits += a;
|
||||
double b = Double.parseDouble(course.getPointByUser());
|
||||
point += b;
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("credits", credits);
|
||||
map.put("point", point);
|
||||
return map;
|
||||
} else if (level.equals("1")) {
|
||||
List<Course> courseList = scoreMapper.getExportList(condition);
|
||||
return getLimit(courseList);
|
||||
} else {
|
||||
List<Course> courseList = scoreMapper.getExportListByAdmin(condition);
|
||||
for (Course course : courseList) {
|
||||
adminCourseMethod(course);
|
||||
}
|
||||
return getLimit(courseList);
|
||||
}
|
||||
}
|
||||
private Map<String, Object> getLimit(List<Course> courseList) {
|
||||
List<Double> list = new ArrayList<>();
|
||||
double max = 0.00;
|
||||
double min = 0.00;
|
||||
double average = 0.00;
|
||||
double count = 0.00;
|
||||
for (Course course : courseList) {
|
||||
if (course.getScoreByUser() != null) {
|
||||
list.add(Double.parseDouble(course.getScoreByUser()));
|
||||
}
|
||||
}
|
||||
if (list.size() > 0) {
|
||||
Collections.sort(list);
|
||||
min = list.get(0);
|
||||
max = list.get(list.size() - 1);
|
||||
}
|
||||
|
||||
for (Double score : list) {
|
||||
count += score;
|
||||
}
|
||||
average = list.size()==0 ? 0.00 : count / list.size();
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("max", max);
|
||||
map.put("min", min);
|
||||
map.put("average", average);
|
||||
return map;
|
||||
}
|
||||
private List<Map<String, Object>> dealScore(List<Course> courseList) {
|
||||
if (courseList.size() > 0) {
|
||||
Map<String, Object> unknownCondition = new HashMap<>();
|
||||
Map<String, Object> failCondition = new HashMap<>();
|
||||
Map<String, Object> passCondition = new HashMap<>();
|
||||
Map<String, Object> goodCondition = new HashMap<>();
|
||||
int fail = 0;
|
||||
int pass = 0;
|
||||
int good = 0;
|
||||
int unknown = 0;
|
||||
for (Course course : courseList) {
|
||||
double scoreFull = course.getScore() / 100;
|
||||
if (course.getScoreByUser() == null) {
|
||||
unknown++;
|
||||
} else {
|
||||
double score = Double.parseDouble(course.getScoreByUser()) * scoreFull;
|
||||
if (score < 60) {
|
||||
fail++;
|
||||
} else if (score < 85) {
|
||||
pass++;
|
||||
} else {
|
||||
good++;
|
||||
}
|
||||
}
|
||||
}
|
||||
int passLine = (int) (courseList.get(0).getScore() * 0.6);
|
||||
int goodLine = (int) (courseList.get(0).getScore() * 0.85);
|
||||
int FullLine = courseList.get(0).getScore();
|
||||
String unknownLabel = "未录入";
|
||||
String failLabel = "不及格(" + "0-" + (passLine - 1) + ")";
|
||||
String passLabel = "及格(" + passLine + "-" + (goodLine - 1) + ")";
|
||||
String goodLabel = "优秀(" + goodLine + "-" + FullLine + ")";
|
||||
if (unknown != 0) {
|
||||
unknownCondition.put("label", unknownLabel);
|
||||
unknownCondition.put("value", unknown);
|
||||
}
|
||||
failCondition.put("label", failLabel);
|
||||
failCondition.put("value", fail);
|
||||
passCondition.put("label", passLabel);
|
||||
passCondition.put("value", pass);
|
||||
goodCondition.put("label", goodLabel);
|
||||
goodCondition.put("value", good);
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
list.add(goodCondition);
|
||||
list.add(passCondition);
|
||||
list.add(failCondition);
|
||||
list.add(unknownCondition);
|
||||
return list;
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.cow.horse.service.Upload;
|
||||
|
||||
import com.cow.horse.domain.Upload;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 上传文件service层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/4/29 13:54
|
||||
**/
|
||||
public interface UploadService {
|
||||
/**
|
||||
* description: 上传头像
|
||||
* @param: upload
|
||||
* return: void
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/29 11:40
|
||||
*/
|
||||
void upload(Upload upload);
|
||||
/**
|
||||
* description: 获取头像
|
||||
* @param: condition
|
||||
* return: String
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/4/29 14:02
|
||||
*/
|
||||
String getHeader(Map<String, Object> condition);
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.cow.horse.service.Upload.impl;
|
||||
|
||||
import com.alibaba.druid.support.logging.Log;
|
||||
import com.alibaba.druid.support.logging.LogFactory;
|
||||
import com.cow.horse.dao.Upload.UploadMapper;
|
||||
import com.cow.horse.domain.Upload;
|
||||
import com.cow.horse.service.Upload.UploadService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 上传业务层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/4/29 13:55
|
||||
**/
|
||||
@Service
|
||||
public class UploadServiceImpl implements UploadService {
|
||||
|
||||
private final Log logger = LogFactory.getLog(UploadServiceImpl.class);
|
||||
|
||||
@Resource
|
||||
private UploadMapper uploadMapper;
|
||||
|
||||
@Override
|
||||
public void upload(Upload upload) {
|
||||
Map<String, Object> condition = new HashMap<>();
|
||||
condition.put("userId", upload.getUserId());
|
||||
condition.put("level", upload.getLevel());
|
||||
String oldUrl = uploadMapper.getHead(condition);
|
||||
if (oldUrl == null) {
|
||||
uploadMapper.add(upload);
|
||||
} else {
|
||||
File file = new File(oldUrl);
|
||||
//文件是否存在
|
||||
if (file.exists()) {
|
||||
if (file.delete()) {
|
||||
logger.info("删除文件成功");
|
||||
}
|
||||
}
|
||||
uploadMapper.update(upload);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHeader(Map<String, Object> condition) {
|
||||
String imgUrl = uploadMapper.getHead(condition);
|
||||
return imgUrl == null ? "" : imgUrl.substring(imgUrl.indexOf("/"));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package com.cow.horse.service.User;
|
||||
|
||||
import com.cow.horse.dto.User;
|
||||
import com.cow.horse.utils.PagingResult;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 管理员Service层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/28 11:05
|
||||
**/
|
||||
public interface AdminService {
|
||||
/**
|
||||
* description: 新增学生账号
|
||||
* @param user
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
void add(User user);
|
||||
|
||||
/**
|
||||
* description: 删除学生账号
|
||||
*
|
||||
* @param ids
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void delete(List<Integer> ids);
|
||||
|
||||
/**
|
||||
* description: 修改学生账号
|
||||
*
|
||||
* @param user
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void update(User user);
|
||||
|
||||
/**
|
||||
* description: 获取学生账号信息列表
|
||||
* @param rowBounds
|
||||
* @param condition
|
||||
* @author cow.horse
|
||||
* @return com.jw.zjh.sms.utils.PagingResult
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
PagingResult<User> getAdminList(RowBounds rowBounds, Map<String, Object> condition);
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package com.cow.horse.service.User;
|
||||
|
||||
import com.cow.horse.dto.User;
|
||||
import com.cow.horse.utils.PagingResult;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 学生账号接口
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/7 15:04
|
||||
**/
|
||||
public interface StudentService {
|
||||
/**
|
||||
* description: 新增学生账号
|
||||
* @param user
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
void addStudent(User user);
|
||||
|
||||
/**
|
||||
* description: 删除学生账号
|
||||
*
|
||||
* @param ids
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void delete(List<String> ids);
|
||||
|
||||
/**
|
||||
* description: 修改学生账号
|
||||
*
|
||||
* @param user
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void update(User user);
|
||||
|
||||
/**
|
||||
* description: 获取学生账号信息列表
|
||||
* @param rowBounds
|
||||
* @param condition
|
||||
* @author cow.horse
|
||||
* @return com.jw.zjh.sms.utils.PagingResult
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
PagingResult<User> getStudentList(RowBounds rowBounds, Map<String, Object> condition);
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package com.cow.horse.service.User;
|
||||
|
||||
import com.cow.horse.dto.User;
|
||||
import com.cow.horse.utils.PagingResult;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 教师用户接口
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/7 15:05
|
||||
**/
|
||||
public interface TeacherService {
|
||||
/**
|
||||
* description: 新增教师账号
|
||||
* @param user
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
void addTeacher(User user);
|
||||
|
||||
/**
|
||||
* description: 删除教师账号
|
||||
*
|
||||
* @param ids
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void delete(List<Integer> ids);
|
||||
|
||||
/**
|
||||
* description: 修改教师账号
|
||||
*
|
||||
* @param user
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @date 2019/8/29 14:55
|
||||
*/
|
||||
void update(User user);
|
||||
|
||||
/**
|
||||
* description: 获取教师账号信息列表
|
||||
* @param rowBounds
|
||||
* @param condition
|
||||
* @author cow.horse
|
||||
* @return com.jw.zjh.sms.utils.PagingResult
|
||||
* @date 2020/3/4 23:05
|
||||
*/
|
||||
PagingResult<User> getTeacherList(RowBounds rowBounds, Map<String, Object> condition);
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.cow.horse.service.User;
|
||||
|
||||
import com.cow.horse.dto.User;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 登陆用户接口
|
||||
* Author: cow.horse
|
||||
* Date2019/10/21 21:01
|
||||
**/
|
||||
public interface UserService {
|
||||
/**
|
||||
* description: 根据用户、密码登陆
|
||||
* @params: condition
|
||||
* @return: com.zjh.student_mis.dto.User
|
||||
* @Author: cow.horse
|
||||
* @Date: 2021/10/21 21:05
|
||||
*/
|
||||
User getStudentInfo(Map<String, Object> condition);
|
||||
/**
|
||||
* description: 修改密码
|
||||
* @param condition
|
||||
* @return void
|
||||
* @author cow.horse
|
||||
* @Date: 2022/3/4 23:05
|
||||
*/
|
||||
boolean update(Map<String, Object> condition);
|
||||
/**
|
||||
* description: 获取树状数据
|
||||
* return: List<Object>
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/27 22:13
|
||||
*/
|
||||
List<Object> getTree();
|
||||
/**
|
||||
* description: 获取token
|
||||
* @param: User
|
||||
* return: String
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/30 23:21
|
||||
*/
|
||||
String getToken(User user, long time);
|
||||
/**
|
||||
* description: 根据等级和id获取用户信息
|
||||
* @param: condition
|
||||
* return: User
|
||||
* Author: cow.horse
|
||||
* @Date: 2022/3/30 23:42
|
||||
*/
|
||||
User findUser(Map<String, Object> condition);
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.cow.horse.service.User.impl;
|
||||
|
||||
import com.cow.horse.dao.User.AdminMapper;
|
||||
import com.cow.horse.dto.User;
|
||||
import com.cow.horse.service.User.AdminService;
|
||||
import com.cow.horse.utils.PagingResult;
|
||||
import com.github.pagehelper.PageRowBounds;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/28 11:06
|
||||
**/
|
||||
@Service
|
||||
public class AdminServiceImpl implements AdminService {
|
||||
|
||||
@Resource
|
||||
private AdminMapper adminMapper;
|
||||
|
||||
@Override
|
||||
public void add(User user) {
|
||||
int num = adminMapper.checkCodeCount();
|
||||
String username = "980502" + Integer.toString(num);
|
||||
user.setUsername(username);
|
||||
user.setPassword("password");
|
||||
adminMapper.add(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void
|
||||
delete(List<Integer> ids) {
|
||||
adminMapper.delete(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(User user) {
|
||||
adminMapper.update(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PagingResult<User> getAdminList(RowBounds rowBounds, Map<String, Object> condition) {
|
||||
PageRowBounds pageRowBounds = new PageRowBounds(rowBounds.getOffset(), rowBounds.getLimit());
|
||||
List<User> StudentInfoList = adminMapper.getAdminList(pageRowBounds, condition);
|
||||
return new PagingResult<>(StudentInfoList, pageRowBounds.getTotal());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package com.cow.horse.service.User.impl;
|
||||
|
||||
import com.cow.horse.dao.Profession.ProfessionMapper;
|
||||
import com.cow.horse.dao.User.StudentMapper;
|
||||
import com.cow.horse.domain.Profession;
|
||||
import com.cow.horse.dto.User;
|
||||
import com.cow.horse.service.User.StudentService;
|
||||
import com.cow.horse.utils.PagingResult;
|
||||
import com.github.pagehelper.PageRowBounds;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Description 学生用户业务层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/7 15:09
|
||||
**/
|
||||
@Service
|
||||
public class StudentServiceImpl implements StudentService {
|
||||
|
||||
@Resource
|
||||
private StudentMapper studentMapper;
|
||||
@Autowired
|
||||
private ProfessionMapper professionMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void addStudent(User user) {
|
||||
int professionId = 0;
|
||||
int count = professionMapper.checkProfessionCount(user.getProfession());
|
||||
if (count > 0) {
|
||||
Profession profession = professionMapper.getProfessionIdByName(user.getProfession());
|
||||
professionId = profession.getId();
|
||||
} else {
|
||||
Profession profession = new Profession();
|
||||
profession.setName(user.getProfession());
|
||||
professionMapper.addProfession(profession);
|
||||
professionId = profession.getId();
|
||||
}
|
||||
String professionStr = "";
|
||||
if (professionId < 10) {
|
||||
professionStr = "0" + Integer.toString(professionId);
|
||||
} else {
|
||||
professionStr = Integer.toString(professionId);
|
||||
}
|
||||
Map<String, Object> condition = new HashMap<>();
|
||||
condition.put("profession", user.getProfession());
|
||||
condition.put("grade", user.getGrade());
|
||||
int num = studentMapper.checkCodeCount(condition) + 1;
|
||||
String str = "";
|
||||
if (num < 10) {
|
||||
str = "0" + Integer.toString(num);
|
||||
} else if (num < 100) {
|
||||
str = Integer.toString(num);
|
||||
}
|
||||
String no = "3" + user.getAdmissionTime().substring(user.getAdmissionTime().length()-2)
|
||||
+ "89" + professionStr + user.getGrade().substring(user.getGrade().length()-1) + str;
|
||||
user.setId(no);
|
||||
user.setUsername(no);
|
||||
user.setPassword("123456");
|
||||
studentMapper.addStudent(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void
|
||||
delete(List<String> ids) {
|
||||
studentMapper.delete(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(User user) {
|
||||
studentMapper.update(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PagingResult<User> getStudentList(RowBounds rowBounds, Map<String, Object> condition) {
|
||||
PageRowBounds pageRowBounds = new PageRowBounds(rowBounds.getOffset(), rowBounds.getLimit());
|
||||
List<User> StudentInfoList = studentMapper.getStudentList(pageRowBounds, condition);
|
||||
return new PagingResult<>(StudentInfoList, pageRowBounds.getTotal());
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package com.cow.horse.service.User.impl;
|
||||
|
||||
import com.cow.horse.dao.User.TeacherMapper;
|
||||
import com.cow.horse.dto.User;
|
||||
import com.cow.horse.service.User.TeacherService;
|
||||
import com.cow.horse.utils.PagingResult;
|
||||
import com.github.pagehelper.PageRowBounds;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description 教师用户业务层
|
||||
* Author: cow.horse
|
||||
* Date: 2020/3/7 15:10
|
||||
**/
|
||||
@Service
|
||||
public class TeacherServiceImpl implements TeacherService {
|
||||
|
||||
@Resource
|
||||
private TeacherMapper teacherMapper;
|
||||
|
||||
@Override
|
||||
public void addTeacher(User user) {
|
||||
int num = teacherMapper.checkCodeCount();
|
||||
String str = "";
|
||||
if (num < 10) {
|
||||
str = "00" + Integer.toString(num);
|
||||
} else if (num < 100) {
|
||||
str = "0" + Integer.toString(num);
|
||||
} else {
|
||||
str = Integer.toString(num);
|
||||
}
|
||||
String no = "389"+str+user.getSex().toString();
|
||||
user.setUsername(no);
|
||||
user.setId(no);
|
||||
user.setPassword("159357");
|
||||
teacherMapper.addTeacher(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(List<Integer> ids) {
|
||||
teacherMapper.delete(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(User user) {
|
||||
teacherMapper.update(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PagingResult<User> getTeacherList(RowBounds rowBounds, Map<String, Object> condition) {
|
||||
PageRowBounds pageRowBounds = new PageRowBounds(rowBounds.getOffset(), rowBounds.getLimit());
|
||||
List<User> TeacherInfoList = teacherMapper.getTeacherList(pageRowBounds, condition);
|
||||
return new PagingResult<>(TeacherInfoList, pageRowBounds.getTotal());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
server.port=9121
|
||||
|
||||
jdbc.driver=com.mysql.jdbc.Driver
|
||||
jdbc.url=jdbc:mysql://localhost:3306/student_manager_system?characterEncoding=utf8&allowPublicKeyRetrieval=true&useSSL=false
|
||||
jdbc.username=root
|
||||
jdbc.password=root123
|
||||
|
||||
mybatis_config_file=mybatis-config.xml
|
||||
mapper_path=/mapper/*/**.xml
|
||||
entity_package=com.cow.horse.dto
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE configuration
|
||||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
<settings>
|
||||
<!-- 获取数据库自增主键值 -->
|
||||
<setting name="useGeneratedKeys" value="true"/>
|
||||
<!-- 使用列标签替换列别名 默认:true -->
|
||||
<setting name="useColumnLabel" value="true"/>
|
||||
<!-- 开启驼峰命名转换 -->
|
||||
<setting name="mapUnderscoreToCamelCase" value="true"/>
|
||||
<!-- sql打印 -->
|
||||
<setting name="logImpl" value="STDOUT_LOGGING"/>
|
||||
</settings>
|
||||
</configuration>
|
||||
|
After Width: | Height: | Size: 241 KiB |
|
After Width: | Height: | Size: 147 KiB |
|
After Width: | Height: | Size: 323 KiB |
|
After Width: | Height: | Size: 388 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 493 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 493 KiB |
|
After Width: | Height: | Size: 765 KiB |
|
After Width: | Height: | Size: 629 KiB |
|
After Width: | Height: | Size: 623 KiB |
|
After Width: | Height: | Size: 493 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 59 KiB |