diff --git a/src/tzx/all1.html b/src/tzx/all1.html new file mode 100644 index 0000000..8fb178b --- /dev/null +++ b/src/tzx/all1.html @@ -0,0 +1,226 @@ + + + + + + + + + + + + + + + +
+
+

管理员模块评测成绩

+ + 首页 + 管理员模块 + 评测成绩 + +
+
+
+
+ +
+ + + + + + + + + + + + + +
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/src/tzx/fenduanController.java b/src/tzx/fenduanController.java new file mode 100644 index 0000000..8c86508 --- /dev/null +++ b/src/tzx/fenduanController.java @@ -0,0 +1,55 @@ +package com.controller; + +import com.domain.fenduan; +import com.untils.PageResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/fenduan") +public class fenduanController { + @Autowired + public com.service.fenduanService fenduanService; + + @PostMapping("/Save") + public int Save(@RequestBody fenduan fenduan) + { + return fenduanService.insert(fenduan); + + } + @DeleteMapping("/Delete/{id}") + public int Delete(@PathVariable Integer id) + { + + return fenduanService.delete(id); + } + + + + + + + + + @GetMapping("/findById/{id}") + public fenduan findById(@PathVariable Integer id) + { + + return fenduanService.findById(id); + } + @PutMapping("/Update") + public int Update(@RequestBody fenduan fenduan) + { + + return fenduanService.edit(fenduan); + } + + @GetMapping("/selectAll") + public List selectAll() + { + + return fenduanService.selectAll(); + } +} diff --git a/src/tzx/login.css b/src/tzx/login.css new file mode 100644 index 0000000..bb3f6eb --- /dev/null +++ b/src/tzx/login.css @@ -0,0 +1,147 @@ +html,body { + /* overflow-y: scroll; */ + margin: 0; +} +.login-container .input{ + display: inline-block; + height: 47px; + width: 85%; + +} +.login-container .input input { + background: transparent; + border: 0px; + -webkit-appearance: none; + border-radius: 0px; + padding: 12px 5px 12px 0; + height: 47px; +} +.login-container .el-form-item { + border: 1px solid #DCDFE6; + background: #fff; + border-radius: 5px; + color: #454545; +} +.login-container .el-button--medium{ + height: 50px; + line-height: 20px; + font-size: 22px; +} +.login-container .loginBox{ + height: 100%; + width: 100%; + background: url('./../img/logingBg.png') no-repeat 100% 100%; + position: relative; +} +.login-container .loginBox .el-form-item__content{ + line-height: initial; +} +.login-container form { + position: absolute; + left: 20%; + top: 50%; + width: 520px; + padding: 35px 35px 15px 35px; + margin: -200px 0 0 0; + background:#f5f5f5; +} +.login-container .tips { + font-size: 14px; + /* // color: #fff; */ + margin-bottom: 10px; + /* span { + &:first-of-type { + margin-right: 16px; + } + } */ +} +.login-container .svg-container { + padding: 6px 5px 6px 15px; + color: #889aa4; + vertical-align: middle; + width: 30px; + display: inline-block; + /* &_login { + font-size: 20px; + } */ +} +.login-container .title-container { + position: relative; + + +} +.login-container .title-container .title { + font-size: 26px; + /* // font-weight: 400; */ + color: #333; + margin: 0px auto 40px auto; + text-align: center; + font-weight: bold; +} +.login-container .title-container .set-language { + /* // color: #fff; */ + position: absolute; + top: 5px; + right: 0px; +} +.login-container { + position: fixed; + height: 100%; + width: 100%; + background-color: #2d3a4b; + background: url('./../img/bg.jpg'); + -moz-background-size: 100% 100%; + background-size: 100% 100%; + background-repeat: no-repeat; +} +.login-container .show-pwd { + position: absolute; + right: 10px; + top: 7px; + font-size: 16px; + color: #889aa4; + cursor: pointer; + user-select: none; +} +.login-container .thirdparty-button { + position: absolute; + right: 35px; + bottom: 28px; +} +.logoInfo{ + padding-bottom:35px; + text-align: center; +} +.logoInfo span{ + font-size: 22px; + padding: 0 10px; + display: inline-block; + +} +.logoInfo .logo{ + background: url(../img/loginLogo.png) no-repeat; + display:inline-block; + width: 200px; + height: 30px; + display: inline-block; + vertical-align: middle; +} +.tipInfo{font-size: 12px;} +.tipInfo span{ + color: #66b1ff; + padding: 0 5px; +} +.tipInfo .el-checkbox{ + margin: 0; +} +.svg-container span{ + width: 22px; + height: 22px; + display: inline-block; +} +.svg-container .user{ + background: url(../img/user.png) no-repeat 0 50%; +} +.svg-container .username{ + background: url(../img/pwd.png) no-repeat 0 50%; +} \ No newline at end of file diff --git a/src/tzx/login.html b/src/tzx/login.html new file mode 100644 index 0000000..4cbdc4b --- /dev/null +++ b/src/tzx/login.html @@ -0,0 +1,119 @@ + + + + + 登录 + + + + + + + + + + + + +
+ + + + +

心理测评系统

+
+
+ + + + + + + + + + + + + + + +
+ +
+ + + + diff --git a/src/tzx/main.html b/src/tzx/main.html new file mode 100644 index 0000000..27c6210 --- /dev/null +++ b/src/tzx/main.html @@ -0,0 +1,245 @@ + + + + + 心理测评系统 + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ 桌面 + + {{tag.name}} + + +
+ + + + +
+
+ + +
+ + + + + diff --git a/src/tzx/timuController.java b/src/tzx/timuController.java new file mode 100644 index 0000000..dba0645 --- /dev/null +++ b/src/tzx/timuController.java @@ -0,0 +1,60 @@ +package com.controller; + +import com.domain.timu; +import com.service.timuService; +import com.untils.PageResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/timu") +public class timuController { + @Autowired + public com.service.timuService timuService; + + @PostMapping("/Save") + public int Save(@RequestBody timu timu) + { + return timuService.insert(timu); + + } + @DeleteMapping("/Delete/{id}") + public int Delete(@PathVariable Integer id) + { + + return timuService.delete(id); + } + + + @GetMapping("/SelectPage/{size}/{current}") + public PageResult selectPage(@PathVariable Integer size, @PathVariable Integer current, timu timu) + { + return timuService.SelectPage(timu,size,current); + } + + + + + + @GetMapping("/findById/{id}") + public timu findById(@PathVariable Integer id) + { + + return timuService.findById(id); + } + @PutMapping("/Update") + public int Update(@RequestBody timu timu) + { + + return timuService.edit(timu); + } + + @GetMapping("/selectAll") + public List selectAll() + { + + return timuService.selectAll(); + } +} diff --git a/src/tzx/userController.java b/src/tzx/userController.java new file mode 100644 index 0000000..ff5bf6b --- /dev/null +++ b/src/tzx/userController.java @@ -0,0 +1,96 @@ +package com.controller; + +import com.domain.user; +import com.service.userService; +import com.untils.PageResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/user") +public class userController { + @Autowired + public userService userService; + + @PostMapping("/Save") + public int Save(@RequestBody user user) + { + return userService.insert(user); + + } + @DeleteMapping("/Delete/{id}") + public int Delete(@PathVariable Integer id) + { + + return userService.delete(id); + } + @PutMapping("/Update") + public int Update(@RequestBody user user) + { + return userService.edit(user); + } + + @GetMapping("/SelectPage/{size}/{current}") + public PageResult selectPage(@PathVariable Integer size, @PathVariable Integer current,user user) + { + return userService.SelectPage(user,size,current); + } + + @GetMapping("/SelectPageStudent/{size}/{current}") + public PageResult selectPageStudent(@PathVariable Integer size, @PathVariable Integer current,user user) + { + return userService.SelectPageStudent(user,size,current); + } + + @GetMapping("/findById/{id}") + public user findById(@PathVariable Integer id) + { + + return userService.findById(id); + } + + @PostMapping("/login") + public Boolean login(@RequestBody user user) + { + user user1= userService.login(user); + if (user1==null) + { + return false; + } + else + { + return true; + } + + } + //获取当前登录用户的用户名 + @GetMapping("/getUsername") + public String getUsername(){ + + org.springframework.security.core.userdetails.User user = + (org.springframework.security.core.userdetails.User) + SecurityContextHolder.getContext().getAuthentication().getPrincipal(); + return user.getUsername(); + + } + + @GetMapping("/getByUserName") + public int getByUserName(String username){ + + return userService.selectByUserName(username).getType(); + + } + + @GetMapping("/getByUserId") + public int getByUserId(String username){ + + return userService.selectByUserName(username).getId(); + + } + + + +} diff --git a/src/tzx/utController.java b/src/tzx/utController.java new file mode 100644 index 0000000..cadc798 --- /dev/null +++ b/src/tzx/utController.java @@ -0,0 +1,85 @@ +package com.controller; + +import com.domain.all; +import com.domain.ut; +import com.untils.PageResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.UUID; + +@RestController +@RequestMapping("/ut") +public class utController { + @Autowired + public com.service.utService utService; + + @PostMapping("/Save") + public int Save(@RequestBody List uts) + { + UUID uuid = UUID.randomUUID(); + + for (ut item:uts) + { + item.setBiaoshi(uuid.toString()); + utService.insert(item); + } + return 1; + + } + @DeleteMapping("/Delete/{id}") + public int Delete(@PathVariable Integer id) + { + + return utService.delete(id); + } + + + @GetMapping("/SelectPage/{size}/{current}") + public PageResult selectPage(@PathVariable Integer size, @PathVariable Integer current, ut ut) + { + return utService.SelectPage(ut,size,current); + } + + + + + + @GetMapping("/findById/{id}") + public ut findById(@PathVariable Integer id) + { + + return utService.findById(id); + } + + + + @PutMapping("/Update") + public int Update(@RequestBody ut ut) + { + + return utService.edit(ut); + } + @GetMapping("/selectAll/{userId}") + public List selectAll(@PathVariable int userId) + { + + return utService.selectAll(userId); + + } + + + @GetMapping("/selectAll1") + public List selectAll1() + { + + return utService.selectAll1(); + + } + + @GetMapping("/selectDetails/{biaoshi}") + public List selectDetails(@PathVariable String biaoshi) { + return utService.selectDetails(biaoshi); + } +} diff --git a/src/tzx/数据库.txt b/src/tzx/数据库.txt new file mode 100644 index 0000000..1037368 --- /dev/null +++ b/src/tzx/数据库.txt @@ -0,0 +1,133 @@ +/* +SQLyog Ultimate v12.08 (64 bit) +MySQL - 8.0.26 : Database - xinli +********************************************************************* +*/ + + +/*!40101 SET NAMES utf8 */; + +/*!40101 SET SQL_MODE=''*/; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +CREATE DATABASE /*!32312 IF NOT EXISTS*/`xinli` /*!40100 DEFAULT CHARACTER SET utf8 */ /*!80016 DEFAULT ENCRYPTION='N' */; + +USE `xinli`; + +/*Table structure for table `fenduan` */ + +DROP TABLE IF EXISTS `fenduan`; + +CREATE TABLE `fenduan` ( + `id` int NOT NULL AUTO_INCREMENT, + `start` double DEFAULT NULL, + `end` double DEFAULT NULL, + `guo` varchar(500) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb3; + +/*Data for the table `fenduan` */ + +insert into `fenduan`(`id`,`start`,`end`,`guo`) values (9,0,59,'抑郁'),(10,60,85,'正常'),(11,85,100,'精神非常好'); + +/*Table structure for table `liaotian` */ + +DROP TABLE IF EXISTS `liaotian`; + +CREATE TABLE `liaotian` ( + `id` int NOT NULL AUTO_INCREMENT, + `one` int DEFAULT NULL, + `two` int DEFAULT NULL, + `content` longtext, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb3; + +/*Data for the table `liaotian` */ + +insert into `liaotian`(`id`,`one`,`two`,`content`) values (17,6,7,'
李丽说:无奈
李丽说:好累啊
孙策说:去你的
'); + +/*Table structure for table `mokuai` */ + +DROP TABLE IF EXISTS `mokuai`; + +CREATE TABLE `mokuai` ( + `id` int NOT NULL AUTO_INCREMENT, + `name` varchar(200) DEFAULT NULL, + `quanzhon` varchar(200) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb3; + +/*Data for the table `mokuai` */ + +insert into `mokuai`(`id`,`name`,`quanzhon`) values (3,'第一模块','30'),(4,'第二模块','30'),(5,'第三模块','30'); + +/*Table structure for table `timu` */ + +DROP TABLE IF EXISTS `timu`; + +CREATE TABLE `timu` ( + `id` int NOT NULL AUTO_INCREMENT, + `xuhao` int DEFAULT NULL, + `them` varchar(200) DEFAULT NULL, + `one` varchar(200) DEFAULT NULL, + `two` varchar(200) DEFAULT NULL, + `three` varchar(200) DEFAULT NULL, + `four` varchar(200) DEFAULT NULL, + `ok` varchar(200) DEFAULT NULL, + `fen` double DEFAULT NULL, + `da` varchar(200) DEFAULT NULL, + `mokuaiId` int DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb3; + +/*Data for the table `timu` */ + +insert into `timu`(`id`,`xuhao`,`them`,`one`,`two`,`three`,`four`,`ok`,`fen`,`da`,`mokuaiId`) values (8,1,'童年','快乐','悲伤','兴奋','优秀','快乐',20,NULL,3),(9,2,'成年','压抑','忧郁','失败','成功','成功',10,NULL,3),(10,1,'吃饭','爱吃','厌食','暴饮暴食','正常就餐','正常就餐',20,NULL,4),(11,2,'睡觉','嗜睡','失眠','正常','压抑','正常',30,NULL,4),(12,1,'自我评价','正常','神经','快乐','失败','快乐',10,NULL,5),(13,2,'未来规划','努力生活','混吃等死','积极向上','好好学习','积极向上',10,NULL,5); + +/*Table structure for table `user` */ + +DROP TABLE IF EXISTS `user`; + +CREATE TABLE `user` ( + `id` int NOT NULL AUTO_INCREMENT, + `username` varchar(200) DEFAULT NULL, + `password` varchar(200) DEFAULT NULL, + `type` int DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb3; + +/*Data for the table `user` */ + +insert into `user`(`id`,`username`,`password`,`type`) values (1,'admin','123',0),(6,'李丽','123',1),(7,'孙策','123',1),(8,'李云','123',1); + +/*Table structure for table `ut` */ + +DROP TABLE IF EXISTS `ut`; + +CREATE TABLE `ut` ( + `id` int NOT NULL AUTO_INCREMENT, + `userId` int DEFAULT NULL, + `xuhao` int DEFAULT NULL, + `them` varchar(200) DEFAULT NULL, + `one` varchar(200) DEFAULT NULL, + `two` varchar(200) DEFAULT NULL, + `three` varchar(200) DEFAULT NULL, + `four` varchar(200) DEFAULT NULL, + `ok` varchar(200) DEFAULT NULL, + `da` varchar(200) DEFAULT NULL, + `fen` double DEFAULT NULL, + `mokuaiId` int DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=142 DEFAULT CHARSET=utf8mb3; + +/*Data for the table `ut` */ + +insert into `ut`(`id`,`userId`,`xuhao`,`them`,`one`,`two`,`three`,`four`,`ok`,`da`,`fen`,`mokuaiId`) values (118,7,1,'童年','快乐','悲伤','兴奋','优秀','快乐','快乐',20,3),(119,7,2,'成年','压抑','忧郁','失败','成功','成功','压抑',0,3),(120,7,1,'吃饭','爱吃','厌食','暴饮暴食','正常就餐','正常就餐','正常就餐',20,4),(121,7,2,'睡觉','嗜睡','失眠','正常','压抑','正常','正常',30,4),(122,7,1,'自我评价','正常','神经','快乐','失败','快乐','正常',0,5),(123,7,2,'未来规划','努力生活','混吃等死','积极向上','好好学习','积极向上','努力生活',0,5),(130,8,1,'童年','快乐','悲伤','兴奋','优秀','快乐','快乐',20,3),(131,8,2,'成年','压抑','忧郁','失败','成功','成功','成功',10,3),(132,8,1,'吃饭','爱吃','厌食','暴饮暴食','正常就餐','正常就餐','正常就餐',20,4),(133,8,2,'睡觉','嗜睡','失眠','正常','压抑','正常','正常',30,4),(134,8,1,'自我评价','正常','神经','快乐','失败','快乐','快乐',10,5),(135,8,2,'未来规划','努力生活','混吃等死','积极向上','好好学习','积极向上','积极向上',10,5),(136,6,1,'童年','快乐','悲伤','兴奋','优秀','快乐','快乐',20,3),(137,6,2,'成年','压抑','忧郁','失败','成功','成功','失败',0,3),(138,6,1,'吃饭','爱吃','厌食','暴饮暴食','正常就餐','正常就餐','暴饮暴食',0,4),(139,6,2,'睡觉','嗜睡','失眠','正常','压抑','正常','正常',30,4),(140,6,1,'自我评价','正常','神经','快乐','失败','快乐','神经',0,5),(141,6,2,'未来规划','努力生活','混吃等死','积极向上','好好学习','积极向上','努力生活',0,5); + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;