Drug management system based on javaweb+mysql (java+SSM+html+jQuery+Tomcat+mysql)

Project Introduction
This project is a front-end and back-end medicine management system (written in a web project),

Simple and clear, the interface is high-end atmosphere, a total of 6 tables

The background management system is used for the management of pills,

The front-end system is for users to buy pills and place an order for use.

Main function introduction:

Drug management system - background:

Order management

add, edit, delete

drug management

Add, Edit, Delete - Drug Name, Drug Category, Unit Price

Drug Category Management

Add, Edit, Delete - Category Name, Description

User Management

Add, Edit, Delete - Username, Phone, Description

Drug Mall - Front Desk:

The front page displays drug categories, drug thumbnails, drug details, available for purchase, adding to shopping carts, and forming orders

Configuration Environment
1. Operating environment: preferably java jdk 1.8, we are running on this platform. Other versions are also theoretically possible.

2.IDE environment: IDEA, Eclipse,Myeclipse can be used. IDEA is recommended;

3.tomcat environment: Tomcat 7.x,8.x,9.x versions are available

4. Hardware environment: Windows 7/8/10 with more than 1G memory; or Mac OS;

5. Whether it is a Maven project: Yes; check whether the source directory contains pom.xml;

If included, it is a maven project, otherwise it is a non-maven project

6. Database: MySql version 5.7;

technology stack

  1. Backend: Spring SpringMVC MyBatis
  2. Front end: html+jQuery+javascript

Steps for usage
1 Import the MedicinesMS project using IDEA/Eclipse

2 Use Navicat or other tools to import and execute the sql file medicine_ms.sql, and modify the database-related configuration in the project's database configuration file db.properties, including database name, database user name, password, etc.;

3 Use tomcat to start the project, the project name is /MedicinesMS Note: Please fix this project name, otherwise an exception will occur

4 Access the background system http://localhost:8080/MedicinesMS/admin_login.html

Enter the login page, username admin, password 123

5 Add drug information on the background system

6 Visit the front page http://localhost:8080/MedicinesMS/login.html,

Use username admin, password 123 to log in, purchase requirements, and form an order.




Be applicable

Course design, large assignments, graduation projects, project exercises, learning demonstrations, etc.

        }catch (IncorrectCredentialsException e){
            return ResultMapUtil.getHashMapLogin("wrong password","2");
        }
        return ResultMapUtil.getHashMapLogin("Verification succeeded","1");
    }
    /**
     * Go to the background management home page
     */
    @RequestMapping(value = "/index")
    public String index(){
        return "/index";
    }
    /**
     * sign out
     */
    @RequestMapping(value = "/logout")
    public String logout(){
    /**
     * Go to the edit page of medicines in and out
     */
    @RequestMapping(value = "/owinfoQueryById")
    public String owinfoQueryById(@RequestParam(name = "id",required = true)Integer id, Model model){
        Owinfo owinfo = owinfoService.queryOwinfoById(id);
        model.addAttribute("obj",owinfo);
        return "/owinfoPage";
    }
    /**
     * Modify a drug inventory
     */
    @RequestMapping(value = "/owinfoEdit")
    @ResponseBody
    public Object owinfoEdit(Owinfo owinfo){
        try{
            int i = owinfoService.editOwinfo(owinfo);
            return ResultMapUtil.getHashMapSave(i);
        } catch (Exception e){
            return ResultMapUtil.getHashMapException(e);
        }
    }
    /**
     * Delete a drug inventory
    @RequestMapping(value = "/owinfoQueryPage")
    @ResponseBody
    public Object owinfoQueryPage(String param, @RequestParam(defaultValue = "1")int pageNum,@RequestParam(defaultValue = "10")int pageSize){
        try{
            IPage<Owinfo> iPage = owinfoService.selectOwinfoPage(pageNum,pageSize,param);
            return ResultMapUtil.getHashMapMysqlPage(iPage);
        } catch (Exception e){
            return ResultMapUtil.getHashMapException(e);
        }
    }
    /**
     * Go to the new page of medicines in and out of the warehouse
     */
    @RequestMapping(value = "/owinfoPage")
    public String owinfoPage(){
        return "/owinfoPage";
    }
    /**
     * Add a Drug Inventory
     */
    @RequestMapping(value = "/owinfoAdd")
    @ResponseBody
    public Object owinfoAdd(Owinfo owinfo){
        try{
            owinfo.setCreatetime(new Date());
            int i = owinfoService.addOwinfo(owinfo);
            return ResultMapUtil.getHashMapSave(i);
    /**
     * Go to the edit page of medicines in and out
     */
    @RequestMapping(value = "/owinfoQueryById")
    public String owinfoQueryById(@RequestParam(name = "id",required = true)Integer id, Model model){
        Owinfo owinfo = owinfoService.queryOwinfoById(id);
        model.addAttribute("obj",owinfo);
        return "/owinfoPage";
    }
    /**
     * Modify a drug inventory
     */
    @RequestMapping(value = "/owinfoEdit")
    @ResponseBody
    public String logout(){
        Subject subject = SecurityUtils.getSubject();
        subject.logout();
        return "redirect:/login";
    }
}
related to medicines controller:
/**
 * Controllers related to medicine in and out
 */
@Controller
@RequestMapping(value = "/owinfo")
public class OwinfoController {
    @Autowired
    private IOwinfoService owinfoService;
    @RequestMapping(value = "/logout")
    public String logout(){
        Subject subject = SecurityUtils.getSubject();
        subject.logout();
        return "redirect:/login";
    }
}
related to medicines controller:
/**
 * Controllers related to medicine in and out
 */
@Controller
@RequestMapping(value = "/owinfo")
     */
    @RequestMapping(value = "/index")
    public String index(){
        return "/index";
    }
    /**
     * sign out
     */
    @RequestMapping(value = "/logout")
    public String logout(){
        Subject subject = SecurityUtils.getSubject();
        subject.logout();
        return "redirect:/login";
    }
}
related to medicines controller:
/**
 * Controllers related to medicine in and out
 */
@Controller
@RequestMapping(value = "/owinfo")
public class OwinfoController {
    @Autowired
    private IOwinfoService owinfoService;
    /**
        } catch (Exception e){
            return ResultMapUtil.getHashMapException(e);
        }
    }
    /**
     * Get all medicines
     */
    @RequestMapping(value = "/druginfoList")
    @ResponseBody
    public Object druginfoList(){
        List<Druginfo> druginfoList = druginfoService.queryDruginfoList();
        return ResultMapUtil.getHashMapList(druginfoList);
    }
            return ResultMapUtil.getHashMapLogin("Username and password cannot be empty","2");
        }
        Subject subject = SecurityUtils.getSubject();
        UsernamePasswordToken token = new UsernamePasswordToken(username,password);
        try{
            subject.login(token);
        }catch (UnknownAccountException e){
            return ResultMapUtil.getHashMapLogin("Username does not exist","2");
        }catch (IncorrectCredentialsException e){
            return ResultMapUtil.getHashMapLogin("wrong password","2");
        }
        return ResultMapUtil.getHashMapLogin("Verification succeeded","1");
    }
    /**
     * Go to the background management home page
     */
    @RequestMapping(value = "/index")
    public String index(){
        return "/index";
    }
    /**
     * sign out
     */
    @RequestMapping(value = "/logout")
    public String logout(){
        Subject subject = SecurityUtils.getSubject();
        subject.logout();
    @ResponseBody
    public Object druginfoEdit(Druginfo druginfo){
        try{
            int i = druginfoService.editDruginfo(druginfo);
            return ResultMapUtil.getHashMapSave(i);
        } catch (Exception e){
            return ResultMapUtil.getHashMapException(e);
        }
    }
    /**
     * delete a drug
     */
    @RequestMapping(value = "/druginfoDelById")
    @ResponseBody
    public Object druginfoDelById(Integer id){
        try{
            int i = druginfoService.delDruginfoById(id);
            return ResultMapUtil.getHashMapDel(i);
        } catch (Exception e){
            return ResultMapUtil.getHashMapException(e);
        }
    }
}
drug related controller:
/**
 * Drug-related controller s
 */
@Controller
@RequestMapping(value = "/druginfo")
public class DruginfoController {
    @Autowired
    private IDruginfoService druginfoService;
    /**
     * Go to drug page
     */
    @RequestMapping
    public String druginfo(){
        return "/druginfo";
    }
    /**
     * Paging query drug list
     */
    @RequestMapping(value = "/druginfoQueryPage")
    @ResponseBody

Tags: MySQL Java Tomcat

Posted by nomad9 on Mon, 30 May 2022 23:39:23 +0530