基于javaweb+mysql的jsp+servlet幼儿园管理系统(java+jsp+easyui+h-ui+servlet+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的JSP+Servlet幼儿园管理系统(java+jsp+easyui+h-ui+servlet+mysql)
项目介绍
本项目为后台管理系统,包括管理员、教师、家长三种角色; 管理员角色包含以下功能: 学生信息管理:学生列表、班级列表; 生活展示:运动会、生活照、菜单; 教师信息管理:教师列表; 园所管理:园所信息; 留言板:留言管理; 系统管理:修改密码;
教师角色包含以下功能: 学生信息管理:学生列表、班级列表; 生活展示:运动会、生活照、菜单; 教师信息管理:教师列表; 园所管理:园所信息; 留言板:留言管理; 系统管理:修改密码;
家长角色包含以下功能: 学生信息管理:学生列表、班级列表; 生活展示:运动会、生活照、菜单; 教师信息管理:教师列表; 园所管理:园所信息; 留言板:留言管理; 系统管理:修改密码; 管理员、教师、家长包含相同的菜单,但对应的权限各不相同,如教师只能查看和修改自己负责班级的学生等;
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目: 否;
技术栈
- 后端:Servlet 2. 前端:JSP+CSS+Javascript+jQuery+easyui+h-ui
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中util/DbUtil.java配置文件中的数据库配置改为自己的配置; 4. 运行项目,在浏览器中输入http://localhost:8080/ 登录
private UserRoleService userRoleService;
@Autowired
public UserController(ResultMap resultMap) {
this.resultMap = resultMap;
@RequestMapping(value = "/getMessage", method = RequestMethod.GET)
public ResultMap getMessage() {
return resultMap.success().message("您拥有用户权限,可以获得该接口的信息!");
@RequestMapping(value = "/editUserPage")
public String editUserPage(String userId, Model model) {
model.addAttribute("manageUser", userId);
if (null != userId) {
User user = userService.selectByPrimaryKey(userId);
public String kqtj(Model model) {
List<TongJi> ts = signService.getAllTeacherCount();
List<String> names = new ArrayList<>();
List<Integer> zc = new ArrayList<>();
List<Integer> tq = new ArrayList<>();
List<Integer> cd = new ArrayList<>();
for (TongJi tongJi : ts) {
names.add(tongJi.getUserName());
zc.add(tongJi.getZhengChang());
tq.add(tongJi.getTiQian());
cd.add(tongJi.getChiDao());
model.addAttribute("names", names);
*/
@RequestMapping("/getAllStudentByLimit")
@ResponseBody
public Object getAllStudentByLimit(Children stuParameter) {
return studentService.getAllStudentByLimit(stuParameter);
/**
* Method name: addStuPage <BR>
* Description: 增加教师界面 <BR>
* @return String<BR>
*/
@RequestMapping(value = "/addStuPage")
sign.setSignIn(date);
sign.setKqrId(user.getUserId());
sign.setKqrType(user.getUserState());
signService.addSign(sign);
return "SUCCESS";
} catch (Exception e) {
return "ERR";
/**
* Method name: addStu <BR>
* Description: 教师添加 <BR>
* @param user
* @return String<BR>
*/
public String addNotice(Notice notice) {
try {
notice.setCreatTime(new Date());
noticeService.addNotice(notice);
return "SUCCESS";
} catch (Exception e) {
return "ERR";
/**
* Method name: updateStudent <BR>
* Description: 更新教师 <BR>
* @param user
* @return String<BR>
@RequestMapping("/addCourse")
public String addCourse(Course course) {
course.setCreateTime(new Date());
try {
courseService.addCourse(course);
return "SUCCESS";
} catch (Exception e) {
return "ERR";
@ResponseBody
@RequestMapping("/delCourse")
public String delCourse(Integer id) {
try {
cd.add(tongJi.getChiDao());
model.addAttribute("names", names);
model.addAttribute("zc", zc);
model.addAttribute("tq", tq);
model.addAttribute("cd", cd);
return "ls/tongJiXueSheng";
@RequestMapping(value = "/course")
public String course(Model model) {
return "ls/course";
//课程
登录管理控制层:
@Controller
public class LoginController {
@Autowired
private ResultMap resultMap;
@Autowired
private UserService userService;// 用户登录service
@Autowired
private PageService pageService;
private final Logger logger = LoggerFactory.getLogger(LoginController.class);
@RequestMapping(value = "/notLogin", method = RequestMethod.GET)
@ResponseBody
public ResultMap notLogin() {
* Method name: getAllSignByLimit <BR>
* Description: 根据条件获取所有教师 <BR>
* @param userParameter
* @return Object<BR>
*/
@RequestMapping("/getAllChildSignByLimit")
@ResponseBody
public Object getAllChildSignByLimit(Sign signParameter) {
return signService.getAllChildSignByLimit(signParameter);
//所有老师签到的总次数统计
@RequestMapping(value = "/kqtj")
return "ls/notice";
/**
* Method name: getAllNoticeByLimit <BR>
* Description: 根据条件获取所有教师 <BR>
* @param userParameter
* @return Object<BR>
*/
@RequestMapping("/getAllNoticeByLimit")
@ResponseBody
public Object getAllNoticeByLimit(Notice noticeParameter) {
return noticeService.getAllNoticeByLimit(noticeParameter);
/**
* Method name: login <BR>
* Description: 登录验证 <BR>
* Remark: <BR>
* @param username 用户名
* @param password 密码
* @return ResultMap<BR>
*/
@RequestMapping(value = "/login")
@ResponseBody
public ResultMap login(String username, String password) {
return userService.login(username, password);
/**
*/
@RequestMapping("/getAllSignByLimit")
@ResponseBody
public Object getAllSignByLimit(Sign signParameter) {
return signService.getAllSignByLimit(signParameter);
//打卡
@RequestMapping(value = "/qianDaoTui")
public String qianDaoTui() {
return "ls/daKa";
/**
* Method name: addStu <BR>
@RequestMapping("/getAllNoticeByLimit")
@ResponseBody
public Object getAllNoticeByLimit(Notice noticeParameter) {
return noticeService.getAllNoticeByLimit(noticeParameter);
/**
* Method name: addStuPage <BR>
* Description: 增加教师界面 <BR>
* @return String<BR>
*/
@RequestMapping(value = "/addNoticePage")
public String addNoticePage(Integer id, Model model) {
model.addAttribute("manageNotice", id);
if (null != id) {
logger.info("{}---没有权限!", user.getUserName());
return resultMap.success().message("您没有权限!");
/**
* Method name: logout <BR>
* Description: 退出登录 <BR>
* @return String<BR>
*/
@RequestMapping(value = "/logout", method = RequestMethod.GET)
public String logout() {
Subject subject = SecurityUtils.getSubject();
private final ResultMap resultMap;
@Autowired
private UserService userService;
@Autowired
private UserRoleService userRoleService;
@Autowired
public UserController(ResultMap resultMap) {
this.resultMap = resultMap;
@RequestMapping(value = "/getMessage", method = RequestMethod.GET)
public ResultMap getMessage() {
return resultMap.success().message("您拥有用户权限,可以获得该接口的信息!");
@RequestMapping(value = "/editUserPage")
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss a");
String time = formatter.format(date).split(" ")[2];
String time1 = formatter.format(date).split(" ")[1];
String s=PropertyUtil.getConfigureProperties("startTime");
if(time.equals("上午") && time1.compareTo(s)>0) {
sign.setState(1);
}else {
sign.setState(3);
sign.setType(1);
sign.setSignIn(date);
sign.setKqrId(user.getUserId());
sign.setKqrType(user.getUserState());
signService.addSign(sign);
return "SUCCESS";
* @return boolean 是否正确<BR>
*/
@RequestMapping(value = "/user/checkUserPassword")
@ResponseBody
public boolean checkUserPassword(String password) {
return userService.checkUserPassword(password);
/**
* Method name: updatePassword <BR>
* Description: 更新密码 <BR>
* @param password 旧密码
* @return String 是否成功<BR>
*/
@RequestMapping(value = "/user/updatePassword")
* Method name: lskq <BR>
* Description: 教师管理页面 <BR>
* @return String<BR>
*/
@RequestMapping(value = "/lskq")
public String lskq() {
return "ls/sign";
/**
* Method name: getAllSignByLimit <BR>
* Description: 根据条件获取所有教师 <BR>
* @param userParameter
* @return Object<BR>
*/
public String lskq() {
return "ls/sign";
/**
* Method name: getAllSignByLimit <BR>
* Description: 根据条件获取所有教师 <BR>
* @param userParameter
* @return Object<BR>
*/
@RequestMapping("/getAllSignByLimit")
@ResponseBody
public boolean checkUserPassword(String password) {
return userService.checkUserPassword(password);
/**
* Method name: updatePassword <BR>
* Description: 更新密码 <BR>
* @param password 旧密码
* @return String 是否成功<BR>
*/
@RequestMapping(value = "/user/updatePassword")
@ResponseBody
public String updatePassword(String password) {
* Description: 教师添加 <BR>
* @param user
* @return String<BR>
*/
@ResponseBody
@RequestMapping("/addStu")
public String addStu(Children student) {
try {
studentService.addStudent(student);
addUserChildren(student);
return "SUCCESS";
@RequestMapping("/updateNotice")
public String updateNotice(Notice notice) {
return noticeService.updateStu(notice);
/**
* Method name: delClaTea <BR>
* Description: 批量删除教师<BR>
* @param ids
* @return String<BR>
*/
@RequestMapping(value = "delNotice")
@ResponseBody
@Transactional
model.addAttribute("manageNotice", id);
if (null != id) {
Notice notice = noticeService.selectByPrimaryKey(id);
model.addAttribute("manageNotice", notice);
return "ls/noticeAdd";
/**
* Method name: addStu <BR>
* Description: 教师添加 <BR>
* @param user
* @return String<BR>
*/
@ResponseBody
@RequestMapping("/addNotice")
* Description: 教师添加 <BR>
* @param user
* @return String<BR>
*/
@ResponseBody
@RequestMapping("/addQianTui")
public String addQianTui(Sign sign) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
try {
Date date=new Date();
public ResultMap notLogin() {
logger.warn("尚未登陆!");
return resultMap.success().message("您尚未登陆!");
@RequestMapping(value = "/notRole", method = RequestMethod.GET)
@ResponseBody
public ResultMap notRole() {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
if (user != null) {
logger.info("{}---没有权限!", user.getUserName());
* @return String<BR>
*/
@ResponseBody
@RequestMapping("/addStu")
public String addStu(Children student) {
try {
studentService.addStudent(student);
addUserChildren(student);
return "SUCCESS";
} catch (Exception e) {
return "ERR";