Java项目:ssm实验室设备管理系统
创始人
2024-03-15 02:04:55
0

作者主页:源码空间站2022

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

ssm实验室设备管理系统。前台jsp+layui+easyui等框架渲染数据、后台java语言搭配ssm(spring、springmvc、mybatis、maven) 数据库mysql5.7、8.0版本均可。该系统主要分三种角色:管理员、教师、学生。主要功能学校实验设备的借、还、修以及实验课程的发布等等;

管理员主要功能:

实验室管理:实验室基本信息管理;
系统管理:系统日志查看;
权限中心:用户组信息管理、用户组权限控制、菜单管理;
信息管理-管理员:教师信息管理、学生信息管理、用户账号管理、班级信息管理、专业信息管理、实验室类型管理、信息通告管理、实验设备管理、实验室使用审批、设备借用审批;

教师主要功能:

实验管理:实验课程管理;
信息管理-教师:个人信息维护、学生信息管理、借用设备管理、设备损坏登记、设备维修登记、信息通告浏览、借用实验室管理。

学生主要功能:

信息管理-学生:个人信息维护;

信息浏览:实验课程浏览、实验设备浏览、信息通告浏览;

环境需要

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.是否Maven项目: 是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven项目 
6.数据库:MySql 5.7/8.0 版本均可;

技术栈

1. 后端:Spring SpringMVC MyBatis
2. 前端:jsp+layui+easyui

使用说明

1. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;

若为maven项目,导入成功后请执行maven clean;maven install命令,下载所需jar包;
2. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置
4. 配置tomcat,然后运行项目,输入localhost:8080/xxx 登录

运行截图

 

相关代码 

IndexController

package com.sys.controller;import com.sys.model.Groupinfo;import com.sys.model.Users;
import com.sys.service.GroupinfoService;
import com.sys.service.LogService;
import com.sys.service.MenuService;
import com.sys.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;@Controller
public class IndexController {@Autowiredprivate UsersService usersService;@Autowiredprivate GroupinfoService groupinfoService;@Autowiredprivate MenuService menuService;@Autowiredprivate LogService logService;@RequestMapping("/Index")public String index(Model model, HttpServletRequest httpServletRequest){HttpSession httpSession = httpServletRequest.getSession();Users users = (Users) httpSession.getAttribute("islogin");if (users!=null) {int groupid = users.getGroupid();String username = users.getUsername();String password = users.getUpassword();Users users1 = usersService.getusersByusername(username);if (users1.getUpassword().equals(password)){
//                此处封装需要带到前端的数据model.addAttribute("users",users1);Groupinfo groupinfo = groupinfoService.selectByPrimaryKey(users1.getGroupid());if (groupinfo!=null){/*start权限中心*/String quanxian = groupinfo.getQx();String qx[] = {};qx = quanxian.split(",");Map map = new HashMap();for (String qxcache : qx) {int qxid = Integer.parseInt(qxcache);Map map1 = new HashMap();map1.put("pmenu", menuService.selectByPrimaryKey(qxid));map1.put("cmenu", menuService.getmenubyfdm(qxid));map.put(String.valueOf(qxid) + "menus", map1);}model.addAttribute("parentmenus", map);/*end权限中心*/return "index";}else {model.addAttribute("errmsg","用户组信息错误!");return "login";}}else {model.addAttribute("errmsg","您以更改密码请重新输入");return "login";}}return "login";}@RequestMapping("/Login")//登录模块public String Login(@RequestParam String username,@RequestParam String password, Model model, HttpServletRequest httpServletRequest){//管理员HttpSession session = httpServletRequest.getSession();password = UtilPacket.Md5MD5String(password);
//        if (username.equals("admin")&&password.equals(UtilPacket.Md5MD5String("admin"))){
//            Users users = usersService.getusersByusername(username); /*查询用户信息*/
//            int groupid = users.getGroupid();
//            Groupinfo groupinfo = groupinfoService.selectByPrimaryKey(groupid); // 获取管理员信息 权限
//            if (groupinfo!=null) {
//                /*start权限中心*/
//                String quanxian = groupinfo.getQx();
//                String qx[] = {};
//                qx = quanxian.split(",");
//                Map map = new HashMap();
//                for (String qxcache : qx) {
//                    int qxid = Integer.parseInt(qxcache);
//                    Map map1 = new HashMap();
//                    map1.put("pmenu", menuService.selectByPrimaryKey(qxid)); //获取菜单信息
//                    map1.put("cmenu", menuService.getmenubyfdm(qxid));  //根据菜单id 获取 子模块
//                    map.put(String.valueOf(qxid) + "menus", map1);
//                }
//                model.addAttribute("parentmenus", map);
//                /*end权限中心*/
//            }
//            users.setUsername("admin");
//            model.addAttribute("users",users);
//            session.setAttribute("islogin",users);
//            setLog.setlod(httpServletRequest,"admin登录",logService);
//            return "index";
//        }
//        //教师,学生
//        elseif(usersService.getusersByusername(username)!=null){if (usersService.getusersByusername(username).getUpassword().equals(password)){Users users = usersService.getusersByusername(username); /*查询用户信息*/model.addAttribute("users",users);session.setAttribute("islogin",users);int groupid = users.getGroupid();Groupinfo groupinfo = groupinfoService.selectByPrimaryKey(groupid);/*根据用户组id查询信息*/if (groupinfo!=null){/*start权限中心*/String quanxian = groupinfo.getQx();String qx[] = {};qx = quanxian.split(",");System.out.printf("qx");Map map = new HashMap();for (String qxcache : qx) {int qxid = Integer.parseInt(qxcache);Map map1 = new HashMap();map1.put("pmenu", menuService.selectByPrimaryKey(qxid));    /*根据id 查询菜单信息*/map1.put("cmenu", menuService.getmenubyfdm(qxid));      /*根据父id 查询子模块信息*/map.put(String.valueOf(qxid) + "menus", map1);}model.addAttribute("parentmenus", map);/*end权限中心*/session.setAttribute("islogin",users);setLog.setlod(httpServletRequest,"id为"+users.getId()+"的用户登录",logService);return "index";}model.addAttribute("errmsg","用户组信息错误!");return "login";}else {model.addAttribute("errmsg","密码错误!");return "login";}}else {model.addAttribute("errmsg","用户名不存在!");return "login";}}
}

jumpController

package com.sys.controller;import com.sys.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;@Controller
public class jumpController {@Autowiredprivate LogService logService;/*用户添加页面跳转*/@RequestMapping("/Jumpto")public String Jumpto(@RequestParam("url") String url){return url;}/*修改密码啊页面跳转*/@RequestMapping("/resetpassword")public String resetpassword(){return  "table/xgmm";}/*安全退出页面跳转*/@RequestMapping("/logout")public String logout(HttpServletRequest httpServletRequest){HttpSession httpSession = httpServletRequest.getSession();setLog.setlod(httpServletRequest, "安全退出",logService);httpSession.invalidate();return "logout";}
}

selectController

package com.sys.controller;
import com.alibaba.fastjson.JSONObject;
import com.sys.model.*;
import com.sys.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;import java.util.*;@RestController
public class selectController {@Autowiredprivate MenuService menuService;@Autowiredprivate LogService logService;@Autowiredprivate GroupinfoService groupinfoService;@Autowiredprivate StudentService studentService;@Autowiredprivate TeacherService teacherService;@Autowiredprivate ZyglService zyglService;@Autowiredprivate ClassesService classesService;@Autowiredprivate UsersService usersService;@Autowiredprivate SyslxService syslxService;@Autowiredprivate XxtgService xxtgService;@Autowiredprivate SysbglService sysbglService;@Autowiredprivate SysglService sysglService;@Autowiredprivate JydjService jydjService;@Autowiredprivate SyxxbService syxxbService;@Autowiredprivate SbshdjService sbshdjService;@Autowiredprivate SbwxdjService sbwxdjService;/***  管理员 修改密码* @param oldpass* @param newpass* @param newpass2* @param httpServletRequest* @return*/@RequestMapping("/getoldpass")public JSONObject getoldpass(@RequestParam(value = "oldpass")String oldpass,@RequestParam(value = "newpass")String newpass,@RequestParam(value = "newpass2")String newpass2,HttpServletRequest httpServletRequest) {HttpSession session = httpServletRequest.getSession();oldpass = UtilPacket.Md5MD5String(oldpass);newpass = UtilPacket.Md5MD5String(newpass);newpass2 = UtilPacket.Md5MD5String(newpass2); //获取前端传入的数据Integer code = 500;String msg= "账号服务器错误!";Users users = (Users)session.getAttribute("islogin"); //获取登录账户String upass = users.getUpassword();setLog.setlod(httpServletRequest, "正在修改密码",logService);if (upass.equals(oldpass)){if (newpass2.equals(newpass)){if (!oldpass.equals(newpass)){code = 0;msg = "密码修改成功请重新登录";users.setUpassword(newpass);if(usersService.updateByPrimaryKeySelective(users)!=0) {setLog.setlod(httpServletRequest, users.getUsername() + "用户修改了密码",logService);session.invalidate();}}else{code=1;msg="新密码与原密码相同!";}}else {code = 2;msg="新密码两次输入不一致!";}}else {code = 3;msg = "原密码错误!";}Map map = new HashMap<>();map.put("success",true);map.put("code",code);map.put("msg",msg);JSONObject json = new JSONObject(map);return json;}/***  管理员 查询全部实验室信息* @param sysname* @param bh* @param httpServletRequest* @return*/@RequestMapping("/selectsysjbxxgl")public JSONObject selectsysjbxxgl(@RequestParam(required = false)String sysname,@RequestParam(required = false)String bh,HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();if (sysname!=null&&!sysname.equals(""))requestparamMap.put("sysname","%"+sysname+"%");if (bh!=null&&!bh.equals(""))requestparamMap.put("bh","%"+bh+"%");List sysgls = sysglService.getSysglList(requestparamMap);List> list = new ArrayList<>();if (sysgls != null) {for (Sysgl sysgl : sysgls) {String yyridstr = "未预约";Integer id = sysgl.getId();String sysnamestr = sysgl.getSysname();if (sysgl.getYyrid()!=null&&!sysgl.getYyrid().equals("")) {Integer yyrid = sysgl.getYyrid();yyridstr = usersService.selectByPrimaryKey(yyrid).getUsername(); /*返回预约用户名*/System.out.println(yyridstr);}Integer lxid = sysgl.getLxid();String lc = sysgl.getLc();String fzrid = sysgl.getFzrid();String bhstr = sysgl.getBh();Integer sfyy = sysgl.getSfyy();String lxidstr = syslxService.getSyslxById(lxid).getLx(); //返回实验室类型名称String sfyystr = "未预约";if (sfyy==1){sfyystr="已预约";}if (sfyy==2){sfyystr="预约未审核";}Map map = new HashMap();map.put("id", id);map.put("yyrid", yyridstr);map.put("sysname", sysnamestr);map.put("lc", lc);map.put("fzrid", fzrid);map.put("bh", bhstr);map.put("lxid", lxidstr);map.put("sfyy", sfyystr);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了实验室基本信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员 查询实验室 显示实验室名称* @param httpServletRequest* @return*/@RequestMapping("/selectsys")public JSONObject selectsys(HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();List sysgls = sysglService.getSysglList(requestparamMap);List> list = new ArrayList<>();if (sysgls != null) {for (Sysgl sysgl : sysgls) {Integer id = sysgl.getId();String sysname = sysgl.getSysname();Map map = new HashMap();map.put("id", id);map.put("sysname", sysname);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了实验室信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员 查询全部实验室使用审批* @param httpServletRequest* @return*/@RequestMapping("/selectsyssysp")public JSONObject selectsyssysp(HttpServletRequest httpServletRequest) {List sysgls = sysglService.getSysglBySfyy(2);List> list = new ArrayList<>();if (sysgls != null) {for (Sysgl sysgl : sysgls) {Integer id = sysgl.getId();String sysname = sysgl.getSysname();String bh = sysgl.getBh();String fzrid = sysgl.getFzrid();String lc = sysgl.getLc();Integer lxid = sysgl.getLxid();Integer yyrid = sysgl.getYyrid();String lx = syslxService.getSyslxById(lxid).getLx();String yyr = usersService.selectByPrimaryKey(yyrid).getUsername();//显示预约人名称Map map = new HashMap();map.put("id", id);map.put("sysname", sysname);map.put("bh", bh);map.put("fzrid", fzrid);map.put("lc", lc);map.put("lx", lx);map.put("yyr", yyr);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "打开了实验室使用审批",logService);JSONObject json = new JSONObject(map1);return json;}/***  教师  查询已预约实验室* @param httpServletRequest* @return*/@RequestMapping("/selecttgkysys")public JSONObject selecttgkysys(HttpServletRequest httpServletRequest) {HttpSession session = httpServletRequest.getSession();Users users = (Users) session.getAttribute("islogin");Integer tid = users.getId();List sysgls = sysglService.getSysglByKysys(tid);List> list = new ArrayList<>();if (sysgls != null) {for (Sysgl sysgl : sysgls) {Integer id = sysgl.getId();String sysname = sysgl.getSysname();String bh = sysgl.getBh();Map map = new HashMap();map.put("id", id);map.put("sysname", sysname);map.put("bh", bh);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了实验室信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  教师  查询全部借用实验室* @param httpServletRequest* @return*/@RequestMapping("/selectjysysgl")public JSONObject selectjysysgl(HttpServletRequest httpServletRequest) {HttpSession session = httpServletRequest.getSession();Users users = (Users) session.getAttribute("islogin");Integer tid = users.getId();List sysgls = sysglService.getSysglByteacher(tid);List> list = new ArrayList<>();if (sysgls != null) {for (Sysgl sysgl : sysgls) {String yyridstr = "未预约";Integer id = sysgl.getId();String sysnamestr = sysgl.getSysname();if (sysgl.getYyrid()!=null&&!sysgl.getYyrid().equals("")) {Integer yyrid = sysgl.getYyrid();yyridstr = usersService.selectByPrimaryKey(yyrid).getUsername();}Integer lxid = sysgl.getLxid();String lc = sysgl.getLc();String fzrid = sysgl.getFzrid();String bhstr = sysgl.getBh();Integer sfyy = sysgl.getSfyy();String lxidstr = syslxService.getSyslxById(lxid).getLx();String sfyystr = "未预约";if (sfyy==1){sfyystr="已预约";}if (sfyy==2){sfyystr="预约未审核";}Map map = new HashMap();map.put("id", id);map.put("yyrid", yyridstr);map.put("sysname", sysnamestr);map.put("lc", lc);map.put("fzrid", fzrid);map.put("bh", bhstr);map.put("lxid", lxidstr);map.put("sfyy", sfyystr);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了实验室基本信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  教师  查询可用实验室  显示实验室名称* @param httpServletRequest* @return*/@RequestMapping("/selectkysys")public JSONObject selectkysys(HttpServletRequest httpServletRequest) {List sysgls = sysglService.getSysglBySfyy(0);List> list = new ArrayList<>();if (sysgls != null) {for (Sysgl sysgl : sysgls) {Integer id = sysgl.getId();String sysname = sysgl.getSysname();String bh = sysgl.getBh();Map map = new HashMap();map.put("id", id);map.put("sysname", sysname);map.put("bh", bh);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了实验室信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员 查询全部日志信息* @param httpServletRequest* @param page* @param limit* @return*/@RequestMapping("/selectxtrzgl")public Map selectxtrzgl(HttpServletRequest httpServletRequest, @RequestParam(value = "page") Integer page,@RequestParam(value = "limit") Integer limit) {page = page-1;Integer start = page*limit;Integer end = (page+1)*limit-1;List logs = logService.getlogList();Integer datacount = logs.size();Integer i = 0;List> list = new ArrayList<>();if (logs != null) {for (Log log : logs) {if (i>=start&&i<=end){Integer id = log.getId();String cz = log.getCz();Integer czr = log.getCzr();Date date = log.getTime();String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());String timestr = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日--"+hour+":"+minute+":"+second;String czrstr=usersService.selectByPrimaryKey(czr).getUsername();Map map = new HashMap();map.put("id", id);map.put("cz", cz);map.put("czr", czrstr);map.put("time", timestr);list.add(map);}i++;}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", datacount);map1.put("data", list);setLog.setlod(httpServletRequest, "查询了全部系统日志信息数据",logService);return map1;}/***   管理员 查询全部用户组信息* @param name* @param httpServletRequest* @return*/@RequestMapping("/selectyhzxxgl")public JSONObject selectyhzxxgl(@RequestParam(required = false) String name, HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();if (name!=null&&!name.equals(""))requestparamMap.put("groupname","%"+name+"%");List groupinfos = groupinfoService.getgroupinfoList(requestparamMap);List> list = new ArrayList<>();if (groupinfos != null) {for (Groupinfo groupinfo : groupinfos) {Integer id = groupinfo.getId();String qx = groupinfo.getQx();String groupname = groupinfo.getGroupname();Map map = new HashMap();map.put("id", id);map.put("qx", qx);map.put("groupname", groupname);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了全部用户组信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员 查询用户组权限信息* @param httpServletRequest* @return*/@RequestMapping("/selectyhzqxgl")public JSONObject selectyhzqxgl(HttpServletRequest httpServletRequest) {List groupinfos = groupinfoService.getgroupinfoList(null);List> list = new ArrayList<>();if (groupinfos != null) {for (Groupinfo groupinfo : groupinfos) {Integer id = groupinfo.getId();String qx = groupinfo.getQx();String groupname = groupinfo.getGroupname();String qxs[] ={};Map map = new HashMap();map.put("id", id+"_a");map.put("field", id+"_a");map.put("title", groupname);if (qx!=null)qxs = qx.split(",");Map child = selectfcd(httpServletRequest);List childdatas = (List) child.get("data");List childsmap = new ArrayList();for (Integer i = 0 ;i2&&qxs!=null) {for (String qxbsstr : qxs) {if (Integer.parseInt(qxbsstr) == childid) {sfxz = true;break;}}}String childmenuname = String.valueOf(childmap.get("menuname"));childmap.put("id",childid+"_b_"+id);childmap.put("title",childmenuname);childmap.put("checked",sfxz);childmap.put("field",childid+"_b_"+id);childsmap.add(childmap);}map.put("children",childsmap);list.add(map);}}Map map1 = new HashMap<>();map1.put("data", list);setLog.setlod(httpServletRequest, "查询了全部权限节点数据",logService);JSONObject json = new JSONObject(map1);return json;}/** 管理员 查询父菜单*/@RequestMapping("/selectfcd")public Map selectfcd(HttpServletRequest httpServletRequest) {List menus = menuService.getfdmmenuList();List> list = new ArrayList<>();if (menus != null) {for (Menu menu : menus) {Integer id = menu.getId();String menuname = menu.getMenuname();Map map = new HashMap();map.put("id", id);map.put("menuname", menuname);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了父菜单信息数据",logService);return map1;}/***  管理员 查询菜单信息信息* @param httpServletRequest* @return*/@RequestMapping("/selectcdgl")public JSONObject selectcdgl(HttpServletRequest httpServletRequest) {List menus = menuService.getmenuList();List> list = new ArrayList<>();if (menus != null) {for (Menu menu : menus) {Integer id = menu.getId();String fdm = null;if(menu.getFdm()!=null&&menu.getFdm()!="") {/*查询父菜单名称他*/fdm = menuService.selectByPrimaryKey(Integer.parseInt(menu.getFdm())).getMenuname();}String menulink = menu.getMenulink();String menuname = menu.getMenuname();Map map = new HashMap();map.put("id", id);map.put("fdm", fdm);map.put("menulink", menulink);map.put("menuname", menuname);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了全部菜单信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员 查询父菜单信息 根据fdm是空查询* @param httpServletRequest* @return*/@RequestMapping("/selectfcd2")public JSONObject selectfcd2(HttpServletRequest httpServletRequest) {List menus = menuService.getfdmmenuList();List> list = new ArrayList<>();if (menus != null) {for (Menu menu : menus) {Integer id = menu.getId();String menuname = menu.getMenuname();Map map = new HashMap();map.put("id", id);map.put("menuname", menuname);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了父菜单信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/*** 管理员  查询全部教师信息* @param tname* @param idcard* @param httpServletRequest* @return*/@RequestMapping("/selectjsxxgl")public JSONObject selectjsxxgl(@RequestParam(required = false)String tname,@RequestParam(required = false) String idcard, HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();if (tname!=null&&!tname.equals(""))requestparamMap.put("tname","%"+tname+"%");if (idcard!=null&&!idcard.equals(""))requestparamMap.put("idcard","%"+idcard+"%");List teachers = teacherService.getTeacherList(requestparamMap);List> list = new ArrayList<>();if (teachers != null) {for (Teacher teacher : teachers) {Integer id = teacher.getId();String tnamestr = teacher.getTname();String sex = teacher.getSex();Date date = teacher.getBirth();String birth = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日";String zyzc = teacher.getZyzc();Integer zyid = teacher.getZyid();String zystr = zyglService.getZyglById(zyid).getZname();String tel = teacher.getTel();String jl = teacher.getJl();String idcardstr = String.valueOf(teacher.getIdcard());Map map = new HashMap();map.put("id", id);map.put("tname", tnamestr);map.put("sex", sex);map.put("birth", birth);map.put("zyzc", zyzc);map.put("zystr", zystr);map.put("tel", tel);map.put("jl", jl);map.put("idcard", idcardstr);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了教师信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***   管理员  查询最后一条教师信息 账号* @param httpServletRequest* @return*/@RequestMapping("/selectjslast")public JSONObject selectjslast(HttpServletRequest httpServletRequest) {Teacher teacher = teacherService.getteacherlast();List> list = new ArrayList<>();Integer idcard = teacher.getIdcard();Map map = new HashMap();map.put("idcard", idcard+1);list.add(map);Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了最后一条教师数据",logService);JSONObject json = new JSONObject(map1);return json;}/***   管理员 查询教师信息 显示教师名称* @param httpServletRequest* @return*/@RequestMapping("/selectjs")public JSONObject selectjs(HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();List teachers = teacherService.getTeacherList(requestparamMap);List> list = new ArrayList<>();if (teachers != null) {for (Teacher teacher : teachers) {Integer id = teacher.getId();Integer idcard = teacher.getIdcard();String tname = teacher.getTname();Map map = new HashMap();map.put("id", id);map.put("tname", tname);map.put("idcard",idcard);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了教师信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  教师 查询个人信息* @param httpServletRequest* @return*/@RequestMapping("/selectgrxxwhjs")public JSONObject selectgrxxwhjs(HttpServletRequest httpServletRequest) {HttpSession session = httpServletRequest.getSession();Users users = (Users) session.getAttribute("islogin");String username = users.getUsername();Integer groupid = users.getGroupid();List> list = new ArrayList<>();if (groupid==2) {Teacher teacher = teacherService.getTeacherByIdcard(Integer.parseInt(username));if (teacher!=null){Integer id = teacher.getId();Integer idcard = teacher.getIdcard();Date date = teacher.getBirth();String birth = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日";String zyzc = teacher.getZyzc();String jl = teacher.getJl();String sex = teacher.getSex();String tname = teacher.getTname();String tel = teacher.getTel();Integer zid = teacher.getZyid();String zidstr = zyglService.getZyglById(zid).getZname();Map map = new HashMap();map.put("id",id);map.put("idcard",idcard);map.put("birth",birth);map.put("zyzc",zyzc);map.put("jl",jl);map.put("sex",sex);map.put("tname",tname);map.put("tel",tel);map.put("zid",zidstr);list.add(map);}}if (groupid==3){Student student = studentService.getStudentByIdcard(Integer.parseInt(username));}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了个人信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员 查询全部专业信息* @param httpServletRequest* @return*/@RequestMapping("/selectzy")public JSONObject selectzy(HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();List zygls = zyglService.getZyglList(requestparamMap);List> list = new ArrayList<>();if (zygls != null) {for (Zygl zygl : zygls) {Integer id = zygl.getId();String zname = zygl.getZname();Map map = new HashMap();map.put("id", id);map.put("zname", zname);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了专业信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员  查询全部学生信息* @param sname* @param idcard* @param httpServletRequest* @return*/@RequestMapping("/selectxsxxgl")public JSONObject selectxsxxgl(@RequestParam(required = false)String sname,@RequestParam(required = false) String idcard, HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();if (sname!=null&&!sname.equals(""))requestparamMap.put("sname","%"+sname+"%");if (idcard!=null&&!idcard.equals(""))requestparamMap.put("idcard","%"+idcard+"%");List students = studentService.getStudentList(requestparamMap);List> list = new ArrayList<>();if (students != null) {for (Student student : students) {Integer id = student.getId();String snamestr = student.getSname();String sex = student.getSex();Date date = student.getBirth();String birth = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日";Integer zyid = student.getZid();Integer cid = student.getCid();String cstr = classesService.getClassesById(cid).getBname();String zystr = zyglService.getZyglById(zyid).getZname();String tel = String.valueOf(student.getTel());String jl = student.getJl();String idcardstr = String.valueOf(student.getIdcard());Map map = new HashMap();map.put("id", id);map.put("sname", snamestr);map.put("sex", sex);map.put("birth", birth);map.put("zystr", zystr);map.put("cstr", cstr);map.put("tel", tel);map.put("jl", jl);map.put("idcard", idcardstr);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了学生信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/*** 管理员  查询最后一条学生信息 账号* @param httpServletRequest* @return*/@RequestMapping("/selectxslast")public JSONObject selectxslast(HttpServletRequest httpServletRequest) {Student student = studentService.getStudentBylast();List> list = new ArrayList<>();Integer idcard = student.getIdcard();Map map = new HashMap();map.put("idcard", idcard+1);list.add(map);Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了最后一条学生数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  学生 个人信息维护* @param httpServletRequest* @return*/@RequestMapping("/selectgrxxwh")public JSONObject selectgrxxwh(HttpServletRequest httpServletRequest) {HttpSession session = httpServletRequest.getSession();Users users = (Users) session.getAttribute("islogin");String username = users.getUsername();Integer groupid = users.getGroupid();List> list = new ArrayList<>();if (groupid==2) {Teacher teacher = teacherService.getTeacherByIdcard(Integer.parseInt(username));}if (groupid==3){Student student = studentService.getStudentByIdcard(Integer.parseInt(username));if (student!=null){Integer id = student.getId();Integer idcard = student.getIdcard();Date date = student.getBirth();String birth = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日";Integer cid = student.getCid();String cidstr = classesService.getClassesById(cid).getBname();String jl = student.getJl();String sex = student.getSex();String sname = student.getSname();String tel = student.getTel();Integer zid = student.getZid();String zidstr = zyglService.getZyglById(zid).getZname();Map map = new HashMap();map.put("id",id);map.put("idcard",idcard);map.put("birth",birth);map.put("cid",cidstr);map.put("jl",jl);map.put("sex",sex);map.put("sname",sname);map.put("tel",tel);map.put("zid",zidstr);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了个人信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/*** 管理员  查询用户账号信息* @param username* @param httpServletRequest* @return*/@RequestMapping("/selectyhzhgl")public JSONObject selectyhzhgl(@RequestParam(required = false)String username,HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();if (username!=null&&!username.equals(""))requestparamMap.put("username","%"+username+"%");List userss = usersService.getuserList(requestparamMap);List> list = new ArrayList<>();if (userss != null) {for (Users users : userss) {Integer id = users.getId();String usernamestr = users.getUsername();Integer gid = users.getGroupid();String groupstr = groupinfoService.selectByPrimaryKey(gid).getGroupname();// 显示用户组名称Date date = users.getRegtime();String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());String regtime = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日--"+hour+":"+minute+":"+second;Map map = new HashMap();map.put("id", id);map.put("username", usernamestr);map.put("groupstr", groupstr);map.put("regtime", regtime);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了用户信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员  查询全部班级信息* @param bname* @param httpServletRequest* @return*/@RequestMapping("/selectbjxxgl")public JSONObject selectbjxxgl(@RequestParam(required = false)String bname,HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();if (bname!=null&&!bname.equals(""))requestparamMap.put("bname","%"+bname+"%");List classess = classesService.getClassesList(requestparamMap);List> list = new ArrayList<>();if (classess != null) {for (Classes classes : classess) {Integer id = classes.getId();String bnamestr = classes.getBname();Integer tid = classes.getTid();String idcard = String.valueOf(teacherService.getTeacherById(tid).getIdcard());String tid1 = teacherService.getTeacherById(tid).getTname();String tidstr = tid1+"---"+idcard;Map map = new HashMap();map.put("id", id);map.put("bname", bnamestr);map.put("tid", tidstr);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了班级信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/*** 管理员  查询班级信息 显示班级名称* @param httpServletRequest* @return*/@RequestMapping("/selectbj")public JSONObject selectbj(HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();List classess = classesService.getClassesList(requestparamMap);List> list = new ArrayList<>();if (classess != null) {for (Classes classes : classess) {Integer id = classes.getId();String bname = classes.getBname();Map map = new HashMap();map.put("id", id);map.put("bname", bname);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了班级信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员  查询全部专业信息* @param zname* @param httpServletRequest* @return*/@RequestMapping("/selectzyxxgl")public JSONObject selectzyxxgl(@RequestParam(required = false)String zname, HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();if (zname!=null&&!zname.equals(""))requestparamMap.put("zname","%"+zname+"%");List zygls = zyglService.getZyglList(requestparamMap);List> list = new ArrayList<>();if (zygls != null) {for (Zygl zygl : zygls) {Integer id = zygl.getId();String znamestr = zygl.getZname();Map map = new HashMap();map.put("id", id);map.put("zname", znamestr);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了专业信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/*** 管理员 查询全部实验室类型* @param lx* @param httpServletRequest* @return*/@RequestMapping("/selectsylxgl")public JSONObject selectsylxgl(@RequestParam(required = false)String lx, HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();if (lx!=null&&!lx.equals(""))requestparamMap.put("lx","%"+lx+"%");List syslxes = syslxService.getSyslxList(requestparamMap);List> list = new ArrayList<>();if (syslxes != null) {for (Syslx syslx : syslxes) {Integer id = syslx.getId();String lxstr = syslx.getLx();Map map = new HashMap();map.put("id", id);map.put("lx", lxstr);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了实验室类型信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员 查询实验室类型 显示实验类型名称* @param httpServletRequest* @return*/@RequestMapping("/selectsyslx")public JSONObject selectsyslx(HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();List syslxs = syslxService.getSyslxList(requestparamMap);List> list = new ArrayList<>();if (syslxs != null) {for (Syslx syslx : syslxs) {Integer id = syslx.getId();String lx = syslx.getLx();Map map = new HashMap();map.put("id", id);map.put("lx", lx);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了实验室类型数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员 查询全部信息通告* @param httpServletRequest* @return*/@RequestMapping("/selectxxtggl")public JSONObject selectxxtggl(HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();List xxtgs = xxtgService.getXxtgList(requestparamMap);List> list = new ArrayList<>();if (xxtgs != null) {for (Xxtg xxtg : xxtgs) {Integer id = xxtg.getId();String fbrstr = usersService.selectByPrimaryKey(xxtg.getFbrid()).getUsername(); //显示账号名称String info = xxtg.getInfo();Date date = xxtg.getFbtime();String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());String fbtime = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日--"+hour+":"+minute+":"+second;Map map = new HashMap();map.put("id", id);map.put("fbrid", fbrstr);map.put("info", info);map.put("fbtime", fbtime);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了信息通告数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  教师 学生 查询全部信息通告* @param httpServletRequest* @return*/@RequestMapping("/selectxxtgll")public JSONObject selectxxtgll(@RequestParam(required = false) String info, HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();if (info!=null&&!info.equals(""))requestparamMap.put("info","%"+info+"%");List xxtgs = xxtgService.getXxtgList(requestparamMap);List> list = new ArrayList<>();if (xxtgs != null) {for (Xxtg xxtg : xxtgs) {Integer id = xxtg.getId();Integer fbrid = xxtg.getFbrid();String infostr = xxtg.getInfo();Date date = xxtg.getFbtime();String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());String fbsj = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日--"+hour+":"+minute+":"+second;Users users = usersService.selectByPrimaryKey(fbrid);String username = users.getUsername();Map map = new HashMap();map.put("id", id);map.put("fbrid", username);map.put("info", infostr);map.put("fbtime", fbsj);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查看了信息通告",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员 查询全部实验设备* @param sbname* @param bh* @param httpServletRequest* @return*/@RequestMapping("/selectsysbgl")public JSONObject selectsysbgl(@RequestParam(required = false)String sbname,@RequestParam(required = false) String bh, HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();if (sbname!=null&&!sbname.equals(""))requestparamMap.put("sbname","%"+sbname+"%");if (bh!=null&&!bh.equals(""))requestparamMap.put("bh","%"+bh+"%");List sysbgls = sysbglService.getSysbglList(requestparamMap);List> list = new ArrayList<>();if (sysbgls != null) {for (Sysbgl sysbgl : sysbgls) {Integer id = sysbgl.getId();String sbnamestr = sysbgl.getSbname();String bhstr = sysbgl.getBh();String sysid = sysglService.getSysglById(sysbgl.getSysid()).getSysname(); //查询实验室名称Date date = sysbgl.getCgsj();String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());String cgsj =  String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日";Integer price = sysbgl.getPrice();Integer ztid = sysbgl.getZtid();String ztstr="未使用";if (ztid==1)ztstr = "正在使用";if (ztid==2)ztstr = "待审核";if (ztid==3)ztstr = "维修中";if (ztid==4)ztstr = "已损坏";if (ztid==5)ztstr = "无法维修";String sfbxstr = "未报修";Integer sfbx = sysbgl.getSfbx();if (sfbx==1)sfbxstr="已报修";String info = sysbgl.getInfo();String img = sysbgl.getImg();Map map = new HashMap();map.put("id", id);map.put("sbname", sbnamestr);map.put("bh", bhstr);map.put("sysid", sysid);map.put("cgsj", cgsj);map.put("price", price);map.put("ztid", ztstr);map.put("sfbx", sfbxstr);map.put("info", info);map.put("img", img);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了设备信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  管理员  查询全部设备借用* @param httpServletRequest* @return*/@RequestMapping("/selectsbsysp")public JSONObject selectsbsysp(HttpServletRequest httpServletRequest) {List jydjs = jydjService.getJydjByZtid(2);List> list = new ArrayList<>();if (jydjs != null) {for (Jydj jydj : jydjs) {Integer id = jydj.getId();String info = jydj.getInfo();Date date = jydj.getJysj();Integer sbid = jydj.getSbid();Integer uid = jydj.getUid();String sbstr = sysbglService.getSysbglById(sbid).getSbname();String ustr = usersService.selectByPrimaryKey(uid).getUsername();String sbbh = sysbglService.getSysbglById(sbid).getBh();String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());String fbtime = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日--"+hour+":"+minute+":"+second;Map map = new HashMap();map.put("id", id);map.put("info", info);map.put("sbid", sbstr);map.put("uid", ustr);map.put("sbbh", sbbh);map.put("jysj", fbtime);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "打开了设备使用审批",logService);JSONObject json = new JSONObject(map1);return json;}/***  教师 查询借用设备* @param httpServletRequest* @return*/@RequestMapping("/selectjysbgl")public JSONObject selectjysbgl(HttpServletRequest httpServletRequest) {HttpSession session = httpServletRequest.getSession();Users users = (Users) session.getAttribute("islogin");Integer tid = users.getId();List jydjs = jydjService.getJydjByUid(tid);List> list = new ArrayList<>();if (jydjs != null) {for (Jydj jydj : jydjs) {Integer id = jydj.getId();Integer sbid = jydj.getSbid();Date date = jydj.getJysj();String info = jydj.getInfo();Date date1 = jydj.getGhsj();Integer ztid = jydj.getZtid();Sysbgl sysbgl = sysbglService.getSysbglById(sbid);String sbname = sysbgl.getSbname();String bh = sysbgl.getBh();String ghsj = "未归还";String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());String jysj = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日--"+hour+":"+minute+":"+second;if (date1!=null) {String hour2 = date1.getHours() > 9 ? String.valueOf(date1.getHours()) : 0 + String.valueOf(date1.getHours());String minute2 = date1.getMinutes() > 9 ? String.valueOf(date1.getMinutes()) : 0 + String.valueOf(date1.getMinutes());String second2 = date1.getSeconds() > 9 ? String.valueOf(date1.getSeconds()) : 0 + String.valueOf(date1.getSeconds());ghsj = String.valueOf(date1.getYear() + 1900) + "年" + String.valueOf(date1.getMonth() + 1) + "月" + String.valueOf(date1.getDate()) + "日--" + hour + ":" + minute + ":" + second;}if(ztid==2)ghsj="管理员审核中";if(ztid==3)ghsj="借用被拒绝";Map map = new HashMap();map.put("id", id);map.put("sbname", sbname);map.put("bh", bh);map.put("jysj", jysj);map.put("ghsj", ghsj);map.put("info", info);map.put("ztid", ztid);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了借用设备记录数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  教师 查询可用设备* @param httpServletRequest* @return*/@RequestMapping("/selectkysb")public JSONObject selectkysb(HttpServletRequest httpServletRequest) {List sysbgls = sysbglService.getSysbglByky();List> list = new ArrayList<>();if (sysbgls != null) {for (Sysbgl sysbgl : sysbgls) {Integer id = sysbgl.getId();String bh = sysbgl.getBh();String sbname = sysbgl.getSbname();Map map = new HashMap();map.put("id", id);map.put("bh", bh);map.put("sbname", sbname);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了可用实验设备列表",logService);JSONObject json = new JSONObject(map1);return json;}/***  教师 查询全部损坏设备记录* @param httpServletRequest* @return*/@RequestMapping("/selectsbshdj")public JSONObject selectsbshdj(HttpServletRequest httpServletRequest) {HttpSession session = httpServletRequest.getSession();Users users = (Users) session.getAttribute("islogin");Integer uid = users.getId();List sbshdjs = sbshdjService.getSbshdjByUid(uid);List> list = new ArrayList<>();if (sbshdjs != null) {for (Sbshdj sbshdj : sbshdjs) {Integer id = sbshdj.getId();Integer sbid = sbshdj.getSbid();String info = sbshdj.getInfo();Integer ztid = sbshdj.getZtid();String ztidstr = "已损坏";if (ztid==1){ztidstr="已维修";}if (ztid==2){ztidstr="无法维修";}if (ztid==3){ztidstr="维修中";}Date date = sbshdj.getShsj();String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());String shsj = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日--"+hour+":"+minute+":"+second;Sysbgl sysbgl = sysbglService.getSysbglById(sbid);String sbname = sysbgl.getSbname();String bh = sysbgl.getBh();Map map = new HashMap();map.put("id", id);map.put("sbname", sbname);map.put("bh", bh);map.put("shsj", shsj);map.put("info", info);map.put("ztid", ztidstr);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了设备损坏记录数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  教师 查询全部维修设备* @param info* @param httpServletRequest* @return*/@RequestMapping("/selectsbwxdj")public JSONObject selectsbwxdj(@RequestParam(required = false) String info, HttpServletRequest httpServletRequest) {Map requestparamMap = new HashMap();if (info!=null&&!info.equals(""))requestparamMap.put("info","%"+info+"%");List sbwxdjs = sbwxdjService.getSbwxdjList(requestparamMap);List> list = new ArrayList<>();if (sbwxdjs != null) {for (Sbwxdj sbwxdj : sbwxdjs) {Integer id = sbwxdj.getId();Integer sbid = sbwxdj.getSbid();String infostr = sbwxdj.getInfo();Integer ztid = sbwxdj.getZtid();String wxr = sbwxdj.getWxr();Integer money = sbwxdj.getMoney();String ztidstr = "正在维修";if (ztid==1){ztidstr="维修完毕";}if (ztid==2){ztidstr="无法维修";}Date date = sbwxdj.getWssj();String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());String wxsj = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日--"+hour+":"+minute+":"+second;Sysbgl sysbgl = sysbglService.getSysbglById(sbid);String sbname = sysbgl.getSbname();String bh = sysbgl.getBh();Map map = new HashMap();map.put("id", id);map.put("sbname", sbname);map.put("bh", bh);map.put("wxsj", wxsj);map.put("info", infostr);map.put("ztid", ztidstr);map.put("wxr", wxr);map.put("money", money);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了设备维修记录数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  教师 查询已损坏设备 显示维修设备名* @param httpServletRequest* @return*/@RequestMapping("/selectkwxsb")public JSONObject selectkwxsb(HttpServletRequest httpServletRequest) {List sbshdjs = sbshdjService.getSbshdjByZtid(0);List> list = new ArrayList<>();if (sbshdjs != null) {for (Sbshdj sbshdj : sbshdjs) {Integer id = sbshdj.getId();Integer sbid = sbshdj.getSbid();Sysbgl sysbgl = sysbglService.getSysbglById(sbid);String sbname = sysbgl.getSbname();String bh = sysbgl.getBh();Map map = new HashMap();map.put("id", sbid);map.put("sbname", sbname);map.put("bh", bh);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了可维修设备列表数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  学生 查询实验设备信息* @param httpServletRequest* @return*/@RequestMapping("/selectsysbll")public JSONObject selectsysbll(HttpServletRequest httpServletRequest) {HttpSession session = httpServletRequest.getSession();Users users = (Users) session.getAttribute("islogin");List> list = new ArrayList<>();if (users.getGroupid()==3){Student student = studentService.getStudentByIdcard(Integer.parseInt(users.getUsername()));List syxxbList = syxxbService.getSyxxbByCid(student.getCid());if (syxxbList!=null)for (Syxxb syxxb : syxxbList){Integer sysid = syxxb.getSysid();List sysbgls = sysbglService.getSysbglBySysid(sysid);for (Sysbgl sysbgl:sysbgls){Integer id = sysbgl.getId();String sbnamestr = sysbgl.getSbname();String bhstr = sysbgl.getBh();String sysidstr = sysglService.getSysglById(sysid).getSysname();Date date = sysbgl.getCgsj();String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());String cgsj =  String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日";Integer price = sysbgl.getPrice();Integer ztid = sysbgl.getZtid();String ztstr="未使用";if (ztid==1)ztstr = "正在使用";if (ztid==2)ztstr = "待审核";if (ztid==3)ztstr = "维修中";if (ztid==4)ztstr = "已损坏";if (ztid==5)ztstr = "无法维修";String sfbxstr = "未报修";Integer sfbx = sysbgl.getSfbx();if (sfbx==1)sfbxstr="已报修";String info = sysbgl.getInfo();String img = sysbgl.getImg();Map map = new HashMap();map.put("id", id);map.put("sbname", sbnamestr);map.put("bh", bhstr);map.put("sysid", sysidstr);map.put("cgsj", cgsj);map.put("price", price);map.put("ztid", ztstr);map.put("sfbx", sfbxstr);map.put("info", info);map.put("img", img);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了设备信息数据",logService);JSONObject json = new JSONObject(map1);return json;}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了设备信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  教师 查询全部实验课程信息* @param info* @param httpServletRequest* @return*/@RequestMapping("/selectsykcgl")public JSONObject selectsykcgl(@RequestParam(required = false)String info,HttpServletRequest httpServletRequest) {HttpSession session = httpServletRequest.getSession();Users users = (Users) session.getAttribute("islogin");Integer uid = users.getId();System.out.printf("uid");Map requestparamMap = new HashMap();if (info!=null&&!info.equals(""))requestparamMap.put("info","%"+info+"%");if (uid!=null&&!uid.equals(""))requestparamMap.put("tid",uid);List syxxbs = syxxbService.getSyxxbList(requestparamMap);List> list = new ArrayList<>();if (syxxbs != null) {for (Syxxb syxxb : syxxbs) {Integer cid = syxxb.getCid();Date date = syxxb.getFbtime();Integer id = syxxb.getId();String infostr = syxxb.getInfo();Integer sfwc = syxxb.getSfwc();Integer sysid = syxxb.getSysid();String cidstr = classesService.getClassesById(cid).getBname();String sfwcstr = "未完成";if (sfwc==1){sfwcstr="已完成";}String sysidstr = sysglService.getSysglById(sysid).getSysname();String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());String fbtime = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日--"+hour+":"+minute+":"+second;Map map = new HashMap();map.put("id", id);map.put("info", infostr);map.put("sysid", sysidstr);map.put("cid", cidstr);map.put("sfwc", sfwcstr);map.put("fbtime", fbtime);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了实验课程信息数据",logService);JSONObject json = new JSONObject(map1);return json;}/***  学生 查询实验课程信息* @param httpServletRequest* @return*/@RequestMapping("/selectsykcll")public JSONObject selectsykcll(HttpServletRequest httpServletRequest) {HttpSession session = httpServletRequest.getSession();Users users = (Users) session.getAttribute("islogin");List> list = new ArrayList<>();if (users.getGroupid()==3){Student student = studentService.getStudentByIdcard(Integer.parseInt(users.getUsername()));List syxxbs = syxxbService.getSyxxbByCid(student.getCid());if (syxxbs != null) {for (Syxxb syxxb : syxxbs) {Date date = syxxb.getFbtime();Integer id = syxxb.getId();String infostr = syxxb.getInfo();Integer sysid = syxxb.getSysid();String bh = sysglService.getSysglById(sysid).getBh();String sysidstr = sysglService.getSysglById(sysid).getSysname();String hour = date.getHours()>9?String.valueOf(date.getHours()):0+String.valueOf(date.getHours());String minute = date.getMinutes()>9?String.valueOf(date.getMinutes()):0+String.valueOf(date.getMinutes());String second = date.getSeconds()>9?String.valueOf(date.getSeconds()):0+String.valueOf(date.getSeconds());String fbtime = String.valueOf(date.getYear()+1900)+"年"+String.valueOf(date.getMonth()+1)+"月"+String.valueOf(date.getDate())+"日--"+hour+":"+minute+":"+second;Map map = new HashMap();map.put("id", id);map.put("info", infostr);map.put("bh", bh);map.put("sysid", sysidstr);map.put("fbtime", fbtime);list.add(map);}}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了实验课程信息数据",logService);JSONObject json = new JSONObject(map1);return json;}Map map1 = new HashMap<>();map1.put("code", 0);map1.put("msg", "ok");map1.put("count", list.size());map1.put("data", list);setLog.setlod(httpServletRequest, "查询了实验课程信息数据",logService);JSONObject json = new JSONObject(map1);return json;}}

如果也想学习本系统,下面领取。关注并回复:035ssm 

上一篇:Vue学习笔记

下一篇:企业级nginx使用

相关内容

热门资讯

常用商务英语口语   商务英语是以适应职场生活的语言要求为目的,内容涉及到商务活动的方方面面。下面是小编收集的常用商务...
六年级上册英语第一单元练习题   一、根据要求写单词。  1.dry(反义词)__________________  2.writ...
复活节英文怎么说 复活节英文怎么说?复活节的英语翻译是什么?复活节:Easter;"Easter,anniversar...
2008年北京奥运会主题曲 2008年北京奥运会(第29届夏季奥林匹克运动会),2008年8月8日到2008年8月24日在中华人...
英语道歉信 英语道歉信15篇  在日常生活中,道歉信的使用频率越来越高,通过道歉信,我们可以更好地解释事情发生的...
六年级英语专题训练(连词成句... 六年级英语专题训练(连词成句30题)  1. have,playhouse,many,I,toy,i...
上班迟到情况说明英语   每个人都或多或少的迟到过那么几次,因为各种原因,可能生病,可能因为交通堵车,可能是因为天气冷,有...
小学英语教学论文 小学英语教学论文范文  引导语:英语教育一直都是每个家长所器重的,那么有关小学英语教学论文要怎么写呢...
英语口语学习必看的方法技巧 英语口语学习必看的方法技巧如何才能说流利的英语? 说外语时,我们主要应做到四件事:理解、回答、提问、...
四级英语作文选:Birth ... 四级英语作文范文选:Birth controlSince the Chinese Governmen...
金融专业英语面试自我介绍 金融专业英语面试自我介绍3篇  金融专业的学生面试时,面试官要求用英语做自我介绍该怎么说。下面是小编...
我的李老师走了四年级英语日记... 我的李老师走了四年级英语日记带翻译  我上了五个学期的小学却换了六任老师,李老师是带我们班最长的语文...
小学三年级英语日记带翻译捡玉... 小学三年级英语日记带翻译捡玉米  今天,我和妈妈去外婆家,外婆家有刚剥的`玉米棒上带有玉米籽,好大的...
七年级英语优秀教学设计 七年级英语优秀教学设计  作为一位兢兢业业的人民教师,常常要写一份优秀的教学设计,教学设计是把教学原...
我的英语老师作文 我的英语老师作文(通用21篇)  在日常生活或是工作学习中,大家都有写作文的经历,对作文很是熟悉吧,...
英语老师教学经验总结 英语老师教学经验总结(通用19篇)  总结是指社会团体、企业单位和个人对某一阶段的学习、工作或其完成...
初一英语暑假作业答案 初一英语暑假作业答案  英语练习一(基础训练)第一题1.D2.H3.E4.F5.I6.A7.J8.C...
大学生的英语演讲稿 大学生的英语演讲稿范文(精选10篇)  使用正确的写作思路书写演讲稿会更加事半功倍。在现实社会中,越...
VOA美国之音英语学习网址 VOA美国之音英语学习推荐网址 美国之音网站已经成为语言学习最重要的资源站点,在互联网上还有若干网站...
商务英语期末试卷 Part I Term Translation (20%)Section A: Translate ...