├── .gitignore
├── .mvn
└── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── README.md
├── db
└── graduationdesign.sql
├── find
├── lib
└── beautyeye_lnf.jar
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src
├── main
├── java
│ └── com
│ │ └── mikey
│ │ └── design
│ │ ├── GraduationDesignApplication.java
│ │ ├── controller
│ │ └── StudentController.java
│ │ ├── entity
│ │ ├── Admin.java
│ │ ├── AdminExample.java
│ │ ├── Design.java
│ │ ├── DesignExample.java
│ │ ├── Student.java
│ │ ├── StudentExample.java
│ │ ├── Teacher.java
│ │ ├── TeacherExample.java
│ │ ├── TitleOfStudent.java
│ │ ├── TitleOfStudentExample.java
│ │ ├── Wish.java
│ │ └── WishExample.java
│ │ ├── listerner
│ │ ├── admin
│ │ │ └── AdminListener.java
│ │ ├── common
│ │ │ ├── LoginListener.java
│ │ │ └── LoginOut.java
│ │ ├── student
│ │ │ └── StudentListener.java
│ │ └── teacher
│ │ │ ├── AdmitStudentButtonListener.java
│ │ │ └── TeacherLisetener.java
│ │ ├── mapper
│ │ ├── AdminMapper.java
│ │ ├── AdminMapper.xml
│ │ ├── DesignMapper.java
│ │ ├── DesignMapper.xml
│ │ ├── StudentMapper.java
│ │ ├── StudentMapper.xml
│ │ ├── TeacherMapper.java
│ │ ├── TeacherMapper.xml
│ │ ├── TitleOfStudentMapper.java
│ │ ├── TitleOfStudentMapper.xml
│ │ ├── WishMapper.java
│ │ └── WishMapper.xml
│ │ ├── service
│ │ ├── AdminService.java
│ │ ├── DesignService.java
│ │ ├── StudentService.java
│ │ ├── TeacherService.java
│ │ ├── TitleOfStudentService.java
│ │ ├── WishService.java
│ │ └── impl
│ │ │ ├── AdminServiceImpl.java
│ │ │ ├── DesignServiceImpl.java
│ │ │ ├── StudentServiceImpl.java
│ │ │ ├── TeacherServiceImpl.java
│ │ │ ├── TitleOfStudentServiceImpl.java
│ │ │ └── WishServiceImpl.java
│ │ ├── utils
│ │ ├── GBM.java
│ │ ├── SpringUtil.java
│ │ └── ThreadLocalUtil.java
│ │ └── views
│ │ ├── Test
│ │ ├── Frame1.java
│ │ ├── MyButtonEditor.java
│ │ ├── MyButtonRenderer.java
│ │ ├── Test.java
│ │ ├── Test2.java
│ │ ├── TestListAndMap.java
│ │ ├── TestPhone.java
│ │ ├── TestTable.java
│ │ ├── change.java
│ │ ├── table.java
│ │ └── test1.java
│ │ ├── admin
│ │ ├── AddStudentJpanel.java
│ │ ├── AddTeacherJpanel.java
│ │ ├── AdminMainView.java
│ │ ├── LookStudentJpanel.java
│ │ ├── LookTeacherJpanel.java
│ │ ├── StudentWishStateJpanel.java
│ │ └── WishDateCountJpanel.java
│ │ ├── common
│ │ ├── UpPwdPanel.java
│ │ ├── UpdatePanel.java
│ │ └── WelcomeJpanel.java
│ │ ├── login
│ │ ├── Login.java
│ │ └── LoginSystem.java
│ │ ├── renderer
│ │ ├── AdmitStudentButtonRenderer.java
│ │ └── MyTableCellRenderer.java
│ │ ├── student
│ │ ├── AlrealdFillWispPanel.java
│ │ ├── StudentMainView.java
│ │ ├── TeacherJpanel.java
│ │ ├── TitleJpanel.java
│ │ └── WispPanel.java
│ │ └── teacher
│ │ ├── AddTitlePanel.java
│ │ ├── AdmitStudentTable.java
│ │ ├── AdmitStudentsJpanel.java
│ │ ├── AlrealyAdmitJpanel.java
│ │ ├── SelfDesignJpanel.java
│ │ └── TeacherMainView.java
└── resources
│ ├── application.yml
│ ├── banner.txt
│ ├── doc
│ └── design.docx
│ ├── gbm
│ └── nbg.xml
│ └── images
│ ├── TIM图片20201229184207.png
│ ├── TIM图片20201229184239.png
│ ├── TIM图片20201229184248.png
│ ├── TIM图片20201229184256.png
│ ├── TIM图片20201229184303.png
│ └── TIM图片20201229184311.png
└── test
└── java
└── com
└── mikey
└── design
└── GraduationDesignApplicationTests.java
/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### IntelliJ IDEA ###
14 | .idea
15 | *.iws
16 | *.iml
17 | *.ipr
18 |
19 | ### NetBeans ###
20 | /nbproject/private/
21 | /build/
22 | /nbbuild/
23 | /dist/
24 | /nbdist/
25 | /.nb-gradle/
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikeygithub/GraduationDesign/609a09caed0ef8b2cce696f58b2af298761f8947/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GraduationDesign
2 |
3 | 基于Java Swing的课程设计/毕业设计选题系统
4 |
5 | ## 功能描述
6 |
7 | >提供学生和教师进行课程设计或者毕业设计选题平台,教师角色通过登入平台发布选题信息和录取相关学生,学生用户进行选题提交教师审核,管理员负责基础数据维护。
8 |
9 | ## 页面截图
10 |
11 | 
12 |
13 | 
14 |
15 | 
16 |
17 | 
18 |
19 | 
20 |
21 | 
22 |
23 | ## 使用技术
24 |
25 | - [SpringBoot]()
26 | - [Java Swing]()
27 | - [Beautyeye](https://github.com/JackJiang2011/beautyeye)
28 |
29 | ## 部署方法
30 |
31 | 1.通过maven安装依赖
32 | 2.导入db文件夹下的数据库文件
33 | 3.运行主类即可
--------------------------------------------------------------------------------
/find:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikeygithub/GraduationDesign/609a09caed0ef8b2cce696f58b2af298761f8947/find
--------------------------------------------------------------------------------
/lib/beautyeye_lnf.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mikeygithub/GraduationDesign/609a09caed0ef8b2cce696f58b2af298761f8947/lib/beautyeye_lnf.jar
--------------------------------------------------------------------------------
/mvnw.cmd:
--------------------------------------------------------------------------------
1 | @REM ----------------------------------------------------------------------------
2 | @REM Licensed to the Apache Software Foundation (ASF) under one
3 | @REM or more contributor license agreements. See the NOTICE file
4 | @REM distributed with this work for additional information
5 | @REM regarding copyright ownership. The ASF licenses this file
6 | @REM to you under the Apache License, Version 2.0 (the
7 | @REM "License"); you may not use this file except in compliance
8 | @REM with the License. You may obtain a copy of the License at
9 | @REM
10 | @REM http://www.apache.org/licenses/LICENSE-2.0
11 | @REM
12 | @REM Unless required by applicable law or agreed to in writing,
13 | @REM software distributed under the License is distributed on an
14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | @REM KIND, either express or implied. See the License for the
16 | @REM specific language governing permissions and limitations
17 | @REM under the License.
18 | @REM ----------------------------------------------------------------------------
19 |
20 | @REM ----------------------------------------------------------------------------
21 | @REM Maven2 Start Up Batch script
22 | @REM
23 | @REM Required ENV vars:
24 | @REM JAVA_HOME - location of a JDK home dir
25 | @REM
26 | @REM Optional ENV vars
27 | @REM M2_HOME - location of maven2's installed home dir
28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
31 | @REM e.g. to debug Maven itself, use
32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
34 | @REM ----------------------------------------------------------------------------
35 |
36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
37 | @echo off
38 | @REM set title of command window
39 | title %0
40 | @REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
42 |
43 | @REM set %HOME% to equivalent of $HOME
44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
45 |
46 | @REM Execute a user defined script before this one
47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending
49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
51 | :skipRcPre
52 |
53 | @setlocal
54 |
55 | set ERROR_CODE=0
56 |
57 | @REM To isolate internal variables from possible post scripts, we use another setlocal
58 | @setlocal
59 |
60 | @REM ==== START VALIDATION ====
61 | if not "%JAVA_HOME%" == "" goto OkJHome
62 |
63 | echo.
64 | echo Error: JAVA_HOME not found in your environment. >&2
65 | echo Please set the JAVA_HOME variable in your environment to match the >&2
66 | echo location of your Java installation. >&2
67 | echo.
68 | goto error
69 |
70 | :OkJHome
71 | if exist "%JAVA_HOME%\bin\java.exe" goto init
72 |
73 | echo.
74 | echo Error: JAVA_HOME is set to an invalid directory. >&2
75 | echo JAVA_HOME = "%JAVA_HOME%" >&2
76 | echo Please set the JAVA_HOME variable in your environment to match the >&2
77 | echo location of your Java installation. >&2
78 | echo.
79 | goto error
80 |
81 | @REM ==== END VALIDATION ====
82 |
83 | :init
84 |
85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
86 | @REM Fallback to current working directory if not found.
87 |
88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
90 |
91 | set EXEC_DIR=%CD%
92 | set WDIR=%EXEC_DIR%
93 | :findBaseDir
94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound
95 | cd ..
96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound
97 | set WDIR=%CD%
98 | goto findBaseDir
99 |
100 | :baseDirFound
101 | set MAVEN_PROJECTBASEDIR=%WDIR%
102 | cd "%EXEC_DIR%"
103 | goto endDetectBaseDir
104 |
105 | :baseDirNotFound
106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
107 | cd "%EXEC_DIR%"
108 |
109 | :endDetectBaseDir
110 |
111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
112 |
113 | @setlocal EnableExtensions EnableDelayedExpansion
114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
116 |
117 | :endReadAdditionalConfig
118 |
119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
122 |
123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"
124 | FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO (
125 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
126 | )
127 |
128 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
129 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data.
130 | if exist %WRAPPER_JAR% (
131 | echo Found %WRAPPER_JAR%
132 | ) else (
133 | echo Couldn't find %WRAPPER_JAR%, downloading it ...
134 | echo Downloading from: %DOWNLOAD_URL%
135 | powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"
136 | echo Finished downloading %WRAPPER_JAR%
137 | )
138 | @REM End of extension
139 |
140 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
141 | if ERRORLEVEL 1 goto error
142 | goto end
143 |
144 | :error
145 | set ERROR_CODE=1
146 |
147 | :end
148 | @endlocal & set ERROR_CODE=%ERROR_CODE%
149 |
150 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
151 | @REM check for post script, once with legacy .bat ending and once with .cmd ending
152 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
153 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
154 | :skipRcPost
155 |
156 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
157 | if "%MAVEN_BATCH_PAUSE%" == "on" pause
158 |
159 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
160 |
161 | exit /B %ERROR_CODE%
162 |
--------------------------------------------------------------------------------
/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | 4.0.0
5 |
6 | com.mikey
7 | graduation-design-system
8 | 0.0.1-SNAPSHOT
9 | jar
10 |
11 | graduationdesignsystem
12 | Demo project for Spring Boot
13 |
14 |
15 | org.springframework.boot
16 | spring-boot-starter-parent
17 | 2.1.0.RELEASE
18 |
19 |
20 |
21 |
22 | UTF-8
23 | UTF-8
24 | 1.8
25 |
26 |
27 |
28 |
29 | org.mybatis.spring.boot
30 | mybatis-spring-boot-starter
31 | 1.3.2
32 |
33 |
34 |
35 | mysql
36 | mysql-connector-java
37 | 5.1.47
38 |
39 |
40 | org.projectlombok
41 | lombok
42 | true
43 |
44 |
45 | org.springframework.boot
46 | spring-boot-starter-test
47 | test
48 |
49 |
50 |
51 | com.alibaba
52 | druid
53 | 1.1.8
54 |
55 |
56 |
57 | com.github.pagehelper
58 | pagehelper-spring-boot-starter
59 | 1.2.3
60 |
61 |
62 |
63 | org.mybatis.generator
64 | mybatis-generator-core
65 | 1.3.7
66 |
67 |
68 | org.junit.jupiter
69 | junit-jupiter-api
70 | RELEASE
71 | compile
72 |
73 |
74 |
75 |
76 | com.beautyeye
77 | beautyeye
78 | 1.0
79 | system
80 | ${project.basedir}/lib/beautyeye_lnf.jar
81 |
82 |
83 |
84 |
85 |
86 | org.springframework.boot
87 | spring-boot-maven-plugin
88 |
89 |
90 |
91 |
92 | src/main/java
93 |
94 | **/*.xml
95 |
96 |
97 |
98 | lib
99 |
100 | **/*.jar
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/GraduationDesignApplication.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design;
2 |
3 | import com.mikey.design.views.login.Login;
4 | import org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper;
5 | import org.mybatis.spring.annotation.MapperScan;
6 | import org.springframework.boot.SpringApplication;
7 | import org.springframework.boot.autoconfigure.SpringBootApplication;
8 |
9 | import javax.swing.*;
10 |
11 | @MapperScan(basePackages={"com.mikey.design.mapper"})
12 | @SpringBootApplication
13 | public class GraduationDesignApplication {
14 |
15 |
16 | public static void main(String[] args) {
17 |
18 | SpringApplication.run(GraduationDesignApplication.class, args);
19 |
20 | showLoginView();
21 | }
22 | public static void showLoginView(){
23 | System.setProperty("java.awt.headless", "false");
24 | try
25 | {
26 | // BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;
27 | // BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.translucencySmallShadow;
28 | // BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.translucencyAppleLike;
29 |
30 | BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow;
31 | //加载美化包
32 | BeautyEyeLNFHelper.translucencyAtFrameInactive = false;
33 | org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
34 | //关闭设置功能
35 | UIManager.put("RootPane.setupButtonVisible", false);
36 | //设置此开关量为false即表示关闭之,BeautyEye LNF中默认是true
37 | }
38 | catch(Exception e)
39 | {
40 | e.printStackTrace();
41 | }
42 | new Login();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/controller/StudentController.java:
--------------------------------------------------------------------------------
1 | //package com.mikey.design.controller;
2 | //
3 | //import com.mikey.design.views.login.Login;
4 | //import org.springframework.beans.factory.annotation.Autowired;
5 | //import org.springframework.stereotype.Component;
6 | //
7 | ///**
8 | // * @author Mikey
9 | // * @Title:
10 | // * @Description:
11 | // * @Email:1625017540@qq.com
12 | // * @date 2018/12/4 7:38
13 | // * @Version 1.0
14 | // */
15 | //@Component
16 | //public class StudentController {
17 | // @Autowired
18 | // private Login login;
19 | // public static void showLoginView(){
20 | //// login.shows();
21 | // }
22 | //}
23 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/entity/Admin.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.entity;
2 |
3 | public class Admin {
4 | private Integer adminId;
5 |
6 | private String adminName;
7 |
8 | private Integer adminSex;
9 |
10 | private String adminPassword;
11 |
12 | private String adminPhone;
13 |
14 | public Integer getAdminId() {
15 | return adminId;
16 | }
17 |
18 | public void setAdminId(Integer adminId) {
19 | this.adminId = adminId;
20 | }
21 |
22 | public String getAdminName() {
23 | return adminName;
24 | }
25 |
26 | public void setAdminName(String adminName) {
27 | this.adminName = adminName == null ? null : adminName.trim();
28 | }
29 |
30 | public Integer getAdminSex() {
31 | return adminSex;
32 | }
33 |
34 | public void setAdminSex(Integer adminSex) {
35 | this.adminSex = adminSex;
36 | }
37 |
38 | public String getAdminPassword() {
39 | return adminPassword;
40 | }
41 |
42 | public void setAdminPassword(String adminPassword) {
43 | this.adminPassword = adminPassword == null ? null : adminPassword.trim();
44 | }
45 |
46 | public String getAdminPhone() {
47 | return adminPhone;
48 | }
49 |
50 | public void setAdminPhone(String adminPhone) {
51 | this.adminPhone = adminPhone == null ? null : adminPhone.trim();
52 | }
53 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/entity/Design.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.entity;
2 |
3 | public class Design {
4 | private Integer designId;
5 |
6 | private Integer designOfTeacher;
7 |
8 | private String designTitle;
9 |
10 | private Integer designNum;
11 |
12 | private Integer designFillNum;
13 |
14 | private String designRequire;
15 |
16 | public Integer getDesignId() {
17 | return designId;
18 | }
19 |
20 | public void setDesignId(Integer designId) {
21 | this.designId = designId;
22 | }
23 |
24 | public Integer getDesignOfTeacher() {
25 | return designOfTeacher;
26 | }
27 |
28 | public void setDesignOfTeacher(Integer designOfTeacher) {
29 | this.designOfTeacher = designOfTeacher;
30 | }
31 |
32 | public String getDesignTitle() {
33 | return designTitle;
34 | }
35 |
36 | public void setDesignTitle(String designTitle) {
37 | this.designTitle = designTitle == null ? null : designTitle.trim();
38 | }
39 |
40 | public Integer getDesignNum() {
41 | return designNum;
42 | }
43 |
44 | public void setDesignNum(Integer designNum) {
45 | this.designNum = designNum;
46 | }
47 |
48 | public Integer getDesignFillNum() {
49 | return designFillNum;
50 | }
51 |
52 | public void setDesignFillNum(Integer designFillNum) {
53 | this.designFillNum = designFillNum;
54 | }
55 |
56 | public String getDesignRequire() {
57 | return designRequire;
58 | }
59 |
60 | public void setDesignRequire(String designRequire) {
61 | this.designRequire = designRequire == null ? null : designRequire.trim();
62 | }
63 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/entity/Student.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.entity;
2 |
3 | public class Student {
4 | private Integer studentId;
5 |
6 | private String studentName;
7 |
8 | private Integer studentSex;
9 |
10 | private String studentPassword;
11 |
12 | private String studentPhone;
13 |
14 | public Integer getStudentId() {
15 | return studentId;
16 | }
17 |
18 | public void setStudentId(Integer studentId) {
19 | this.studentId = studentId;
20 | }
21 |
22 | public String getStudentName() {
23 | return studentName;
24 | }
25 |
26 | public void setStudentName(String studentName) {
27 | this.studentName = studentName == null ? null : studentName.trim();
28 | }
29 |
30 | public Integer getStudentSex() {
31 | return studentSex;
32 | }
33 |
34 | public void setStudentSex(Integer studentSex) {
35 | this.studentSex = studentSex;
36 | }
37 |
38 | public String getStudentPassword() {
39 | return studentPassword;
40 | }
41 |
42 | public void setStudentPassword(String studentPassword) {
43 | this.studentPassword = studentPassword == null ? null : studentPassword.trim();
44 | }
45 |
46 | public String getStudentPhone() {
47 | return studentPhone;
48 | }
49 |
50 | public void setStudentPhone(String studentPhone) {
51 | this.studentPhone = studentPhone == null ? null : studentPhone.trim();
52 | }
53 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/entity/Teacher.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.entity;
2 |
3 | public class Teacher {
4 | private Integer teacherId;
5 |
6 | private String teacherName;
7 |
8 | private Integer teacherSex;
9 |
10 | private String teacherInfo;
11 |
12 | private String teacherPassword;
13 |
14 | private String teacherPhone;
15 |
16 | public Integer getTeacherId() {
17 | return teacherId;
18 | }
19 |
20 | public void setTeacherId(Integer teacherId) {
21 | this.teacherId = teacherId;
22 | }
23 |
24 | public String getTeacherName() {
25 | return teacherName;
26 | }
27 |
28 | public void setTeacherName(String teacherName) {
29 | this.teacherName = teacherName == null ? null : teacherName.trim();
30 | }
31 |
32 | public Integer getTeacherSex() {
33 | return teacherSex;
34 | }
35 |
36 | public void setTeacherSex(Integer teacherSex) {
37 | this.teacherSex = teacherSex;
38 | }
39 |
40 | public String getTeacherInfo() {
41 | return teacherInfo;
42 | }
43 |
44 | public void setTeacherInfo(String teacherInfo) {
45 | this.teacherInfo = teacherInfo == null ? null : teacherInfo.trim();
46 | }
47 |
48 | public String getTeacherPassword() {
49 | return teacherPassword;
50 | }
51 |
52 | public void setTeacherPassword(String teacherPassword) {
53 | this.teacherPassword = teacherPassword == null ? null : teacherPassword.trim();
54 | }
55 |
56 | public String getTeacherPhone() {
57 | return teacherPhone;
58 | }
59 |
60 | public void setTeacherPhone(String teacherPhone) {
61 | this.teacherPhone = teacherPhone == null ? null : teacherPhone.trim();
62 | }
63 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/entity/TitleOfStudent.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.entity;
2 |
3 | public class TitleOfStudent {
4 | private Integer desOfStuId;
5 |
6 | private Integer desOfStu;
7 |
8 | private Integer desOfTitle;
9 |
10 | private Integer desState;
11 |
12 | private Integer desWishOrder;
13 |
14 | public Integer getDesOfStuId() {
15 | return desOfStuId;
16 | }
17 |
18 | public void setDesOfStuId(Integer desOfStuId) {
19 | this.desOfStuId = desOfStuId;
20 | }
21 |
22 | public Integer getDesOfStu() {
23 | return desOfStu;
24 | }
25 |
26 | public void setDesOfStu(Integer desOfStu) {
27 | this.desOfStu = desOfStu;
28 | }
29 |
30 | public Integer getDesOfTitle() {
31 | return desOfTitle;
32 | }
33 |
34 | public void setDesOfTitle(Integer desOfTitle) {
35 | this.desOfTitle = desOfTitle;
36 | }
37 |
38 | public Integer getDesState() {
39 | return desState;
40 | }
41 |
42 | public void setDesState(Integer desState) {
43 | this.desState = desState;
44 | }
45 |
46 | public Integer getDesWishOrder() {
47 | return desWishOrder;
48 | }
49 |
50 | public void setDesWishOrder(Integer desWishOrder) {
51 | this.desWishOrder = desWishOrder;
52 | }
53 | private Student student;
54 |
55 | private Design design;
56 |
57 | public Student getStudent() {
58 | return student;
59 | }
60 |
61 | public void setStudent(Student student) {
62 | this.student = student;
63 | }
64 |
65 | public Design getDesign() {
66 | return design;
67 | }
68 |
69 | public void setDesign(Design design) {
70 | this.design = design;
71 | }
72 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/entity/Wish.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.entity;
2 |
3 | public class Wish {
4 | private Integer wishId;
5 |
6 | private String wishFist;
7 |
8 | private String wishSecond;
9 |
10 | public Integer getWishId() {
11 | return wishId;
12 | }
13 |
14 | public void setWishId(Integer wishId) {
15 | this.wishId = wishId;
16 | }
17 |
18 | public String getWishFist() {
19 | return wishFist;
20 | }
21 |
22 | public void setWishFist(String wishFist) {
23 | this.wishFist = wishFist == null ? null : wishFist.trim();
24 | }
25 |
26 | public String getWishSecond() {
27 | return wishSecond;
28 | }
29 |
30 | public void setWishSecond(String wishSecond) {
31 | this.wishSecond = wishSecond == null ? null : wishSecond.trim();
32 | }
33 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/listerner/admin/AdminListener.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.listerner.admin;
2 |
3 | /**
4 | * @author Mikey
5 | * @Title:
6 | * @Description:
7 | * @Email:1625017540@qq.com
8 | * @date 2018/12/3 20:22
9 | * @Version 1.0
10 | */
11 | public class AdminListener {
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/listerner/common/LoginListener.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.listerner.common;
2 |
3 | import com.mikey.design.entity.Admin;
4 | import com.mikey.design.entity.Student;
5 | import com.mikey.design.entity.Teacher;
6 | import com.mikey.design.service.AdminService;
7 | import com.mikey.design.service.StudentService;
8 | import com.mikey.design.service.TeacherService;
9 | import com.mikey.design.utils.SpringUtil;
10 | import com.mikey.design.utils.ThreadLocalUtil;
11 | import com.mikey.design.views.admin.AdminMainView;
12 | import com.mikey.design.views.student.StudentMainView;
13 | import com.mikey.design.views.teacher.TeacherMainView;
14 | import org.springframework.beans.factory.annotation.Autowired;
15 | import org.springframework.stereotype.Component;
16 |
17 | import javax.swing.*;
18 | import java.awt.*;
19 | import java.awt.event.ActionEvent;
20 | import java.util.regex.Pattern;
21 |
22 | /**
23 | * @author Mikey
24 | * @Title:
25 | * @Description:
26 | * @Email:1625017540@qq.com
27 | * @date 2018/12/3 9:36
28 | * @Version 1.0
29 | */
30 | @Component
31 | public class LoginListener extends AbstractAction {
32 |
33 | @Autowired
34 | private StudentService studentService;
35 | @Autowired
36 | private TeacherService teacherService;
37 | @Autowired
38 | private AdminService adminService;
39 |
40 | private final static String ADMIN="admin";
41 |
42 | private final static String STU="student";
43 |
44 | private final static String TEA="teacher";
45 |
46 | private final static String IS_NUM="^\\d+$";
47 |
48 | private JFrame login;
49 |
50 | private JTextField usernameField;
51 |
52 | private JPasswordField passwordField;
53 |
54 | private String username;
55 |
56 | private String password;
57 |
58 | private String role;
59 |
60 | private CheckboxGroup group;//选择
61 |
62 | private String baseUserName;//数据库查询出来的用户名
63 |
64 | private String basePassWord;//数据库查询出来的密码
65 |
66 | @Override
67 | public void actionPerformed(ActionEvent e) {
68 |
69 | /**
70 | * 无法通过自动注入,只能通过工具类获取
71 | */
72 | studentService = (StudentService) SpringUtil.getBean("studentServiceImpl");
73 | teacherService = (TeacherService) SpringUtil.getBean("teacherServiceImpl");
74 | adminService = (AdminService) SpringUtil.getBean("adminServiceImpl");
75 |
76 |
77 | this.username=usernameField.getText().trim();//获取用户名
78 | this.password=new String(passwordField.getPassword()).trim();//获取密码
79 | this.role=group.getSelectedCheckbox().getLabel();//获取角色
80 |
81 | if(Pattern.matches(IS_NUM,username)==false){
82 | JOptionPane.showMessageDialog(login, "学号或者工号错误");
83 | return;
84 | }
85 |
86 | if(username.length()==0||password.length()==0||username.equals("请输入学号或者工号")){
87 | JOptionPane.showMessageDialog(login, "用户名密码不能为空");
88 | return;
89 | }
90 |
91 | switch (role){
92 | case ADMIN://管理员登入
93 | Admin admin=adminService.getAdmin(Integer.parseInt(username));
94 | if (admin==null){
95 | JOptionPane.showMessageDialog(login, "用户不存在");
96 | return;
97 | }
98 | this.baseUserName=admin.getAdminId().toString();
99 | this.basePassWord=admin.getAdminPassword();
100 | //身份认证
101 | if(username.equals(baseUserName)&&password.equals(basePassWord)){//判断用户名和密码
102 | System.out.println("管理员登入成功------------》》》》");
103 | //登录成功
104 | ThreadLocalUtil.set(admin);//保存用户信息
105 | login.setVisible(false);
106 | new AdminMainView(login);//进入管理员页面
107 | }
108 | else{
109 | JOptionPane.showMessageDialog(login, "用户名或密码错误");
110 | }
111 | break;
112 | case STU://学生登入
113 |
114 | Student student= this.studentService.getStudent(Integer.parseInt(username));
115 |
116 | if (student==null){
117 | JOptionPane.showMessageDialog(login, "用户不存在");
118 | return;
119 | }
120 |
121 | this.baseUserName=student.getStudentId().toString();
122 | this.basePassWord=student.getStudentPassword();
123 | //身份认证
124 | if(username.equals(baseUserName)&&password.equals(basePassWord)){//判断用户名和密码
125 | //登录成功
126 | ThreadLocalUtil.set(student);//保存用户信息
127 | login.setVisible(false);
128 | new StudentMainView(login);//进入学生页面
129 | }
130 | else{
131 | JOptionPane.showMessageDialog(login, "用户名或密码错误");
132 | }
133 | break;
134 | case TEA://教师登入
135 | Teacher teacher=teacherService.getTeacher(Integer.parseInt(username));
136 |
137 | if (teacher==null){
138 | JOptionPane.showMessageDialog(login, "用户不存在");
139 | return;
140 | }
141 | this.baseUserName=teacher.getTeacherId().toString();
142 | this.basePassWord=teacher.getTeacherPassword();
143 | //身份认证
144 | if(username.equals(baseUserName)&&password.equals(basePassWord)){//判断用户名和密码
145 | //登录成功
146 | ThreadLocalUtil.set(teacher);//保存登入用户信息
147 | login.setVisible(false);
148 | new TeacherMainView(login);//进入教师页面
149 | }
150 | else{
151 | JOptionPane.showMessageDialog(login, "用户名或密码错误");
152 | }
153 | break;
154 | }
155 | }
156 |
157 | public LoginListener() {
158 | }
159 |
160 | public LoginListener(JTextField username, JPasswordField passwordField, CheckboxGroup group,JFrame login) {
161 | this.usernameField = username;
162 | this.passwordField = passwordField;
163 | this.group=group;
164 | this.login=login;
165 | }
166 | }
167 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/listerner/common/LoginOut.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.listerner.common;
2 |
3 | import com.mikey.design.utils.ThreadLocalUtil;
4 |
5 | import javax.swing.*;
6 | import java.awt.event.ActionEvent;
7 |
8 | /**
9 | * @author Mikey
10 | * @Title: logout
11 | * @Description: 退出登入监听器
12 | * @Email:1625017540@qq.com
13 | * @date 2018/12/4 10:16
14 | * @Version 1.0
15 | */
16 | public class LoginOut extends AbstractAction {
17 |
18 | private JFrame loginjFrame;//登入面板
19 | private JFrame mainjFrame;//主页面面板
20 |
21 | @Override
22 | public void actionPerformed(ActionEvent e) {
23 | int result = JOptionPane.showConfirmDialog(mainjFrame, "确认退出登入?", "系统提示", JOptionPane.YES_NO_CANCEL_OPTION);
24 | /**
25 | * 提交保存
26 | */
27 | if (result == JOptionPane.YES_OPTION) {
28 | mainjFrame.setVisible(false);//关闭登入面板
29 | ThreadLocalUtil.remove();//移除登入的用户
30 | System.out.println("用户退出登入成功================》》》》》》");
31 | loginjFrame.setVisible(true);//开启登入面板
32 | }
33 | }
34 |
35 | public LoginOut(JFrame loginjFrame, JFrame mainjFrame) {
36 | this.loginjFrame = loginjFrame;
37 | this.mainjFrame = mainjFrame;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/listerner/student/StudentListener.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.listerner.student;
2 |
3 | import javax.swing.*;
4 | import java.awt.event.ActionEvent;
5 |
6 | /**
7 | * @author Mikey
8 | * @Title: 监听器
9 | * @Description: 监听学生端
10 | * @Email:1625017540@qq.com
11 | * @date 2018/12/3 20:21
12 | * @Version 1.0
13 | */
14 | public class StudentListener extends AbstractAction {
15 | @Override
16 | public void actionPerformed(ActionEvent e) {
17 |
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/listerner/teacher/AdmitStudentButtonListener.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.listerner.teacher;
2 |
3 | import com.mikey.design.entity.TitleOfStudent;
4 | import com.mikey.design.service.TitleOfStudentService;
5 | import com.mikey.design.utils.SpringUtil;
6 | import com.mikey.design.views.teacher.AdmitStudentsJpanel;
7 | import org.jb2011.lnf.beautyeye.ch3_button.BEButtonUI;
8 |
9 | import javax.swing.*;
10 | import javax.swing.table.TableCellEditor;
11 | import java.awt.*;
12 | import java.awt.event.ActionEvent;
13 | import java.awt.event.ActionListener;
14 | import java.util.List;
15 | /**
16 | * @author Mikey
17 | * @Title: 监听录取按钮
18 | * @Description: 监听教师在报名列表录取报名学生
19 | * @Email:1625017540@qq.com
20 | * @date 2018/12/4 21:27
21 | * @Version 1.0
22 | */
23 | public class AdmitStudentButtonListener extends AbstractCellEditor implements TableCellEditor {
24 |
25 | private TitleOfStudentService titleOfStudentService;
26 |
27 | //当前教师的毕设题目列表
28 | private static List titleOfStudentList;
29 |
30 | public static void setTitleOfStudentList(List titleOfStudentList) {
31 | AdmitStudentButtonListener.titleOfStudentList = titleOfStudentList;
32 | }
33 |
34 | private JPanel buttonJpanel;
35 |
36 | private JButton admitButton;
37 |
38 | public AdmitStudentButtonListener(JTable table,AdmitStudentsJpanel admitStudentsJpanel) {
39 |
40 | //获取当前登入用户信息
41 |
42 | titleOfStudentService = (TitleOfStudentService) SpringUtil.getBean("titleOfStudentServiceImpl");
43 |
44 | buttonJpanel=new JPanel();
45 | buttonJpanel.setLayout(new BorderLayout());
46 | admitButton=new JButton("录取");
47 | admitButton.setUI(new BEButtonUI().setNormalColor(BEButtonUI.NormalColor.green));
48 | buttonJpanel.add(admitButton,BorderLayout.CENTER);
49 |
50 |
51 | admitButton.addActionListener(new ActionListener() {
52 | @Override
53 | public void actionPerformed(ActionEvent e) {
54 | System.out.println("Message=当前页数量"+titleOfStudentList.size());
55 |
56 | int selectedRow = table.getSelectedRow();
57 |
58 | System.out.println("选中的行--------------------》》》》》》》》》》》》"+selectedRow);
59 |
60 | if (selectedRow>titleOfStudentList.size()){
61 | JOptionPane.showMessageDialog(admitStudentsJpanel, "该行无数据");
62 | return;
63 | }
64 |
65 | int result = JOptionPane.showConfirmDialog(admitStudentsJpanel, "您确定要录取这位学生吗?", "确认录取", JOptionPane.YES_NO_OPTION);
66 |
67 | if(result == JOptionPane.YES_OPTION){
68 | //进行录取操作、调用service执行sql语句
69 | TitleOfStudent titleOfStudent = titleOfStudentList.get(selectedRow);
70 | //
71 | System.out.println("将要录取的学生姓名="+titleOfStudent.getStudent().getStudentName());
72 | //录取
73 | titleOfStudentService.admitStudentWish(titleOfStudent);
74 |
75 | titleOfStudentList.remove(selectedRow);//移除
76 |
77 | JOptionPane.showMessageDialog(admitStudentsJpanel, "录取学生成功");
78 |
79 | admitStudentsJpanel.refreshData();//刷新数据
80 |
81 | System.out.println("录取学生成功===================》》》》》》》》》");
82 | }
83 | fireEditingStopped();//终止编辑
84 | }
85 | });
86 | }
87 | /**
88 | * 为编辑器设置初始值
89 | * @param table
90 | * @param value
91 | * @param isSelected
92 | * @param row
93 | * @param column
94 | * @return
95 | */
96 | @Override
97 | public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
98 | return buttonJpanel;
99 | }
100 |
101 | /**
102 | *设置编辑器返回值
103 | * @return
104 | */
105 | @Override
106 | public Object getCellEditorValue() {
107 | return null;
108 | }
109 |
110 | }
111 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/listerner/teacher/TeacherLisetener.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.listerner.teacher;
2 |
3 | /**
4 | * @author Mikey
5 | * @Title:
6 | * @Description:
7 | * @Email:1625017540@qq.com
8 | * @date 2018/12/3 20:22
9 | * @Version 1.0
10 | */
11 | public class TeacherLisetener {
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/mapper/AdminMapper.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.mapper;
2 |
3 | import com.mikey.design.entity.Admin;
4 | import com.mikey.design.entity.AdminExample;
5 | import java.util.List;
6 | import org.apache.ibatis.annotations.Param;
7 |
8 | public interface AdminMapper {
9 | long countByExample(AdminExample example);
10 |
11 | int deleteByExample(AdminExample example);
12 |
13 | int deleteByPrimaryKey(Integer adminId);
14 |
15 | int insert(Admin record);
16 |
17 | int insertSelective(Admin record);
18 |
19 | List selectByExample(AdminExample example);
20 |
21 | Admin selectByPrimaryKey(Integer adminId);
22 |
23 | int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example);
24 |
25 | int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example);
26 |
27 | int updateByPrimaryKeySelective(Admin record);
28 |
29 | int updateByPrimaryKey(Admin record);
30 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/mapper/DesignMapper.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.mapper;
2 |
3 | import com.mikey.design.entity.Design;
4 | import com.mikey.design.entity.DesignExample;
5 | import java.util.List;
6 | import org.apache.ibatis.annotations.Param;
7 |
8 | public interface DesignMapper {
9 | long countByExample(DesignExample example);
10 |
11 | int deleteByExample(DesignExample example);
12 |
13 | int deleteByPrimaryKey(Integer designId);
14 |
15 | int insert(Design record);
16 |
17 | int insertSelective(Design record);
18 |
19 | List selectByExample(DesignExample example);
20 |
21 | Design selectByPrimaryKey(Integer designId);
22 |
23 | int updateByExampleSelective(@Param("record") Design record, @Param("example") DesignExample example);
24 |
25 | int updateByExample(@Param("record") Design record, @Param("example") DesignExample example);
26 |
27 | int updateByPrimaryKeySelective(Design record);
28 |
29 | int updateByPrimaryKey(Design record);
30 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/mapper/StudentMapper.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.mapper;
2 |
3 | import com.mikey.design.entity.Student;
4 | import com.mikey.design.entity.StudentExample;
5 | import java.util.List;
6 | import org.apache.ibatis.annotations.Param;
7 | import org.springframework.stereotype.Component;
8 |
9 | public interface StudentMapper {
10 | long countByExample(StudentExample example);
11 |
12 | int deleteByExample(StudentExample example);
13 |
14 | int deleteByPrimaryKey(Integer studentId);
15 |
16 | int insert(Student record);
17 |
18 | int insertSelective(Student record);
19 |
20 | List selectByExample(StudentExample example);
21 |
22 | Student selectByPrimaryKey(Integer studentId);
23 |
24 | int updateByExampleSelective(@Param("record") Student record, @Param("example") StudentExample example);
25 |
26 | int updateByExample(@Param("record") Student record, @Param("example") StudentExample example);
27 |
28 | int updateByPrimaryKeySelective(Student record);
29 |
30 | int updateByPrimaryKey(Student record);
31 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/mapper/TeacherMapper.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.mapper;
2 |
3 | import com.github.pagehelper.PageInfo;
4 | import com.mikey.design.entity.Student;
5 | import com.mikey.design.entity.Teacher;
6 | import com.mikey.design.entity.TeacherExample;
7 | import java.util.List;
8 |
9 | import com.mikey.design.entity.TitleOfStudent;
10 | import org.apache.ibatis.annotations.Param;
11 | import org.springframework.stereotype.Component;
12 |
13 | public interface TeacherMapper {
14 | long countByExample(TeacherExample example);
15 |
16 | int deleteByExample(TeacherExample example);
17 |
18 | int deleteByPrimaryKey(Integer teacherId);
19 |
20 | int insert(Teacher record);
21 |
22 | int insertSelective(Teacher record);
23 |
24 | List selectByExample(TeacherExample example);
25 |
26 | Teacher selectByPrimaryKey(Integer teacherId);
27 |
28 | int updateByExampleSelective(@Param("record") Teacher record, @Param("example") TeacherExample example);
29 |
30 | int updateByExample(@Param("record") Teacher record, @Param("example") TeacherExample example);
31 |
32 | int updateByPrimaryKeySelective(Teacher record);
33 |
34 | int updateByPrimaryKey(Teacher record);
35 | //获取填报当前登入教师的所有学生志愿信息
36 | List getWillAdmitStudentMes(Integer teacherId);
37 | //获取当前教师已经录取的学生信息
38 | List getAllAlreayAdmitStudent(Integer teacherId);
39 | //获取学生填报志愿状态
40 | List getAllStudentWishStateForAdmin();
41 | //统计已经填报志愿的人数个数
42 | long getAlreadyFillWishStudentNum();
43 | //统计未填报志愿人数个数
44 | long getNotFillWishStudentNum();
45 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/mapper/TitleOfStudentMapper.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.mapper;
2 |
3 | import com.mikey.design.entity.TitleOfStudent;
4 | import com.mikey.design.entity.TitleOfStudentExample;
5 | import java.util.List;
6 | import org.apache.ibatis.annotations.Param;
7 |
8 | public interface TitleOfStudentMapper {
9 | long countByExample(TitleOfStudentExample example);
10 |
11 | int deleteByExample(TitleOfStudentExample example);
12 |
13 | int deleteByPrimaryKey(Integer desOfStuId);
14 |
15 | int insert(TitleOfStudent record);
16 |
17 | int insertSelective(TitleOfStudent record);
18 |
19 | List selectByExample(TitleOfStudentExample example);
20 |
21 | TitleOfStudent selectByPrimaryKey(Integer desOfStuId);
22 |
23 | int updateByExampleSelective(@Param("record") TitleOfStudent record, @Param("example") TitleOfStudentExample example);
24 |
25 | int updateByExample(@Param("record") TitleOfStudent record, @Param("example") TitleOfStudentExample example);
26 |
27 | int updateByPrimaryKeySelective(TitleOfStudent record);
28 |
29 | int updateByPrimaryKey(TitleOfStudent record);
30 |
31 | //回档第二志愿
32 | void backSecondWish(Integer studentId);
33 | //回档第一志愿
34 | void backFirstWish(Integer studentId);
35 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/mapper/WishMapper.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.mapper;
2 |
3 | import com.mikey.design.entity.Wish;
4 | import com.mikey.design.entity.WishExample;
5 | import java.util.List;
6 | import org.apache.ibatis.annotations.Param;
7 |
8 | public interface WishMapper {
9 | long countByExample(WishExample example);
10 |
11 | int deleteByExample(WishExample example);
12 |
13 | int deleteByPrimaryKey(Integer wishId);
14 |
15 | int insert(Wish record);
16 |
17 | int insertSelective(Wish record);
18 |
19 | List selectByExample(WishExample example);
20 |
21 | Wish selectByPrimaryKey(Integer wishId);
22 |
23 | int updateByExampleSelective(@Param("record") Wish record, @Param("example") WishExample example);
24 |
25 | int updateByExample(@Param("record") Wish record, @Param("example") WishExample example);
26 |
27 | int updateByPrimaryKeySelective(Wish record);
28 |
29 | int updateByPrimaryKey(Wish record);
30 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/mapper/WishMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | and ${criterion.condition}
18 |
19 |
20 | and ${criterion.condition} #{criterion.value}
21 |
22 |
23 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
24 |
25 |
26 | and ${criterion.condition}
27 |
28 | #{listItem}
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | and ${criterion.condition}
47 |
48 |
49 | and ${criterion.condition} #{criterion.value}
50 |
51 |
52 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
53 |
54 |
55 | and ${criterion.condition}
56 |
57 | #{listItem}
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | wish_id, wish_fist, wish_second
69 |
70 |
84 |
90 |
91 | delete from des_wish
92 | where wish_id = #{wishId,jdbcType=INTEGER}
93 |
94 |
95 | delete from des_wish
96 |
97 |
98 |
99 |
100 |
101 | insert into des_wish (wish_id, wish_fist, wish_second
102 | )
103 | values (#{wishId,jdbcType=INTEGER}, #{wishFist,jdbcType=VARCHAR}, #{wishSecond,jdbcType=VARCHAR}
104 | )
105 |
106 |
107 | insert into des_wish
108 |
109 |
110 | wish_id,
111 |
112 |
113 | wish_fist,
114 |
115 |
116 | wish_second,
117 |
118 |
119 |
120 |
121 | #{wishId,jdbcType=INTEGER},
122 |
123 |
124 | #{wishFist,jdbcType=VARCHAR},
125 |
126 |
127 | #{wishSecond,jdbcType=VARCHAR},
128 |
129 |
130 |
131 |
137 |
138 | update des_wish
139 |
140 |
141 | wish_id = #{record.wishId,jdbcType=INTEGER},
142 |
143 |
144 | wish_fist = #{record.wishFist,jdbcType=VARCHAR},
145 |
146 |
147 | wish_second = #{record.wishSecond,jdbcType=VARCHAR},
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 | update des_wish
156 | set wish_id = #{record.wishId,jdbcType=INTEGER},
157 | wish_fist = #{record.wishFist,jdbcType=VARCHAR},
158 | wish_second = #{record.wishSecond,jdbcType=VARCHAR}
159 |
160 |
161 |
162 |
163 |
164 | update des_wish
165 |
166 |
167 | wish_fist = #{wishFist,jdbcType=VARCHAR},
168 |
169 |
170 | wish_second = #{wishSecond,jdbcType=VARCHAR},
171 |
172 |
173 | where wish_id = #{wishId,jdbcType=INTEGER}
174 |
175 |
176 | update des_wish
177 | set wish_fist = #{wishFist,jdbcType=VARCHAR},
178 | wish_second = #{wishSecond,jdbcType=VARCHAR}
179 | where wish_id = #{wishId,jdbcType=INTEGER}
180 |
181 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/service/AdminService.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.service;
2 |
3 | import com.mikey.design.entity.Admin;
4 |
5 | /**
6 | * @author Mikey
7 | * @Title: 管理员
8 | * @Description: 统计志愿填报,总学生人数,已经填报人数,未填报人数,教师人数,毕业设计题目总数
9 | * @Email:1625017540@qq.com
10 | * @date 2018/11/28 18:44
11 | * @Version 1.0
12 | */
13 | public interface AdminService {
14 | /**
15 | * 统计教师人数
16 | * @return
17 | */
18 | public long getTeacherNum();
19 |
20 | /**
21 | * 统计学生人数
22 | * @return
23 | */
24 | public long getStudentNum();
25 |
26 | /**
27 | * 统计所有毕设题目总数
28 | * @return
29 | */
30 | public long allTitleNum() ;
31 | /**
32 | * 查看信息、登入
33 | * @param AdminId
34 | * @return
35 | */
36 | public Admin getAdmin(int AdminId);
37 |
38 | /**
39 | * 更新数据
40 | * @param admin
41 | */
42 | public void updataAdmin(Admin admin);
43 |
44 | /**
45 | * 统计已经填报志愿的学生个数
46 | * @return
47 | */
48 | long getAlreadyFillWishStudentNum();
49 |
50 | /**
51 | * 统计未填报志愿的学生个数
52 | * @return
53 | */
54 | long getNotFillWishStudentNum();
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/service/DesignService.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.service;
2 |
3 | import com.github.pagehelper.PageInfo;
4 | import com.mikey.design.entity.Design;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * @author Mikey
10 | * @Title:
11 | * @Description:
12 | * @Email:1625017540@qq.com
13 | * @date 2018/11/28 18:45
14 | * @Version 1.0
15 | */
16 | public interface DesignService {
17 | public void addDesign(Design design);
18 | public void updateDesign(Design design);
19 | public void deleteDesign(int designId);
20 | public List getAllDesign();
21 | PageInfo getDesignByPage(int currentPage, int pageSize);
22 | PageInfo getSelfDesignByPage(int teacherId,int currentPage, int pageSize);//教师获取自己的毕设题目列表
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/service/StudentService.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.service;
2 |
3 | import com.github.pagehelper.PageInfo;
4 | import com.mikey.design.entity.Student;
5 |
6 | /**
7 | * @author Mikey
8 | * @Title:
9 | * @Description:
10 | * @Email:1625017540@qq.com
11 | * @date 2018/11/28 18:10
12 | * @Version 1.0
13 | */
14 | public interface StudentService {
15 | public void addStudent(Student student);
16 | public void updateStudent(Student student);
17 | public void deleteStudent(int studentId);
18 | public int getStudentNum();
19 | public Student getStudent(int studentId);
20 |
21 | PageInfo getAllTeacherByPage(int currentPage, int pageSize);
22 |
23 | /**
24 | * 通过手机号回显学号
25 | * @param studentPhone
26 | * @return
27 | */
28 | Student getStudentByPhone(String studentPhone);
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/service/TeacherService.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.service;
2 |
3 | import com.github.pagehelper.PageInfo;
4 | import com.mikey.design.entity.Teacher;
5 | import com.mikey.design.entity.TitleOfStudent;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * @author Mikey
11 | * @Title:
12 | * @Description:
13 | * @Email:1625017540@qq.com
14 | * @date 2018/11/28 18:45
15 | * @Version 1.0
16 | */
17 | public interface TeacherService {
18 | public int getTeacherNum();//获取教师人数
19 | public void addTeacher(Teacher teacher);//添加教师
20 | public void updateTeacherNum(Teacher teacher);
21 | public void deleteTeacherNum(int teacherId);
22 | public Teacher getTeacher(int teacherId);
23 | List getAllTeacher();
24 | PageInfo getAllTeacherByPage(int currentPage, int pageSize);//分页获取所有教师
25 | PageInfo getWillAdmitStudentMes(Integer teacherId, int currentPage, int pageSize);//通过教师id获取全部志愿信息分页
26 | //获取当前教师已经录取的学生信息
27 | PageInfo getAllAlreayAdmitStudent(Integer teacherId, int currentPage, int pageSize);
28 | //获取学生填报志愿状态
29 | PageInfo getAllStudentWishStateForAdmin(int currentPage, int pageSize);
30 | //通过手机号回显新增教师
31 | Teacher getStudentByPhone(String teacherPhone);
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/service/TitleOfStudentService.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.service;
2 |
3 | import com.mikey.design.entity.Design;
4 | import com.mikey.design.entity.TitleOfStudent;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * @author Mikey
10 | * @Title:
11 | * @Description:
12 | * @Email:1625017540@qq.com
13 | * @date 2018/12/6 9:12
14 | * @Version 1.0
15 | */
16 | public interface TitleOfStudentService {
17 | void addTitleOfStudent(TitleOfStudent titleOfStudent);//填报志愿
18 | void addTitleOfStudent(TitleOfStudent titleOfStudent1,TitleOfStudent titleOfStudent2);//提交第一第二志愿
19 | boolean fillWishOrNot(Integer studentId);//判断该学生是否已经填报志愿
20 | Design getFirstWish(Integer studentId);//获取第一志愿信息
21 | Design getSecondWish(Integer studentId);//获取第二志愿信息
22 | Integer getAdmitState(Integer studentId);//获取录取状态
23 |
24 | Design getAdmitDesign(Integer studentId);//查看学生志愿
25 |
26 | List getByTeacherId(Integer teacherId);//获取填报当前教师 的学生信息
27 |
28 | void admitStudentWish(TitleOfStudent titleOfStudent);//录取志愿
29 | }
30 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/service/WishService.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.service;
2 |
3 | import com.mikey.design.entity.Wish;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * @author Mikey
9 | * @Title:
10 | * @Description:
11 | * @Email:1625017540@qq.com
12 | * @date 2018/11/28 18:45
13 | * @Version 1.0
14 | */
15 | public interface WishService {
16 | public void addWish(Wish wish);
17 | public void updateWish(Wish wish);
18 | public Wish getWish(int wishId);
19 | public List getAllWish();
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/service/impl/AdminServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.service.impl;
2 |
3 | import com.mikey.design.entity.Admin;
4 | import com.mikey.design.mapper.AdminMapper;
5 | import com.mikey.design.mapper.DesignMapper;
6 | import com.mikey.design.mapper.StudentMapper;
7 | import com.mikey.design.mapper.TeacherMapper;
8 | import com.mikey.design.service.AdminService;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.stereotype.Service;
11 |
12 | /**
13 | * @author Mikey
14 | * @Title:
15 | * @Description:
16 | * @Email:1625017540@qq.com
17 | * @date 2018/11/28 18:47
18 | * @Version 1.0
19 | */
20 | @Service
21 | public class AdminServiceImpl implements AdminService {
22 | @Autowired
23 | private AdminMapper adminMapper;
24 |
25 | @Autowired
26 | private DesignMapper designMapper;
27 |
28 | @Autowired
29 | private TeacherMapper teacherMapper;
30 |
31 | @Autowired
32 | private StudentMapper studentMapper;
33 |
34 | @Override
35 | public long getTeacherNum() {
36 | return teacherMapper.countByExample(null);
37 | }
38 |
39 | @Override
40 | public long getStudentNum() {
41 | return studentMapper.countByExample(null);
42 | }
43 | /**
44 | * 获取全部题目总数
45 | * @return
46 | */
47 | @Override
48 | public long allTitleNum() {
49 | return designMapper.countByExample(null);
50 | }
51 |
52 | /**
53 | * 管理员信息
54 | * @param adminId
55 | * @return
56 | */
57 | @Override
58 | public Admin getAdmin(int adminId) {
59 | return adminMapper.selectByPrimaryKey(adminId);
60 | }
61 |
62 | /**
63 | * 更新管理员
64 | * @param admin
65 | */
66 | @Override
67 | public void updataAdmin(Admin admin) {
68 | adminMapper.updateByPrimaryKey(admin);
69 | }
70 |
71 | /**
72 | *统计已经填报志愿的学生个数
73 | * @return
74 | */
75 | @Override
76 | public long getAlreadyFillWishStudentNum() {
77 | return teacherMapper.getAlreadyFillWishStudentNum();
78 | }
79 |
80 | /**
81 | * 统计未填报志愿的学生个数
82 | * @return
83 | */
84 | @Override
85 | public long getNotFillWishStudentNum() {
86 | return teacherMapper.getNotFillWishStudentNum();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/service/impl/DesignServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.service.impl;
2 |
3 | import com.github.pagehelper.PageHelper;
4 | import com.github.pagehelper.PageInfo;
5 | import com.mikey.design.entity.Design;
6 | import com.mikey.design.entity.DesignExample;
7 | import com.mikey.design.mapper.DesignMapper;
8 | import com.mikey.design.service.DesignService;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.stereotype.Service;
11 |
12 | import java.util.List;
13 |
14 | /**
15 | * @author Mikey
16 | * @Title:
17 | * @Description:
18 | * @Email:1625017540@qq.com
19 | * @date 2018/11/28 18:48
20 | * @Version 1.0
21 | */
22 | @Service
23 | public class DesignServiceImpl implements DesignService {
24 | @Autowired
25 | private DesignMapper designMapper;
26 |
27 | /**
28 | * 添加毕业设计
29 | * @param design
30 | */
31 | @Override
32 | public void addDesign(Design design) {
33 | designMapper.insert(design);
34 | }
35 |
36 | /**
37 | * 更新毕业设计
38 | * @param design
39 | */
40 | @Override
41 | public void updateDesign(Design design) {
42 | designMapper.updateByPrimaryKey(design);
43 | }
44 |
45 | /**
46 | * 删除毕业设计
47 | * @param designId
48 | */
49 | @Override
50 | public void deleteDesign(int designId) {
51 | designMapper.deleteByPrimaryKey(designId);
52 | }
53 |
54 | /**
55 | * 获取全部毕业设计信息
56 | * @return
57 | */
58 | @Override
59 | public List getAllDesign() {
60 | return designMapper.selectByExample(null);
61 | }
62 |
63 | /**
64 | * 分页查询毕业设计题目
65 | * @param currentPage
66 | * @param pageSize
67 | * @return
68 | */
69 | @Override
70 | public PageInfo getDesignByPage(int currentPage, int pageSize) {
71 |
72 | PageHelper.startPage(currentPage,pageSize);
73 |
74 | List allBook=designMapper.selectByExample(null);
75 |
76 | PageInfo pageData = new PageInfo(allBook, pageSize);
77 |
78 | return pageData;
79 | }
80 |
81 | /**
82 | * 通过教师id获取他发布的题目
83 | * @param teacherId
84 | * @param currentPage
85 | * @param pageSize
86 | * @return
87 | */
88 | @Override
89 | public PageInfo getSelfDesignByPage(int teacherId, int currentPage, int pageSize) {
90 |
91 | DesignExample designExample=new DesignExample();
92 |
93 | DesignExample.Criteria criteria = designExample.createCriteria();
94 |
95 | criteria.andDesignOfTeacherEqualTo(teacherId);
96 |
97 | PageHelper.startPage(currentPage,pageSize);
98 |
99 | List allBook=designMapper.selectByExample(designExample);
100 |
101 | PageInfo pageData = new PageInfo(allBook, pageSize);
102 |
103 | return pageData;
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/service/impl/StudentServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.service.impl;
2 |
3 | import com.github.pagehelper.PageHelper;
4 | import com.github.pagehelper.PageInfo;
5 | import com.mikey.design.entity.Student;
6 | import com.mikey.design.entity.StudentExample;
7 | import com.mikey.design.mapper.StudentMapper;
8 | import com.mikey.design.service.StudentService;
9 | import org.springframework.beans.factory.annotation.Autowired;
10 | import org.springframework.stereotype.Service;
11 |
12 | import java.util.List;
13 |
14 | /**
15 | * @author Mikey
16 | * @Title:
17 | * @Description:
18 | * @Email:1625017540@qq.com
19 | * @date 2018/11/28 18:25
20 | * @Version 1.0
21 | */
22 | @Service
23 | public class StudentServiceImpl implements StudentService {
24 | @Autowired
25 | private StudentMapper studentMapper;
26 |
27 | /**
28 | * 添加学生
29 | * @param student
30 | */
31 | @Override
32 | public void addStudent(Student student) {
33 | studentMapper.insertSelective(student);
34 | }
35 |
36 | /**
37 | * 修改学生
38 | * @param student
39 | */
40 | @Override
41 | public void updateStudent(Student student) {
42 |
43 | studentMapper.updateByPrimaryKey(student);
44 | }
45 |
46 | /**
47 | * 删除学生
48 | * @param studentId
49 | */
50 | @Override
51 | public void deleteStudent(int studentId) {
52 |
53 | studentMapper.deleteByPrimaryKey(studentId);
54 | }
55 |
56 | /**
57 | * 获取学生人数
58 | * @return
59 | */
60 | @Override
61 | public int getStudentNum() {
62 | StudentExample studentExample=new StudentExample();
63 | StudentExample.Criteria criteria = studentExample.createCriteria();
64 |
65 | return (int) studentMapper.countByExample(null);
66 | }
67 |
68 | /**
69 | * 获取学生信息
70 | * @param studentId
71 | */
72 | @Override
73 | public Student getStudent(int studentId) {
74 |
75 | return studentMapper.selectByPrimaryKey(studentId);
76 | }
77 |
78 | @Override
79 | public PageInfo getAllTeacherByPage(int currentPage, int pageSize) {
80 |
81 | PageHelper.startPage(currentPage,pageSize);
82 |
83 | List allBook=studentMapper.selectByExample(null);
84 |
85 | PageInfo pageData = new PageInfo(allBook, pageSize);
86 |
87 | return pageData;
88 | }
89 |
90 | /**
91 | * 通过手机号回显id
92 | * @param studentPhone
93 | * @return
94 | */
95 | @Override
96 | public Student getStudentByPhone(String studentPhone) {
97 |
98 | StudentExample studentExample = new StudentExample();
99 |
100 | StudentExample.Criteria criteria = studentExample.createCriteria();
101 |
102 | criteria.andStudentPhoneEqualTo(studentPhone);
103 |
104 | List studentsList = studentMapper.selectByExample(studentExample);
105 |
106 | if (studentsList.size()>0)return studentsList.get(0);
107 |
108 | return new Student();
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/service/impl/TeacherServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.service.impl;
2 |
3 | import com.github.pagehelper.PageHelper;
4 | import com.github.pagehelper.PageInfo;
5 | import com.mikey.design.entity.Student;
6 | import com.mikey.design.entity.Teacher;
7 | import com.mikey.design.entity.TeacherExample;
8 | import com.mikey.design.entity.TitleOfStudent;
9 | import com.mikey.design.mapper.TeacherMapper;
10 | import com.mikey.design.service.TeacherService;
11 | import org.springframework.beans.factory.annotation.Autowired;
12 | import org.springframework.stereotype.Service;
13 |
14 | import java.util.List;
15 |
16 | /**
17 | * @author Mikey
18 | * @Title: 教师
19 | * @Description:
20 | * @Email:1625017540@qq.com
21 | * @date 2018/11/28 18:48
22 | * @Version 1.0
23 | */
24 | @Service
25 | public class TeacherServiceImpl implements TeacherService {
26 | @Autowired
27 | private TeacherMapper teacherMapper;
28 |
29 | /**
30 | * 获取教师人数
31 | * @return
32 | */
33 | @Override
34 | public int getTeacherNum() {
35 | return 0;
36 | }
37 |
38 | /**
39 | * 添加教师
40 | * @param teacher
41 | */
42 | @Override
43 | public void addTeacher(Teacher teacher) {
44 |
45 | teacherMapper.insertSelective(teacher);
46 |
47 | }
48 | /**
49 | * 修改教师
50 | * @param teacher
51 | */
52 | @Override
53 | public void updateTeacherNum(Teacher teacher) {
54 |
55 | teacherMapper.updateByPrimaryKey(teacher);
56 | }
57 | /**
58 | * 删除教师
59 | * @param teacherId
60 | */
61 | @Override
62 | public void deleteTeacherNum(int teacherId) {
63 |
64 | teacherMapper.deleteByPrimaryKey(teacherId);
65 | }
66 |
67 | /**
68 | * 获取单个教师信息
69 | * @param teacherId
70 | * @return
71 | */
72 | @Override
73 | public Teacher getTeacher(int teacherId) {
74 | return teacherMapper.selectByPrimaryKey(teacherId);
75 | }
76 |
77 | /**
78 | * 直接获取全部教师信息
79 | * @return
80 | */
81 | public List getAllTeacher(){
82 | return teacherMapper.selectByExample(null);
83 | }
84 | /**
85 | * 分页查询教师信息列表
86 | * @param currentPage
87 | * @param pageSize
88 | * @return
89 | */
90 | @Override
91 | public PageInfo getAllTeacherByPage(int currentPage,int pageSize) {
92 |
93 | PageHelper.startPage(currentPage,pageSize);
94 |
95 | List teacherList=teacherMapper.selectByExample(null);
96 |
97 | PageInfo pageData = new PageInfo(teacherList, pageSize);
98 |
99 | return pageData;
100 | }
101 |
102 | /**
103 | * 获取将要被录取的学生信息
104 | * @param teacherId
105 | * @return
106 | */
107 | @Override
108 | public PageInfo getWillAdmitStudentMes(Integer teacherId, int currentPage, int pageSize){
109 |
110 | PageHelper.startPage(currentPage,pageSize);
111 |
112 | List titleOfStudentList=teacherMapper.getWillAdmitStudentMes(teacherId);
113 |
114 | PageInfo pageData=new PageInfo(titleOfStudentList,pageSize);
115 |
116 | return pageData;
117 | }
118 |
119 | /**
120 | * 获取当前教师已经录取的学生信息
121 | * @param teacherId
122 | * @param currentPage
123 | * @param pageSize
124 | * @return
125 | */
126 | @Override
127 | public PageInfo getAllAlreayAdmitStudent(Integer teacherId, int currentPage, int pageSize) {
128 | PageHelper.startPage(currentPage,pageSize);
129 |
130 | List titleOfStudentList=teacherMapper.getAllAlreayAdmitStudent(teacherId);
131 |
132 | PageInfo pageData=new PageInfo(titleOfStudentList,pageSize);
133 |
134 | return pageData;
135 | }
136 |
137 | /**
138 | * 获取学生填报志愿状态
139 | * @param currentPage
140 | * @param pageSize
141 | * @return
142 | */
143 | @Override
144 | public PageInfo getAllStudentWishStateForAdmin(int currentPage, int pageSize) {
145 |
146 | PageHelper.startPage(currentPage,pageSize);
147 |
148 | List titleOfStudentList=teacherMapper.getAllStudentWishStateForAdmin();
149 |
150 | PageInfo pageData=new PageInfo(titleOfStudentList,pageSize);
151 |
152 | return pageData;
153 |
154 | }
155 |
156 | /**
157 | * 通过手机号回显新增教师
158 | * @param teacherPhone
159 | * @return
160 | */
161 | @Override
162 | public Teacher getStudentByPhone(String teacherPhone) {
163 | TeacherExample teacherExample=new TeacherExample();
164 |
165 | TeacherExample.Criteria criteria = teacherExample.createCriteria();
166 |
167 | criteria.andTeacherPhoneEqualTo(teacherPhone);
168 |
169 | List teacherList = teacherMapper.selectByExample(teacherExample);
170 |
171 | if (teacherList.size()>0)return teacherList.get(0);
172 |
173 | return new Teacher();
174 | }
175 | }
176 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/service/impl/TitleOfStudentServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.service.impl;
2 |
3 | import com.mikey.design.entity.Design;
4 | import com.mikey.design.entity.DesignExample;
5 | import com.mikey.design.entity.TitleOfStudent;
6 | import com.mikey.design.entity.TitleOfStudentExample;
7 | import com.mikey.design.mapper.DesignMapper;
8 | import com.mikey.design.mapper.TitleOfStudentMapper;
9 | import com.mikey.design.service.TitleOfStudentService;
10 | import org.springframework.beans.factory.annotation.Autowired;
11 | import org.springframework.stereotype.Service;
12 |
13 | import java.util.List;
14 |
15 | /**
16 | * @author Mikey
17 | * @Title:
18 | * @Description:
19 | * @Email:1625017540@qq.com
20 | * @date 2018/12/6 9:16
21 | * @Version 1.0
22 | */
23 | @Service
24 | public class TitleOfStudentServiceImpl implements TitleOfStudentService {
25 | @Autowired
26 | private TitleOfStudentMapper titleOfStudentMapper;
27 |
28 | @Autowired
29 | private DesignMapper designMapper;
30 |
31 |
32 | /**
33 | * 添加志愿
34 | * @param titleOfStudent
35 | */
36 | @Override
37 | public void addTitleOfStudent(TitleOfStudent titleOfStudent) {
38 | titleOfStudentMapper.insert(titleOfStudent);
39 | }
40 |
41 | /**
42 | * 添加志愿
43 | * @param titleOfStudent1
44 | * @param titleOfStudent2
45 | */
46 | @Override
47 | public void addTitleOfStudent(TitleOfStudent titleOfStudent1, TitleOfStudent titleOfStudent2) {
48 | titleOfStudentMapper.insert(titleOfStudent1);
49 | titleOfStudentMapper.insert(titleOfStudent2);
50 | }
51 |
52 | /**
53 | * 通过学生id判断是否已经进行志愿填报
54 | * @param studentId
55 | * @return
56 | */
57 | @Override
58 | public boolean fillWishOrNot(Integer studentId) {
59 | TitleOfStudentExample titleOfStudentExample = new TitleOfStudentExample();
60 | TitleOfStudentExample.Criteria criteria = titleOfStudentExample.createCriteria();
61 | criteria.andDesOfStuEqualTo(studentId);
62 | return titleOfStudentMapper.countByExample(titleOfStudentExample)>0;
63 | }
64 |
65 | /**
66 | * 获取第一志愿信息
67 | * @param studentId
68 | * @return
69 | */
70 | @Override
71 | public Design getFirstWish(Integer studentId) {
72 |
73 | TitleOfStudentExample titleOfStudentExample = new TitleOfStudentExample();
74 |
75 | TitleOfStudentExample.Criteria criteria = titleOfStudentExample.createCriteria();
76 |
77 | criteria.andDesOfStuEqualTo(studentId);//当前学生志愿
78 |
79 | criteria.andDesWishOrderEqualTo(0);//第一志愿
80 |
81 | List titleOfStudent= titleOfStudentMapper.selectByExample(titleOfStudentExample);
82 |
83 | if (titleOfStudent.size()>0) {
84 | return designMapper.selectByPrimaryKey(titleOfStudent.get(0).getDesOfTitle());
85 | }else {
86 | return null;
87 | }
88 | }
89 |
90 | /**
91 | *获取第二志愿信息
92 | * @param studentId
93 | * @return
94 | */
95 | @Override
96 | public Design getSecondWish(Integer studentId) {
97 | TitleOfStudentExample titleOfStudentExample = new TitleOfStudentExample();
98 |
99 | TitleOfStudentExample.Criteria criteria = titleOfStudentExample.createCriteria();
100 |
101 | criteria.andDesOfStuEqualTo(studentId);//当前学生志愿
102 |
103 | criteria.andDesWishOrderEqualTo(1);//第二志愿
104 |
105 | List titleOfStudent= titleOfStudentMapper.selectByExample(titleOfStudentExample);
106 |
107 | if (titleOfStudent.size()>0) {
108 | return designMapper.selectByPrimaryKey(titleOfStudent.get(0).getDesOfTitle());
109 | }else {
110 | return null;
111 | }
112 | }
113 |
114 | /**
115 | * 获取录取的状态
116 | * @param studentId
117 | * @return
118 | */
119 | @Override
120 | public Integer getAdmitState(Integer studentId) {
121 |
122 | TitleOfStudentExample titleOfStudentExample = new TitleOfStudentExample();
123 | TitleOfStudentExample.Criteria criteria = titleOfStudentExample.createCriteria();
124 | criteria.andDesOfStuEqualTo(studentId);//当前学生志愿
125 | criteria.andDesWishOrderEqualTo(0);//第一志愿
126 | List titleOfStudent=titleOfStudentMapper.selectByExample(titleOfStudentExample);
127 |
128 | if(titleOfStudent.size()>0&&titleOfStudent.get(0).getDesState()==0)return 0;//第一志愿待录取
129 | if(titleOfStudent.size()>0&&titleOfStudent.get(0).getDesState()==1)return 1;//第一志愿已经录取
130 |
131 | TitleOfStudentExample titleOfStudentExample2 = new TitleOfStudentExample();
132 | TitleOfStudentExample.Criteria criteria2 = titleOfStudentExample.createCriteria();
133 | criteria2.andDesOfStuEqualTo(studentId);//当前学生志愿
134 | criteria2.andDesWishOrderEqualTo(1);//第二志愿
135 | List titleOfStudent2= titleOfStudentMapper.selectByExample(titleOfStudentExample2);
136 |
137 | if(titleOfStudent2.size()>0){
138 | return titleOfStudent2.get(0).getDesState();
139 | }
140 | return 0;
141 | }
142 |
143 | /**
144 | * 获取录取的课设信息
145 | * @param studentId
146 | * @return
147 | */
148 | @Override
149 | public Design getAdmitDesign(Integer studentId) {
150 |
151 | TitleOfStudentExample titleOfStudentExample = new TitleOfStudentExample();
152 |
153 | TitleOfStudentExample.Criteria criteria = titleOfStudentExample.createCriteria();
154 |
155 | criteria.andDesOfStuEqualTo(studentId);//当前学生志愿
156 |
157 | criteria.andDesStateEqualTo(1);//已经录取
158 |
159 | List titleOfStudent= titleOfStudentMapper.selectByExample(titleOfStudentExample);
160 |
161 | if (titleOfStudent.size()>0){
162 | return designMapper.selectByPrimaryKey(titleOfStudent.get(0).getDesOfTitle());
163 | }else {
164 | return null;
165 | }
166 | }
167 |
168 | /**
169 | *
170 | * @param teacherId
171 | * @return
172 | */
173 | @Override
174 | public List getByTeacherId(Integer teacherId) {
175 |
176 | DesignExample designExample = new DesignExample();
177 |
178 | DesignExample.Criteria criteria = designExample.createCriteria();
179 |
180 | criteria.andDesignOfTeacherEqualTo(teacherId);
181 |
182 | List designList = designMapper.selectByExample(designExample);//查询出当前教师的所有毕业设计题目
183 |
184 | if (designList.size()>0){
185 |
186 | }
187 |
188 | return null;
189 | }
190 |
191 | /**
192 | * 录取志愿
193 | * @param titleOfStudent
194 | */
195 | @Override
196 | public void admitStudentWish(TitleOfStudent titleOfStudent) {
197 |
198 | titleOfStudent.setDesState(1);//录取
199 |
200 | titleOfStudentMapper.updateByPrimaryKey(titleOfStudent);//提交更新
201 |
202 | //TODO:将该学生的另一个志愿回档
203 |
204 | switch (titleOfStudent.getDesWishOrder()){
205 | case 0://第一志愿被录取、将第二志愿回档
206 | titleOfStudentMapper.backSecondWish(titleOfStudent.getStudent().getStudentId());
207 | break;
208 | case 1://第一志愿被录取、将第二志愿回档
209 | titleOfStudentMapper.backFirstWish(titleOfStudent.getStudent().getStudentId());
210 | break;
211 | }
212 |
213 | }
214 | }
215 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/service/impl/WishServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.service.impl;
2 |
3 | import com.mikey.design.entity.Wish;
4 | import com.mikey.design.mapper.WishMapper;
5 | import com.mikey.design.service.WishService;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.stereotype.Service;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * @author Mikey
13 | * @Title:
14 | * @Description:
15 | * @Email:1625017540@qq.com
16 | * @date 2018/11/28 18:49
17 | * @Version 1.0
18 | */
19 | @Service
20 | public class WishServiceImpl implements WishService {
21 |
22 | @Autowired
23 | private WishMapper wishMapper;
24 |
25 | /**
26 | * 添加志愿
27 | * @param wish
28 | */
29 | @Override
30 | public void addWish(Wish wish) {
31 |
32 | wishMapper.insert(wish);
33 | }
34 |
35 | /**
36 | * 修改志愿
37 | * @param wish
38 | */
39 | @Override
40 | public void updateWish(Wish wish) {
41 | wishMapper.updateByPrimaryKey(wish);
42 |
43 | }
44 |
45 | /**
46 | * 获取志愿信息
47 | * @param wishId
48 | * @return
49 | */
50 | @Override
51 | public Wish getWish(int wishId) {
52 | return wishMapper.selectByPrimaryKey(wishId);
53 | }
54 |
55 | /**
56 | * 获取全部志愿
57 | * @return
58 | */
59 | @Override
60 | public List getAllWish() {
61 | return wishMapper.selectByExample(null);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/utils/GBM.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.utils;
2 |
3 | import org.junit.jupiter.api.Test;
4 | import org.mybatis.generator.api.MyBatisGenerator;
5 | import org.mybatis.generator.config.Configuration;
6 | import org.mybatis.generator.config.xml.ConfigurationParser;
7 | import org.mybatis.generator.internal.DefaultShellCallback;
8 |
9 | import java.io.File;
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | /**
14 | * @author Mikey
15 | * @Title:
16 | * @Description:
17 | * @Email:1625017540@qq.com
18 | * @date 2018/11/27 12:41
19 | * @Version 1.0
20 | */
21 | public class GBM {
22 |
23 | @Test
24 | public static void main(String[] args) throws Exception {
25 | List warnings = new ArrayList();
26 | boolean overwrite = true;
27 | File configFile = new File("E:\\MIKEY\\MobileFile\\Image\\GraduationDesign\\src\\main\\resources\\GBM\\nbg.xml");
28 | ConfigurationParser cp = new ConfigurationParser(warnings);
29 | Configuration config = cp.parseConfiguration(configFile);
30 | DefaultShellCallback callback = new DefaultShellCallback(overwrite);
31 | MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config,
32 | callback, warnings);
33 | myBatisGenerator.generate(null);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/utils/SpringUtil.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.utils;
2 |
3 | import org.springframework.beans.BeansException;
4 | import org.springframework.beans.factory.NoSuchBeanDefinitionException;
5 | import org.springframework.context.ApplicationContext;
6 | import org.springframework.context.ApplicationContextAware;
7 | import org.springframework.stereotype.Component;
8 | /**
9 | * @author Mikey
10 | * @Title:
11 | * @Description:
12 | * @Email:1625017540@qq.com
13 | * @date 2018/12/3 21:57
14 | * @Version 1.0
15 | */
16 | @Component
17 | public class SpringUtil implements ApplicationContextAware {
18 | private static ApplicationContext applicationContext = null;
19 |
20 | public SpringUtil() {
21 | }
22 |
23 | public void setApplicationContext(ApplicationContext arg0) throws BeansException {
24 | if (applicationContext == null) {
25 | applicationContext = arg0;
26 | }
27 |
28 | }
29 |
30 | public static ApplicationContext getApplicationContext() {
31 | return applicationContext;
32 | }
33 |
34 | public static void setAppCtx(ApplicationContext webAppCtx) {
35 | if (webAppCtx != null) {
36 | applicationContext = webAppCtx;
37 | }
38 | }
39 |
40 | /**
41 | * 拿到ApplicationContext对象实例后就可以手动获取Bean的注入实例对象
42 | */
43 | public static T getBean(Class clazz) {
44 | return getApplicationContext().getBean(clazz);
45 | }
46 |
47 | public static T getBean(String name, Class clazz) throws ClassNotFoundException {
48 | return getApplicationContext().getBean(name, clazz);
49 | }
50 |
51 | public static final Object getBean(String beanName) {
52 | return getApplicationContext().getBean(beanName);
53 | }
54 |
55 | public static final Object getBean(String beanName, String className) throws ClassNotFoundException {
56 | Class clz = Class.forName(className);
57 | return getApplicationContext().getBean(beanName, clz.getClass());
58 | }
59 |
60 | public static boolean containsBean(String name) {
61 | return getApplicationContext().containsBean(name);
62 | }
63 |
64 | public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
65 | return getApplicationContext().isSingleton(name);
66 | }
67 |
68 | public static Class> getType(String name) throws NoSuchBeanDefinitionException {
69 | return getApplicationContext().getType(name);
70 | }
71 |
72 | public static String[] getAliases(String name) throws NoSuchBeanDefinitionException {
73 | return getApplicationContext().getAliases(name);
74 | }
75 | }
--------------------------------------------------------------------------------
/src/main/java/com/mikey/design/utils/ThreadLocalUtil.java:
--------------------------------------------------------------------------------
1 | package com.mikey.design.utils;
2 |
3 | /**
4 | * @author Mikey
5 | * @Title:
6 | * @Description:
7 | * @Email:1625017540@qq.com
8 | * @date 2018/12/3 20:11
9 | * @Version 1.0
10 | */
11 | public class ThreadLocalUtil {
12 | public static ThreadLocal