当前位置:网站首页>SSM laboratory equipment management
SSM laboratory equipment management
2022-07-02 07:19:00 【Night Weiyang 5788】
Author URI : In the middle of the night 5788
brief introduction :Java Quality creators in the field 、Java project 、 Learning materials 、 Technical assistance
Get the source code at the end of the article
Project introduction
This project is a background management system , Divided into administrators 、 teacher 、 Students have three roles ;
The administrator role includes the following functions :
information management : User management ;
Basic management : Laboratory management , Laboratory application records , Equipment management , Equipment record management , Consumables management , Consumables record management and other functions .
Statistics management : Query statistics management ;
The teacher role includes the following functions :
information management : Personal information modification ;
Basic management : Laboratory management 、 Laboratory application management 、 Equipment management 、 Equipment record management , Consumables management , Consumables record management and other functions .
The student role includes the following functions :
information management : Personal information modification ;
Basic management : Laboratory management 、 Laboratory application management 、 Equipment management 、 Equipment record management , Consumables management , Consumables record management and other functions .
Environmental needs
1. Running environment : It is best to java jdk 1.8, We run on this platform . Other versions can, in theory .
2.IDE Environmental Science :IDEA,Eclipse,Myeclipse Fine . recommend IDEA;
3.tomcat Environmental Science :Tomcat 7.x,8.x,9.x All versions are available
4. Hardware environment :windows 7/8/10 1G Above memory ; perhaps Mac OS;
5. database :MySql 5.7 edition ;
6. whether Maven project : no ;
Technology stack
1. Back end :Spring+SpringMVC+Mybatis
2. front end :JSP+CSS+JavaScript+jQuery
Instructions
1. Use Navicat Or other tools , stay mysql Create a database with the corresponding name in , And import the sql file ;
2. Use IDEA/Eclipse/MyEclipse Import the project ,Eclipse/MyEclipse Import time , if maven Item, please select maven;
if maven project , After importing successfully, please execute maven clean;maven install command , And then run ;
3. In the project applicationContext.xml Change the database configuration in the configuration file to your own configuration ;
4. Run the project , Input http://localhost:8080/shiyanshi Sign in
Run a screenshot
Administrator login

Teacher role

Student role

Related codes
User management controller
@Controller
public class SysuserController {
@Resource
private SysuserServier userService;
@RequestMapping("flogin.do")
public String login() {
return "login";
}
@RequestMapping("admin/showUserInfo.do")
public String showUserInfo(ModelMap map,HttpSession session){
if(session.getAttribute("auser")==null){
return "login";
}
Sysuser u=(Sysuser)session.getAttribute("auser");
map.put("user",userService.getById(u.getUid()));
return "admin/update_user_persion";
}
@RequestMapping("admin/updatePersionUser.do")
public String updateUserInfo(ModelMap map,HttpSession session,Sysuser user){
userService.update(user);
map.put("user", userService.getById(user.getUid()));
session.setAttribute("suc", "cc");
return "redirect:showUserInfo.do";
}
@RequestMapping("admin/login.do")
public String aLogin() {
return "admin/login";
}
// Process and modify personal information
@RequestMapping("showInfo.do")
public String showInfo(HttpSession session,ModelMap map) {
Sysuser u=(Sysuser)session.getAttribute("user");
if(u==null){
return "fore_login";
}else{
map.put("user", userService.getById(u.getUid()));
return "showUserinfo";
}
}
// Process and modify personal information
@RequestMapping("addShowInfo.do")
public String addShowInfo(HttpSession session,ModelMap map,Sysuser user) {
userService.update(user);
return "success";
}
// Upload files
public String fileUpload(@RequestParam(value="file",required=false)MultipartFile file,
HttpServletRequest request,String img){
String path=request.getSession().getServletContext().getRealPath("upload");
System.out.println("path==="+path);
System.out.println("file==="+file);
String fileName=file.getOriginalFilename();
System.out.println("fileName==="+fileName);
File targetFile=new File(path,fileName);
if(!targetFile.exists()){
targetFile.mkdirs();
}
try {
file.transferTo(targetFile);
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
String pa=request.getContextPath()+"/upload/"+fileName;
System.out.println("path==="+pa);
if(fileName!=null&&!fileName.equals("")){
img=fileName;
}else{
img=null;
}
return img;
}
// Backstage login
@RequestMapping("admin/alogin.do")
public String checkLogin(ModelMap map,Sysuser user, HttpSession session) {
Map<String,Object> u=new HashMap<String,Object>();
System.out.println("name===" + user.getUname());
System.out.println("pwd===" + user.getPwd());
u.put("uname",user.getUname());
u.put("utype", user.getUtype());
u.put("pwd",user.getPwd());
user = userService.adminLogin(u);
if (user != null) {
session.setAttribute("auser", user);
System.out.println("auser=" + user);
return "admin/index";
} else {
map.put("errorInfo", " Wrong username or password !");
return "admin/login";
}
}
Experimental controller
@Controller
public class ShiYanController {
@Resource
private ShiYanServer ShiYanService;
@Resource
private ForderServer orderService;
@Resource
private SysuserServier userService;
// Upload files
public String fileUpload(@RequestParam(value="file",required=false)MultipartFile file,
HttpServletRequest request,String img){
String path=request.getSession().getServletContext().getRealPath("upload");
String fileName=file.getOriginalFilename();
File targetFile=new File(path,fileName);
if(!targetFile.exists()){
targetFile.mkdirs();
}
try {
file.transferTo(targetFile);
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
String pa=request.getContextPath()+"/upload/"+fileName;
System.out.println("path==="+pa);
if(fileName!=null&&!fileName.equals("")){
img=fileName;
}else{
img="zanwu.jpg";
}
return img;
}
// Laboratory management
@RequestMapping("admin/addShiYan.do")
public String addShiYan(ModelMap map,ShiYan shiYan,HttpServletRequest request){
Timestamp time=new Timestamp(System.currentTimeMillis());
shiYan.setFtype(" laboratory ");
shiYan.setMstatus(" In my spare time ");
shiYan.setIsdel("1");
shiYan.setPubtime(time.toString().substring(0, 19));
ShiYanService.add(shiYan);
return "redirect:ShiYanList.do";
}
@RequestMapping("admin/doUpdateShiYan.do")
public String doUpdateShiYan(ModelMap map,int id){
map.put("sy", ShiYanService.getById(id));
return "admin/update_ShiYan";
}
@RequestMapping("admin/updateShiYan.do")
public String updateShiYan( HttpServletRequest request,ShiYan ShiYan){
ShiYanService.update(ShiYan);
return "redirect:ShiYanList.do";
}
// Paging query
@RequestMapping("admin/ShiYanList.do")
public String shiYanList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session){
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page), PageBean.PAGESIZE);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", pageBean.getPageSize());
Map<String, Object> cmap=new HashMap<String, Object>();
pmap.put("name", null);
cmap.put("name", null);
cmap.put("ftype", " laboratory ");
pmap.put("ftype", " laboratory ");
int total=ShiYanService.getCount(cmap);
pageBean.setTotal(total);
List<ShiYan> list=ShiYanService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 1);
return "admin/list_ShiYan";
}
// Paging fuzzy query
@RequestMapping("admin/vagueShiYanList.do")
public String vagueShiYanList(@RequestParam(value="page",required=false)String page,
ModelMap map,HttpSession session,ShiYan cd){
if(page==null||page.equals("")){
page="1";
}
PageBean pageBean=new PageBean(Integer.parseInt(page),PageBean.PAGESIZE);
Map<String, Object> pmap=new HashMap<String,Object>();
pmap.put("pageno", pageBean.getStart());
pmap.put("pageSize", pageBean.getPageSize());
Map<String, Object> cmap=new HashMap<String,Object>();
if(cd.getName()!=null&&!cd.getName().equals("")){
cmap.put("name", cd.getName());
pmap.put("name", cd.getName());
}
cmap.put("ftype", " laboratory ");
pmap.put("ftype", " laboratory ");
int total=ShiYanService.getCount(cmap);
pageBean.setTotal(total);
List<ShiYan> list=ShiYanService.getByPage(pmap);
map.put("page", pageBean);
map.put("list", list);
session.setAttribute("p", 2);
return "admin/list_ShiYan";
}
@RequestMapping("admin/deleteShiYan.do")
public String deleteShiYan(int id){
ShiYanService.delete(id);
return "redirect:ShiYanList.do";
}
If you want to learn this system , Now get . reply :072ssm
边栏推荐
猜你喜欢

Changes in foreign currency bookkeeping and revaluation general ledger balance table (Part 2)

如何高效开发一款微信小程序

【模型蒸馏】TinyBERT: Distilling BERT for Natural Language Understanding

使用 Compose 实现可见 ScrollBar

Alpha Beta Pruning in Adversarial Search

使用Matlab实现:Jacobi、Gauss-Seidel迭代

在php的开发环境中如何调取WebService?

Spark的原理解析

Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool

离线数仓和bi开发的实践和思考
随机推荐
Laravel8中的find_in_set、upsert的使用方法
在php的开发环境中如何调取WebService?
【信息检索导论】第六章 词项权重及向量空间模型
How to call WebService in PHP development environment?
Yaml file of ingress controller 0.47.0
CAD secondary development object
Agile development of software development pattern (scrum)
【Torch】解决tensor参数有梯度,weight不更新的若干思路
Ceaspectuss shipping company shipping artificial intelligence products, anytime, anywhere container inspection and reporting to achieve cloud yard, shipping company intelligent digital container contr
ARP攻击
User login function: simple but difficult
【信息检索导论】第二章 词项词典与倒排记录表
【信息检索导论】第一章 布尔检索
@Transational踩坑
Yolov5 practice: teach object detection by hand
Sqli-labs customs clearance (less1)
Practice and thinking of offline data warehouse and Bi development
Oracle 11.2.0.3 handles the problem of continuous growth of sysaux table space without downtime
华为机试题
Basic knowledge of software testing
