Java项目:中药药方管理系统(java+SSM+JSP+bootstrap+Mysql)

本文主要是介绍Java项目:中药药方管理系统(java+SSM+JSP+bootstrap+Mysql),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

源码获取:俺的博客首页 "资源" 里下载!

项目介绍

本项目分为药房人员、管理员与医生三种角色;
药房人员角色包含以下功能:
药房人员登录,导诊单管理,采购管理等功能。

管理员角色包含以下功能:
管理员登录,药房人员管理,医生管理,药材信息管理,药方管理等功能。

医生角色包含以下功能:
医生登录,药材信息查询,药方查询,导诊单管理等功能。

环境需要

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/8.0版本均可;
6.是否Maven项目:是;

技术栈

1. 后端:Spring+SpringMVC+Mbytes
2. 前端:JSP+css+javascript+bootstrap+jQuery

使用说明

1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行;
3. 将项目中db.properties配置文件中的数据库配置改为自己的配置;
4. 运行项目,在浏览器中输入localhost:8080/ssm_yaofangsys/
医生账号/密码: doctor/123456
药房人员账号/密码:yaofang/123456
管理员账号/密码:admin/admin

 

 

 

 

 

 

 

登录管理控制层:

@Controller
@RequestMapping("/login")
public class LoginController extends BaseController{@Autowiredprivate ManageService manageService;@Autowiredprivate MedicineUserService medicineUserService;@Autowiredprivate DoctorService doctorService;/*** 跳转登陆* @return*/@RequestMapping("/login")public String login(){return "login/mLogin";}@RequestMapping("/index")public String index(){return "login/mIndex";}@RequestMapping("/uIndex")public String uIndex(Model model){return "login/uIndex";}@RequestMapping("/welcome")public String welcome(){return "login/welcome";}@RequestMapping("/mup")public String mpass(){return "login/mup";}/*** 管理员登陆* @param manage* @param request* @param response* @return*/@RequestMapping("/toLogin")public String toLogin(Manage manage,Integer role, HttpServletRequest request, HttpServletResponse response){if (role == null){return "redirect:/login/login.action";}//超级管理员if (role== 1){Manage byEntity = manageService.getByEntity(manage);if(byEntity != null){request.getSession().setAttribute("role", role);request.getSession().setAttribute("name", byEntity.getRealName());return "redirect:/login/index.action";}else{return "redirect:/login/login.action";}}//1 超级管理员2 医生  3 药房人员 if (role== 2){Doctor d = new Doctor();d.setPassword(manage.getPassword());d.setUserName(manage.getUserName());Doctor byEntity = doctorService.getByEntity(d);if(byEntity != null){request.getSession().setAttribute("role", role);request.getSession().setAttribute("name", byEntity.getRealName());request.getSession().setAttribute("userId", byEntity.getId());return "redirect:/login/index.action";}else{return "redirect:/login/login.action";}}//药房人员if (role== 3){MedicineUser d = new MedicineUser();d.setPassword(manage.getPassword());d.setUserName(manage.getUserName());MedicineUser byEntity = medicineUserService.getByEntity(d);if(byEntity != null){request.getSession().setAttribute("role", role);request.getSession().setAttribute("name", byEntity.getRealName());request.getSession().setAttribute("userId", byEntity.getId());return "redirect:/login/index.action";}else{return "redirect:/login/login.action";}}return null;}/*** 退出* @param request* @param response* @return*/@RequestMapping("/tuichu")public String tuichu( HttpServletRequest request, HttpServletResponse response){HttpSession session = request.getSession();session.invalidate();return "redirect:/login/login.action";}@RequestMapping("/uTui")public String uTui( HttpServletRequest request, HttpServletResponse response){HttpSession session = request.getSession();session.invalidate();return "redirect:/login/uLogin.action";}@RequestMapping("/head")private String head(){return "inc/head";}@RequestMapping("/left")private String left(){return "inc/left";}}

医生管理控制层: 

@Controller
@RequestMapping("/doctor")
public class DoctorController extends BaseController {/*** 依赖注入 start dao/service/===*/@Autowiredprivate DoctorService doctorService;@RequestMapping(value = "/findBySql")public String findBySql(Doctor doctor, Model model, HttpServletRequest request, HttpServletResponse response) {//分页查询String sql = "SELECT * FROM doctor WHERE 1=1  and isDelete = 0 ";//and isDelete = 0 if(!isEmpty(doctor.getUserName())){sql += " and userName like '%"+doctor.getUserName()+"%'";}if(!isEmpty(doctor.getPassword())){sql += " and password like '%"+doctor.getPassword()+"%'";}if(!isEmpty(doctor.getRealName())){sql += " and realName like '%"+doctor.getRealName()+"%'";}if(!isEmpty(doctor.getIdCard())){sql += " and idCard like '%"+doctor.getIdCard()+"%'";}if(!isEmpty(doctor.getPhone())){sql += " and phone like '%"+doctor.getPhone()+"%'";}if(!isEmpty(doctor.getSex())){sql += " and sex like '%"+doctor.getSex()+"%'";}if(!isEmpty(doctor.getIsDelete())){sql += " and isDelete like '%"+doctor.getIsDelete()+"%'";}sql += " ORDER BY ID DESC ";Pager<Doctor> pagers = doctorService.findBySqlRerturnEntity(sql);model.addAttribute("pagers", pagers);//存储查询条件model.addAttribute("obj", doctor);return "doctor/doctor";}/*** 跳至添加页面* @return*/@RequestMapping(value = "/add")public String add() {return "doctor/add";}/*** 添加执行* @return*/@RequestMapping(value = "/exAdd")public String exAdd(Doctor doctor, Model model, HttpServletRequest request, HttpServletResponse response) {doctor.setIsDelete(0);doctorService.insert(doctor);return "redirect:/doctor/findBySql";}/*** 跳至修改页面* @return*/@RequestMapping(value = "/update")public String update(Integer id,Model model) {Doctor obj = doctorService.load(id);model.addAttribute("obj",obj);return "doctor/update";}/*** 添加修改* @return*/@RequestMapping(value = "/exUpdate")public String exUpdate(Doctor doctor, Model model, HttpServletRequest request, HttpServletResponse response) {//1.通过实体类修改,可以多传修改条件doctorService.updateById(doctor);//2.通过主键id修改//doctorService.updateById(doctor);return "redirect:/doctor/findBySql";}/*** 删除通过主键* @return*/@RequestMapping(value = "/delete")public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {Doctor load = doctorService.load(id);load.setIsDelete(1);doctorService.update(load);doctorService.updateById(load);return "redirect:/doctor/findBySql";}}

药房人员管理控制层:

@Controller
@RequestMapping("/medicineUser")
public class MedicineUserController extends BaseController {/*** 依赖注入 start dao/service/===*/@Autowiredprivate MedicineUserService medicineUserService;@RequestMapping(value = "/findBySql")public String findBySql(MedicineUser medicineUser, Model model, HttpServletRequest request, HttpServletResponse response) {//分页查询String sql = "SELECT * FROM medicine_user WHERE 1=1  and isDelete = 0  ";//and isDelete = 0 if(!isEmpty(medicineUser.getUserName())){sql += " and userName like '%"+medicineUser.getUserName()+"%'";}if(!isEmpty(medicineUser.getPassword())){sql += " and password like '%"+medicineUser.getPassword()+"%'";}if(!isEmpty(medicineUser.getRealName())){sql += " and realName like '%"+medicineUser.getRealName()+"%'";}if(!isEmpty(medicineUser.getIdCard())){sql += " and idCard like '%"+medicineUser.getIdCard()+"%'";}if(!isEmpty(medicineUser.getPhone())){sql += " and phone like '%"+medicineUser.getPhone()+"%'";}if(!isEmpty(medicineUser.getSex())){sql += " and sex like '%"+medicineUser.getSex()+"%'";}if(!isEmpty(medicineUser.getIsDelete())){sql += " and isDelete like '%"+medicineUser.getIsDelete()+"%'";}sql += " ORDER BY ID DESC ";Pager<MedicineUser> pagers = medicineUserService.findBySqlRerturnEntity(sql);model.addAttribute("pagers", pagers);//存储查询条件model.addAttribute("obj", medicineUser);return "medicineUser/medicineUser";}/*** 跳至添加页面* @return*/@RequestMapping(value = "/add")public String add() {return "medicineUser/add";}/*** 添加执行* @return*/@RequestMapping(value = "/exAdd")public String exAdd(MedicineUser medicineUser, Model model, HttpServletRequest request, HttpServletResponse response) {medicineUser.setIsDelete(0);medicineUserService.insert(medicineUser);return "redirect:/medicineUser/findBySql";}/*** 跳至修改页面* @return*/@RequestMapping(value = "/update")public String update(Integer id,Model model) {MedicineUser obj = medicineUserService.load(id);model.addAttribute("obj",obj);return "medicineUser/update";}/*** 添加修改* @return*/@RequestMapping(value = "/exUpdate")public String exUpdate(MedicineUser medicineUser, Model model, HttpServletRequest request, HttpServletResponse response) {//1.通过实体类修改,可以多传修改条件medicineUserService.updateById(medicineUser);//2.通过主键id修改//medicineUserService.updateById(medicineUser);return "redirect:/medicineUser/findBySql";}/*** 删除通过主键* @return*/@RequestMapping(value = "/delete")public String delete(Integer id, Model model, HttpServletRequest request, HttpServletResponse response) {MedicineUser load = medicineUserService.load(id);load.setIsDelete(1);medicineUserService.updateById(load);return "redirect:/medicineUser/findBySql";}}

源码获取:俺的博客首页 "资源" 里下载!

这篇关于Java项目:中药药方管理系统(java+SSM+JSP+bootstrap+Mysql)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/408308

相关文章

分布式锁在Spring Boot应用中的实现过程

《分布式锁在SpringBoot应用中的实现过程》文章介绍在SpringBoot中通过自定义Lock注解、LockAspect切面和RedisLockUtils工具类实现分布式锁,确保多实例并发操作... 目录Lock注解LockASPect切面RedisLockUtils工具类总结在现代微服务架构中,分布

Java使用Thumbnailator库实现图片处理与压缩功能

《Java使用Thumbnailator库实现图片处理与压缩功能》Thumbnailator是高性能Java图像处理库,支持缩放、旋转、水印添加、裁剪及格式转换,提供易用API和性能优化,适合Web应... 目录1. 图片处理库Thumbnailator介绍2. 基本和指定大小图片缩放功能2.1 图片缩放的

精选20个好玩又实用的的Python实战项目(有图文代码)

《精选20个好玩又实用的的Python实战项目(有图文代码)》文章介绍了20个实用Python项目,涵盖游戏开发、工具应用、图像处理、机器学习等,使用Tkinter、PIL、OpenCV、Kivy等库... 目录① 猜字游戏② 闹钟③ 骰子模拟器④ 二维码⑤ 语言检测⑥ 加密和解密⑦ URL缩短⑧ 音乐播放

Spring Boot集成/输出/日志级别控制/持久化开发实践

《SpringBoot集成/输出/日志级别控制/持久化开发实践》SpringBoot默认集成Logback,支持灵活日志级别配置(INFO/DEBUG等),输出包含时间戳、级别、类名等信息,并可通过... 目录一、日志概述1.1、Spring Boot日志简介1.2、日志框架与默认配置1.3、日志的核心作用

破茧 JDBC:MyBatis 在 Spring Boot 中的轻量实践指南

《破茧JDBC:MyBatis在SpringBoot中的轻量实践指南》MyBatis是持久层框架,简化JDBC开发,通过接口+XML/注解实现数据访问,动态代理生成实现类,支持增删改查及参数... 目录一、什么是 MyBATis二、 MyBatis 入门2.1、创建项目2.2、配置数据库连接字符串2.3、入

Springboot项目启动失败提示找不到dao类的解决

《Springboot项目启动失败提示找不到dao类的解决》SpringBoot启动失败,因ProductServiceImpl未正确注入ProductDao,原因:Dao未注册为Bean,解决:在启... 目录错误描述原因解决方法总结***************************APPLICA编

深度解析Spring Security 中的 SecurityFilterChain核心功能

《深度解析SpringSecurity中的SecurityFilterChain核心功能》SecurityFilterChain通过组件化配置、类型安全路径匹配、多链协同三大特性,重构了Spri... 目录Spring Security 中的SecurityFilterChain深度解析一、Security

MySQL中EXISTS与IN用法使用与对比分析

《MySQL中EXISTS与IN用法使用与对比分析》在MySQL中,EXISTS和IN都用于子查询中根据另一个查询的结果来过滤主查询的记录,本文将基于工作原理、效率和应用场景进行全面对比... 目录一、基本用法详解1. IN 运算符2. EXISTS 运算符二、EXISTS 与 IN 的选择策略三、性能对比

MySQL常用字符串函数示例和场景介绍

《MySQL常用字符串函数示例和场景介绍》MySQL提供了丰富的字符串函数帮助我们高效地对字符串进行处理、转换和分析,本文我将全面且深入地介绍MySQL常用的字符串函数,并结合具体示例和场景,帮你熟练... 目录一、字符串函数概述1.1 字符串函数的作用1.2 字符串函数分类二、字符串长度与统计函数2.1

SpringBoot多环境配置数据读取方式

《SpringBoot多环境配置数据读取方式》SpringBoot通过环境隔离机制,支持properties/yaml/yml多格式配置,结合@Value、Environment和@Configura... 目录一、多环境配置的核心思路二、3种配置文件格式详解2.1 properties格式(传统格式)1.