ssm实验室耗材管理系统源码和论文023
开发工具:idea
数据库mysql5.7+
数据库链接工具:navcat,小海豚等
技术:ssm
摘 要
互联网发展至今,无论是其理论还是技术都已经成熟,而且它广泛参与在社会中的方方面面。它让信息都可以通过网络传播,搭配信息管理工具可以很好地为人们提供服务。针对实验室耗材信息管理混乱,出错率高,信息安全性差,劳动强度大,费时费力等问题,采用实验室耗材管理系统可以有效管理,使信息管理能够更加科学和规范。
实验室耗材管理系统在Eclipse环境中,使用Java语言进行编码,使用Mysql创建数据表保存本系统产生的数据。系统可以提供信息显示和相应服务,本系统教师和学生申请使用实验材料,管理员管理实验材料,审核实验材料的申请信息,统计实验材料每学年的使用总数。
总之,实验室耗材管理系统集中管理信息,有着保密性强,效率高,存储空间大,成本低等诸多优点。它可以降低信息管理成本,实现信息管理计算机化。
关键词:实验室耗材管理系统;Java语言;Mysql
课题背景
互联网发展至今,无论是其理论还是技术都已经成熟,而且它广泛参与在社会中的方方面面。它让信息都可以通过网络传播,搭配信息管理工具可以很好地为人们提供服务。所以各行业,尤其是规模较大的企业和学校等都开始借助互联网和软件工具管理信息,传播信息,共享信息等等,以此可以增强自身实力,提高在同行业当中的竞争能力,并从各种激烈的竞争中获取发展的机会。针对实验室耗材信息管理混乱,出错率高,信息安全性差,劳动强度大,费时费力等问题,经过分析和考虑,在目前的情况下,可以引进一款实验室耗材管理系统这样的现代化管理工具,这个工具就是解决上述问题的最好的解决方案。它不仅可以实时完成信息处理,还缩短实验室耗材信息管理流程,使其系统化和规范化。同时还可以减少工作量,节约实验室耗材信息管理需要的人力和资金。所以实验室耗材管理系统是信息管理环节中不可缺少的工具,它对管理者来说非常重要。
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.XueshengshenqingEntity;
import com.entity.view.XueshengshenqingView;
import com.service.XueshengshenqingService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 学生申请
* 后端接口
* @author
* @email
* @date 2021-03-02 15:11:14
*/
@RestController
@RequestMapping("/xueshengshenqing")
public class XueshengshenqingController {
@Autowired
private XueshengshenqingService xueshengshenqingService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,XueshengshenqingEntity xueshengshenqing, HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("xuesheng")) {
xueshengshenqing.setXuehao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<XueshengshenqingEntity> ew = new EntityWrapper<XueshengshenqingEntity>();
PageUtils page = xueshengshenqingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xueshengshenqing), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,XueshengshenqingEntity xueshengshenqing, HttpServletRequest request){
EntityWrapper<XueshengshenqingEntity> ew = new EntityWrapper<XueshengshenqingEntity>();
PageUtils page = xueshengshenqingService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, xueshengshenqing), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( XueshengshenqingEntity xueshengshenqing){
EntityWrapper<XueshengshenqingEntity> ew = new EntityWrapper<XueshengshenqingEntity>();
ew.allEq(MPUtil.allEQMapPre( xueshengshenqing, "xueshengshenqing"));
return R.ok().put("data", xueshengshenqingService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(XueshengshenqingEntity xueshengshenqing){
EntityWrapper< XueshengshenqingEntity> ew = new EntityWrapper< XueshengshenqingEntity>();
ew.allEq(MPUtil.allEQMapPre( xueshengshenqing, "xueshengshenqing"));
XueshengshenqingView xueshengshenqingView = xueshengshenqingService.selectView(ew);
return R.ok("查询学生申请成功").put("data", xueshengshenqingView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
XueshengshenqingEntity xueshengshenqing = xueshengshenqingService.selectById(id);
return R.ok().put("data", xueshengshenqing);
}
/**
* 前端详情
*/
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
XueshengshenqingEntity xueshengshenqing = xueshengshenqingService.selectById(id);
return R.ok().put("data", xueshengshenqing);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody XueshengshenqingEntity xueshengshenqing, HttpServletRequest request){
xueshengshenqing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xueshengshenqing);
xueshengshenqingService.insert(xueshengshenqing);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody XueshengshenqingEntity xueshengshenqing, HttpServletRequest request){
xueshengshenqing.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(xueshengshenqing);
xueshengshenqingService.insert(xueshengshenqing);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody XueshengshenqingEntity xueshengshenqing, HttpServletRequest request){
//ValidatorUtils.validateEntity(xueshengshenqing);
xueshengshenqingService.updateById(xueshengshenqing);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
xueshengshenqingService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<XueshengshenqingEntity> wrapper = new EntityWrapper<XueshengshenqingEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("xuesheng")) {
wrapper.eq("xuehao", (String)request.getSession().getAttribute("username"));
}
int count = xueshengshenqingService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
研究内容
对实验室耗材管理系统设计制作,不仅需要技术支撑,也需要大量的理论研究。本文在对实验室耗材管理系统进行介绍时,将按照如下内容进行。
第一部分:介绍实验室耗材管理系统研究的背景意义,便于用户了解系统;
第二部分:介绍开发实验室耗材管理系统需要搭建的环境,包括技术和工具;
第三部分:介绍用户对实验室耗材管理系统的功能要求,以及对实验室耗材管理系统的性能要求等;
第四部分:介绍数据库的设计方案,以及根据功能要求设计的功能结构;
第五部分:介绍通过编码最终实现的系统功能运行效果;
第六部分:介绍系统的功能测试,对系统进行综合检测,并及时解决系统出现的问题,直至系统运行正常。
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.YishengEntity;
import com.entity.view.YishengView;
import com.service.YishengService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
/**
* 医生
* 后端接口
* @author
* @email
* @date 2024-03-09 14:04:05
*/
@RestController
@RequestMapping("/yisheng")
public class YishengController {
@Autowired
private YishengService yishengService;
@Autowired
private TokenService tokenService;
/**
* 登录
*/
@IgnoreAuth
@RequestMapping(value = "/login")
public R login(String username, String password, String captcha, HttpServletRequest request) {
YishengEntity user = yishengService.selectOne(new EntityWrapper<YishengEntity>().eq("yishenggonghao", username));
if(user==null || !user.getMima().equals(password)) {
return R.error("账号或密码不正确");
}
String token = tokenService.generateToken(user.getId(), username,"yisheng", "医生" );
return R.ok().put("token", token);
}
/**
* 注册
*/
@IgnoreAuth
@RequestMapping("/register")
public R register(@RequestBody YishengEntity yisheng){
//ValidatorUtils.validateEntity(yisheng);
YishengEntity user = yishengService.selectOne(new EntityWrapper<YishengEntity>().eq("yishenggonghao", yisheng.getYishenggonghao()));
if(user!=null) {
return R.error("注册用户已存在");
}
Long uId = new Date().getTime();
yisheng.setId(uId);
yishengService.insert(yisheng);
return R.ok();
}
/**
* 退出
*/
@RequestMapping("/logout")
public R logout(HttpServletRequest request) {
request.getSession().invalidate();
return R.ok("退出成功");
}
/**
* 获取用户的session用户信息
*/
@RequestMapping("/session")
public R getCurrUser(HttpServletRequest request){
Long id = (Long)request.getSession().getAttribute("userId");
YishengEntity user = yishengService.selectById(id);
return R.ok().put("data", user);
}
/**
* 密码重置
*/
@IgnoreAuth
@RequestMapping(value = "/resetPass")
public R resetPass(String username, HttpServletRequest request){
YishengEntity user = yishengService.selectOne(new EntityWrapper<YishengEntity>().eq("yishenggonghao", username));
if(user==null) {
return R.error("账号不存在");
}
user.setMima("123456");
yishengService.updateById(user);
return R.ok("密码已重置为:123456");
}
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,YishengEntity yisheng, HttpServletRequest request){
EntityWrapper<YishengEntity> ew = new EntityWrapper<YishengEntity>();
PageUtils page = yishengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yisheng), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,YishengEntity yisheng, HttpServletRequest request){
EntityWrapper<YishengEntity> ew = new EntityWrapper<YishengEntity>();
PageUtils page = yishengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yisheng), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( YishengEntity yisheng){
EntityWrapper<YishengEntity> ew = new EntityWrapper<YishengEntity>();
ew.allEq(MPUtil.allEQMapPre( yisheng, "yisheng"));
return R.ok().put("data", yishengService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(YishengEntity yisheng){
EntityWrapper< YishengEntity> ew = new EntityWrapper< YishengEntity>();
ew.allEq(MPUtil.allEQMapPre( yisheng, "yisheng"));
YishengView yishengView = yishengService.selectView(ew);
return R.ok("查询医生成功").put("data", yishengView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
YishengEntity yisheng = yishengService.selectById(id);
yisheng.setClicktime(new Date());
yishengService.updateById(yisheng);
return R.ok().put("data", yisheng);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
YishengEntity yisheng = yishengService.selectById(id);
yisheng.setClicktime(new Date());
yishengService.updateById(yisheng);
return R.ok().put("data", yisheng);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody YishengEntity yisheng, HttpServletRequest request){
yisheng.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yisheng);
YishengEntity user = yishengService.selectOne(new EntityWrapper<YishengEntity>().eq("yishenggonghao", yisheng.getYishenggonghao()));
if(user!=null) {
return R.error("用户已存在");
}
yisheng.setId(new Date().getTime());
yishengService.insert(yisheng);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody YishengEntity yisheng, HttpServletRequest request){
yisheng.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(yisheng);
YishengEntity user = yishengService.selectOne(new EntityWrapper<YishengEntity>().eq("yishenggonghao", yisheng.getYishenggonghao()));
if(user!=null) {
return R.error("用户已存在");
}
yisheng.setId(new Date().getTime());
yishengService.insert(yisheng);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody YishengEntity yisheng, HttpServletRequest request){
//ValidatorUtils.validateEntity(yisheng);
yishengService.updateById(yisheng);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
yishengService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<YishengEntity> wrapper = new EntityWrapper<YishengEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = yishengService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,YishengEntity yisheng, HttpServletRequest request,String pre){
EntityWrapper<YishengEntity> ew = new EntityWrapper<YishengEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicktime");
params.put("order", "desc");
PageUtils page = yishengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yisheng), params), params));
return R.ok().put("data", page);
}
}