当前位置: 首页 > news >正文

基于SSM和VUE的药品管理系统(含源码+sql+视频导入教程+文档)

👉文末查看项目功能视频演示+获取源码+sql脚本+视频导入教程视频

1 、功能描述

  基于SSM和VUE的药品管理系统2拥有两种角色

管理员:药品管理、出库管理、入库管理、销售员管理、报损管理等

销售员:登录注册、入库、出库、销售、报损等

功能架构

1.1 背景描述

  随着医疗领域的快速发展和人们对健康管理的需求不断增加,药店在社会中的地位日益重要。然而,传统的药店管理方式存在着库存管理困难、药品销售不透明、客户信息管理混乱等问题。为了解决这些挑战,我们开发了一款全新的药店管理系统,通过整合先进的信息技术和管理理念,实现了药品采购、库存管理、销售记录、客户健康档案管理等多项功能的一体化管理。我们致力于提高药店管理的效率、提升客户体验,并且确保药品管理的安全性和合规性,为药店经营者提供了更便捷、高效和可靠的管理工具,助力药店实现更加稳健可持续的发展。

2、项目技术

后端框架:SSM(Spring、SpringMVC、Mybatis)

前端技术:VUE

2.1 SSM

  SSM(Spring+SpringMVC+MyBatis)是目前比较主流的Java EE企业级框架,适用于搭建各种大型的企业级应用系统。其中,Spring就像是整个项目中的粘合剂,负责装配bean并管理其生命周期,实现控制反转(IoC)的功能。SpringMVC负责拦截用户请求,通过DispatcherServlet将请求匹配到相应的Controller并执行。而MyBatis则是对JDBC的封装,让数据库底层操作变得透明,通过配置文件关联到各实体类的Mapper文件,实现了SQL语句映射。

2.2 mysql

  MySQL是一款Relational Database Management System,直译过来的意思就是关系型数据库管理系统,MySQL有着它独特的特点,这些特点使他成为目前最流行的RDBMS之一,MySQL想比与其他数据库如ORACLE、DB2等,它属于一款体积小、速度快的数据库,重点是它符合本次毕业设计的真实租赁环境,拥有成本低,开发源码这些特点,这也是选择它的主要原因。

3、开发环境

  • JAVA版本:JDK1.8(最佳)
  • IDE类型:IDEA、Eclipse都可运行
  • 数据库类型:MySql(5.7、8.x版本都可)
  • tomcat版本:Tomcat 7-10版本均可
  • maven版本:无限制
  • 硬件环境:Windows

4、功能截图+视频演示+文档目录

4.1 登录

登录

4.2 管理员模块

管理员-报损申报管理

管理员-药品分类管理
管理员-出库记录

管理员-入库管理

管理员-药品管理

管理员-销售员管理

4.3 销售员模块

销售员-药品管理

4.4 文档目录

文档目录

5 、核心代码实现

5.1 配置代码


spring:datasource:username: rootpassword: rootdriver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://127.0.0.1:3306/chuangmeng?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true&allowPublicKeyRetrieval=trueservlet:multipart:max-file-size: 50MBmax-request-size: 50MB
server:port: 521
redis:open: false
shiro:redis: false
logging:level:com:mh: debug
mybatis-plus:type-aliases-package: com.mh.*.entitymapper-locations: classpath*:/mapper/*/*.xml

5.2 其它核心代码


package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登录相关*/
@RequestMapping("users")
@RestController
public class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登录*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("账号或密码不正确");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());return R.ok().put("token", token);}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密码重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null) {return R.error("账号不存在");}user.setPassword("123456");userService.update(user,null);return R.ok("密码已重置为:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", userService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用户已存在");}userService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {return R.error("用户名已存在。");}userService.updateById(user);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}

6 、获取方式

👇 大家点赞、收藏、关注、评论啦 👇🏻获取联系方式,后台回复关键词:药店👇🏻

请添加图片描述

http://www.lryc.cn/news/436037.html

相关文章:

  • 机器学习--神经网络
  • post请求中有[]报400异常
  • ad22 如何在pcb 的keepout layout 上画线 然后裁出想要的黑色画布大小
  • SparkSQL SET和RESET
  • java 中线程的等待和唤醒
  • windows下自启springboot项目(jar+nginx)
  • 解锁SAP数据的潜力:SNP Glue与SAP Datasphere的协同作用
  • Missing package to enable rendering OpenAI Gym in Colab
  • 通过打包 Flash Attention 来提升 Hugging Face 训练效率
  • 用hiredis连接redis
  • 第G8周:ACGAN任务
  • nvm拉取安装node包时报错的解决办法
  • PyTorch 和 TensorFlow
  • 数据库视图和索引
  • 哈希表的底层实现(1)---C++版
  • 如何使用PTK一键安装opengaussdb 5.0
  • 跟李沐学AI:长短期记忆网络LSTM
  • 【BIM模型数据】BIM模型的数据如何存储,BIM大模型数据云端存储,需要考虑哪些因素,BIM模型数据存储和获取
  • 【LLM大模型】大模型架构:layer\_normalization
  • PON光模块的独特类型和特性
  • 架构与业务的一致性应用:实现企业战略目标和合规管理的全面指南
  • 时尚穿搭想换就换,各种风格一键完美搭配!亲测在线虚拟试衣换装平台效果超赞!
  • 【C++】C++ 标准库string类介绍(超详细解析,小白必看系列)
  • 若依RuoYi项目环境搭建教程(RuoYi-Vue + RuoYi-Vue3版本)
  • Java 后端接口入参 - 联合前端VUE 使用AES完成入参出参加密解密
  • HarmonyOS开发之使用PhotoViewPicker(图库选择器)保存图片
  • 跨境独立站支付收款常见问题排雷篇1.0丨出海笔记
  • uni-app实现web-view和App之间的相互通信
  • HTB-Vaccine(suid提权、sqlmap、john2zip)
  • 【达梦数据库】异构数据库迁移到达梦