当前位置:   article > 正文

Java项目:SSM医药信息管理系统_医药管理信息系统

医药管理信息系统

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

该系统共七个功能模块:查询模块、录入模块、删除模块、修改模块、浏览模块、打印模块和用户管理模块。

系统只有一个超级管理员,可以创建系统用户并进行权限管理,其他用户没有用户管理权限,只有其他权限。

不同的用户可以进入不同的模块进行相应操作。

管理员角色包含以下功能:

登录,信息查询,信息录入,信息删除,信息修改,信息浏览,打印报表,用户管理,权限管理,系统帮助等功能。

用户角色包含以下功能:

管理员只设置了查询功能,一些说明等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可
4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 

5.数据库:MySql 5.7版本;

6.是否Maven项目:是;

技术栈

1. 后端:Spring+SpringMVC+Mybatis

2. 前端:HTML+CSS+JavaScript+easyui

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;

2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;

若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;

3. 将项目中jdbc.properties配置文件中的数据库配置改为自己的配置;
4. 运行项目,输入localhost:8080/ 登录
管理员账号:admir 密码:1234

用户账号:test 密码:1201

运行截图

 

 

 

 

 

 

 

相关代码 

AgencyController

  1. package mms.controller;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.web.bind.annotation.RequestMapping;
  5. import org.springframework.web.bind.annotation.RequestParam;
  6. import org.springframework.web.bind.annotation.ResponseBody;
  7. import mms.pojo.Agency;
  8. import mms.pojo.EasyUIResult;
  9. import mms.services.AgencyService;
  10. @RequestMapping("Agency")
  11. @Controller
  12. public class AgencyController {
  13. // 经办人controller
  14. @Autowired
  15. private AgencyService agencyService;
  16. // 通过ano查询单个经办人
  17. @RequestMapping("GetAgency")
  18. @ResponseBody
  19. public Agency queryAgencyByAno(String ano) {
  20. Agency agency = agencyService.queryAgencyByAno(ano);
  21. return agency;
  22. }
  23. @RequestMapping(value = "DeleteAgency", produces = "text/html;charset=UTF-8")
  24. @ResponseBody
  25. // 按编号删除
  26. public String deleteAgencyByAno(String ano) {
  27. return agencyService.deleteAgencyByAno(ano);
  28. }
  29. // 批量删除
  30. @RequestMapping(value = "DeleteRows", produces = "text/html;charset=UTF-8")
  31. @ResponseBody
  32. public String deleteAgencyByRows(@RequestParam(value = "array[]") String[] array) {
  33. try {
  34. return agencyService.deleteAgencyByRows(array);
  35. } catch (Exception e) {
  36. // TODO: handle exception
  37. // 捕获异常,spring进行事务回滚
  38. return "操作异常,,某些经办人处理过顾客信息,无法删除该经办人,请重新选择";
  39. }
  40. }
  41. // 修改经办人信息
  42. @RequestMapping(value = "ModifyAgency", produces = "text/html;charset=UTF-8")
  43. @ResponseBody
  44. public String modifyAgency(Agency agency) {
  45. return agencyService.modifyAgency(agency);
  46. }
  47. // easyui数据表格返回全部经办人json
  48. @RequestMapping("GetMessage")
  49. @ResponseBody
  50. public EasyUIResult queryAllAgency(@RequestParam(value = "page", defaultValue = "1") Integer page,
  51. @RequestParam(value = "rows", defaultValue = "5") Integer rows) {
  52. return this.agencyService.queryAllAgency(page, rows);
  53. }
  54. // 保存经办人信息
  55. @RequestMapping(value = "SaveAgency", produces = "text/html;charset=UTF-8")
  56. @ResponseBody
  57. public String saveAgency(Agency agency) {
  58. return agencyService.saveAgency(agency);
  59. }
  60. // 返回所有经办人
  61. @RequestMapping("GetAllAgency")
  62. @ResponseBody
  63. public java.util.List<Agency> getAllAgency() {
  64. java.util.List<Agency> allAgency = agencyService.getAllAgency();
  65. return allAgency;
  66. }
  67. }

ClientController

  1. package mms.controller;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.web.bind.annotation.RequestMapping;
  5. import org.springframework.web.bind.annotation.RequestParam;
  6. import org.springframework.web.bind.annotation.ResponseBody;
  7. import mms.pojo.Client;
  8. import mms.pojo.EasyUIResult;
  9. import mms.services.ClientService;
  10. @RequestMapping("Client")
  11. @Controller
  12. public class ClientController {
  13. // 顾客controller
  14. @Autowired
  15. // 注入service
  16. private ClientService clientService;
  17. // 按编号查询
  18. @RequestMapping("GetClient")
  19. @ResponseBody
  20. public Client queryClientBycno(String cno) {
  21. Client client = clientService.queryClientBycno(cno);
  22. return client;
  23. }
  24. // 按编号删除
  25. @RequestMapping("DeleteClient")
  26. @ResponseBody
  27. public void deleteClientBycno(String cno) {
  28. clientService.deleteClientBycno(cno);
  29. }
  30. // 批量删除
  31. @RequestMapping(value = "DeleteRows", produces = "text/html;charset=UTF-8")
  32. @ResponseBody
  33. public String deleteClientByRows(
  34. @RequestParam(value = "array[]") String[] array) {
  35. return clientService.deleteClientByRows(array);
  36. // clientService.deleteClientBycno(cno);
  37. }
  38. // 保存顾客信息
  39. @RequestMapping(value = "SaveClient", produces = "text/html;charset=UTF-8")
  40. @ResponseBody
  41. public String saveClient(Client client) {
  42. return clientService.saveClient(client);
  43. }
  44. @RequestMapping("GetMessage")
  45. @ResponseBody
  46. // easyui返回json
  47. public EasyUIResult queryAllClient(@RequestParam(value = "page", defaultValue = "1") Integer page,
  48. @RequestParam(value = "rows", defaultValue = "5") Integer rows) {
  49. EasyUIResult queryAllClient = clientService.queryAllClient(page, rows);
  50. return queryAllClient;
  51. }
  52. // 修改客户信息
  53. @RequestMapping(value = "ModifyClient", produces = "text/html;charset=UTF-8")
  54. @ResponseBody
  55. public String modifyClient(Client client) {
  56. return clientService.modifyClient(client);
  57. }
  58. }

LoginController

  1. package mms.controller;
  2. import java.util.Enumeration;
  3. import javax.servlet.http.HttpSession;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.stereotype.Controller;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.ResponseBody;
  8. import mms.services.LoginService;
  9. //处理登陆逻辑
  10. @RequestMapping("Login")
  11. @Controller
  12. public class LoginController {
  13. @Autowired
  14. private LoginService loginService;
  15. /*
  16. * 用户登陆 判断是否存在用户 存在保存session
  17. */
  18. @RequestMapping(value = "loginUser", produces = "text/html;charset=UTF-8")
  19. @ResponseBody
  20. public String login(String username, String password, HttpSession session) {
  21. return loginService.login(username, password, session);
  22. }
  23. // 取出seeion的用户名
  24. @RequestMapping("GetLoginName")
  25. @ResponseBody
  26. public Object GetLoginName(HttpSession session) {
  27. Object username = session.getAttribute("user");
  28. return username;
  29. }
  30. // 清除session
  31. @RequestMapping("LogOff")
  32. @ResponseBody
  33. public void logOff(HttpSession session) {
  34. Enumeration em = session.getAttributeNames();
  35. while (em.hasMoreElements()) {
  36. session.removeAttribute(em.nextElement().toString());
  37. }
  38. }
  39. }

MedicineController

  1. package mms.controller;
  2. import java.util.List;
  3. import javax.servlet.http.HttpSession;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.stereotype.Controller;
  6. import org.springframework.web.bind.annotation.RequestMapping;
  7. import org.springframework.web.bind.annotation.RequestParam;
  8. import org.springframework.web.bind.annotation.ResponseBody;
  9. import mms.pojo.EasyUIResult;
  10. import mms.pojo.Medicine;
  11. import mms.services.MedicineService;
  12. @RequestMapping("Medicine")
  13. @Controller
  14. public class MedicineController {
  15. // 药品controller
  16. @Autowired
  17. private MedicineService medicineService;
  18. // 通过mno查询药品信息
  19. @RequestMapping("QueryMedicineByMno")
  20. @ResponseBody
  21. public Medicine queryMedicineByMno(String mno) {
  22. Medicine medicine = medicineService.queryMedicineByMno(mno);
  23. return medicine;
  24. }
  25. /*
  26. * // 多条件药品信息保存session
  27. *
  28. * @RequestMapping("QueryMultiMedicine")
  29. *
  30. * @ResponseBody public String queryMultiMedicine(Medicine
  31. * medicine,HttpSession session) { return
  32. * medicineService.queryMultiMedicine(medicine,session);
  33. *
  34. * } // 多条件药品查询url
  35. *
  36. * @RequestMapping("GetMultiMedicine")
  37. *
  38. * @ResponseBody public EasyUIResult getMultiMedicine(@RequestParam(value =
  39. * "page", defaultValue = "1") Integer page,
  40. *
  41. * @RequestParam(value = "rows", defaultValue = "5") Integer rows,
  42. * HttpSession session) { return medicineService.getMultiMedicine(page,
  43. * rows,session);
  44. *
  45. * }
  46. */
  47. /*
  48. * // 通过mno删除药品信息
  49. *
  50. * @RequestMapping(value = "DeleteMedicine", produces =
  51. * "text/html;charset=UTF-8")
  52. *
  53. * @ResponseBody public String deleteMedicineByMno(String mno) { return
  54. * medicineService.deleteMedicineByMno(mno); }
  55. */
  56. // 批量删除
  57. @RequestMapping(value = "DeleteRows", produces = "text/html;charset=UTF-8")
  58. @ResponseBody
  59. public String deleteMedicineByRows(@RequestParam(value = "array[]") String[] array) {
  60. try {
  61. return medicineService.deleteMedicineByRows(array);
  62. } catch (Exception e) {
  63. // TODO: handle exception
  64. return "操作异常,可能某些药品被顾客购买过," + "无法删该药品,请重新选择";
  65. }
  66. }
  67. // 保存药品信息
  68. @RequestMapping(value = "SaveMedicine", produces = "text/html;charset=UTF-8")
  69. @ResponseBody
  70. public String saveMedicine(Medicine medicine) {
  71. return medicineService.saveMedicine(medicine);
  72. }
  73. // 修改药品信息
  74. @RequestMapping(value = "ModifyMedicine", produces = "text/html;charset=UTF-8")
  75. @ResponseBody
  76. public String modifyMedicine(Medicine medicine) {
  77. return medicineService.modifyMedicine(medicine);
  78. }
  79. // easyui返回json
  80. @RequestMapping("GetMessage")
  81. @ResponseBody
  82. public EasyUIResult queryAllMedicine(@RequestParam(value = "page", defaultValue = "1") Integer page,
  83. @RequestParam(value = "rows", defaultValue = "5") Integer rows) {
  84. return medicineService.queryAllMedicine(page, rows);
  85. }
  86. // 获得药品信息
  87. @RequestMapping("GetAllMedicine")
  88. @ResponseBody
  89. public List<Medicine> getAllMedicine() {
  90. List<Medicine> allMedicine = medicineService.getAllMedicine();
  91. return allMedicine;
  92. }
  93. }

UserController

  1. package mms.controller;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.http.HttpStatus;
  4. import org.springframework.stereotype.Controller;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestParam;
  7. import org.springframework.web.bind.annotation.ResponseBody;
  8. import org.springframework.web.bind.annotation.ResponseStatus;
  9. import mms.pojo.EasyUIResult;
  10. import mms.pojo.User;
  11. import mms.services.UserServies;
  12. //用户
  13. @RequestMapping("User")
  14. @Controller
  15. public class UserController {
  16. @Autowired
  17. private UserServies userServies;
  18. // 添加新用户
  19. @RequestMapping("AddUser")
  20. @ResponseBody
  21. public String addUser(User user) {
  22. userServies.addUser(user);
  23. return "success";
  24. }
  25. // 修改用户信息
  26. @RequestMapping("UpdateUser")
  27. @ResponseBody
  28. public void updateUser(User user) {
  29. userServies.updateUser(user);
  30. }
  31. // 删除用户
  32. @RequestMapping("DeleteUser")
  33. @ResponseStatus(value = HttpStatus.OK)
  34. public void deleteUser(String uUsername) {
  35. userServies.deleteUser(uUsername);
  36. }
  37. // easyui返回全部用户信息
  38. @RequestMapping("queryAllUser")
  39. @ResponseBody
  40. public EasyUIResult queryAllUser(@RequestParam(value = "page", defaultValue = "1") Integer page,
  41. @RequestParam(value = "rows", defaultValue = "5") Integer rows) {
  42. EasyUIResult queryAllUser = userServies.queryAllUser(page, rows);
  43. return queryAllUser;
  44. }
  45. // 通过uUsername查询用户
  46. @RequestMapping(value = "GetUUsername", produces = "text/html;charset=UTF-8")
  47. @ResponseBody
  48. public String queryUserByName(String uUsername) {
  49. return userServies.queryUserByName(uUsername);
  50. }
  51. @RequestMapping(value = "GetUpassword", produces = "text/html;charset=UTF-8")
  52. @ResponseBody
  53. public String queryPasswordByName(String uUsername) {
  54. return userServies.queryPasswordByName(uUsername);
  55. }
  56. }

如果也想学习本系统,下面领取。关注并回复:079ssm 

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/运维做开发/article/detail/734888
推荐阅读
相关标签
  

闽ICP备14008679号