• 基于springboot的药品管理


    博主主页猫头鹰源码

    博主简介:Java领域优质创作者、CSDN博客专家、公司架构师、全网粉丝5万+、专注Java技术领域和毕业设计项目实战

    主要内容:毕业设计(Javaweb项目|小程序等)、简历模板、学习资料、面试题库、技术咨询

    文末联系获取

    项目介绍: 

    该系统包含详细数据库设计。基于springboot技术,数据层为MyBatis,mysql数据库,具有完整的业务逻辑,适合选题:springboot、药品、药品管理等。

    项目功能:

    系统共分为管理员(药店店长之类的)、员工两种角色

    管理员:

    登录注册
    个人信息管理:查看个人信息,修改
    管理员管理:新增管理员,查看
    员工管理:新增员工,修改,查看,删除
    供货商管理:新增供货商、修改、查看、删除
    药品信息管理:对药品各种信息的增、删、改、查
    采购管理:采购药品的订单查询
    销售管理:销售订单查询
    公告管理:新增公告,修改,查看,删除

    员工:登录注册
    个人信息管理:查看个人信息,修改
    药品信息管理:对药品各种信息的增、删、改、查
    采购管理:采购药品的订单生成(订单里包含供货商信息、采购日期、药品信息、订单号...)
    销售管理:主要功能:销售订单的生成(订单里包含客户姓名、药品信息...)
    公告管理:查看

    数据库表结构文档:

    系统包含技术:

    技术:SpringBoot,Mybatis,前端框架layui
    开发工具:idea
    数据库:mysql 5.7
    JDK版本:jdk1.8

    部分截图说明:

    下面是登录页面

    管理员首页

     管理员对供应商进行维护

     管理员对员工维护

     管理员对药品维护

     管理员添加药品

    修改信息

    管理员对公告维护

    员工销售页面

    部分代码截图:

    药品操作代码

    1. // 依赖注入
    2. @Autowired
    3. private MedicineService medicineService;
    4. @Autowired
    5. private SupplierService supplierService;
    6. /**
    7. * 分页查询
    8. * pageIndex 当前页码
    9. * pageSize 显示条数
    10. */
    11. @RequestMapping(value = "/findMedicine")
    12. public String findMedicine(Integer pageIndex, Integer pageSize, Model model,HttpServletRequest request) {
    13. HttpSession session = request.getSession();
    14. if(session.getAttribute("ad") == null){
    15. session.setAttribute("msg", "对不起,请登录!");
    16. return "login";
    17. }
    18. PageInfo<Medicine> pageList = medicineService.findPageInfo(pageIndex,pageSize);
    19. List<Supplier> supplierList = supplierService.getAll();
    20. model.addAttribute("pageList",pageList);
    21. model.addAttribute("supplierList",supplierList);
    22. return "MedicineList";
    23. }
    24. /**
    25. * 添加
    26. */
    27. @RequestMapping(value = "/addMedicine" ,method = RequestMethod.POST)
    28. @ResponseBody
    29. public String addMedicine( @RequestBody Medicine medicine) {
    30. Supplier supplierById = supplierService.findSupplierById(Integer.parseInt(medicine.getSid()));
    31. medicine.setSname(supplierById.getName());
    32. int d = medicineService.addMedicine(medicine);
    33. return "MedicineList";
    34. }
    35. /**
    36. * 删除
    37. */
    38. @RequestMapping( "/deleteMedicine")
    39. @ResponseBody
    40. public String deleteMedicine(Integer id) {
    41. int d = medicineService.deleteMedicine(id);
    42. return "MedicineList";
    43. }
    44. /**
    45. * 修改
    46. */
    47. @RequestMapping( "/updateMedicine")
    48. public String updateMedicine( Medicine medicine,Model model) {
    49. Supplier supplierById = supplierService.findSupplierById(Integer.parseInt(medicine.getSid()));
    50. medicine.setSname(supplierById.getName());
    51. int d = medicineService.updateMedicine(medicine);
    52. return "redirect:/findMedicine";
    53. }
    54. /**
    55. * 按照ID查询
    56. */
    57. @RequestMapping( "/findMedicineById")
    58. public String findMedicineById(Integer id,Model model,HttpServletRequest request) {
    59. HttpSession session = request.getSession();
    60. if(session.getAttribute("ad") == null){
    61. session.setAttribute("msg", "对不起,请登录!");
    62. return "login";
    63. }
    64. Medicine medicine= medicineService.findMedicineById(id);
    65. List<Supplier> supplierList = supplierService.getAll();
    66. model.addAttribute("supplierList",supplierList);
    67. model.addAttribute("medicine",medicine);
    68. return "MedicineEdit";
    69. }

    登录操作

    1. /**
    2. * 登录
    3. * 将提交数据(username,password)写入Admin对象
    4. */
    5. @RequestMapping(value = "/login")
    6. public String login(Admin admin, Model model, HttpSession session, HttpServletRequest request) {
    7. if(admin.getUsername()==null || admin.getUsername().length()<=0 ){
    8. model.addAttribute("msg", "请输入登录名!");
    9. return "login";
    10. }
    11. if(admin.getPassword()==null || admin.getPassword().length()<1){
    12. model.addAttribute("msg", "请输入密码!");
    13. return "login";
    14. }
    15. if(admin.getType()==null || admin.getType().length()<1){
    16. model.addAttribute("msg", "请选择人员类型!");
    17. return "login";
    18. }
    19. if(admin.getType().equals("01")){
    20. Admin ad = adminService.findAdmin(admin.getUsername(),admin.getPassword());
    21. if(ad!=null){
    22. session.setAttribute("ad", ad);
    23. session.setAttribute("type", "01");
    24. return "homepage1";
    25. }else{
    26. model.addAttribute("msg", "请确定账户信息是否正确!");
    27. return "login";
    28. }
    29. }else{
    30. User ad = userService.findUser(admin.getUsername(),admin.getPassword());
    31. if(ad!=null){
    32. session.setAttribute("ad", ad);
    33. session.setAttribute("type", "02");
    34. return "homepage2";
    35. }else{
    36. model.addAttribute("msg", "请确定账户信息是否正确!");
    37. return "login";
    38. }
    39. }
    40. }

    以上就是部分功能展示,从整体上来看,本系统功能是十分完整的,界面设计简洁大方,交互友好,数据库设计也很合理,规模适中,代码工整,清晰,适合学习使用。

    好了,今天就到这儿吧,小伙伴们点赞、收藏、评论,一键三连走起呀,下期见~~

  • 相关阅读:
    Node.js开发-fs模块
    深圳市宝安区委常委、宣传部部长周学良一行莅临联诚发考察调研
    『现学现忘』Docker基础 — 30、Docker中数据卷相关命令
    大学经典题目:Java输出杨辉三角形
    ctf:kali工具ettercap,setoolkit
    StatefulSet:有状态应用部署
    【ArcGIS模型构建器】01:模型构建器Model Builder介绍
    ASTM D4434/D4434M-2021 PVC屋面板检测
    DirectX11 With Windows SDK--19(Dev) 编译Assimp并加载模型、新的Effects框架
    pnpm v9 正式发布,已停止 Node.js v16 支持
  • 原文地址:https://blog.csdn.net/mtyedu/article/details/119327185