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

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

package mms.controller;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import mms.pojo.Agency;
import mms.pojo.EasyUIResult;
import mms.services.AgencyService;

@RequestMapping("Agency")
@Controller
public class AgencyController {
	// 经办人controller
	@Autowired
	private AgencyService agencyService;

	// 通过ano查询单个经办人
	@RequestMapping("GetAgency")
	@ResponseBody
	public Agency queryAgencyByAno(String ano) {
		Agency agency = agencyService.queryAgencyByAno(ano);
		return agency;
	}

	@RequestMapping(value = "DeleteAgency", produces = "text/html;charset=UTF-8")
	@ResponseBody
	// 按编号删除
	public String deleteAgencyByAno(String ano) {
		return agencyService.deleteAgencyByAno(ano);
	}

	// 批量删除
	@RequestMapping(value = "DeleteRows", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String deleteAgencyByRows(@RequestParam(value = "array[]") String[] array) {
		try {
			return agencyService.deleteAgencyByRows(array);
		} catch (Exception e) {
			// TODO: handle exception
			// 捕获异常,spring进行事务回滚
			return "操作异常,,某些经办人处理过顾客信息,无法删除该经办人,请重新选择";
		}

	}

	// 修改经办人信息
	@RequestMapping(value = "ModifyAgency", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String modifyAgency(Agency agency) {
		return agencyService.modifyAgency(agency);
	}

	// easyui数据表格返回全部经办人json
	@RequestMapping("GetMessage")
	@ResponseBody
	public EasyUIResult queryAllAgency(@RequestParam(value = "page", defaultValue = "1") Integer page,
			@RequestParam(value = "rows", defaultValue = "5") Integer rows) {
		return this.agencyService.queryAllAgency(page, rows);
	}

	// 保存经办人信息
	@RequestMapping(value = "SaveAgency", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String saveAgency(Agency agency) {
		return agencyService.saveAgency(agency);
	}

	// 返回所有经办人
	@RequestMapping("GetAllAgency")
	@ResponseBody
	public java.util.List<Agency> getAllAgency() {
		java.util.List<Agency> allAgency = agencyService.getAllAgency();
		return allAgency;
	}
}

ClientController

package mms.controller;

import org.springframework.beans.factory.annotation.Autowired;



import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import mms.pojo.Client;
import mms.pojo.EasyUIResult;
import mms.services.ClientService;

@RequestMapping("Client")
@Controller
public class ClientController {
	// 顾客controller
	@Autowired
	// 注入service
	private ClientService clientService;

	// 按编号查询
	@RequestMapping("GetClient")
	@ResponseBody
	public Client queryClientBycno(String cno) {
		Client client = clientService.queryClientBycno(cno);
		return client;
	}

	// 按编号删除
	@RequestMapping("DeleteClient")
	@ResponseBody
	public void deleteClientBycno(String cno) {
		clientService.deleteClientBycno(cno);
	}
//	批量删除
	@RequestMapping(value = "DeleteRows", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String deleteClientByRows(
			@RequestParam(value = "array[]") String[] array) {
		return clientService.deleteClientByRows(array);
		
//		clientService.deleteClientBycno(cno);
	}

	// 保存顾客信息
	@RequestMapping(value = "SaveClient", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String saveClient(Client client) {
		return clientService.saveClient(client);
	}

	@RequestMapping("GetMessage")
	@ResponseBody
	// easyui返回json
	public EasyUIResult queryAllClient(@RequestParam(value = "page", defaultValue = "1") Integer page,
			@RequestParam(value = "rows", defaultValue = "5") Integer rows) {
		EasyUIResult queryAllClient = clientService.queryAllClient(page, rows);
		return queryAllClient;
	}

	// 修改客户信息
	@RequestMapping(value = "ModifyClient", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String modifyClient(Client client) {
		return clientService.modifyClient(client);
	}
}

LoginController

package mms.controller;

import java.util.Enumeration;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import mms.services.LoginService;
//处理登陆逻辑

@RequestMapping("Login")
@Controller
public class LoginController {
	@Autowired
	private LoginService loginService;

	/*
	 * 用户登陆 判断是否存在用户 存在保存session
	 */
	@RequestMapping(value = "loginUser", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String login(String username, String password, HttpSession session) {
		return loginService.login(username, password, session);
	}

	// 取出seeion的用户名
	@RequestMapping("GetLoginName")
	@ResponseBody
	public Object GetLoginName(HttpSession session) {
		Object username = session.getAttribute("user");
		return username;
	}

	// 清除session
	@RequestMapping("LogOff")
	@ResponseBody
	public void logOff(HttpSession session) {
		Enumeration em = session.getAttributeNames();
		while (em.hasMoreElements()) {
			session.removeAttribute(em.nextElement().toString());
		}
	}
}

MedicineController

package mms.controller;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import mms.pojo.EasyUIResult;
import mms.pojo.Medicine;
import mms.services.MedicineService;

@RequestMapping("Medicine")
@Controller
public class MedicineController {
	// 药品controller
	@Autowired
	private MedicineService medicineService;

	// 通过mno查询药品信息
	@RequestMapping("QueryMedicineByMno")
	@ResponseBody
	public Medicine queryMedicineByMno(String mno) {
		Medicine medicine = medicineService.queryMedicineByMno(mno);
		return medicine;
	}

	/*
	 * // 多条件药品信息保存session
	 * 
	 * @RequestMapping("QueryMultiMedicine")
	 * 
	 * @ResponseBody public String queryMultiMedicine(Medicine
	 * medicine,HttpSession session) { return
	 * medicineService.queryMultiMedicine(medicine,session);
	 * 
	 * } // 多条件药品查询url
	 * 
	 * @RequestMapping("GetMultiMedicine")
	 * 
	 * @ResponseBody public EasyUIResult getMultiMedicine(@RequestParam(value =
	 * "page", defaultValue = "1") Integer page,
	 * 
	 * @RequestParam(value = "rows", defaultValue = "5") Integer rows,
	 * HttpSession session) { return medicineService.getMultiMedicine(page,
	 * rows,session);
	 * 
	 * }
	 */
	/*
	 * // 通过mno删除药品信息
	 * 
	 * @RequestMapping(value = "DeleteMedicine", produces =
	 * "text/html;charset=UTF-8")
	 * 
	 * @ResponseBody public String deleteMedicineByMno(String mno) { return
	 * medicineService.deleteMedicineByMno(mno); }
	 */
	// 批量删除
	@RequestMapping(value = "DeleteRows", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String deleteMedicineByRows(@RequestParam(value = "array[]") String[] array) {
		try {

			return medicineService.deleteMedicineByRows(array);

		} catch (Exception e) {
			// TODO: handle exception
			return "操作异常,可能某些药品被顾客购买过," + "无法删该药品,请重新选择";
		}
	}

	// 保存药品信息
	@RequestMapping(value = "SaveMedicine", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String saveMedicine(Medicine medicine) {
		return medicineService.saveMedicine(medicine);
	}

	// 修改药品信息
	@RequestMapping(value = "ModifyMedicine", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String modifyMedicine(Medicine medicine) {
		return medicineService.modifyMedicine(medicine);
	}

	// easyui返回json
	@RequestMapping("GetMessage")
	@ResponseBody
	public EasyUIResult queryAllMedicine(@RequestParam(value = "page", defaultValue = "1") Integer page,
			@RequestParam(value = "rows", defaultValue = "5") Integer rows) {
		return medicineService.queryAllMedicine(page, rows);

	}

	// 获得药品信息
	@RequestMapping("GetAllMedicine")
	@ResponseBody
	public List<Medicine> getAllMedicine() {
		List<Medicine> allMedicine = medicineService.getAllMedicine();
		return allMedicine;

	}
}

UserController

package mms.controller;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;

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.ResponseStatus;

import mms.pojo.EasyUIResult;
import mms.pojo.User;
import mms.services.UserServies;

//用户
@RequestMapping("User")
@Controller
public class UserController {
	@Autowired
	private UserServies userServies;

	// 添加新用户
	@RequestMapping("AddUser")
	@ResponseBody
	public String addUser(User user) {
		userServies.addUser(user);
		return "success";
	}

	// 修改用户信息
	@RequestMapping("UpdateUser")
	@ResponseBody
	public void updateUser(User user) {
		userServies.updateUser(user);
	}

	// 删除用户
	@RequestMapping("DeleteUser")
	@ResponseStatus(value = HttpStatus.OK)
	public void deleteUser(String uUsername) {
		userServies.deleteUser(uUsername);
	}

	// easyui返回全部用户信息
	@RequestMapping("queryAllUser")
	@ResponseBody
	public EasyUIResult queryAllUser(@RequestParam(value = "page", defaultValue = "1") Integer page,
			@RequestParam(value = "rows", defaultValue = "5") Integer rows) {
		EasyUIResult queryAllUser = userServies.queryAllUser(page, rows);
		return queryAllUser;
	}

	// 通过uUsername查询用户
	@RequestMapping(value = "GetUUsername", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String queryUserByName(String uUsername) {
		return userServies.queryUserByName(uUsername);
	}
	@RequestMapping(value = "GetUpassword", produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String queryPasswordByName(String uUsername) {
		return userServies.queryPasswordByName(uUsername);
	}
}

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

相关文章:

  • python——装饰器深入研究(一)
  • 猿创征文|【C++游戏引擎Easy2D】炫酷动画来这学,位移动画构造函数让节点执行动画
  • 做好规划 拿下未来!
  • MATLAB算法实战应用案例精讲-【智能优化算法】非支配排序遗传算法-NSGA-Ⅱ(附python和matlab代码)
  • 完美免费在线去背景图片,便捷变速。在5秒内消除或者替换图像背景,智能调整颜色,所有操作都在浏览器完成,无需上传图像 - BgSub
  • 一文掌握MySQL的索引(认真排版、简洁易懂)
  • 十、mongodb分片集群运维相关
  • 每日十(?)题之20220903
  • 2.数据结构与算法 进阶知识
  • 下载JDK8 JVM源码
  • 基于某钉探索针对CEF框架的一些逆向思路
  • C++迭代器
  • 关联容器(字典)map
  • 欧拉函数——最大公约数(gcd+筛质数+欧拉函数)
  • 【小程序】网络请求API介绍及网络请求的封装
  • Angular4 模板式表单用法以及验证
  • JavaScript 事件——“事件类型”中“HTML5事件”的注意要点
  • LeetCode算法系列_0891_子序列宽度之和
  • mongo索引构建
  • node 版本过低
  • PaddlePaddle-GitHub的正确打开姿势
  • Spring Cloud(3) - 服务治理: Spring Cloud Eureka
  • Zepto.js源码学习之二
  • 官方新出的 Kotlin 扩展库 KTX,到底帮你干了什么?
  • 使用Gradle第一次构建Java程序
  • 看到一个关于网页设计的文章分享过来!大家看看!
  • ​LeetCode解法汇总307. 区域和检索 - 数组可修改
  • ​如何在iOS手机上查看应用日志
  • ​一些不规范的GTID使用场景
  • $GOPATH/go.mod exists but should not goland
  • (+4)2.2UML建模图
  • (2)(2.4) TerraRanger Tower/Tower EVO(360度)
  • (3)选择元素——(17)练习(Exercises)
  • (html5)在移动端input输入搜索项后 输入法下面为什么不想百度那样出现前往? 而我的出现的是换行...
  • (Matlab)基于蝙蝠算法实现电力系统经济调度
  • (附源码)计算机毕业设计ssm电影分享网站
  • (附源码)计算机毕业设计SSM疫情居家隔离服务系统
  • (机器学习-深度学习快速入门)第一章第一节:Python环境和数据分析
  • (牛客腾讯思维编程题)编码编码分组打印下标(java 版本+ C版本)
  • (四) Graphivz 颜色选择
  • (算法)前K大的和
  • (一一四)第九章编程练习
  • (转)Android学习系列(31)--App自动化之使用Ant编译项目多渠道打包
  • (转载)微软数据挖掘算法:Microsoft 时序算法(5)
  • ..回顾17,展望18
  • .NET “底层”异步编程模式——异步编程模型(Asynchronous Programming Model,APM)...
  • .Net 6.0 处理跨域的方式
  • .NET Entity FrameWork 总结 ,在项目中用处个人感觉不大。适合初级用用,不涉及到与数据库通信。
  • .Net Remoting常用部署结构
  • .NET 解决重复提交问题
  • .net连接oracle数据库
  • /etc/sudoer文件配置简析
  • :O)修改linux硬件时间
  • @EnableWebMvc介绍和使用详细demo
  • [C++]四种方式求解最大子序列求和问题