当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
【MEDICAL】Attend to Medical Ontologies: Content Selection for Clinical Abstractive Summarization
DNS attack details
PM2 simple use and daemon
【Torch】解决tensor参数有梯度,weight不更新的若干思路
oracle apex ajax process + dy 校验
ORACLE 11.2.0.3 不停机处理SYSAUX表空间一直增长问题
软件开发模式之敏捷开发(scrum)
ssm人事管理系统
优化方法:常用数学符号的含义
SSM学生成绩信息管理系统
Explain in detail the process of realizing Chinese text classification by CNN
php中根据数字月份返回月份的英文缩写
ARP攻击
MySQL组合索引加不加ID
在php的开发环境中如何调取WebService?
一个中年程序员学习中国近代史的小结
Pratique et réflexion sur l'entrepôt de données hors ligne et le développement Bi
Check log4j problems using stain analysis
SSM实验室设备管理
CRP实施方法论










