基于javaweb+mysql的ssm+maven实验室设备管理系统(java+ssm+thymeleaf+html+layui+easyui+mysql+redis)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM+Maven实验室设备管理系统(java+ssm+thymeleaf+html+layui+easyui+mysql+redis)
项目介绍
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 版本均可;
技术栈
- 后端:Spring SpringMVC MyBatis 2. 前端:jsp+layui+easyui
使用说明
- 使用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 登录
@Autowired
private ClassesService classesService;
@Autowired
private UsersService usersService;
@Autowired
private SyslxService syslxService;
@Autowired
private XxtgService xxtgService;
@Autowired
private SysbglService sysbglService;
@Autowired
private SysglService sysglService;
@Autowired
private JydjService jydjService;
@Autowired
private SyxxbService syxxbService;
@Autowired
private SbshdjService sbshdjService;
@Autowired
private 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);
int uid = users.getId();
Sysgl sysgl = sysglService.getSysglById(sysid);
sysgl.setYyrid(uid);
sysgl.setSfyy(2);
sysgl.setFzrid(img);
if (sysglService.UpSysgl(sysgl) != 0) {
setLog.setlod(httpServletRequest, "申请编号为"+sysgl.getBh()+"的实验室", logService);
return true;
} else
return false;
}
}
@RestController
public class delController {
@Autowired
private LogService logService;
@Autowired
private GroupinfoService groupinfoService;
@Autowired
private MenuService menuService;
@Autowired
private TeacherService teacherService;
@Autowired
private UsersService usersService;
@Autowired
private StudentService studentService;
@Autowired
private ClassesService classesService;
@Autowired
* @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<Classes> classess = classesService.getClassesList(requestparamMap);
List<Map<String, Object>> 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<String, Object> 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<Classes> classess = classesService.getClassesList(requestparamMap);
List<Map<String, Object>> list = new ArrayList<>();
@RequestMapping("/delsysbgl")
public boolean delsysbgl(HttpServletRequest httpServletRequest, @RequestParam int id){
if (sysbglService.delSysbgl(id)!=0) {
setLog.setlod(httpServletRequest, "删除了主键为"+id+"的实验设备",logService);
return true;
}
return false;
}
/**
* 教师 删除实验课程
* @param httpServletRequest
* @param id
* @return
*/
@RequestMapping("/delsykcgl")
public boolean delsykcgl(HttpServletRequest httpServletRequest, @RequestParam int id){
if (syxxbService.delSyxxb(id)!=0) {
setLog.setlod(httpServletRequest, "删除了主键为"+id+"的实验课程",logService);
return true;
}
return false;
}
}
@Controller
public class IndexController {
@Autowired
private UsersService usersService;
@Autowired
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<String, Object> 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<Sbshdj> sbshdjs = sbshdjService.getSbshdjByZtid(0);
List<Map<String, Object>> 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);
@RequestMapping("/upsykcgl")
public boolean upsykcgl(@RequestParam(value = "id") int id,
@RequestParam(value = "field") String field,
@RequestParam(value = "updateValue") String updateValue,
HttpServletRequest httpServletRequest){
Syxxb syxxb = syxxbService.getSyxxbById(id);
if (syxxb != null) {
if (field.equals("info"))
syxxb.setInfo(updateValue);
if (syxxbService.upSyxxb(syxxb) != 0) {
setLog.setlod(httpServletRequest, "修改了id为" + id + "的实验课程" + field + "为" + updateValue,logService);
return true;
}
return false;
}
return false;
}
/**
* 教师 完成实验课程
* @param httpServletRequest
* @param id
* @return
*/
@RequestMapping("/sykcglwc")
public boolean sykcglwc(HttpServletRequest httpServletRequest, @RequestParam int id){
Syxxb syxxb = syxxbService.getSyxxbById(id);
syxxb.setSfwc(1);
if (syxxbService.upSyxxb(syxxb)!=0) {
setLog.setlod(httpServletRequest, "实验id为" + syxxb.getId() + "的实验已完成", logService);
return true;
}
return false;
}
/**
* 上传图片
* @param file
* @param request
* @return
*/
@RequestMapping("/layupload")
public JSONObject upload(MultipartFile file, HttpServletRequest request) {
try {
String path = "D:/JAVA/upload";
String image = UtilPacket.uploadImage(file, path);
*/
@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<Map<String, Object>> 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<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
return true;
}
return false;
}
return false;
}
/**
* 管理员 修改教师信息
* @param id
* @param field
* @param updateValue
* @param httpServletRequest
* @return
*/
@RequestMapping("/upjsxxgl")
public boolean upjsxxgl(@RequestParam(value = "id") int id,
@RequestParam(value = "field") String field,
@RequestParam(value = "updateValue") String updateValue,
HttpServletRequest httpServletRequest) {
Teacher teacher = teacherService.getTeacherById(id);
if (teacher != null) {
if (field.equals("tname"))
teacher.setTname(updateValue);
if (field.equals("sex"))
teacher.setSex(updateValue);
if (field.equals("zyzc"))
teacher.setZyzc(updateValue);
if (field.equals("tel"))
teacher.setTel(updateValue);
if (field.equals("jl"))
teacher.setJl(updateValue);
if (teacherService.upTeacher(teacher) != 0) {
setLog.setlod(httpServletRequest, "修改了id为" + id + "的教师" + field + "为" + updateValue,logService);
return true;
}
return false;
}
return false;
}
Map map = new HashMap();
map.put("id", id);
map.put("bname", bname);
list.add(map);
}
}
Map<String, Object> 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<Zygl> zygls = zyglService.getZyglList(requestparamMap);
List<Map<String, Object>> 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<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
* @return
*/
@RequestMapping("/selectxslast")
public JSONObject selectxslast(HttpServletRequest httpServletRequest) {
Student student = studentService.getStudentBylast();
List<Map<String, Object>> list = new ArrayList<>();
Integer idcard = student.getIdcard();
Map map = new HashMap();
map.put("idcard", idcard+1);
list.add(map);
Map<String, Object> 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<Map<String, Object>> 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();
}
}
Map<String, Object> 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<Menu> menus = menuService.getmenuList();
List<Map<String, Object>> 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<String, Object> map1 = new HashMap<>();
map1.put("code", 0);
map1.put("msg", "ok");
map1.put("count", list.size());
map1.put("data", list);
setLog.setlod(httpServletRequest, "查询了全部菜单信息数据",logService);
HttpSession session = httpServletRequest.getSession();
Users users = (Users) session.getAttribute("islogin");
String username = users.getUsername();
Integer groupid = users.getGroupid();
List<Map<String, Object>> 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<String, Object> 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.put("price", price);
map.put("ztid", ztstr);
map.put("sfbx", sfbxstr);
map.put("info", info);
map.put("img", img);
list.add(map);
}
}
Map<String, Object> 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<String, Object> 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();
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<String, Object> 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<Sysgl> sysgls = sysglService.getSysglList(requestparamMap);
List<Map<String, Object>> 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);
}
}
@RequestParam(value = "updateValue") String updateValue,
HttpServletRequest httpServletRequest) {
Menu menu = menuService.selectByPrimaryKey(id);
if (menu != null) {
if (field.equals("menuname"))
menu.setMenuname(updateValue);
if (field.equals("menulink"))
menu.setMenulink(updateValue);
if (menuService.updateByPrimaryKeySelective(menu) != 0) {
setLog.setlod(httpServletRequest, "修改了" + id + "菜单的" + field + "为" + updateValue,logService);
return true;
}
return false;
}
return false;
}
/**
* 管理员 修改教师信息
* @param id
* @param field
* @param updateValue
* @param httpServletRequest
* @return
*/
@RequestMapping("/upjsxxgl")
public boolean upjsxxgl(@RequestParam(value = "id") int id,
@RequestParam(value = "field") String field,
@RequestParam(value = "updateValue") String updateValue,
HttpServletRequest httpServletRequest) {
Teacher teacher = teacherService.getTeacherById(id);
if (teacher != null) {
if (field.equals("tname"))
teacher.setTname(updateValue);
if (field.equals("sex"))
teacher.setSex(updateValue);
if (field.equals("zyzc"))
teacher.setZyzc(updateValue);
if (field.equals("tel"))
teacher.setTel(updateValue);
@RequestMapping("/upsylxgl")
public boolean upsylxgl(@RequestParam(value = "id") int id,
@RequestParam(value = "field") String field,
@RequestParam(value = "updateValue") String updateValue,
HttpServletRequest httpServletRequest) {
Syslx syslx = syslxService.getSyslxById(id);
if (syslx != null) {
if (field.equals("lx"))
syslx.setLx(updateValue);
if (syslxService.upSyslx(syslx) != 0) {
setLog.setlod(httpServletRequest, "修改了id为" + id + "的实验室类型" + field + "为" + updateValue,logService);
return true;
}
return false;
}
return false;
}
/**
* 管理员 修改实验设备信息
* @param id
* @param field
* @param updateValue
* @param httpServletRequest
* @return
*/
@RequestMapping("/upsysbgl")
public boolean upsysbgl(@RequestParam(value = "id") int id,
@RequestParam(value = "field") String field,
@RequestParam(value = "updateValue") String updateValue,
HttpServletRequest httpServletRequest) {
Sysbgl sysbgl = sysbglService.getSysbglById(id);
if (sysbgl != null) {
if (field.equals("sbname"))
sysbgl.setSbname(updateValue);
if (field.equals("bh"))
sysbgl.setBh(updateValue);
if (field.equals("price"))
sysbgl.setPrice(Integer.parseInt(updateValue));
if (field.equals("info"))
sysbgl.setInfo(updateValue);
if (sysbglService.upSysbgl(sysbgl) != 0) {
setLog.setlod(httpServletRequest, "修改了id为" + id + "的实验设备" + field + "为" + updateValue,logService);
return true;
}
return false;
}
return false;
}
/**
setLog.setlod(httpServletRequest, "查询了实验室基本信息数据",logService);
JSONObject json = new JSONObject(map1);
return json;
}
/**
* 教师 查询可用实验室 显示实验室名称
* @param httpServletRequest
* @return
*/
@RequestMapping("/selectkysys")
public JSONObject selectkysys(HttpServletRequest httpServletRequest) {
List<Sysgl> sysgls = sysglService.getSysglBySfyy(0);
List<Map<String, Object>> 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<String, Object> 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<String, Object> selectxtrzgl(HttpServletRequest httpServletRequest, @RequestParam(value = "page") Integer page,@RequestParam(value = "limit") Integer limit) {
page = page-1;
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<String, Object> 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")