current position:Home>Java project: drug management system (java + springboot + HTML + layui + bootstrap + seals + MySQL)
Java project: drug management system (java + springboot + HTML + layui + bootstrap + seals + MySQL)
2022-04-29 16:40:33【OldWinePot】
The source code for : Blog's front page " resources " Download !
Project introduction
This project belongs to the project with front and rear ends separated , It is divided into two roles: drug administrator and personnel of drug taking office
Drug Administrator :
Sign in 、 sign out 、 Drug information entry 、 Pharmaceutical information entry 、 Purchaser information entry 、 Drug information browsing 、 Pharmaceutical information browsing 、 Purchasing personnel information browsing 、 Drug information query, warehousing, modification and deletion 、 Modification and deletion of pharmaceutical factory information warehousing 、 Modification and deletion of purchaser information warehousing 、 Browse warehousing records 、 Browse the delivery record 、 System help
Personnel of drug taking department :
Sign in 、 sign out 、 Drug information browsing 、 Pharmaceutical information browsing 、 Buyer information browsing 、 Drug information query 、 Browse the delivery record 、 System help
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 : yes
Technology stack
1. Back end :SpringBoot
2. front end :html+layui+jquery+bootstrap+echarts
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 application.yml Change the database configuration in the configuration file to your own configuration ;
4. Run the project , Back end input localhost:8081/
User related controller Control layer :
/**
* User related controller
*/
@Controller
public class UserController {
/**
* Go to the login page
*/
@RequestMapping(value = "/login")
public String login(){
return "/login";
}
/**
* Judge whether the user login is successful
*/
@RequestMapping(value = "/toLogin")
@ResponseBody
public Object toLogin(String username,String password){
if(username==null||password==null){
return ResultMapUtil.getHashMapLogin(" User name 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(" The username does not exist ","2");
}catch (IncorrectCredentialsException e){
return ResultMapUtil.getHashMapLogin(" Wrong password ","2");
}
return ResultMapUtil.getHashMapLogin(" Verify success ","1");
}
/**
* Turn to the background management homepage
*/
@RequestMapping(value = "/index")
public String index(){
return "/index";
}
/**
* Log out
*/
@RequestMapping(value = "/logout")
public String logout(){
Subject subject = SecurityUtils.getSubject();
subject.logout();
return "redirect:/login";
}
}
Drug related controller:
/**
* Drug related controller
*/
@Controller
@RequestMapping(value = "/druginfo")
public class DruginfoController {
@Autowired
private IDruginfoService druginfoService;
/**
* Go to the drugs page
*/
@RequestMapping
public String druginfo(){
return "/druginfo";
}
/**
* Query the drug list by page
*/
@RequestMapping(value = "/druginfoQueryPage")
@ResponseBody
public Object druginfoQueryPage(String param, @RequestParam(defaultValue = "1")int pageNum,@RequestParam(defaultValue = "10")int pageSize){
try{
IPage<Druginfo> iPage = druginfoService.selectDruginfoPage(pageNum,pageSize,param);
return ResultMapUtil.getHashMapMysqlPage(iPage);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* Turn to the new drug page
*/
@RequestMapping(value = "/druginfoPage")
public String druginfoPage(){
return "/druginfoPage";
}
/**
* Add a medicine
*/
@RequestMapping(value = "/druginfoAdd")
@ResponseBody
public Object druginfoAdd(Druginfo druginfo){
try{
int i = druginfoService.addDruginfo(druginfo);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* Turn to the drug editing page
*/
@RequestMapping(value = "/druginfoQueryById")
public String druginfoQueryById(@RequestParam(name = "id",required = true)Integer id, Model model){
Druginfo druginfo = druginfoService.queryDruginfoById(id);
model.addAttribute("obj",druginfo);
return "/druginfoPage";
}
/**
* Modify a drug
*/
@RequestMapping(value = "/druginfoEdit")
@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);
}
}
/**
* Get all medicines
*/
@RequestMapping(value = "/druginfoList")
@ResponseBody
public Object druginfoList(){
List<Druginfo> druginfoList = druginfoService.queryDruginfoList();
return ResultMapUtil.getHashMapList(druginfoList);
}
/**
* Turn to the drug shelf life inspection page
*/
@RequestMapping(value = "/warranty")
public String warranty(){
return "/warranty";
}
}
Supplier related controller:
/**
* Supplier related controller
*/
@Controller
@RequestMapping(value = "/supplier")
public class SupplierController {
@Autowired
private ISupplierService supplierService;
/**
* Go to the supplier page
*/
@RequestMapping
public String supplier(){
return "/supplier";
}
/**
* Query the supplier list by page
*/
@RequestMapping(value = "/supplierQueryPage")
@ResponseBody
public Object supplierQueryPage(String param, @RequestParam(defaultValue = "1")int pageNum,@RequestParam(defaultValue = "10")int pageSize){
try{
IPage<Supplier> iPage = supplierService.selectSupplierPage(pageNum,pageSize,param);
return ResultMapUtil.getHashMapMysqlPage(iPage);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* Turn to the new supplier page
*/
@RequestMapping(value = "/supplierPage")
public String supplierPage(){
return "/supplierPage";
}
/**
* Add a supplier
*/
@RequestMapping(value = "/supplierAdd")
@ResponseBody
public Object supplierAdd(Supplier supplier){
try{
supplier.setCreatetime(new Date());
int i = supplierService.addSupplier(supplier);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* Turn to the supplier edit page
*/
@RequestMapping(value = "/supplierQueryById")
public String supplierQueryById(@RequestParam(name = "id",required = true)Integer id, Model model){
Supplier supplier = supplierService.querySupplierById(id);
model.addAttribute("obj",supplier);
return "/supplierPage";
}
/**
* Modify a supplier
*/
@RequestMapping(value = "/supplierEdit")
@ResponseBody
public Object supplierEdit(Supplier supplier){
try{
int i = supplierService.editSupplier(supplier);
return ResultMapUtil.getHashMapSave(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* Delete a supplier
*/
@RequestMapping(value = "/supplierDelById")
@ResponseBody
public Object supplierDelById(Integer id){
try{
int i = supplierService.delSupplierById(id);
return ResultMapUtil.getHashMapDel(i);
} catch (Exception e){
return ResultMapUtil.getHashMapException(e);
}
}
/**
* Get all suppliers
*/
@RequestMapping(value = "/supplierList")
@ResponseBody
public Object supplierList(){
List<Supplier> supplierList = supplierService.querySupplierList();
return ResultMapUtil.getHashMapList(supplierList);
}
}
The source code for : Blog's front page " resources " Download !
copyright notice
author[OldWinePot],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/119/202204291448261731.html
The sidebar is recommended
- HTTP becomes HTTPS, self-made certificate
- Web front-end operation - tourism enterprise marketing publicity responsive website template (HTML + CSS + JavaScript)
- Self inspection list of a [qualified] front-end Engineer
- This principle in JavaScript and six common usage scenarios
- JavaScript this priority
- Analyzing the principle of HTTPS encryption
- Difference and principle between websocket and http
- Use of elementui scroll bar component El scrollbar
- Nginx security optimization
- GAC group has become the first pilot enterprise of "yueyouhang". Blessed are the car owners in Guangdong!
guess what you like
Loki HTTP API usage
JavaScript - prototype, prototype chain
Front end experience
JavaScript -- Inheritance
HTTP cache
Filters usage of table in elementui
A JavaScript pit encountered by a non front-end siege lion
Grain College - image error when writing Vue with vscode
Utility gadget - get the IP address in the HTTP request
Could not fetch URL https://pypi.org/simple/pytest-html/: There was a problem confirming the ssl cer
Random recommended
- Function of host parameter in http
- Use nginx proxy node red under centos7 and realize password access
- Centos7 nginx reverse proxy TCP port
- In eclipse, an error is reported when referencing layuijs and CSS
- Front end online teacher Pink
- Learn to use PHP to insert elements at the specified position and key of the array
- Learn how to use HTML and CSS styles to overlay two pictures on another picture to achieve the effect of scanning QR code by wechat
- Learn how to use CSS to vertically center the content in Div
- Learn how to use CSS to circle numbers
- Learn to open and display PDF files in HTML web pages
- The PHP array random sorting function shuffle() randomly scrambles the order of array elements
- JQuery implements the keyboard enter search function
- 16 ArcGIS API for JavaScript 4.18 a new development method based on ES modules @ ArcGIS / core
- 17 ArcGIS API for JavaScript 4.18 draw points, lines and faces with the mouse
- 18 ArcGIS API for JavaScript 4.18 obtain the length and area after drawing line segments and surface features
- Vue environment construction -- scaffold
- Build a demo with Vue scaffold
- Using vuex in Vue projects
- Use Vue router in Vue project
- 26 [react basics-5] react hook
- 07 Chrome browser captures hover element style
- WebGIS development training (ArcGIS API for JavaScript)
- Solution to the blank page of the project created by create react app after packaging
- 19. Html2canvas implements ArcGIS API for JavaScript 4 X screenshot function
- Introduction to JavaScript API for ArcGIS 13
- Development of ArcGIS API for JavaScript under mainstream front-end framework
- Nginx learning notes
- Less learning notes tutorial
- Vue2 cannot get the value in props in the data of the child component, or it is always the default value (the value of the parent component comes from asynchrony)
- LeetCode 217. Determine whether there are duplicate elements in the array
- I'll write a website collection station myself. Do you think it's ok? [HTML + CSS + JS] Tan Zi
- Front end browser debugging tips
- Application of anti chattering and throttling in JavaScript
- How to create JavaScript custom events
- Several ways of hiding elements in CSS
- node. Js-3 step out the use of a server and express package
- CSS matrix function
- Fastapi series - synchronous and asynchronous mutual conversion processing practice
- How to extend the functionality of Axios without interceptors
- Read pseudo classes and pseudo elements