一、项目简述
功能包括:
课题管理,学生管理,内容管理,文件管理,提问管理,教师管理,进度管理等等。
二、项目运行
环境配置:
Jdk1.8 Tomcat8.5 mysql Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。
项目技术:
JSP Spring SpringMVC MyBatis html css JavaScript JQuery Ajax layui maven等等。
管理员控制层:
@Controller("adminController")@RequestMapping(value = "/admin")public class AdminController extends MyController { @RequestMapping(value = "/index") public String frame(Model model, HttpServletRequest request)throws Exception { return "/admin/index"; } @RequestMapping(value = "/main") public String main(Model model, HttpServletRequest request)throws Exception { return "/admin/main"; } @RequestMapping(value = "/tj1") public String tj1(Model model, HttpServletRequest request)throws Exception { String sql="select DATE_FORMAT(insertDate,'%Y-%m-%d') dates,sum(allPrice) price from t_order order by DATE_FORMAT(insertDate,'%Y-%m-%d') desc"; List<Map> list = db.queryForList(sql); model.addAttribute("list", list); System.out.println(list); return "/admin/tj/tj1"; } @RequestMapping(value = "/password") public String password(Model model, HttpServletRequest request)throws Exception { return "/admin/password"; } @RequestMapping(value = "/changePassword") public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String oldPassword,String newPassword) throws Exception { Map admin = getAdmin(request); if(oldPassword.equals(admin.get("password").toString())){ String sql="update t_admin set password=? where id=?"; db.update(sql, new Object[]{newPassword,admin.get("id")}); return renderData(true,"1",null); }else{ return renderData(false,"1",null); } }}
管理员用户控制层:
@Controller("adminUserController")@RequestMapping(value = "/admin/user")public class AdminUserController extends MyController { @RequestMapping(value = "/frame") public String frame(Model model, HttpServletRequest request)throws Exception { return "/admin/user/frame"; } @RequestMapping(value = "/list") public String list(Model model, HttpServletRequest request,String username,String name)throws Exception { String sql="select a.* from t_user a where 1=1"; if(username!=null&&!"".equals(username)){ sql =" and username like '%" username "%'"; } if(name!=null&&!"".equals(name)){ sql =" and name like '%" name "%'"; } sql =" order by id desc"; List list = db.queryForList(sql); request.setAttribute("list", list); return "/admin/user/list"; } @RequestMapping(value = "/editSave") public ResponseEntity<String> editSave(Model model,HttpServletRequest request,Long id ,String username,String password,String name,String gh,String mobile,String headPic) throws Exception{ int result = 0; if(id!=null){ String sql="update t_user set username=?,password=?,name=?,gh=?,mobile=?,headPic=? where id=?"; result = db.update(sql, new Object[]{username,password,name,gh,mobile,headPic,id}); }else{ String sql="insert into t_user(username,password,name,gh,mobile,headPic) values(?,?,?,?,?,?)"; result = db.update(sql, new Object[]{username,password,name,gh,mobile,headPic}); } if(result==1){ return renderData(true,"操作成功",null); }else{ return renderData(false,"操作失败",null); } } @RequestMapping(value = "/editDelete") public ResponseEntity<String> editDelete(Model model,HttpServletRequest request,Long id) throws Exception { String sql="delete from t_user where id=?"; int result = db.update(sql, new Object[]{id}); if(result==1){ return renderData(true,"操作成功",null); }else{ return renderData(false,"操作失败",null); } } @RequestMapping(value = "/edit") public String edit(Model model, HttpServletRequest request,Long id)throws Exception { if(id!=null){ //修改 String sql="select * from t_user where id=?"; Map map = db.queryForMap(sql,new Object[]{id}); model.addAttribute("map", map); }String sql=""; return "/admin/user/edit"; }}
管理员登录控制层:
@Controller("adminLoginController")@RequestMapping(value = "/adminLogin")public class AdminLoginController extends MyController { @RequestMapping(value = "/login") public String index(Model model, HttpServletRequest request)throws Exception { return "/admin/login"; } @RequestMapping(value = "/save") public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String username,String password) throws Exception { String sql="select * from t_admin where username=?"; List<Map> list = db.queryForList(sql, new Object[]{username}); String result="1"; if(list!=null&&list.size()>0){ Map map = list.get(0); if(StringHelper.get(map, "password").equals(password)){ request.getSession().setMaxInactiveInterval(60*60*24); request.getSession().setAttribute("adminBean", map); result="1"; }else{ result="0"; } }else{ result="0"; } return renderData(true,result,null); } @RequestMapping(value = "/out") public String out(Model model, HttpServletRequest request)throws Exception { request.getSession().removeAttribute("adminBean"); return "redirect:/adminLogin/login.html"; } }
项目源码与开发文档
由于限制,这里不能直接放链接,需要项目源码与开发文档的同学转发本文 关注 私信【0215】即可获取
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。