当前位置:网站首页>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
边栏推荐
- Oracle 11.2.0.3 handles the problem of continuous growth of sysaux table space without downtime
- Module not found: Error: Can't resolve './$$_ gendir/app/app. module. ngfactory'
- Sqli-labs customs clearance (less15-less17)
- 【MEDICAL】Attend to Medical Ontologies: Content Selection for Clinical Abstractive Summarization
- CSRF attack
- ORACLE 11G SYSAUX表空间满处理及move和shrink区别
- view的绘制机制(三)
- oracle apex ajax process + dy 校验
- DNS攻击详解
- 使用Matlab实现:弦截法、二分法、CG法,求零点、解方程
猜你喜欢

腾讯机试题

MapReduce与YARN原理解析

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

Yolov5 practice: teach object detection by hand

【调参Tricks】WhiteningBERT: An Easy Unsupervised Sentence Embedding Approach

Only the background of famous universities and factories can programmers have a way out? Netizen: two, big factory background is OK

sqli-labs通關匯總-page2

The boss said: whoever wants to use double to define the amount of goods, just pack up and go

2021-07-05C#/CAD二次开发创建圆弧(4)

CAD secondary development object
随机推荐
Oracle apex Ajax process + dy verification
使用Matlab实现:弦截法、二分法、CG法,求零点、解方程
php中判断版本号是否连续
Oracle 11g uses ords+pljson to implement JSON_ Table effect
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory'
Pratique et réflexion sur l'entrepôt de données hors ligne et le développement Bi
UEditor . Net version arbitrary file upload vulnerability recurrence
Spark的原理解析
IDEA2020中PySpark的两表关联(字段名相同)
第一个快应用(quickapp)demo
2021-07-17c /cad secondary development creation circle (5)
【MEDICAL】Attend to Medical Ontologies: Content Selection for Clinical Abstractive Summarization
腾讯机试题
【BERT,GPT+KG调研】Pretrain model融合knowledge的论文集锦
How to call WebService in PHP development environment?
Sqli-labs customs clearance (less1)
Sqli-labs customs clearance (less2-less5)
Yaml file of ingress controller 0.47.0
TCP攻击
Yolov5 practice: teach object detection by hand
