├── src ├── main │ ├── resources │ │ ├── static │ │ │ ├── addLimimt.html │ │ │ ├── javascript │ │ │ │ ├── add.js │ │ │ │ ├── index.js │ │ │ │ ├── login.js │ │ │ │ ├── dw_form_submit.js │ │ │ │ ├── sys_config.js │ │ │ │ └── dw.js │ │ │ ├── courseTeacher.html │ │ │ ├── css │ │ │ │ ├── global.css │ │ │ │ └── login.css │ │ │ ├── image │ │ │ │ ├── main.jpg │ │ │ │ └── login_home_background.jpg │ │ │ ├── icheck │ │ │ │ └── minimal │ │ │ │ │ ├── aero.png │ │ │ │ │ ├── blue.png │ │ │ │ │ ├── grey.png │ │ │ │ │ ├── pink.png │ │ │ │ │ ├── red.png │ │ │ │ │ ├── green.png │ │ │ │ │ ├── orange.png │ │ │ │ │ ├── purple.png │ │ │ │ │ ├── red@2x.png │ │ │ │ │ ├── yellow.png │ │ │ │ │ ├── aero@2x.png │ │ │ │ │ ├── blue@2x.png │ │ │ │ │ ├── green@2x.png │ │ │ │ │ ├── grey@2x.png │ │ │ │ │ ├── minimal.png │ │ │ │ │ ├── orange@2x.png │ │ │ │ │ ├── pink@2x.png │ │ │ │ │ ├── purple@2x.png │ │ │ │ │ ├── yellow@2x.png │ │ │ │ │ ├── minimal@2x.png │ │ │ │ │ ├── minimal.css │ │ │ │ │ ├── red.css │ │ │ │ │ ├── aero.css │ │ │ │ │ ├── blue.css │ │ │ │ │ ├── grey.css │ │ │ │ │ ├── pink.css │ │ │ │ │ ├── green.css │ │ │ │ │ ├── orange.css │ │ │ │ │ ├── purple.css │ │ │ │ │ └── yellow.css │ │ │ ├── layui │ │ │ │ ├── font │ │ │ │ │ ├── iconfont.eot │ │ │ │ │ ├── iconfont.ttf │ │ │ │ │ └── iconfont.woff │ │ │ │ ├── images │ │ │ │ │ └── face │ │ │ │ │ │ ├── 0.gif │ │ │ │ │ │ ├── 1.gif │ │ │ │ │ │ ├── 2.gif │ │ │ │ │ │ ├── 3.gif │ │ │ │ │ │ ├── 4.gif │ │ │ │ │ │ ├── 5.gif │ │ │ │ │ │ ├── 6.gif │ │ │ │ │ │ ├── 7.gif │ │ │ │ │ │ ├── 8.gif │ │ │ │ │ │ ├── 9.gif │ │ │ │ │ │ ├── 10.gif │ │ │ │ │ │ ├── 11.gif │ │ │ │ │ │ ├── 12.gif │ │ │ │ │ │ ├── 13.gif │ │ │ │ │ │ ├── 14.gif │ │ │ │ │ │ ├── 15.gif │ │ │ │ │ │ ├── 16.gif │ │ │ │ │ │ ├── 17.gif │ │ │ │ │ │ ├── 18.gif │ │ │ │ │ │ ├── 19.gif │ │ │ │ │ │ ├── 20.gif │ │ │ │ │ │ ├── 21.gif │ │ │ │ │ │ ├── 22.gif │ │ │ │ │ │ ├── 23.gif │ │ │ │ │ │ ├── 24.gif │ │ │ │ │ │ ├── 25.gif │ │ │ │ │ │ ├── 26.gif │ │ │ │ │ │ ├── 27.gif │ │ │ │ │ │ ├── 28.gif │ │ │ │ │ │ ├── 29.gif │ │ │ │ │ │ ├── 30.gif │ │ │ │ │ │ ├── 31.gif │ │ │ │ │ │ ├── 32.gif │ │ │ │ │ │ ├── 33.gif │ │ │ │ │ │ ├── 34.gif │ │ │ │ │ │ ├── 35.gif │ │ │ │ │ │ ├── 36.gif │ │ │ │ │ │ ├── 37.gif │ │ │ │ │ │ ├── 38.gif │ │ │ │ │ │ ├── 39.gif │ │ │ │ │ │ ├── 40.gif │ │ │ │ │ │ ├── 41.gif │ │ │ │ │ │ ├── 42.gif │ │ │ │ │ │ ├── 43.gif │ │ │ │ │ │ ├── 44.gif │ │ │ │ │ │ ├── 45.gif │ │ │ │ │ │ ├── 46.gif │ │ │ │ │ │ ├── 47.gif │ │ │ │ │ │ ├── 48.gif │ │ │ │ │ │ ├── 49.gif │ │ │ │ │ │ ├── 50.gif │ │ │ │ │ │ ├── 51.gif │ │ │ │ │ │ ├── 52.gif │ │ │ │ │ │ ├── 53.gif │ │ │ │ │ │ ├── 54.gif │ │ │ │ │ │ ├── 55.gif │ │ │ │ │ │ ├── 56.gif │ │ │ │ │ │ ├── 57.gif │ │ │ │ │ │ ├── 58.gif │ │ │ │ │ │ ├── 59.gif │ │ │ │ │ │ ├── 60.gif │ │ │ │ │ │ ├── 61.gif │ │ │ │ │ │ ├── 62.gif │ │ │ │ │ │ ├── 63.gif │ │ │ │ │ │ ├── 64.gif │ │ │ │ │ │ ├── 65.gif │ │ │ │ │ │ ├── 66.gif │ │ │ │ │ │ ├── 67.gif │ │ │ │ │ │ ├── 68.gif │ │ │ │ │ │ ├── 69.gif │ │ │ │ │ │ ├── 70.gif │ │ │ │ │ │ └── 71.gif │ │ │ │ ├── css │ │ │ │ │ └── modules │ │ │ │ │ │ ├── layer │ │ │ │ │ │ └── default │ │ │ │ │ │ │ ├── icon.png │ │ │ │ │ │ │ ├── icon-ext.png │ │ │ │ │ │ │ ├── loading-0.gif │ │ │ │ │ │ │ ├── loading-1.gif │ │ │ │ │ │ │ └── loading-2.gif │ │ │ │ │ │ └── code.css │ │ │ │ └── lay │ │ │ │ │ └── modules │ │ │ │ │ ├── code.js │ │ │ │ │ ├── laytpl.js │ │ │ │ │ ├── flow.js │ │ │ │ │ ├── rate.js │ │ │ │ │ ├── tree.js │ │ │ │ │ ├── util.js │ │ │ │ │ ├── carousel.js │ │ │ │ │ └── laypage.js │ │ │ ├── welcome.html │ │ │ ├── login.html │ │ │ ├── updateCourse.html │ │ │ ├── index.html │ │ │ ├── user.html │ │ │ ├── son │ │ │ │ ├── userson.html │ │ │ │ └── classson.html │ │ │ ├── classroom.html │ │ │ └── teacher.html │ │ ├── application.properties │ │ └── generatorConfig.xml │ └── java │ │ └── com │ │ └── hut │ │ └── kwk │ │ ├── service │ │ ├── IArrService.java │ │ ├── ITeacherService.java │ │ ├── IClassesService.java │ │ ├── IArrangeService.java │ │ ├── ISemesterService.java │ │ ├── ITeachingService.java │ │ ├── ICourseService.java │ │ ├── IUserService.java │ │ ├── IClassroomService.java │ │ ├── ICourseTableService.java │ │ └── impl │ │ │ ├── SemesterServiceImpl.java │ │ │ ├── TeacherServiceImpl.java │ │ │ ├── ClassesServiceImpl.java │ │ │ ├── TeachingServiceImpl.java │ │ │ ├── CourseServiceImpl.java │ │ │ ├── ArrangeServiceImpl.java │ │ │ ├── UserServiceImpl.java │ │ │ ├── CourseTableServiceImpl.java │ │ │ └── ClassroomServiceImpl.java │ │ ├── constant │ │ ├── Constant.java │ │ ├── LayerResponse.java │ │ └── ServerResponse.java │ │ ├── model │ │ └── entity │ │ │ ├── ClassroomHelp.java │ │ │ └── ClassroomFree.java │ │ ├── ArrangingCoursesApplication.java │ │ ├── interceptor │ │ ├── LoginRequired.java │ │ └── AuthorityInterceptor.java │ │ ├── util │ │ ├── ToLayerUtil.java │ │ └── DayUtil.java │ │ ├── controller │ │ ├── ArrController.java │ │ ├── ArrangeController.java │ │ ├── TeacherController.java │ │ ├── ClassesController.java │ │ ├── CourseController.java │ │ ├── ClassroomController.java │ │ ├── UserController.java │ │ └── CourseTableController.java │ │ ├── CorsConfig.java │ │ ├── MyWebMvcConfig.java │ │ └── RedisConfiguration.java └── test │ └── java │ └── com │ └── example │ └── demo │ └── ArrangingCoursesApplicationTests.java ├── generator.sh ├── README.md ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ ├── maven-wrapper.properties │ └── MavenWrapperDownloader.java ├── migrations └── drivers │ └── mysql-connector-java-5.1.47.jar ├── .gitignore └── pom.xml /src/main/resources/static/addLimimt.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/main/resources/static/javascript/add.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/main/resources/static/courseTeacher.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/main/resources/static/css/global.css: -------------------------------------------------------------------------------- 1 | .text-center{ 2 | text-align: center; 3 | } -------------------------------------------------------------------------------- /src/main/resources/static/javascript/index.js: -------------------------------------------------------------------------------- 1 | layui.use(['element'], function () { 2 | }); -------------------------------------------------------------------------------- /generator.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | mvn -Dmybatis.generator.overwrite=true mybatis-generator:generate 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # arranging-courses 2 | springboot排课系统 3 | 4 | 等项目写完了我会将项目完全开源并编写接口文档 5 | 6 | 项目架构:Layer+SpringBoot 7 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/static/image/main.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/image/main.jpg -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/aero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/aero.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/blue.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/grey.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/pink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/pink.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/red.png -------------------------------------------------------------------------------- /src/main/resources/static/layui/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/font/iconfont.eot -------------------------------------------------------------------------------- /src/main/resources/static/layui/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/font/iconfont.ttf -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/0.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/1.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/2.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/3.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/4.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/5.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/6.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/7.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/8.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/9.gif -------------------------------------------------------------------------------- /migrations/drivers/mysql-connector-java-5.1.47.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/migrations/drivers/mysql-connector-java-5.1.47.jar -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/green.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/orange.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/purple.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/red@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/red@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/yellow.png -------------------------------------------------------------------------------- /src/main/resources/static/layui/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/font/iconfont.woff -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/10.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/11.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/12.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/13.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/14.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/15.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/16.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/17.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/18.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/19.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/20.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/21.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/22.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/23.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/24.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/25.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/26.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/27.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/28.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/29.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/30.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/31.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/32.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/33.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/34.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/35.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/36.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/37.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/38.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/39.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/40.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/41.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/42.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/43.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/44.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/45.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/46.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/47.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/48.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/49.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/50.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/51.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/52.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/53.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/54.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/55.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/56.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/57.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/58.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/59.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/60.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/61.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/62.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/63.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/64.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/65.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/66.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/67.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/68.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/69.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/70.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/images/face/71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/images/face/71.gif -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/aero@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/aero@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/blue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/blue@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/green@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/green@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/grey@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/grey@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/minimal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/minimal.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/orange@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/orange@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/pink@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/pink@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/purple@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/purple@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/yellow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/yellow@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/minimal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/icheck/minimal/minimal@2x.png -------------------------------------------------------------------------------- /src/main/resources/static/image/login_home_background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/image/login_home_background.jpg -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/css/modules/layer/default/icon.png -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/css/modules/layer/default/icon-ext.png -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/css/modules/layer/default/loading-0.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/css/modules/layer/default/loading-1.gif -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/layer/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xiaoyingzhi/arranging-courses/HEAD/src/main/resources/static/layui/css/modules/layer/default/loading-2.gif -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/IArrService.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service; 2 | 3 | import com.hut.kwk.constant.ServerResponse; 4 | 5 | /** 6 | * Create by kwk on 2019-04-24 7 | * 8 | * @author kwk 9 | */ 10 | public interface IArrService { 11 | ServerResponse arr(int weeks); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/constant/Constant.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.constant; 2 | 3 | /** 4 | * Create by kwk on 2019-04-17 5 | * 6 | * @author kwk 7 | */ 8 | public class Constant { 9 | public static final String ADMIN = "超级管理员"; 10 | 11 | public static final String NOT_ADMIN = "普通用户"; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/model/entity/ClassroomHelp.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.model.entity; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * Create by kwk on 2019-04-25 7 | * 8 | * @author kwk 9 | */ 10 | @Data 11 | public class ClassroomHelp extends Classroom { 12 | private Integer day; 13 | private Integer number; 14 | } 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | 28 | ### VS Code ### 29 | .vscode/ 30 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/ArrangingCoursesApplication.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * @author kwk 8 | */ 9 | @SpringBootApplication 10 | public class ArrangingCoursesApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(ArrangingCoursesApplication.class, args); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/model/entity/ClassroomFree.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.model.entity; 2 | 3 | import lombok.Data; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Create by Wang Heng on 2019-04-29 9 | * 10 | * @author Wang Heng 11 | */ 12 | @Data 13 | public class ClassroomFree implements Serializable { 14 | 15 | private Integer week; 16 | private Integer classroomId; 17 | private String classroomName; 18 | private String day; 19 | private Integer number; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/resources/static/javascript/login.js: -------------------------------------------------------------------------------- 1 | layui.use(['layer','form'], function(){ 2 | var form = layui.form; 3 | var layer = layui.layer; 4 | 5 | //监听提交 6 | form.on('submit(formDemo)', function (data) { 7 | var action = data.form.action;//表单提交URL地址 8 | console.log(JSON.stringify(data.field));//表单数据 9 | $.post(action, data.field, function (obj) { 10 | //根据返回结果作出相应处理 11 | }); 12 | return false;//注释掉这行代码后,表单将会以普通方式提交表单,否则以ajax方式提交表单 13 | }); 14 | }); -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/constant/LayerResponse.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.constant; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | import java.io.Serializable; 7 | 8 | /** 9 | * Create by kwk on 2019-04-21 10 | * 11 | * @author kwk 12 | */ 13 | @Data 14 | @AllArgsConstructor 15 | public class LayerResponse implements Serializable { 16 | //"code":0,"msg":"","count":1000,"data" 17 | private Integer code; 18 | private String msg; 19 | private Long count; 20 | private T data; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/interceptor/LoginRequired.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.interceptor; 2 | 3 | /** 4 | * Create by Wang Heng on 2019-05-05 5 | * 6 | * @author Wang Heng 7 | */ 8 | 9 | import java.lang.annotation.ElementType; 10 | import java.lang.annotation.Retention; 11 | import java.lang.annotation.RetentionPolicy; 12 | import java.lang.annotation.Target; 13 | 14 | /** 15 | * 在需要登录验证的Controller的方法上使用此注解 16 | */ 17 | @Target({ElementType.METHOD})// 可用在方法名上 18 | @Retention(RetentionPolicy.RUNTIME)// 运行时有效 19 | public @interface LoginRequired { 20 | String value() default ""; 21 | } -------------------------------------------------------------------------------- /src/main/resources/static/welcome.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | layout 后台大布局 - Layui 7 | 8 | 9 |
10 |
11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/ITeacherService.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.Teacher; 6 | 7 | public interface ITeacherService { 8 | ServerResponse add(String name, String phone,Integer countLimit); 9 | 10 | ServerResponse del(Integer id); 11 | 12 | ServerResponse update(Integer id, String name, String phone,Integer countLimit); 13 | 14 | ServerResponse find(Integer id); 15 | 16 | ServerResponse> findAll(Integer pageNum, Integer pageSize); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/IClassesService.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.Classes; 6 | 7 | public interface IClassesService { 8 | ServerResponse add(String className, String classNum,Integer limit); 9 | 10 | ServerResponse del(Integer id); 11 | 12 | ServerResponse update(Integer id, String className, String classNum ,Integer limit); 13 | 14 | ServerResponse find(Integer id); 15 | 16 | ServerResponse> findAll(Integer pageNum, Integer pageSize); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/IArrangeService.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.Arrange; 6 | 7 | /** 8 | * Create by kwk on 2019-04-23 9 | * 10 | * @author kwk 11 | */ 12 | public interface IArrangeService { 13 | ServerResponse add(Arrange arrange); 14 | 15 | ServerResponse del(Integer id); 16 | 17 | ServerResponse update(Arrange arrange); 18 | 19 | ServerResponse find(Integer id); 20 | 21 | ServerResponse> findAll(Integer pageNum, Integer pageSize); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/ISemesterService.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.Semester; 6 | 7 | public interface ISemesterService { 8 | ServerResponse add(String year, String semester, Integer weekCount); 9 | 10 | ServerResponse del(Integer id); 11 | 12 | ServerResponse update(Integer id, String year, String semester, Integer weekCount); 13 | 14 | ServerResponse> findAll(Integer pageNum, Integer pageSize); 15 | 16 | ServerResponse find(Integer id); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/util/ToLayerUtil.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.util; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.LayerResponse; 5 | import com.hut.kwk.constant.ServerResponse; 6 | import com.hut.kwk.model.entity.User; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * Create by kwk on 2019-04-21 12 | * 13 | * @author kwk 14 | */ 15 | public class ToLayerUtil { 16 | public static LayerResponse> toLayer(ServerResponse> serverResponse){ 17 | return new LayerResponse<>(serverResponse.getStatus(),serverResponse.getMsg(),serverResponse.getData().getTotal(),serverResponse.getData().getList()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/ITeachingService.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.Teaching; 6 | 7 | public interface ITeachingService { 8 | ServerResponse add(Integer classId, Integer teacherId, Integer semId, String className, String techerName); 9 | 10 | ServerResponse del(Integer id); 11 | 12 | ServerResponse update(Integer id, Integer classId, Integer teacherId, Integer semId, String className, String techerName); 13 | 14 | ServerResponse find(Integer id); 15 | 16 | ServerResponse> findAll(Integer pageNum, Integer pageSize); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/resources/static/javascript/dw_form_submit.js: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | 表单提交页面通用表单监听(如有特殊需求可参照此文件写一个单独的js文件,如:sys_config.js) 3 | // +---------------------------------------------------------------------- 4 | layui.use(['element','form'], function(){ 5 | var element = layui.element; 6 | var form = layui.form; 7 | //监听提交 8 | form.on('submit(formDemo)', function(data){ 9 | var action = data.form.action;//表单提交URL地址 10 | console.log(JSON.stringify(data.field));//表单数据 11 | $.post(action,data.field,function(obj){ 12 | //根据返回结果作出相应处理 13 | }); 14 | return false;//注释掉这行代码后,表单将会以普通方式提交表单,否则以ajax方式提交表单 15 | }); 16 | }); -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/controller/ArrController.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.controller; 2 | 3 | import com.hut.kwk.constant.ServerResponse; 4 | import com.hut.kwk.service.IArrService; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | /** 10 | * Create by kwk on 2019-04-24 11 | * 12 | * @author kwk 13 | */ 14 | @RestController 15 | @RequestMapping("/process/") 16 | public class ArrController { 17 | 18 | @Autowired 19 | private IArrService iArrService; 20 | @RequestMapping("arr") 21 | public ServerResponse arr() { 22 | return iArrService.arr(20); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/CorsConfig.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.CorsRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | 7 | /** 8 | * Create by kwk on 2019-04-18 9 | * 10 | * @author kwk 11 | */ 12 | @Configuration 13 | public class CorsConfig implements WebMvcConfigurer { 14 | 15 | @Override 16 | public void addCorsMappings(CorsRegistry registry) { 17 | registry.addMapping("/**") 18 | .allowedOrigins("*") 19 | .allowCredentials(true) 20 | .allowedMethods("GET", "POST", "DELETE", "PUT","PATCH") 21 | .maxAge(3600); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/ICourseService.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.Course; 6 | 7 | public interface ICourseService { 8 | ServerResponse add(String courseName, Integer courseTime,Integer sord); 9 | 10 | ServerResponse del(Integer id); 11 | 12 | ServerResponse update(Integer id, String courseName, Integer courseTime ,Integer sord); 13 | 14 | ServerResponse find(Integer id); 15 | 16 | ServerResponse> findAll(Integer pageNum, Integer pageSize); 17 | 18 | ServerResponse> findAllByName(Integer pageNum, Integer pageSize, String courseName); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/IUserService.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.User; 6 | 7 | /** 8 | * Create by kwk on 2019-04-17 9 | * 10 | * @author kwk 11 | */ 12 | public interface IUserService { 13 | ServerResponse add(String username, String password, String role); 14 | 15 | ServerResponse login(String username, String password, String role); 16 | 17 | ServerResponse del(Integer id); 18 | 19 | ServerResponse> findAll(String role, Integer pageNum, Integer pageSize); 20 | 21 | ServerResponse findById(Integer id); 22 | 23 | ServerResponse update(Integer id, String username, String password,String role); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/IClassroomService.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.Classroom; 6 | import com.hut.kwk.model.entity.ClassroomFree; 7 | 8 | import java.util.List; 9 | 10 | public interface IClassroomService { 11 | ServerResponse add(String roomName, Integer roomSpace, Integer roomLayer); 12 | 13 | ServerResponse del(Integer id); 14 | 15 | ServerResponse find(Integer id); 16 | 17 | ServerResponse> findAll(Integer pageNum, Integer pageSize); 18 | 19 | ServerResponse update(Integer id, String roomName, Integer roomSpace, Integer roomLaye); 20 | 21 | List findByWeek(Integer week,String roomName); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/MyWebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk; 2 | 3 | import com.hut.kwk.interceptor.AuthorityInterceptor; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 8 | 9 | /** 10 | * 11 | * @author kwk 12 | */ 13 | @Configuration 14 | public class MyWebMvcConfig implements WebMvcConfigurer { 15 | 16 | @Override 17 | public void addInterceptors(InterceptorRegistry registry) { 18 | // 拦截所有请求,通过判断是否有 @LoginRequired 注解 决定是否需要登录 19 | registry.addInterceptor(authorityinterceptor()).addPathPatterns("/**"); 20 | } 21 | 22 | 23 | @Bean 24 | public AuthorityInterceptor authorityinterceptor() { 25 | return new AuthorityInterceptor(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Redis数据库索引(默认为0) 2 | spring.redis.database=0 3 | # Redis服务器地址 4 | spring.redis.host=139.196.101.194 5 | # Redis服务器连接端口 6 | spring.redis.port=6379 7 | # Redis服务器连接密码(默认为空) 8 | spring.redis.password=Wh1206123 9 | # 连接池最大连接数(使用负值表示没有限制) 10 | spring.redis.jedis.pool.max-active=8 11 | # 连接池最大阻塞等待时间(使用负值表示没有限制) 12 | spring.redis.jedis.pool.max-wait=-1 13 | # 连接池中的最大空闲连接 14 | spring.redis.jedis.pool.max-idle=8 15 | # 连接池中的最小空闲连接 16 | spring.redis.jedis.pool.min-idle=0 17 | # 连接超时时间(毫秒) 18 | spring.redis.timeout=10000 19 | 20 | #tomcat端口 21 | server.port=8088 22 | 23 | #数据连接 24 | db.driverClassName=com.mysql.cj.jdbc.Driver 25 | 26 | #数据连接 27 | spring.datasource.url=jdbc:mysql://139.196.101.194:3306/arranging_courses?characterEncoding=utf-8 28 | spring.datasource.username=root 29 | spring.datasource.password=Wh1206123. 30 | spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver 31 | 32 | #Mybatis扫描 33 | mybatis.mapper-locations=classpath*:com/hut/kwk/model/mapper/*.xml 34 | #起别名。可省略写mybatis的xml中的resultType的全路径 35 | #mybatis.type-aliases-package=com.hut.kwk 36 | 37 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/code.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
  1. '+o.replace(/[\r\t\n]+/g,"
  2. ")+"
"),c.find(">.layui-code-h3")[0]||c.prepend('

'+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/ICourseTableService.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.CourseTable; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Create by kwk on 2019-04-24 11 | * 12 | * @author kwk 13 | */ 14 | public interface ICourseTableService { 15 | ServerResponse add(CourseTable courseTable); 16 | 17 | ServerResponse del(Integer id); 18 | 19 | ServerResponse update(CourseTable courseTable); 20 | 21 | ServerResponse find(Integer id); 22 | 23 | ServerResponse> findAll(Integer pageNum, Integer pageSize); 24 | 25 | ServerResponse arr(); 26 | 27 | ServerResponse> findBy(String className, String teacherName,Integer week); 28 | 29 | ServerResponse> findAllBy(Integer pageNum, Integer pageSize, Integer week, String courseName, String className, String teacherName, String roomName); 30 | 31 | ServerResponse adjust(Integer courseTableId, Integer classroomId, Integer week, String day, Integer number, String classroomName); 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/com/example/demo/ArrangingCoursesApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import com.hut.kwk.ArrangingCoursesApplication; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | import org.springframework.data.redis.core.RedisTemplate; 9 | import org.springframework.data.redis.core.StringRedisTemplate; 10 | import org.springframework.test.context.junit4.SpringRunner; 11 | 12 | @RunWith(SpringRunner.class) 13 | @SpringBootTest(classes = ArrangingCoursesApplication.class) 14 | public class ArrangingCoursesApplicationTests { 15 | 16 | 17 | @Autowired 18 | private StringRedisTemplate stringRedisTemplate; 19 | @Autowired 20 | private RedisTemplate redisTemplate; 21 | 22 | @Test 23 | public void test(){ 24 | stringRedisTemplate.opsForValue().set("111","222"); 25 | System.out.println(stringRedisTemplate.opsForValue().get("111")); 26 | } 27 | 28 | 29 | public void getRedis(String key){ 30 | 31 | //return stringRedisTemplate.opsForValue().get(key); 32 | } 33 | 34 | 35 | public void setRedis(String key,String value){ 36 | stringRedisTemplate.opsForValue().set(key,value); 37 | // return "SUCCESS"; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/util/DayUtil.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.util; 2 | 3 | /** 4 | * Create by kwk on 2019-04-25 5 | * 6 | * @author kwk 7 | */ 8 | public class DayUtil { 9 | public static String toDay(int x){ 10 | switch (x){ 11 | case 1: 12 | return "星期一"; 13 | case 2: 14 | return "星期二"; 15 | case 3: 16 | return "星期三"; 17 | case 4: 18 | return "星期四"; 19 | case 5: 20 | return "星期五"; 21 | default: 22 | return null; 23 | } 24 | } 25 | public static String toTime(int x){ 26 | switch (x){ 27 | case 1: 28 | return "第一节"; 29 | case 2: 30 | return "第二节"; 31 | case 3: 32 | return "第三节"; 33 | case 4: 34 | return "第四节"; 35 | default: 36 | return null; 37 | } 38 | 39 | } 40 | 41 | public static Integer toDayNum(String x){ 42 | switch (x){ 43 | case "星期一": 44 | return 1; 45 | case "星期二": 46 | return 2; 47 | case "星期三": 48 | return 3; 49 | case "星期四": 50 | return 4; 51 | case "星期五": 52 | return 5; 53 | default: 54 | return null; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/controller/ArrangeController.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.controller; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.Arrange; 6 | import com.hut.kwk.service.IArrangeService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * Create by kwk on 2019-04-23 13 | * 14 | * @author kwk 15 | */ 16 | @RestController 17 | @RequestMapping("/arrange/") 18 | public class ArrangeController { 19 | 20 | @Autowired 21 | private IArrangeService iArrangeService; 22 | 23 | @RequestMapping("add") 24 | public ServerResponse add(Arrange arrange) { 25 | return iArrangeService.add(arrange); 26 | } 27 | 28 | @RequestMapping("del") 29 | public ServerResponse del(Integer id) { 30 | return iArrangeService.del(id); 31 | } 32 | 33 | @RequestMapping("update") 34 | public ServerResponse update(Arrange arrange) { 35 | return iArrangeService.update(arrange); 36 | } 37 | 38 | @RequestMapping("find") 39 | public ServerResponse find(Integer id) { 40 | return iArrangeService.find(id); 41 | } 42 | 43 | @RequestMapping("findAll") 44 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 45 | return iArrangeService.findAll(pageNum, pageSize); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/controller/TeacherController.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.controller; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.Teacher; 6 | import com.hut.kwk.service.ITeacherService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * Create by kwk on 2019-04-17 13 | * 14 | * @author kwk 15 | */ 16 | @RestController 17 | @RequestMapping("/teacher/") 18 | public class TeacherController { 19 | @Autowired 20 | private ITeacherService iTeacherService; 21 | 22 | @RequestMapping("add") 23 | public ServerResponse add(String name, String phone,Integer countLimit) { 24 | return iTeacherService.add(name, phone,countLimit); 25 | } 26 | 27 | @RequestMapping("del") 28 | public ServerResponse del(Integer id) { 29 | return iTeacherService.del(id); 30 | } 31 | 32 | @RequestMapping("update") 33 | public ServerResponse update(Integer id, String name, String phone,Integer countLimit) { 34 | return iTeacherService.update(id, name, phone,countLimit); 35 | } 36 | 37 | @RequestMapping("find") 38 | public ServerResponse find(Integer id) { 39 | return iTeacherService.find(id); 40 | } 41 | 42 | @RequestMapping("findAll") 43 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 44 | return iTeacherService.findAll(pageNum, pageSize); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/controller/ClassesController.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.controller; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.Classes; 6 | import com.hut.kwk.service.IClassesService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * Create by kwk on 2019-04-17 13 | * 14 | * @author kwk 15 | */ 16 | @RestController 17 | @RequestMapping("/classes/") 18 | public class ClassesController { 19 | @Autowired 20 | private IClassesService iClassesService; 21 | 22 | @RequestMapping("add") 23 | public ServerResponse add(String className, String classNum,Integer limit) { 24 | return iClassesService.add(className, classNum,limit); 25 | } 26 | 27 | @RequestMapping("del") 28 | public ServerResponse del(Integer id) { 29 | return iClassesService.del(id); 30 | } 31 | 32 | @RequestMapping("update") 33 | public ServerResponse update(Integer id, String className, String classNum,Integer limit) { 34 | return iClassesService.update(id, className, classNum,limit); 35 | } 36 | 37 | @RequestMapping("find") 38 | public ServerResponse find(Integer id) { 39 | return iClassesService.find(id); 40 | } 41 | 42 | @RequestMapping("findAll") 43 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 44 | return iClassesService.findAll(pageNum, pageSize); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/minimal.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Minimal skin, black 2 | ----------------------------------- */ 3 | .icheckbox_minimal, 4 | .iradio_minimal { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 18px; 11 | height: 18px; 12 | background: url(minimal.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_minimal { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_minimal.hover { 21 | background-position: -20px 0; 22 | } 23 | .icheckbox_minimal.checked { 24 | background-position: -40px 0; 25 | } 26 | .icheckbox_minimal.disabled { 27 | background-position: -60px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_minimal.checked.disabled { 31 | background-position: -80px 0; 32 | } 33 | 34 | .iradio_minimal { 35 | background-position: -100px 0; 36 | } 37 | .iradio_minimal.hover { 38 | background-position: -120px 0; 39 | } 40 | .iradio_minimal.checked { 41 | background-position: -140px 0; 42 | } 43 | .iradio_minimal.disabled { 44 | background-position: -160px 0; 45 | cursor: default; 46 | } 47 | .iradio_minimal.checked.disabled { 48 | background-position: -180px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_minimal, 54 | .iradio_minimal { 55 | background-image: url(minimal@2x.png); 56 | -webkit-background-size: 200px 20px; 57 | background-size: 200px 20px; 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/RedisConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.PropertyAccessor; 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.data.redis.connection.RedisConnectionFactory; 9 | import org.springframework.data.redis.core.RedisTemplate; 10 | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; 11 | import org.springframework.data.redis.serializer.StringRedisSerializer; 12 | 13 | /** 14 | * @author kwk 15 | */ 16 | @Configuration 17 | public class RedisConfiguration { 18 | 19 | @Bean 20 | public RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory) { 21 | RedisTemplate redisTemplate = new RedisTemplate<>(); 22 | redisTemplate.setConnectionFactory(redisConnectionFactory); 23 | 24 | // 使用Jackson2JsonRedisSerialize 替换默认序列化 25 | Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class); 26 | 27 | ObjectMapper objectMapper = new ObjectMapper(); 28 | objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); 29 | objectMapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); 30 | 31 | jackson2JsonRedisSerializer.setObjectMapper(objectMapper); 32 | 33 | // 设置value的序列化规则和 key的序列化规则 34 | redisTemplate.setValueSerializer(jackson2JsonRedisSerializer); 35 | redisTemplate.setKeySerializer(new StringRedisSerializer()); 36 | redisTemplate.afterPropertiesSet(); 37 | return redisTemplate; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/laytpl.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)}); -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/red.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Minimal skin, red 2 | ----------------------------------- */ 3 | .icheckbox_minimal-red, 4 | .iradio_minimal-red { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 18px; 11 | height: 18px; 12 | background: url(red.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_minimal-red { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_minimal-red.hover { 21 | background-position: -20px 0; 22 | } 23 | .icheckbox_minimal-red.checked { 24 | background-position: -40px 0; 25 | } 26 | .icheckbox_minimal-red.disabled { 27 | background-position: -60px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_minimal-red.checked.disabled { 31 | background-position: -80px 0; 32 | } 33 | 34 | .iradio_minimal-red { 35 | background-position: -100px 0; 36 | } 37 | .iradio_minimal-red.hover { 38 | background-position: -120px 0; 39 | } 40 | .iradio_minimal-red.checked { 41 | background-position: -140px 0; 42 | } 43 | .iradio_minimal-red.disabled { 44 | background-position: -160px 0; 45 | cursor: default; 46 | } 47 | .iradio_minimal-red.checked.disabled { 48 | background-position: -180px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_minimal-red, 54 | .iradio_minimal-red { 55 | background-image: url(red@2x.png); 56 | -webkit-background-size: 200px 20px; 57 | background-size: 200px 20px; 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/aero.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Minimal skin, aero 2 | ----------------------------------- */ 3 | .icheckbox_minimal-aero, 4 | .iradio_minimal-aero { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 18px; 11 | height: 18px; 12 | background: url(aero.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_minimal-aero { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_minimal-aero.hover { 21 | background-position: -20px 0; 22 | } 23 | .icheckbox_minimal-aero.checked { 24 | background-position: -40px 0; 25 | } 26 | .icheckbox_minimal-aero.disabled { 27 | background-position: -60px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_minimal-aero.checked.disabled { 31 | background-position: -80px 0; 32 | } 33 | 34 | .iradio_minimal-aero { 35 | background-position: -100px 0; 36 | } 37 | .iradio_minimal-aero.hover { 38 | background-position: -120px 0; 39 | } 40 | .iradio_minimal-aero.checked { 41 | background-position: -140px 0; 42 | } 43 | .iradio_minimal-aero.disabled { 44 | background-position: -160px 0; 45 | cursor: default; 46 | } 47 | .iradio_minimal-aero.checked.disabled { 48 | background-position: -180px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_minimal-aero, 54 | .iradio_minimal-aero { 55 | background-image: url(aero@2x.png); 56 | -webkit-background-size: 200px 20px; 57 | background-size: 200px 20px; 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/blue.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Minimal skin, blue 2 | ----------------------------------- */ 3 | .icheckbox_minimal-blue, 4 | .iradio_minimal-blue { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 18px; 11 | height: 18px; 12 | background: url(blue.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_minimal-blue { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_minimal-blue.hover { 21 | background-position: -20px 0; 22 | } 23 | .icheckbox_minimal-blue.checked { 24 | background-position: -40px 0; 25 | } 26 | .icheckbox_minimal-blue.disabled { 27 | background-position: -60px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_minimal-blue.checked.disabled { 31 | background-position: -80px 0; 32 | } 33 | 34 | .iradio_minimal-blue { 35 | background-position: -100px 0; 36 | } 37 | .iradio_minimal-blue.hover { 38 | background-position: -120px 0; 39 | } 40 | .iradio_minimal-blue.checked { 41 | background-position: -140px 0; 42 | } 43 | .iradio_minimal-blue.disabled { 44 | background-position: -160px 0; 45 | cursor: default; 46 | } 47 | .iradio_minimal-blue.checked.disabled { 48 | background-position: -180px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_minimal-blue, 54 | .iradio_minimal-blue { 55 | background-image: url(blue@2x.png); 56 | -webkit-background-size: 200px 20px; 57 | background-size: 200px 20px; 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/grey.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Minimal skin, grey 2 | ----------------------------------- */ 3 | .icheckbox_minimal-grey, 4 | .iradio_minimal-grey { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 18px; 11 | height: 18px; 12 | background: url(grey.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_minimal-grey { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_minimal-grey.hover { 21 | background-position: -20px 0; 22 | } 23 | .icheckbox_minimal-grey.checked { 24 | background-position: -40px 0; 25 | } 26 | .icheckbox_minimal-grey.disabled { 27 | background-position: -60px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_minimal-grey.checked.disabled { 31 | background-position: -80px 0; 32 | } 33 | 34 | .iradio_minimal-grey { 35 | background-position: -100px 0; 36 | } 37 | .iradio_minimal-grey.hover { 38 | background-position: -120px 0; 39 | } 40 | .iradio_minimal-grey.checked { 41 | background-position: -140px 0; 42 | } 43 | .iradio_minimal-grey.disabled { 44 | background-position: -160px 0; 45 | cursor: default; 46 | } 47 | .iradio_minimal-grey.checked.disabled { 48 | background-position: -180px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_minimal-grey, 54 | .iradio_minimal-grey { 55 | background-image: url(grey@2x.png); 56 | -webkit-background-size: 200px 20px; 57 | background-size: 200px 20px; 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/pink.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Minimal skin, pink 2 | ----------------------------------- */ 3 | .icheckbox_minimal-pink, 4 | .iradio_minimal-pink { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 18px; 11 | height: 18px; 12 | background: url(pink.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_minimal-pink { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_minimal-pink.hover { 21 | background-position: -20px 0; 22 | } 23 | .icheckbox_minimal-pink.checked { 24 | background-position: -40px 0; 25 | } 26 | .icheckbox_minimal-pink.disabled { 27 | background-position: -60px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_minimal-pink.checked.disabled { 31 | background-position: -80px 0; 32 | } 33 | 34 | .iradio_minimal-pink { 35 | background-position: -100px 0; 36 | } 37 | .iradio_minimal-pink.hover { 38 | background-position: -120px 0; 39 | } 40 | .iradio_minimal-pink.checked { 41 | background-position: -140px 0; 42 | } 43 | .iradio_minimal-pink.disabled { 44 | background-position: -160px 0; 45 | cursor: default; 46 | } 47 | .iradio_minimal-pink.checked.disabled { 48 | background-position: -180px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_minimal-pink, 54 | .iradio_minimal-pink { 55 | background-image: url(pink@2x.png); 56 | -webkit-background-size: 200px 20px; 57 | background-size: 200px 20px; 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/green.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Minimal skin, green 2 | ----------------------------------- */ 3 | .icheckbox_minimal-green, 4 | .iradio_minimal-green { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 18px; 11 | height: 18px; 12 | background: url(green.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_minimal-green { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_minimal-green.hover { 21 | background-position: -20px 0; 22 | } 23 | .icheckbox_minimal-green.checked { 24 | background-position: -40px 0; 25 | } 26 | .icheckbox_minimal-green.disabled { 27 | background-position: -60px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_minimal-green.checked.disabled { 31 | background-position: -80px 0; 32 | } 33 | 34 | .iradio_minimal-green { 35 | background-position: -100px 0; 36 | } 37 | .iradio_minimal-green.hover { 38 | background-position: -120px 0; 39 | } 40 | .iradio_minimal-green.checked { 41 | background-position: -140px 0; 42 | } 43 | .iradio_minimal-green.disabled { 44 | background-position: -160px 0; 45 | cursor: default; 46 | } 47 | .iradio_minimal-green.checked.disabled { 48 | background-position: -180px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_minimal-green, 54 | .iradio_minimal-green { 55 | background-image: url(green@2x.png); 56 | -webkit-background-size: 200px 20px; 57 | background-size: 200px 20px; 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/orange.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Minimal skin, orange 2 | ----------------------------------- */ 3 | .icheckbox_minimal-orange, 4 | .iradio_minimal-orange { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 18px; 11 | height: 18px; 12 | background: url(orange.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_minimal-orange { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_minimal-orange.hover { 21 | background-position: -20px 0; 22 | } 23 | .icheckbox_minimal-orange.checked { 24 | background-position: -40px 0; 25 | } 26 | .icheckbox_minimal-orange.disabled { 27 | background-position: -60px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_minimal-orange.checked.disabled { 31 | background-position: -80px 0; 32 | } 33 | 34 | .iradio_minimal-orange { 35 | background-position: -100px 0; 36 | } 37 | .iradio_minimal-orange.hover { 38 | background-position: -120px 0; 39 | } 40 | .iradio_minimal-orange.checked { 41 | background-position: -140px 0; 42 | } 43 | .iradio_minimal-orange.disabled { 44 | background-position: -160px 0; 45 | cursor: default; 46 | } 47 | .iradio_minimal-orange.checked.disabled { 48 | background-position: -180px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_minimal-orange, 54 | .iradio_minimal-orange { 55 | background-image: url(orange@2x.png); 56 | -webkit-background-size: 200px 20px; 57 | background-size: 200px 20px; 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/purple.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Minimal skin, purple 2 | ----------------------------------- */ 3 | .icheckbox_minimal-purple, 4 | .iradio_minimal-purple { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 18px; 11 | height: 18px; 12 | background: url(purple.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_minimal-purple { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_minimal-purple.hover { 21 | background-position: -20px 0; 22 | } 23 | .icheckbox_minimal-purple.checked { 24 | background-position: -40px 0; 25 | } 26 | .icheckbox_minimal-purple.disabled { 27 | background-position: -60px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_minimal-purple.checked.disabled { 31 | background-position: -80px 0; 32 | } 33 | 34 | .iradio_minimal-purple { 35 | background-position: -100px 0; 36 | } 37 | .iradio_minimal-purple.hover { 38 | background-position: -120px 0; 39 | } 40 | .iradio_minimal-purple.checked { 41 | background-position: -140px 0; 42 | } 43 | .iradio_minimal-purple.disabled { 44 | background-position: -160px 0; 45 | cursor: default; 46 | } 47 | .iradio_minimal-purple.checked.disabled { 48 | background-position: -180px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_minimal-purple, 54 | .iradio_minimal-purple { 55 | background-image: url(purple@2x.png); 56 | -webkit-background-size: 200px 20px; 57 | background-size: 200px 20px; 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/resources/static/icheck/minimal/yellow.css: -------------------------------------------------------------------------------- 1 | /* iCheck plugin Minimal skin, yellow 2 | ----------------------------------- */ 3 | .icheckbox_minimal-yellow, 4 | .iradio_minimal-yellow { 5 | display: inline-block; 6 | *display: inline; 7 | vertical-align: middle; 8 | margin: 0; 9 | padding: 0; 10 | width: 18px; 11 | height: 18px; 12 | background: url(yellow.png) no-repeat; 13 | border: none; 14 | cursor: pointer; 15 | } 16 | 17 | .icheckbox_minimal-yellow { 18 | background-position: 0 0; 19 | } 20 | .icheckbox_minimal-yellow.hover { 21 | background-position: -20px 0; 22 | } 23 | .icheckbox_minimal-yellow.checked { 24 | background-position: -40px 0; 25 | } 26 | .icheckbox_minimal-yellow.disabled { 27 | background-position: -60px 0; 28 | cursor: default; 29 | } 30 | .icheckbox_minimal-yellow.checked.disabled { 31 | background-position: -80px 0; 32 | } 33 | 34 | .iradio_minimal-yellow { 35 | background-position: -100px 0; 36 | } 37 | .iradio_minimal-yellow.hover { 38 | background-position: -120px 0; 39 | } 40 | .iradio_minimal-yellow.checked { 41 | background-position: -140px 0; 42 | } 43 | .iradio_minimal-yellow.disabled { 44 | background-position: -160px 0; 45 | cursor: default; 46 | } 47 | .iradio_minimal-yellow.checked.disabled { 48 | background-position: -180px 0; 49 | } 50 | 51 | /* HiDPI support */ 52 | @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { 53 | .icheckbox_minimal-yellow, 54 | .iradio_minimal-yellow { 55 | background-image: url(yellow@2x.png); 56 | -webkit-background-size: 200px 20px; 57 | background-size: 200px 20px; 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/controller/CourseController.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.controller; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.Course; 6 | import com.hut.kwk.service.ICourseService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | /** 12 | * Create by kwk on 2019-04-17 13 | * 14 | * @author kwk 15 | */ 16 | @RestController 17 | @RequestMapping("/course/") 18 | public class CourseController { 19 | @Autowired 20 | private ICourseService iCourseService; 21 | 22 | @RequestMapping("add") 23 | public ServerResponse add(String courseName, Integer courseTime,Integer sord) { 24 | return iCourseService.add(courseName, courseTime,sord); 25 | } 26 | 27 | @RequestMapping("del") 28 | public ServerResponse del(Integer id) { 29 | return iCourseService.del(id); 30 | } 31 | 32 | @RequestMapping("update") 33 | public ServerResponse update(Integer id, String courseName, Integer courseTime,Integer sord) { 34 | return iCourseService.update(id, courseName, courseTime,sord); 35 | } 36 | 37 | @RequestMapping("find") 38 | public ServerResponse find(Integer id) { 39 | return iCourseService.find(id); 40 | } 41 | 42 | @RequestMapping("findAll") 43 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 44 | return iCourseService.findAll(pageNum, pageSize); 45 | } 46 | @RequestMapping("findAllByName") 47 | public ServerResponse> findAllByName(Integer pageNum, Integer pageSize,String courseName) { 48 | return iCourseService.findAllByName(pageNum, pageSize,courseName); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/flow.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)}); -------------------------------------------------------------------------------- /src/main/resources/static/javascript/sys_config.js: -------------------------------------------------------------------------------- 1 | layui.use(['element','form'], function(){ 2 | var element = layui.element; 3 | var form = layui.form; 4 | // +---------------------------------------------------------------------- 5 | // | 弹出层 6 | // +---------------------------------------------------------------------- 7 | $(".dw-dailog").click(function(){ 8 | var dw_url = $(this).attr("dw-url");//URL地址,必填 9 | var dw_title = $(this).attr("dw-title");//弹出层标题,必填 10 | var dw_width = $(this).attr("dw-width");//弹出层宽度,如80%或500px;如果没有默认为屏幕宽度的50% 11 | var dw_height = $(this).attr("dw-height");//弹出层高度,如50%或500px;如果没有默认为屏幕高度的50% 12 | if(dw_url == undefined) { 13 | layer.msg("请给button加上dw-url属性"); 14 | return false; 15 | } 16 | if(dw_title == undefined) { 17 | layer.msg("请给button加上dw-title属性"); 18 | return false; 19 | } 20 | if(dw_width == undefined) dw_width = '50%'; 21 | if(dw_height == undefined) dw_height = '50%'; 22 | layer.open({ 23 | type: 2, 24 | title: dw_title, 25 | shadeClose: true, 26 | shade: 0.8, 27 | area: [dw_width, dw_height], 28 | content: dw_url, 29 | cancel: function (index, layero) { 30 | $(".dw-refresh").trigger('click'); 31 | return false; 32 | } 33 | }); 34 | }); 35 | // +---------------------------------------------------------------------- 36 | // | 刷新 37 | // +---------------------------------------------------------------------- 38 | $(".dw-refresh").click(function(){ 39 | location.href = location.href; 40 | }); 41 | // +---------------------------------------------------------------------- 42 | // | 监听提交 43 | // +---------------------------------------------------------------------- 44 | form.on('submit(formDemo)', function(data){ 45 | layer.msg(JSON.stringify(data.field)); 46 | return false; 47 | }); 48 | }); -------------------------------------------------------------------------------- /src/main/resources/static/css/login.css: -------------------------------------------------------------------------------- 1 | .beg-login-bg { 2 | background: rgba(0, 0, 0, 0) url("../image/login_home_background.jpg") no-repeat fixed center center / cover ; 3 | background-color: #393D49; 4 | height: auto; 5 | } 6 | 7 | .beg-login-box { 8 | width: 450px; 9 | margin: 10% auto; 10 | background-color: rgba(255, 255, 255, 0.5); 11 | border-radius: 10px; 12 | color: aliceblue; 13 | } 14 | 15 | .beg-login-box header { 16 | height: 39px; 17 | padding: 10px; 18 | border-bottom: 1px solid aliceblue; 19 | } 20 | 21 | .beg-login-box header h1 { 22 | text-align: center; 23 | font-size: 25px; 24 | line-height: 40px; 25 | } 26 | 27 | .beg-login-box .beg-login-main { 28 | padding: 30px 90px 0; 29 | } 30 | 31 | .beg-login-main .layui-form-item { 32 | position: relative; 33 | } 34 | 35 | .beg-login-main .layui-form-item .beg-login-icon { 36 | position: absolute; 37 | color: #cccccc; 38 | top: 10px; 39 | left: 10px; 40 | } 41 | 42 | .beg-login-main .layui-form-item input { 43 | padding-left: 34px; 44 | } 45 | 46 | .beg-login-box footer { 47 | height: 35px; 48 | padding: 10px 10px 0 10px; 49 | } 50 | 51 | .beg-login-box footer p { 52 | line-height: 35px; 53 | text-align: center; 54 | } 55 | 56 | .beg-pull-left { 57 | float: left !important; 58 | } 59 | 60 | .beg-pull-right { 61 | float: right !important; 62 | } 63 | 64 | .beg-clear { 65 | clear: both; 66 | } 67 | 68 | .beg-login-remember { 69 | line-height: 38px; 70 | } 71 | 72 | .beg-login-remember .layui-form-switch { 73 | margin-top: 0px; 74 | } 75 | 76 | .beg-login-code-box { 77 | position: relative; 78 | padding: 10px; 79 | } 80 | 81 | .beg-login-code-box input { 82 | position: absolute; 83 | width: 100px; 84 | } 85 | 86 | .beg-login-code-box img { 87 | cursor: pointer; 88 | position: absolute; 89 | left: 115px; 90 | height: 38px; 91 | } 92 | 93 | .verify{ 94 | cursor: pointer; 95 | position: absolute; 96 | right: 0px; 97 | top:0px; 98 | border:1px solid #e6e6e6; 99 | width:104px; 100 | padding:1px 1px; 101 | } 102 | .verify img{ 103 | width:100%; 104 | } -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/constant/ServerResponse.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.constant; 2 | import org.codehaus.jackson.annotate.JsonIgnore; 3 | import org.codehaus.jackson.map.annotate.JsonSerialize; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @author kwk 9 | */ 10 | @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) 11 | public class ServerResponse implements Serializable { 12 | 13 | private int status; 14 | private String msg; 15 | private T data; 16 | 17 | private ServerResponse(int status) { 18 | this.status = status; 19 | } 20 | 21 | private ServerResponse(int status, T data) { 22 | this.status = status; 23 | this.data = data; 24 | } 25 | 26 | private ServerResponse(int status, String msg, T data) { 27 | this.status = status; 28 | this.msg = msg; 29 | this.data = data; 30 | } 31 | 32 | private ServerResponse(int status, String msg) { 33 | this.status = status; 34 | this.msg = msg; 35 | } 36 | 37 | @JsonIgnore 38 | public boolean isSuccess() { 39 | return this.status == 0; 40 | } 41 | 42 | public int getStatus() { 43 | return status; 44 | } 45 | 46 | public T getData() { 47 | return data; 48 | } 49 | 50 | public String getMsg() { 51 | return msg; 52 | } 53 | 54 | public static ServerResponse createBySuccess() { 55 | return new ServerResponse(0); 56 | } 57 | 58 | public static ServerResponse createBySuccessMessage(String msg) { 59 | return new ServerResponse(0, msg); 60 | } 61 | 62 | public static ServerResponse createBySuccess(T data) { 63 | return new ServerResponse(0, data); 64 | } 65 | 66 | public static ServerResponse createBySuccess(String msg, T data) { 67 | return new ServerResponse(0, msg, data); 68 | } 69 | 70 | public static ServerResponse createByError() { 71 | return new ServerResponse(1, "失败"); 72 | } 73 | 74 | public static ServerResponse createByErrorMessage(String errorMessage) { 75 | return new ServerResponse(1, errorMessage); 76 | } 77 | 78 | public static ServerResponse createByErrorCodeMessage(int errorCode, String errorMessage) { 79 | return new ServerResponse(errorCode, errorMessage); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/controller/ClassroomController.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.controller; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.Classroom; 6 | import com.hut.kwk.model.entity.ClassroomFree; 7 | import com.hut.kwk.service.IClassroomService; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | import java.util.List; 13 | import java.util.stream.Collectors; 14 | 15 | /** 16 | * Create by kwk on 2019-04-17 17 | * 18 | * @author kwk 19 | */ 20 | @RestController 21 | @RequestMapping("/classroom/") 22 | public class ClassroomController { 23 | 24 | @Autowired 25 | private IClassroomService iClassroomService; 26 | 27 | @RequestMapping("add") 28 | public ServerResponse add(String roomName, Integer roomSpace, Integer roomLayer) { 29 | return iClassroomService.add(roomName, roomSpace, roomLayer); 30 | } 31 | 32 | @RequestMapping("del") 33 | public ServerResponse del(Integer id) { 34 | return iClassroomService.del(id); 35 | } 36 | 37 | @RequestMapping("update") 38 | public ServerResponse update(Integer id, String roomName, Integer roomSpace, Integer roomLayer) { 39 | return iClassroomService.update(id, roomName, roomSpace, roomLayer); 40 | } 41 | 42 | @RequestMapping("find") 43 | public ServerResponse find(Integer id) { 44 | return iClassroomService.find(id); 45 | } 46 | 47 | @RequestMapping("findAll") 48 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 49 | return iClassroomService.findAll(pageNum, pageSize); 50 | } 51 | 52 | @RequestMapping("findByWeek") 53 | public ServerResponse> findByWeek(Integer pageNum, Integer pageSize, Integer week,String roomName,String day) { 54 | List byWeek = iClassroomService.findByWeek(week,roomName); 55 | List collect; 56 | if (day!=null&&!"".equals(day)){ 57 | collect= byWeek.stream().filter(s->s.getDay().equals(day)).skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); 58 | }else { 59 | collect= byWeek.stream().skip((pageNum - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); 60 | } 61 | PageInfo pageInfo = new PageInfo<>(collect); 62 | pageInfo.setTotal(byWeek.size()); 63 | return ServerResponse.createBySuccess(pageInfo); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/rate.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.jquery,i={config:{},index:layui.rate?layui.rate.index+1e4:0,set:function(e){var i=this;return i.config=a.extend({},i.config,e),i},on:function(e,a){return layui.onevent.call(this,n,e,a)}},l=function(){var e=this,a=e.config;return{setvalue:function(a){e.setvalue.call(e,a)},config:a}},n="rate",t="layui-rate",o="layui-icon-rate",s="layui-icon-rate-solid",u="layui-icon-rate-half",r="layui-icon-rate-solid layui-icon-rate-half",c="layui-icon-rate-solid layui-icon-rate",f="layui-icon-rate layui-icon-rate-half",v=function(e){var l=this;l.index=++i.index,l.config=a.extend({},l.config,i.config,e),l.render()};v.prototype.config={length:5,text:!1,readonly:!1,half:!1,value:0,theme:""},v.prototype.render=function(){var e=this,i=e.config,l=i.theme?'style="color: '+i.theme+';"':"";i.elem=a(i.elem),parseInt(i.value)!==i.value&&(i.half||(i.value=Math.ceil(i.value)-i.value<.5?Math.ceil(i.value):Math.floor(i.value)));for(var n='
    ",u=1;u<=i.length;u++){var r='
  • ";i.half&&parseInt(i.value)!==i.value&&u==Math.ceil(i.value)?n=n+'
  • ":n+=r}n+="
"+(i.text?''+i.value+"星":"")+"";var c=i.elem,f=c.next("."+t);f[0]&&f.remove(),e.elemTemp=a(n),i.span=e.elemTemp.next("span"),i.setText&&i.setText(i.value),c.html(e.elemTemp),c.addClass("layui-inline"),i.readonly||e.action()},v.prototype.setvalue=function(e){var a=this,i=a.config;i.value=e,a.render()},v.prototype.action=function(){var e=this,i=e.config,l=e.elemTemp,n=l.find("i").width();l.children("li").each(function(e){var t=e+1,v=a(this);v.on("click",function(e){if(i.value=t,i.half){var o=e.pageX-a(this).offset().left;o<=n/2&&(i.value=i.value-.5)}i.text&&l.next("span").text(i.value+"星"),i.choose&&i.choose(i.value),i.setText&&i.setText(i.value)}),v.on("mousemove",function(e){if(l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+t+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half){var c=e.pageX-a(this).offset().left;c<=n/2&&v.children("i").addClass(u).removeClass(s)}}),v.on("mouseleave",function(){l.find("i").each(function(){a(this).addClass(o).removeClass(r)}),l.find("i:lt("+Math.floor(i.value)+")").each(function(){a(this).addClass(s).removeClass(f)}),i.half&&parseInt(i.value)!==i.value&&l.children("li:eq("+Math.floor(i.value)+")").children("i").addClass(u).removeClass(c)})})},v.prototype.events=function(){var e=this;e.config},i.render=function(e){var a=new v(e);return l.call(a)},e(n,i)}); -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/interceptor/AuthorityInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.interceptor; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import lombok.extern.slf4j.Slf4j; 6 | import org.springframework.web.method.HandlerMethod; 7 | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | import javax.servlet.http.HttpSession; 12 | import java.io.IOException; 13 | import java.io.PrintWriter; 14 | import java.lang.reflect.Method; 15 | 16 | /** 17 | * Create by Wang Heng on 2019-05-05 18 | * 19 | * @author Wang Heng 20 | */ 21 | @Slf4j 22 | public class AuthorityInterceptor extends HandlerInterceptorAdapter { 23 | 24 | @Override 25 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 26 | // 如果不是映射到方法直接通过 27 | if (!(handler instanceof HandlerMethod)) { 28 | return true; 29 | } 30 | // ①:START 方法注解级拦截器 31 | HandlerMethod handlerMethod = (HandlerMethod) handler; 32 | Method method = handlerMethod.getMethod(); 33 | // 判断接口是否需要登录 34 | LoginRequired methodAnnotation = method.getAnnotation(LoginRequired.class); 35 | 36 | // 有 @LoginRequired 注解,需要认证 37 | if (methodAnnotation != null) { 38 | String value = methodAnnotation.value(); 39 | // 这写你拦截需要干的事儿,比如取缓存,SESSION,权限判断等 40 | HttpSession session = request.getSession(); 41 | Object user = session.getAttribute("user"); 42 | if (user == null) { 43 | ServerResponse errorMessage = ServerResponse.createByErrorMessage("没有登录"); 44 | String jsonObjectStr = JSONObject.toJSONString(errorMessage); 45 | returnJson(request, response, jsonObjectStr); 46 | return false; 47 | } 48 | return true; 49 | } 50 | return true; 51 | } 52 | 53 | private void returnJson(HttpServletRequest request, HttpServletResponse response, String json) throws Exception { 54 | 55 | String origin = request.getHeader("Origin"); 56 | response.setHeader("Access-Control-Allow-Origin", origin); 57 | response.setHeader("Access-Control-Allow-Methods", "*"); 58 | response.setHeader("Access-Control-Allow-Headers", "Origin,Content-Type,Accept,token,X-Requested-With"); 59 | response.setHeader("Access-Control-Allow-Credentials", "true"); 60 | response.setCharacterEncoding("UTF-8"); 61 | response.setContentType("text/html; charset=UTF-8"); 62 | 63 | try (PrintWriter writer = response.getWriter()) { 64 | writer.print(json); 65 | } catch (IOException e) { 66 | log.error("response error", e); 67 | } 68 | } 69 | 70 | } -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/tree.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o('
    '),s=o(["
  • ",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return r.check?''+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),"
  • "].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o('
    '));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})}); -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/impl/SemesterServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service.impl; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import com.hut.kwk.constant.ServerResponse; 6 | import com.hut.kwk.model.entity.Semester; 7 | import com.hut.kwk.model.entity.SemesterQuery; 8 | import com.hut.kwk.model.mapper.SemesterMapper; 9 | import com.hut.kwk.service.ISemesterService; 10 | import org.apache.ibatis.session.RowBounds; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * Create by kwk on 2019-04-17 18 | * 19 | * @author kwk 20 | */ 21 | @Service 22 | public class SemesterServiceImpl implements ISemesterService { 23 | @Autowired 24 | private SemesterMapper semesterMapper; 25 | 26 | @Override 27 | public ServerResponse add(String year, String semester, Integer weekCount) { 28 | SemesterQuery query = new SemesterQuery(); 29 | query.createCriteria().andYearEqualTo(year).andSemesterEqualTo(semester); 30 | Semester s = semesterMapper.selectOneByExample(query); 31 | if (s != null) { 32 | return ServerResponse.createByErrorMessage("学期已经存在"); 33 | } 34 | Semester c = new Semester(); 35 | c.setYear(year); 36 | c.setSemester(semester); 37 | c.setWeekCount(weekCount); 38 | int count = semesterMapper.insertSelective(c); 39 | if (count > 0) { 40 | return ServerResponse.createBySuccessMessage("新建成功"); 41 | } 42 | return ServerResponse.createByErrorMessage("新建失败"); 43 | } 44 | 45 | @Override 46 | public ServerResponse del(Integer id) { 47 | int count = semesterMapper.deleteByPrimaryKey(id); 48 | if (count > 0) { 49 | return ServerResponse.createBySuccessMessage("删除成功"); 50 | } 51 | return ServerResponse.createByErrorMessage("删除失败"); 52 | } 53 | 54 | @Override 55 | public ServerResponse update(Integer id, String year, String semester, Integer weekCount) { 56 | Semester s = semesterMapper.selectByPrimaryKey(id); 57 | s.setYear(year); 58 | s.setSemester(semester); 59 | int count = semesterMapper.updateByPrimaryKeySelective(s); 60 | if (count > 0) { 61 | return ServerResponse.createBySuccessMessage("更新成功"); 62 | } 63 | return ServerResponse.createByErrorMessage("更新失败"); 64 | } 65 | 66 | @Override 67 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 68 | SemesterQuery query = new SemesterQuery(); 69 | PageHelper.startPage(pageNum, pageSize); 70 | List list = semesterMapper.selectByExampleWithRowbounds(query,new RowBounds((pageNum-1)*10,pageSize)); 71 | PageInfo pageInfo = new PageInfo<>(list); 72 | pageInfo.setTotal(semesterMapper.countByExample(query)); 73 | return ServerResponse.createBySuccess(pageInfo); 74 | } 75 | 76 | @Override 77 | public ServerResponse find(Integer id) { 78 | return ServerResponse.createBySuccess(semesterMapper.selectByPrimaryKey(id)); 79 | 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.controller; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.LayerResponse; 5 | import com.hut.kwk.constant.ServerResponse; 6 | import com.hut.kwk.model.entity.User; 7 | import com.hut.kwk.service.IUserService; 8 | import com.hut.kwk.util.ToLayerUtil; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import javax.servlet.http.HttpSession; 14 | import java.util.List; 15 | 16 | /** 17 | * Create by kwk on 2019-04-17 18 | * 19 | * @author kwk 20 | */ 21 | @RestController 22 | @RequestMapping("/user/") 23 | public class UserController { 24 | 25 | @Autowired 26 | private IUserService iUserService; 27 | 28 | /** 29 | * 添加用户 30 | * 31 | * @param username 32 | * @param password 33 | * @param role 34 | * @return 35 | */ 36 | @RequestMapping("add") 37 | public ServerResponse add(String username, String password, String role) { 38 | return iUserService.add(username, password, role); 39 | 40 | } 41 | 42 | /** 43 | * 登录 44 | * 45 | * @param username 46 | * @param password 47 | * @param role 48 | * @param session 49 | * @return 50 | */ 51 | @RequestMapping("login") 52 | public ServerResponse login(String username, String password, String role, HttpSession session) { 53 | 54 | ServerResponse login = iUserService.login(username, password, role); 55 | if (login.isSuccess()) { 56 | session.setAttribute("user", login.getData()); 57 | System.out.println(session.getId()); 58 | } 59 | return login; 60 | } 61 | 62 | /** 63 | * 根据id删除用户 64 | * 65 | * @param id 66 | * @return 67 | */ 68 | @RequestMapping("del") 69 | public ServerResponse del(Integer id) { 70 | return iUserService.del(id); 71 | } 72 | 73 | /** 74 | * 查找全部用户 75 | * 76 | * @param session 77 | * @return 78 | */ 79 | @RequestMapping("findAll") 80 | public LayerResponse> findAll(HttpSession session, Integer pageNum, Integer pageSize) { 81 | User user = (User) session.getAttribute(session.getId()); 82 | ServerResponse> all = iUserService.findAll("超级管理员", pageNum, pageSize); 83 | return ToLayerUtil.toLayer(all); 84 | } 85 | 86 | /** 87 | * 根据id查找用户 88 | * 89 | * @param id 90 | * @return 91 | */ 92 | @RequestMapping("find") 93 | public ServerResponse find(Integer id) { 94 | return iUserService.findById(id); 95 | } 96 | 97 | /** 98 | * 更新用户信息 99 | * 100 | * @param id 101 | * @param username 102 | * @param password 103 | * @return 104 | */ 105 | @RequestMapping("update") 106 | public ServerResponse update(Integer id, String username, String password,String role) { 107 | return iUserService.update(id, username, password,role); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/impl/TeacherServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service.impl; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import com.hut.kwk.constant.ServerResponse; 6 | import com.hut.kwk.model.entity.Teacher; 7 | import com.hut.kwk.model.entity.TeacherQuery; 8 | import com.hut.kwk.model.mapper.TeacherMapper; 9 | import com.hut.kwk.service.ITeacherService; 10 | import org.apache.ibatis.session.RowBounds; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * Create by kwk on 2019-04-17 18 | * 19 | * @author kwk 20 | */ 21 | @Service 22 | public class TeacherServiceImpl implements ITeacherService { 23 | @Autowired 24 | private TeacherMapper teacherMapper; 25 | 26 | @Override 27 | public ServerResponse add(String name, String phone,Integer countLimit) { 28 | TeacherQuery query = new TeacherQuery(); 29 | query.createCriteria().andTeacherNameEqualTo(name); 30 | Teacher techer = teacherMapper.selectOneByExample(query); 31 | if (techer != null) { 32 | return ServerResponse.createByErrorMessage("教师已经存在"); 33 | } 34 | Teacher t = new Teacher(); 35 | t.setTeacherName(name); 36 | t.setTeacherPhone(phone); 37 | t.setCountLimit(countLimit); 38 | int count = teacherMapper.insertSelective(t); 39 | if (count > 0) { 40 | return ServerResponse.createBySuccessMessage("新建成功"); 41 | } 42 | return ServerResponse.createByErrorMessage("新建失败"); 43 | } 44 | 45 | @Override 46 | public ServerResponse del(Integer id) { 47 | int count = teacherMapper.deleteByPrimaryKey(id); 48 | if (count > 0) { 49 | return ServerResponse.createBySuccessMessage("删除成功"); 50 | } 51 | return ServerResponse.createByErrorMessage("删除失败"); 52 | } 53 | 54 | @Override 55 | public ServerResponse update(Integer id, String name, String phone,Integer countLimit) { 56 | Teacher techer = teacherMapper.selectByPrimaryKey(id); 57 | techer.setTeacherName(name); 58 | techer.setTeacherPhone(phone); 59 | techer.setCountLimit(countLimit); 60 | int count = teacherMapper.updateByPrimaryKeySelective(techer); 61 | if (count > 0) { 62 | return ServerResponse.createBySuccessMessage("更新成功"); 63 | } 64 | return ServerResponse.createByErrorMessage("更新失败"); 65 | } 66 | 67 | @Override 68 | public ServerResponse find(Integer id) { 69 | return ServerResponse.createBySuccess(teacherMapper.selectByPrimaryKey(id)); 70 | } 71 | 72 | @Override 73 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 74 | TeacherQuery query = new TeacherQuery(); 75 | PageHelper.startPage(pageNum, pageSize); 76 | List list = teacherMapper.selectByExampleWithRowbounds(query,new RowBounds((pageNum-1)*10,pageSize)); 77 | PageInfo pageInfo = new PageInfo<>(list); 78 | pageInfo.setTotal(teacherMapper.countByExample(query)); 79 | return ServerResponse.createBySuccess(pageInfo); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/impl/ClassesServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service.impl; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import com.hut.kwk.constant.ServerResponse; 6 | import com.hut.kwk.model.entity.Classes; 7 | import com.hut.kwk.model.entity.ClassesQuery; 8 | import com.hut.kwk.model.mapper.ClassesMapper; 9 | import com.hut.kwk.service.IClassesService; 10 | import org.apache.ibatis.session.RowBounds; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * Create by kwk on 2019-04-17 18 | * 19 | * @author kwk 20 | */ 21 | @Service 22 | public class ClassesServiceImpl implements IClassesService { 23 | @Autowired 24 | private ClassesMapper classesMapper; 25 | 26 | @Override 27 | public ServerResponse add(String className, String classNum,Integer limit) { 28 | ClassesQuery query = new ClassesQuery(); 29 | query.createCriteria().andClassNameEqualTo(className); 30 | Classes classes = classesMapper.selectOneByExample(query); 31 | if (classes != null) { 32 | return ServerResponse.createByErrorMessage("班级已经存在"); 33 | } 34 | Classes c = new Classes(); 35 | c.setClassName(className); 36 | c.setClassNumber(classNum); 37 | c.setDayLimit(limit); 38 | int count = classesMapper.insertSelective(c); 39 | if (count > 0) { 40 | return ServerResponse.createBySuccessMessage("新建成功"); 41 | } 42 | return ServerResponse.createByErrorMessage("新建失败"); 43 | } 44 | 45 | @Override 46 | public ServerResponse del(Integer id) { 47 | int count = classesMapper.deleteByPrimaryKey(id); 48 | if (count > 0) { 49 | return ServerResponse.createBySuccessMessage("删除成功"); 50 | } 51 | return ServerResponse.createByErrorMessage("删除失败"); 52 | } 53 | 54 | @Override 55 | public ServerResponse update(Integer id, String className, String classNum,Integer limit) { 56 | Classes classes = classesMapper.selectByPrimaryKey(id); 57 | classes.setClassName(className); 58 | classes.setClassNumber(classNum); 59 | classes.setDayLimit(limit); 60 | int count = classesMapper.updateByPrimaryKeySelective(classes); 61 | if (count > 0) { 62 | return ServerResponse.createBySuccessMessage("更新成功"); 63 | } 64 | return ServerResponse.createByErrorMessage("更新失败"); 65 | } 66 | 67 | @Override 68 | public ServerResponse find(Integer id) { 69 | return ServerResponse.createBySuccess(classesMapper.selectByPrimaryKey(id)); 70 | } 71 | 72 | @Override 73 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 74 | ClassesQuery query = new ClassesQuery(); 75 | PageHelper.startPage(pageNum, pageSize); 76 | List list = classesMapper.selectByExampleWithRowbounds(query,new RowBounds((pageNum-1)*10,pageSize)); 77 | PageInfo pageInfo = new PageInfo<>(list); 78 | pageInfo.setTotal(classesMapper.countByExample(query)); 79 | return ServerResponse.createBySuccess(pageInfo); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(t){"use strict";var e=layui.$,i={fixbar:function(t){var i,a,n="layui-fixbar",r="layui-fixbar-top",o=e(document),l=e("body");t=e.extend({showHeight:200},t),t.bar1=t.bar1===!0?"":t.bar1,t.bar2=t.bar2===!0?"":t.bar2,t.bgcolor=t.bgcolor?"background-color:"+t.bgcolor:"";var c=[t.bar1,t.bar2,""],g=e(['
      ',t.bar1?'
    • '+c[0]+"
    • ":"",t.bar2?'
    • '+c[1]+"
    • ":"",'
    • '+c[2]+"
    • ","
    "].join("")),s=g.find("."+r),u=function(){var e=o.scrollTop();e>=t.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};e("."+n)[0]||("object"==typeof t.css&&g.css(t.css),l.append(g),u(),g.find("li").on("click",function(){var i=e(this),a=i.attr("lay-type");"top"===a&&e("html,body").animate({scrollTop:0},200),t.click&&t.click.call(this,a)}),o.on("scroll",function(){clearTimeout(a),a=setTimeout(function(){u()},100)}))},countdown:function(t,e,i){var a=this,n="function"==typeof e,r=new Date(t).getTime(),o=new Date(!e||n?(new Date).getTime():e).getTime(),l=r-o,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];n&&(i=e);var g=setTimeout(function(){a.countdown(t,o+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],e,g),l<=0&&clearTimeout(g),g},timeAgo:function(t,e){var i=this,a=[[],[]],n=(new Date).getTime()-new Date(t).getTime();return n>6912e5?(n=new Date(t),a[0][0]=i.digit(n.getFullYear(),4),a[0][1]=i.digit(n.getMonth()+1),a[0][2]=i.digit(n.getDate()),e||(a[1][0]=i.digit(n.getHours()),a[1][1]=i.digit(n.getMinutes()),a[1][2]=i.digit(n.getSeconds())),a[0].join("-")+" "+a[1].join(":")):n>=864e5?(n/1e3/60/60/24|0)+"天前":n>=36e5?(n/1e3/60/60|0)+"小时前":n>=12e4?(n/1e3/60|0)+"分钟前":n<0?"未来":"刚刚"},digit:function(t,e){var i="";t=String(t),e=e||2;for(var a=t.length;a/g,">").replace(/'/g,"'").replace(/"/g,""")}};!function(t,e,i){"$:nomunge";function a(){n=e[l](function(){r.each(function(){var e=t(this),i=e.width(),a=e.height(),n=t.data(this,g);(i!==n.w||a!==n.h)&&e.trigger(c,[n.w=i,n.h=a])}),a()},o[s])}var n,r=t([]),o=t.resize=t.extend(t.resize,{}),l="setTimeout",c="resize",g=c+"-special-event",s="delay",u="throttleWindow";o[s]=250,o[u]=!0,t.event.special[c]={setup:function(){if(!o[u]&&this[l])return!1;var e=t(this);r=r.add(e),t.data(this,g,{w:e.width(),h:e.height()}),1===r.length&&a()},teardown:function(){if(!o[u]&&this[l])return!1;var e=t(this);r=r.not(e),e.removeData(g),r.length||clearTimeout(n)},add:function(e){function a(e,a,r){var o=t(this),l=t.data(this,g)||{};l.w=a!==i?a:o.width(),l.h=r!==i?r:o.height(),n.apply(this,arguments)}if(!o[u]&&this[l])return!1;var n;return t.isFunction(e)?(n=e,a):(n=e.handler,void(e.handler=a))}}}(e,window),t("util",i)}); -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/controller/CourseTableController.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.controller; 2 | 3 | import com.github.pagehelper.PageInfo; 4 | import com.hut.kwk.constant.ServerResponse; 5 | import com.hut.kwk.model.entity.CourseTable; 6 | import com.hut.kwk.service.ICourseTableService; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | import java.util.List; 13 | 14 | /** 15 | * Create by kwk on 2019-04-24 16 | * 17 | * @author kwk 18 | */ 19 | @RestController 20 | @RequestMapping("/coursetable/") 21 | public class CourseTableController { 22 | 23 | @Autowired 24 | private ICourseTableService iCourseTableService; 25 | 26 | @RequestMapping("findBy") 27 | public ServerResponse> find(String className, String teacherName,Integer week) { 28 | if ((className==null||"".equals(className)&&(teacherName==null||"".equals(teacherName)))){ 29 | return ServerResponse.createByErrorMessage("请输入正确参数"); 30 | } 31 | if (week==null||week==0){ 32 | return ServerResponse.createByErrorMessage("请选择周数"); 33 | } 34 | return iCourseTableService.findBy(className,teacherName,week); 35 | } 36 | 37 | @RequestMapping("add") 38 | public ServerResponse add(CourseTable courseTable) { 39 | 40 | return iCourseTableService.add(courseTable); 41 | } 42 | 43 | @RequestMapping("del") 44 | public ServerResponse del(Integer id) { 45 | return iCourseTableService.del(id); 46 | } 47 | 48 | @RequestMapping("update") 49 | public ServerResponse update(CourseTable courseTable) { 50 | return iCourseTableService.update(courseTable); 51 | } 52 | 53 | @RequestMapping("find") 54 | public ServerResponse find(Integer id) { 55 | return iCourseTableService.find(id); 56 | } 57 | 58 | @RequestMapping("findAll") 59 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 60 | return iCourseTableService.findAll(pageNum, pageSize); 61 | } 62 | 63 | @RequestMapping("findAllBy") 64 | public ServerResponse> findAllBy(HttpServletRequest request,Integer pageNum, Integer pageSize, Integer week, 65 | String courseName, String className, String teacherName, 66 | String roomName) { 67 | System.out.println(request.getRequestURI()); 68 | System.out.println(request.getServletPath()); 69 | return iCourseTableService.findAllBy(pageNum, pageSize,week,courseName,className,teacherName,roomName); 70 | } 71 | /** 72 | * var day = data.day; 73 | * var week = data.week; 74 | * var number = data.number; 75 | * var classroomId = data.classroomId; 76 | * var classroomName = data.classroomName; 77 | * console.log(day+" "+week+" "+number+" "+classroomId+" "+classroomName) 78 | * console.log(courseTableId) 79 | */ 80 | @RequestMapping("adjust") 81 | public ServerResponse adjust(Integer courseTableId,String day,Integer week,Integer number,String classroomName,Integer classroomId){ 82 | 83 | return iCourseTableService.adjust(courseTableId,classroomId,week,day,number,classroomName); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/impl/TeachingServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service.impl; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import com.hut.kwk.constant.ServerResponse; 6 | import com.hut.kwk.model.entity.Teaching; 7 | import com.hut.kwk.model.entity.TeachingQuery; 8 | import com.hut.kwk.model.mapper.TeachingMapper; 9 | import com.hut.kwk.service.ITeachingService; 10 | import org.apache.ibatis.session.RowBounds; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * Create by kwk on 2019-04-17 18 | * 19 | * @author kwk 20 | */ 21 | @Service 22 | public class TeachingServiceImpl implements ITeachingService { 23 | @Autowired 24 | private TeachingMapper teachingMapper; 25 | 26 | @Override 27 | public ServerResponse add(Integer classId, Integer teacherId, Integer semId, String className, String techerName) { 28 | TeachingQuery query = new TeachingQuery(); 29 | query.createCriteria().andClassIdEqualTo(classId).andTeacherIdEqualTo(teacherId).andSemIdEqualTo(semId); 30 | Teaching teaching = teachingMapper.selectOneByExample(query); 31 | if (teaching != null) { 32 | return ServerResponse.createByErrorMessage("已经存在分配"); 33 | } 34 | Teaching t = new Teaching(); 35 | t.setClassId(classId); 36 | t.setTeacherId(teacherId); 37 | t.setSemId(semId); 38 | t.setClassName(className); 39 | t.setTecherName(techerName); 40 | int count = teachingMapper.insertSelective(t); 41 | if (count > 0) { 42 | return ServerResponse.createBySuccessMessage("新建成功"); 43 | } 44 | return ServerResponse.createByErrorMessage("新建失败"); 45 | } 46 | 47 | @Override 48 | public ServerResponse del(Integer id) { 49 | int count = teachingMapper.deleteByPrimaryKey(id); 50 | if (count > 0) { 51 | return ServerResponse.createBySuccessMessage("删除成功"); 52 | } 53 | return ServerResponse.createByErrorMessage("删除失败"); 54 | 55 | } 56 | 57 | @Override 58 | public ServerResponse update(Integer id, Integer classId, Integer teacherId, Integer semId, String className, String techerName) { 59 | Teaching t = teachingMapper.selectByPrimaryKey(id); 60 | t.setClassId(classId); 61 | t.setTeacherId(teacherId); 62 | t.setSemId(semId); 63 | t.setClassName(className); 64 | t.setTecherName(techerName); 65 | int count = teachingMapper.updateByPrimaryKeySelective(t); 66 | if (count > 0) { 67 | return ServerResponse.createBySuccessMessage("更新成功"); 68 | } 69 | return ServerResponse.createByErrorMessage("更新失败"); 70 | } 71 | 72 | @Override 73 | public ServerResponse find(Integer id) { 74 | return ServerResponse.createBySuccess(teachingMapper.selectByPrimaryKey(id)); 75 | } 76 | 77 | @Override 78 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 79 | TeachingQuery query = new TeachingQuery(); 80 | PageHelper.startPage(pageNum, pageSize); 81 | List list = teachingMapper.selectByExampleWithRowbounds(query,new RowBounds((pageNum-1)*10,pageSize)); 82 | PageInfo pageInfo = new PageInfo<>(list); 83 | pageInfo.setTotal(teachingMapper.countByExample(query)); 84 | return ServerResponse.createBySuccess(pageInfo); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.4.RELEASE 9 | 10 | 11 | com.hut 12 | arranging-courses 13 | 0.0.1-SNAPSHOT 14 | arranging-courses 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 1.3.5 20 | 21 | 22 | 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-thymeleaf 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-web 31 | 32 | 33 | org.mybatis.spring.boot 34 | mybatis-spring-boot-starter 35 | 2.0.1 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-data-redis 41 | 42 | 43 | mysql 44 | mysql-connector-java 45 | runtime 46 | 47 | 48 | org.projectlombok 49 | lombok 50 | true 51 | 52 | 53 | org.springframework.boot 54 | spring-boot-starter-test 55 | test 56 | 57 | 58 | org.codehaus.jackson 59 | jackson-mapper-asl 60 | 1.9.13 61 | 62 | 63 | com.github.pagehelper 64 | pagehelper 65 | 4.1.6 66 | 67 | 68 | com.alibaba 69 | fastjson 70 | 1.2.56 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | org.mybatis.generator 81 | mybatis-generator-maven-plugin 82 | ${mybatis.generator.plugin.version} 83 | 84 | src/main/resources/generatorConfig.xml 85 | 86 | 87 | 88 | com.tigerbrokers.alpha 89 | clearing-common 90 | ${project.version} 91 | 92 | 93 | com.itfsw 94 | mybatis-generator-plugin 95 | 1.2.14 96 | 97 | 98 | 99 | 100 | org.springframework.boot 101 | spring-boot-maven-plugin 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /src/main/resources/static/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 课程管理系统-登录 9 | 10 | 11 | 12 | 13 | 39 | 40 | 41 | 42 | 43 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/carousel.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
      ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
    "].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a add(String courseName, Integer courseTime,Integer sord) { 29 | CourseQuery query = new CourseQuery(); 30 | query.createCriteria().andCourseNameEqualTo(courseName); 31 | Course course = courseMapper.selectOneByExample(query); 32 | if (course != null) { 33 | return ServerResponse.createByErrorMessage("课程已经存在"); 34 | } 35 | Course c = new Course(); 36 | c.setCourseName(courseName); 37 | c.setCourseTime(courseTime); 38 | c.setStatu(sord); 39 | int count = courseMapper.insertSelective(c); 40 | if (count > 0) { 41 | return ServerResponse.createBySuccessMessage("新建成功"); 42 | } 43 | return ServerResponse.createByErrorMessage("新建失败"); 44 | } 45 | 46 | @Override 47 | public ServerResponse del(Integer id) { 48 | int count = courseMapper.deleteByPrimaryKey(id); 49 | if (count > 0) { 50 | return ServerResponse.createBySuccessMessage("删除成功"); 51 | } 52 | return ServerResponse.createByErrorMessage("删除失败"); 53 | } 54 | 55 | @Override 56 | public ServerResponse update(Integer id, String courseName, Integer courseTime,Integer sord) { 57 | Course course = courseMapper.selectByPrimaryKey(id); 58 | course.setCourseName(courseName); 59 | course.setCourseTime(courseTime); 60 | course.setStatu(sord); 61 | int count = courseMapper.updateByPrimaryKeySelective(course); 62 | if (count > 0) { 63 | return ServerResponse.createBySuccessMessage("更新成功"); 64 | } 65 | return ServerResponse.createByErrorMessage("更新失败"); 66 | } 67 | 68 | @Override 69 | public ServerResponse find(Integer id) { 70 | return ServerResponse.createBySuccess(courseMapper.selectByPrimaryKey(id)); 71 | } 72 | 73 | @Override 74 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 75 | CourseQuery query = new CourseQuery(); 76 | PageHelper.startPage(pageNum, pageSize); 77 | List list = courseMapper.selectByExampleWithRowbounds(query,new RowBounds((pageNum-1)*10,pageSize)); 78 | PageInfo pageInfo = new PageInfo<>(list); 79 | pageInfo.setTotal(courseMapper.countByExample(query)); 80 | return ServerResponse.createBySuccess(pageInfo); 81 | } 82 | 83 | @Override 84 | public ServerResponse> findAllByName(Integer pageNum, Integer pageSize, String courseName) { 85 | CourseQuery query = new CourseQuery(); 86 | query.createCriteria().andCourseNameLike("%"+courseName+"%"); 87 | PageHelper.startPage(pageNum, pageSize); 88 | List list = courseMapper.selectByExampleWithRowbounds(query,new RowBounds((pageNum-1)*10,pageSize)); 89 | PageInfo pageInfo = new PageInfo<>(list); 90 | pageInfo.setTotal(courseMapper.countByExample(query)); 91 | return ServerResponse.createBySuccess(pageInfo); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/impl/ArrangeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service.impl; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import com.hut.kwk.constant.ServerResponse; 6 | import com.hut.kwk.model.entity.Arrange; 7 | import com.hut.kwk.model.entity.ArrangeQuery; 8 | import com.hut.kwk.model.entity.ClassesQuery; 9 | import com.hut.kwk.model.entity.CourseQuery; 10 | import com.hut.kwk.model.mapper.ArrangeMapper; 11 | import com.hut.kwk.model.mapper.ClassesMapper; 12 | import com.hut.kwk.model.mapper.CourseMapper; 13 | import com.hut.kwk.service.IArrangeService; 14 | import org.apache.ibatis.session.RowBounds; 15 | import org.springframework.beans.factory.annotation.Autowired; 16 | import org.springframework.stereotype.Service; 17 | 18 | import java.util.List; 19 | 20 | /** 21 | * Create by kwk on 2019-04-23 22 | * 23 | * @author kwk 24 | */ 25 | @Service 26 | public class ArrangeServiceImpl implements IArrangeService { 27 | @Autowired 28 | private ArrangeMapper arrangeMapper; 29 | 30 | @Autowired 31 | private ClassesMapper classesMapper; 32 | 33 | @Autowired 34 | private CourseMapper courseMapper; 35 | 36 | @Override 37 | public ServerResponse add(Arrange arrange) { 38 | String classNames = arrange.getClassName(); 39 | String[] split = classNames.split("_"); 40 | ArrangeQuery query = new ArrangeQuery(); 41 | ArrangeQuery.Criteria criteria = query.createCriteria(); 42 | criteria.andCourseIdEqualTo(arrange.getCourseId()) 43 | .andSemeIdEqualTo(arrange.getSemeId()); 44 | int number = 0; 45 | for (String s : split){ 46 | criteria.andClassNameLike("%"+s+"%"); 47 | number+=Integer.valueOf(classesMapper.selectOneByExample(new ClassesQuery()).getClassNumber()); 48 | } 49 | 50 | query.setDistinct(true); 51 | Arrange arrange2 = arrangeMapper.selectOneByExample(query); 52 | 53 | if (arrange2 != null) { 54 | return ServerResponse.createByErrorMessage("班级:"+arrange2.getClassName()+" 课程:"+arrange2.getCourseName()+" 已经存在分配"); 55 | } 56 | arrange.setStatu(number); 57 | CourseQuery query1 = new CourseQuery(); 58 | query1.createCriteria().andIdEqualTo(arrange.getCourseId()); 59 | arrange.setSrd(courseMapper.selectOneByExample(query1).getStatu()); 60 | int count = arrangeMapper.insertSelective(arrange); 61 | if (count == 0) { 62 | return ServerResponse.createByErrorMessage("分配失败"); 63 | } 64 | return ServerResponse.createBySuccessMessage("分配成功"); 65 | } 66 | 67 | @Override 68 | public ServerResponse del(Integer id) { 69 | int count = arrangeMapper.deleteByPrimaryKey(id); 70 | if (count > 0) { 71 | return ServerResponse.createBySuccessMessage("删除成功"); 72 | } 73 | return ServerResponse.createByErrorMessage("删除失败"); 74 | } 75 | 76 | @Override 77 | public ServerResponse update(Arrange arrange) { 78 | Arrange a = arrangeMapper.selectByPrimaryKey(arrange.getId()); 79 | //todo 到底怎么修改? 目前不让他修改 80 | 81 | int count = arrangeMapper.updateByPrimaryKeySelective(a); 82 | if (count > 0) { 83 | return ServerResponse.createBySuccessMessage("更新成功"); 84 | } 85 | return ServerResponse.createByErrorMessage("更新失败"); 86 | } 87 | 88 | @Override 89 | public ServerResponse find(Integer id) { 90 | return ServerResponse.createBySuccess(arrangeMapper.selectByPrimaryKey(id)); 91 | } 92 | 93 | @Override 94 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 95 | ArrangeQuery query = new ArrangeQuery(); 96 | PageHelper.startPage(pageNum, pageSize); 97 | List list = arrangeMapper.selectByExampleWithRowbounds(query, new RowBounds((pageNum - 1) * 10, pageSize)); 98 | PageInfo pageInfo = new PageInfo<>(list); 99 | pageInfo.setTotal(arrangeMapper.countByExample(query)); 100 | return ServerResponse.createBySuccess(pageInfo); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/main/resources/static/layui/lay/modules/laypage.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.4.5 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var a=document,t="getElementById",n="getElementsByTagName",i="laypage",r="layui-disabled",u=function(e){var a=this;a.config=e||{},a.config.index=++s.index,a.render(!0)};u.prototype.type=function(){var e=this.config;if("object"==typeof e.elem)return void 0===e.elem.length?2:3},u.prototype.view=function(){var e=this,a=e.config,t=a.groups="groups"in a?0|a.groups:5;a.layout="object"==typeof a.layout?a.layout:["prev","page","next"],a.count=0|a.count,a.curr=0|a.curr||1,a.limits="object"==typeof a.limits?a.limits:[10,20,30,40,50],a.limit=0|a.limit||10,a.pages=Math.ceil(a.count/a.limit)||1,a.curr>a.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),refresh:['','',""].join(""),skip:function(){return['到第','','页',""].join("")}()};return['
    ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
    "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service.impl; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import com.hut.kwk.constant.Constant; 6 | import com.hut.kwk.constant.ServerResponse; 7 | import com.hut.kwk.model.entity.User; 8 | import com.hut.kwk.model.entity.UserQuery; 9 | import com.hut.kwk.model.mapper.UserMapper; 10 | import com.hut.kwk.service.IUserService; 11 | import org.apache.ibatis.session.RowBounds; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Service; 14 | 15 | import java.util.List; 16 | 17 | /** 18 | * Create by kwk on 2019-04-17 19 | * 20 | * @author kwk 21 | */ 22 | @Service 23 | public class UserServiceImpl implements IUserService { 24 | 25 | @Autowired 26 | private UserMapper userMapper; 27 | 28 | @Override 29 | public ServerResponse add(String username, String password, String role) { 30 | UserQuery query = new UserQuery(); 31 | query.createCriteria().andUsernameEqualTo(username); 32 | List users = userMapper.selectByExample(query); 33 | if (users.size() > 0) { 34 | return ServerResponse.createByErrorMessage("用户已经存在"); 35 | } 36 | User user = new User(); 37 | user.setUsername(username); 38 | user.setPassword(password); 39 | user.setRole(role); 40 | int count = userMapper.insertSelective(user); 41 | if (count > 0) { 42 | return ServerResponse.createBySuccessMessage("用户创建成功"); 43 | } 44 | return ServerResponse.createByErrorMessage("用户创建失败"); 45 | } 46 | 47 | @Override 48 | public ServerResponse login(String username, String password, String role) { 49 | UserQuery query = new UserQuery(); 50 | query.createCriteria().andUsernameEqualTo(username).andPasswordEqualTo(password).andRoleEqualTo(role); 51 | User user = userMapper.selectOneByExample(query); 52 | if (user != null) { 53 | user.setPassword(""); 54 | return ServerResponse.createBySuccess("登录成功", user); 55 | } 56 | return ServerResponse.createByErrorMessage("账号信息错误"); 57 | } 58 | 59 | @Override 60 | public ServerResponse del(Integer id) { 61 | int count = userMapper.deleteByPrimaryKey(id); 62 | if (count > 0) { 63 | return ServerResponse.createBySuccessMessage("删除成功"); 64 | } 65 | return ServerResponse.createByErrorMessage("删除失败"); 66 | } 67 | 68 | @Override 69 | public ServerResponse> findAll(String role, Integer pageNum, Integer pageSize) { 70 | PageHelper.startPage(pageNum, pageSize); 71 | UserQuery query = new UserQuery(); 72 | List users; 73 | PageInfo pageInfo; 74 | if (role.equals(Constant.ADMIN)) { 75 | users = userMapper.selectByExampleWithRowbounds(query, new RowBounds((pageNum - 1) * 10, pageSize)); 76 | pageInfo = new PageInfo<>(users); 77 | pageInfo.setTotal(userMapper.countByExample(query)); 78 | 79 | } else { 80 | query.createCriteria().andRoleEqualTo(Constant.NOT_ADMIN); 81 | users = userMapper.selectByExampleWithRowbounds(query, new RowBounds((pageNum - 1) * 10, pageSize)); 82 | pageInfo = new PageInfo<>(users); 83 | pageInfo.setTotal(userMapper.countByExample(query)); 84 | } 85 | return ServerResponse.createBySuccess(pageInfo); 86 | } 87 | 88 | @Override 89 | public ServerResponse findById(Integer id) { 90 | return ServerResponse.createBySuccess(userMapper.selectByPrimaryKey(id)); 91 | } 92 | 93 | @Override 94 | public ServerResponse update(Integer id, String username, String password, String role) { 95 | User user = userMapper.selectByPrimaryKey(id); 96 | user.setUsername(username); 97 | user.setPassword(password); 98 | user.setRole(role); 99 | int count = userMapper.updateByPrimaryKeySelective(user); 100 | if (count > 0) { 101 | return ServerResponse.createBySuccessMessage("更新成功"); 102 | } 103 | return ServerResponse.createByErrorMessage("更新失败"); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/main/resources/static/updateCourse.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | layui 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
    18 | 19 |
    20 | 22 |
    23 | 24 |
    25 | 27 |
    28 | 查询空教室 29 | 30 |
    31 | 32 | 33 | 34 |
    36 | 37 | 43 | 46 | 50 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /src/main/resources/static/javascript/dw.js: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | 列表页通用引用文件(如有特殊需求可参照此文件写一个单独的js文件,如:sys_config.js) 3 | // +---------------------------------------------------------------------- 4 | layui.use(['element', 'layer'], function () { 5 | var element = layui.element; 6 | var layer = layui.layer; 7 | var $ = layui.jquery; 8 | // +---------------------------------------------------------------------- 9 | // | icheck 10 | // +---------------------------------------------------------------------- 11 | $('input').iCheck({ 12 | checkboxClass: 'icheckbox_minimal-red', 13 | radioClass: 'iradio_minimal-red', 14 | increaseArea: '20%' // optional 15 | });//checkbox美化 16 | $('.selectAll input').on('ifChecked', function (event) { 17 | $('input').iCheck('check'); 18 | });//全选 19 | $('.selectAll input').on('ifUnchecked', function (event) { 20 | $('input').iCheck('uncheck'); 21 | });//反选 22 | // +---------------------------------------------------------------------- 23 | // | 弹出层 24 | // +---------------------------------------------------------------------- 25 | $(".dw-dailog").click(function () { 26 | var dw_url = $(this).attr("dw-url");//URL地址,必填 27 | var dw_title = $(this).attr("dw-title");//弹出层标题,必填 28 | var dw_width = $(this).attr("dw-width");//弹出层宽度,如80%或500px;如果没有默认为屏幕宽度的50% 29 | var dw_height = $(this).attr("dw-height");//弹出层高度,如50%或500px;如果没有默认为屏幕高度的50% 30 | if (dw_url == undefined) { 31 | layer.msg("请给button加上dw-url属性"); 32 | return false; 33 | } 34 | if (dw_title == undefined) { 35 | layer.msg("请给button加上dw-title属性"); 36 | return false; 37 | } 38 | if (dw_width == undefined) dw_width = '50%'; 39 | if (dw_height == undefined) dw_height = '50%'; 40 | layer.open({ 41 | type: 2, 42 | title: dw_title, 43 | shadeClose: true, 44 | shade: 0.8, 45 | area: [dw_width, dw_height], 46 | content: dw_url, 47 | cancel: function (index, layero) { 48 | $(".dw-refresh").trigger('click'); 49 | return false; 50 | } 51 | }); 52 | }); 53 | // +---------------------------------------------------------------------- 54 | // | 批量删除 55 | // +---------------------------------------------------------------------- 56 | $(".dw-batch-delete").click(function () { 57 | var dw_url = $(this).attr("dw-url");//URL地址,必填 58 | if (dw_url == undefined) { 59 | layer.msg("请给button加上dw-url属性"); 60 | return false; 61 | } 62 | var chk_value = []; 63 | $('input[name="id"]:checked').each(function () { 64 | chk_value.push($(this).val()); 65 | }); 66 | if (chk_value.length == 0) { 67 | layer.msg("请选择要删除的数据!", { anim: 1 }); 68 | return false; 69 | } 70 | layer.confirm('确定要删除选中的数据吗?', { icon: 3, title: '提示' }, function (index) { 71 | $.ajax(dw_url, { id: chk_value }, function (obj) { 72 | if (obj.code == 1) { 73 | layer.msg(obj.msg, { anim: 1 }); 74 | $(".dw-refresh").trigger('click'); 75 | } else { 76 | layer.msg(obj.msg, { anim: 1 }); 77 | } 78 | }); 79 | layer.close(index); 80 | }); 81 | }); 82 | // +---------------------------------------------------------------------- 83 | // | 删除 84 | // +---------------------------------------------------------------------- 85 | $(".dw-delete").click(function () { 86 | var dw_url = $(this).attr("dw-url");//URL地址,必填 87 | var dw_title = $(this).attr("dw-title");//删除数据标识,如姓名,默认为'该数据' 88 | if (dw_url == undefined) { 89 | layer.msg("请给button加上dw-url属性"); 90 | return false; 91 | } 92 | if (dw_title == undefined) { 93 | dw_title = '该数据'; 94 | } 95 | layer.confirm('确定要删除[' + dw_title + ']吗?', { icon: 3, title: '提示' }, function (index) { 96 | $.ajax(dw_url, {}, function (obj) { 97 | if (obj.code == 1) { 98 | layer.msg(obj.msg, { anim: 1 }); 99 | $(".dw-refresh").trigger('click'); 100 | } else { 101 | layer.msg(obj.msg, { anim: 1 }); 102 | } 103 | }); 104 | layer.close(index); 105 | }); 106 | }); 107 | // +---------------------------------------------------------------------- 108 | // | 刷新 109 | // +---------------------------------------------------------------------- 110 | $(".dw-refresh").click(function () { 111 | location.href = location.href; 112 | }); 113 | }); -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/impl/CourseTableServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service.impl; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import com.hut.kwk.constant.ServerResponse; 6 | import com.hut.kwk.model.entity.CourseTable; 7 | import com.hut.kwk.model.entity.CourseTableQuery; 8 | import com.hut.kwk.model.mapper.CourseTableMapper; 9 | import com.hut.kwk.service.ICourseTableService; 10 | import org.apache.ibatis.session.RowBounds; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * Create by kwk on 2019-04-24 18 | * 19 | * @author kwk 20 | */ 21 | @Service 22 | public class CourseTableServiceImpl implements ICourseTableService { 23 | 24 | @Autowired 25 | private CourseTableMapper courseTableMapper; 26 | 27 | /** 28 | * 排课算法 29 | * @return 30 | */ 31 | @Override 32 | public ServerResponse arr() { 33 | 34 | return null; 35 | } 36 | 37 | @Override 38 | public ServerResponse> findBy(String className, String teacherName,Integer week) { 39 | CourseTableQuery query =new CourseTableQuery(); 40 | CourseTableQuery.Criteria criteria = query.createCriteria(); 41 | if (className!=null&&!"".equals(className)){ 42 | criteria.andClassNameLike("%"+className+"%"); 43 | } 44 | if (teacherName!=null&&!"".equals(teacherName)){ 45 | criteria.andTecherNameEqualTo(teacherName); 46 | } 47 | criteria.andStatuEqualTo(week); 48 | List courseTables = courseTableMapper.selectByExample(query); 49 | return ServerResponse.createBySuccess(courseTables); 50 | } 51 | 52 | @Override 53 | public ServerResponse> findAllBy(Integer pageNum, Integer pageSize, Integer week, String courseName, String className, String teacherName, String roomName) { 54 | CourseTableQuery query = new CourseTableQuery(); 55 | query.createCriteria().andStatuEqualTo(week) 56 | .andCourseNameLike("%"+courseName+"%") 57 | .andClassNameLike("%"+className+"%") 58 | .andTecherNameLike("%"+teacherName+"%") 59 | .andRoomNameLike("%"+roomName+"%"); 60 | PageHelper.startPage(pageNum, pageSize); 61 | List list = courseTableMapper.selectByExampleWithRowbounds(query,new RowBounds((pageNum-1)*10,pageSize)); 62 | PageInfo pageInfo = new PageInfo<>(list); 63 | pageInfo.setTotal(courseTableMapper.countByExample(query)); 64 | return ServerResponse.createBySuccess(pageInfo); 65 | 66 | } 67 | 68 | @Override 69 | public ServerResponse adjust(Integer courseTableId, Integer classroomId, Integer week, String day, Integer number, String classroomName) { 70 | CourseTable courseTable = courseTableMapper.selectByPrimaryKey(courseTableId); 71 | courseTable.setStatu(week); 72 | courseTable.setRoomId(classroomId); 73 | courseTable.setRoomName(classroomName); 74 | courseTable.setTimeName(day); 75 | courseTable.setTimeId(number); 76 | int count = courseTableMapper.updateByPrimaryKey(courseTable); 77 | if (count >0){ 78 | return ServerResponse.createBySuccessMessage("调整成功"); 79 | } 80 | return ServerResponse.createByErrorMessage("调整失败"); 81 | } 82 | 83 | @Override 84 | public ServerResponse add(CourseTable courseTable) { 85 | //todo 86 | return null; 87 | } 88 | 89 | @Override 90 | public ServerResponse del(Integer id) { 91 | int count = courseTableMapper.deleteByPrimaryKey(id); 92 | if (count > 0) { 93 | return ServerResponse.createBySuccessMessage("删除成功"); 94 | } 95 | return ServerResponse.createByErrorMessage("删除失败"); 96 | } 97 | 98 | @Override 99 | public ServerResponse update(CourseTable courseTable) { 100 | //todo 101 | return null; 102 | } 103 | 104 | @Override 105 | public ServerResponse find(Integer id) { 106 | return ServerResponse.createBySuccess(courseTableMapper.selectByPrimaryKey(id)); 107 | } 108 | 109 | @Override 110 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 111 | CourseTableQuery query = new CourseTableQuery(); 112 | PageHelper.startPage(pageNum, pageSize); 113 | List list = courseTableMapper.selectByExampleWithRowbounds(query,new RowBounds((pageNum-1)*10,pageSize)); 114 | PageInfo pageInfo = new PageInfo<>(list); 115 | pageInfo.setTotal(courseTableMapper.countByExample(query)); 116 | return ServerResponse.createBySuccess(pageInfo); 117 | } 118 | 119 | } 120 | -------------------------------------------------------------------------------- /.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to the Apache Software Foundation (ASF) under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. The ASF licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | https://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | */ 19 | 20 | import java.io.File; 21 | import java.io.FileInputStream; 22 | import java.io.FileOutputStream; 23 | import java.io.IOException; 24 | import java.net.URL; 25 | import java.nio.channels.Channels; 26 | import java.nio.channels.ReadableByteChannel; 27 | import java.util.Properties; 28 | 29 | public class MavenWrapperDownloader { 30 | 31 | /** 32 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 33 | */ 34 | private static final String DEFAULT_DOWNLOAD_URL = 35 | "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar"; 36 | 37 | /** 38 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 39 | * use instead of the default one. 40 | */ 41 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 42 | ".mvn/wrapper/maven-wrapper.properties"; 43 | 44 | /** 45 | * Path where the maven-wrapper.jar will be saved to. 46 | */ 47 | private static final String MAVEN_WRAPPER_JAR_PATH = 48 | ".mvn/wrapper/maven-wrapper.jar"; 49 | 50 | /** 51 | * Name of the property which should be used to override the default download url for the wrapper. 52 | */ 53 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 54 | 55 | public static void main(String args[]) { 56 | System.out.println("- Downloader started"); 57 | File baseDirectory = new File(args[0]); 58 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 59 | 60 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 61 | // wrapperUrl parameter. 62 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 63 | String url = DEFAULT_DOWNLOAD_URL; 64 | if(mavenWrapperPropertyFile.exists()) { 65 | FileInputStream mavenWrapperPropertyFileInputStream = null; 66 | try { 67 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 68 | Properties mavenWrapperProperties = new Properties(); 69 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 70 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 71 | } catch (IOException e) { 72 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 73 | } finally { 74 | try { 75 | if(mavenWrapperPropertyFileInputStream != null) { 76 | mavenWrapperPropertyFileInputStream.close(); 77 | } 78 | } catch (IOException e) { 79 | // Ignore ... 80 | } 81 | } 82 | } 83 | System.out.println("- Downloading from: : " + url); 84 | 85 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 86 | if(!outputFile.getParentFile().exists()) { 87 | if(!outputFile.getParentFile().mkdirs()) { 88 | System.out.println( 89 | "- ERROR creating output direcrory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 90 | } 91 | } 92 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 93 | try { 94 | downloadFileFromURL(url, outputFile); 95 | System.out.println("Done"); 96 | System.exit(0); 97 | } catch (Throwable e) { 98 | System.out.println("- Error downloading"); 99 | e.printStackTrace(); 100 | System.exit(1); 101 | } 102 | } 103 | 104 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 105 | URL website = new URL(urlString); 106 | ReadableByteChannel rbc; 107 | rbc = Channels.newChannel(website.openStream()); 108 | FileOutputStream fos = new FileOutputStream(destination); 109 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 110 | fos.close(); 111 | rbc.close(); 112 | } 113 | 114 | } 115 | -------------------------------------------------------------------------------- /src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 课程排课系统后台 8 | 9 | 10 | 11 | 72 | 73 | 74 | 75 | 76 |
    77 |
    78 | 79 | 80 | 81 | 87 |
      88 |
    • 89 | 90 |
    • 91 |
    • 92 | 退出 93 |
    • 94 |
    95 | 96 | 97 |
    98 | 99 |
    100 |
    101 | 102 | 126 |
    127 |
    128 | 129 |
    130 | 131 | 132 |
    133 | 134 | 138 |
    139 | 157 | 158 | 159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /src/main/resources/static/user.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | layui 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
    18 | 19 | 25 | 29 | 33 | 148 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /src/main/resources/static/son/userson.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | layui 7 | 8 | 9 | 10 | 11 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 |
    23 |
    24 | 25 |
    26 | 28 |
    29 |
    30 |
    31 | 32 |
    33 | 35 |
    36 |
    37 | 38 |
    39 | 40 | 41 |
    42 | 43 |
    44 |
    45 | 46 |
    47 | 48 |
    49 | 50 |
    51 | 52 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /src/main/resources/static/classroom.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | layui 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
    18 | 19 | 24 | 28 | 32 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /src/main/java/com/hut/kwk/service/impl/ClassroomServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.hut.kwk.service.impl; 2 | 3 | import com.github.pagehelper.PageHelper; 4 | import com.github.pagehelper.PageInfo; 5 | import com.hut.kwk.constant.ServerResponse; 6 | import com.hut.kwk.model.entity.*; 7 | import com.hut.kwk.model.mapper.ClassroomMapper; 8 | import com.hut.kwk.model.mapper.CourseTableMapper; 9 | import com.hut.kwk.service.IClassroomService; 10 | import com.hut.kwk.util.DayUtil; 11 | import org.apache.ibatis.session.RowBounds; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Service; 14 | 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | /** 19 | * Create by kwk on 2019-04-17 20 | * 21 | * @author kwk 22 | */ 23 | @Service 24 | public class ClassroomServiceImpl implements IClassroomService { 25 | 26 | @Autowired 27 | private ClassroomMapper classroomMapper; 28 | 29 | @Autowired 30 | private CourseTableMapper courseTableMapper; 31 | 32 | @Override 33 | public ServerResponse add(String roomName, Integer roomSpace, Integer roomLayer) { 34 | ClassroomQuery query = new ClassroomQuery(); 35 | query.createCriteria().andRoomNameEqualTo(roomName); 36 | Classroom classroom = classroomMapper.selectOneByExample(query); 37 | if (classroom != null) { 38 | return ServerResponse.createByErrorMessage("教室已经存在"); 39 | } 40 | Classroom c = new Classroom(); 41 | c.setRoomName(roomName); 42 | c.setRoomSpace(roomSpace); 43 | c.setRoomLayer(roomLayer); 44 | int count = classroomMapper.insertSelective(c); 45 | if (count > 0) { 46 | return ServerResponse.createBySuccessMessage("新建成功"); 47 | } 48 | return ServerResponse.createByErrorMessage("新建失败"); 49 | } 50 | 51 | @Override 52 | public ServerResponse del(Integer id) { 53 | int count = classroomMapper.deleteByPrimaryKey(id); 54 | if (count > 0) { 55 | return ServerResponse.createBySuccessMessage("删除成功"); 56 | } 57 | return ServerResponse.createByErrorMessage("删除失败"); 58 | } 59 | 60 | @Override 61 | public ServerResponse find(Integer id) { 62 | return ServerResponse.createBySuccess(classroomMapper.selectByPrimaryKey(id)); 63 | } 64 | 65 | @Override 66 | public ServerResponse> findAll(Integer pageNum, Integer pageSize) { 67 | ClassroomQuery query = new ClassroomQuery(); 68 | PageHelper.startPage(pageNum, pageSize); 69 | List list = classroomMapper.selectByExampleWithRowbounds(query, new RowBounds((pageNum - 1) * 10, pageSize)); 70 | PageInfo pageInfo = new PageInfo<>(list); 71 | pageInfo.setTotal(classroomMapper.countByExample(query)); 72 | return ServerResponse.createBySuccess(pageInfo); 73 | } 74 | 75 | @Override 76 | public ServerResponse update(Integer id, String roomName, Integer roomSpace, Integer roomLaye) { 77 | Classroom classroom = classroomMapper.selectByPrimaryKey(id); 78 | classroom.setRoomName(roomName); 79 | classroom.setRoomSpace(roomSpace); 80 | classroom.setRoomLayer(roomLaye); 81 | System.out.println(roomLaye); 82 | int count = classroomMapper.updateByPrimaryKeySelective(classroom); 83 | if (count > 0) { 84 | return ServerResponse.createBySuccessMessage("更新成功"); 85 | } 86 | return ServerResponse.createByErrorMessage("更新失败"); 87 | } 88 | 89 | @Override 90 | public List findByWeek(Integer week, String roomName) { 91 | ClassroomQuery query1 = new ClassroomQuery(); 92 | ClassroomQuery.Criteria criteria1 = query1.createCriteria(); 93 | if (roomName != null && !"".equals(roomName)){ 94 | criteria1.andRoomNameLike("%" + roomName + "%"); 95 | } 96 | List classrooms = classroomMapper.selectByExample(query1); 97 | 98 | List classroomFrees = new ArrayList<>(); 99 | 100 | for (Classroom classroom : classrooms) { 101 | int[][] arr = new int[5][4]; 102 | Integer classroomId = classroom.getId(); 103 | 104 | CourseTableQuery query = new CourseTableQuery(); 105 | CourseTableQuery.Criteria criteria = query.createCriteria(); 106 | criteria.andStatuEqualTo(week) 107 | .andRoomIdEqualTo(classroomId); 108 | List courseTables = courseTableMapper.selectByExample(query); 109 | 110 | for (CourseTable courseTable : courseTables) { 111 | Integer number = courseTable.getTimeId(); 112 | String timeName = courseTable.getTimeName(); 113 | arr[DayUtil.toDayNum(timeName) - 1][number - 1] = 1; 114 | } 115 | 116 | for (int x = 1; x <= 5; x++) { 117 | for (int y = 1; y <= 4; y++) { 118 | if (arr[x - 1][y - 1] == 0) { 119 | classroomFrees.add(toFree(classroom, DayUtil.toDay(x), y,week)); 120 | } 121 | } 122 | } 123 | } 124 | return classroomFrees; 125 | } 126 | 127 | private ClassroomFree toFree(Classroom classroom, String day, Integer number,Integer week) { 128 | ClassroomFree classroomFree = new ClassroomFree(); 129 | classroomFree.setClassroomId(classroom.getId()); 130 | classroomFree.setClassroomName(classroom.getRoomName()); 131 | classroomFree.setDay(day); 132 | classroomFree.setWeek(week); 133 | classroomFree.setNumber(number); 134 | return classroomFree; 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /src/main/resources/generatorConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 56 | 57 | 58 | 59 | 60 | 61 | 63 | 64 | 65 | 66 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 |
    96 | 97 | 98 | 99 | 100 | 101 | 102 |
    103 |
    104 | -------------------------------------------------------------------------------- /src/main/resources/static/teacher.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | layui 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
    19 | 20 | 25 | 30 | 34 | 159 | 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /src/main/resources/static/son/classson.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | layui 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 |
    23 | 班级管理 24 |
    25 |
    26 | 27 | 28 |
    29 | 30 |
    31 | 32 |
    33 |
    34 | 35 |
    36 | 37 |
    38 | 39 |
    40 |
    41 | 42 |
    43 | 44 |
    45 | 47 |
    48 |
    49 | 50 |
    51 |
    52 | 53 |
    54 | 56 |
    57 | 58 |
    59 | 60 | 134 | 135 | 136 | 137 | 138 | 139 | --------------------------------------------------------------------------------