基于javaweb+jsp的医院住院管理系统(java+SSM+jsp+mysql+maven)
一、项目简述
功能包括: 住院病人管理,住院病房管理,医生管理,药品管理,仪 器管理等等。
二、项目运行
环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等。
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
@RequestMapping(value = "/findAdmin")
public String findAdmin(String tmsUser, String tmsName,Integer pageIndex
, Integer pageSize, Model model,HttpSession session) {
PageInfo<Tms> ai = tmsService.findPageInfo(tmsUser,tmsName, pageIndex,pageSize);
model.addAttribute("ai",ai);
session.setAttribute("u",tmsUser);
session.setAttribute("t",tmsName);
return "admin_list";
}
/**
* 添加管理员信息
*/
@RequestMapping(value = "/addAdmin" ,method = RequestMethod.POST)
@ResponseBody
public String addAdmin(@RequestBody Tms tms) {
tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
return admin;
}
/**
* 根据管理员Id搜索;
*/
@RequestMapping( "/findAdminById")
public String findAdminById( Integer tmId,HttpSession session) {
Tms a= tmsService.findTmsById(tmId);
session.setAttribute("a",a);
return "admin_edit";
}
/**
* 修改管理员信息
*/
/**
session.setAttribute("ad", ad);
return "homepage";
}
model.addAttribute("msg", "error");
return "login";
}
/**
* 退出登录
*/
@RequestMapping(value = "/loginOut")
public String loginOut(Tms tms, Model model, HttpSession session) {
session.invalidate();
return "login";
}
/**
* 分页查询
*/
@RequestMapping(value = "/findAdmin")
public String findAdmin(String tmsUser, String tmsName,Integer pageIndex
, Integer pageSize, Model model,HttpSession session) {
public String updateDept(Dept dept) {
int a = deptService.updateDept(dept);
return "redirect:/findDept";
}
/**
* 根据Id搜索;
*/
@RequestMapping("/findDeptById")
public String findDeptById(Integer deptId, HttpSession session) {
Dept de2= deptService.findDeptById(deptId);
session.setAttribute("de2",de2);
return "Dept_edit";
}
/**
* 导出Excel
*/
@RequestMapping(value = "/exportDeptlist" , method = RequestMethod.POST)
@ResponseBody
public List<Dept> exportDept(){
List<Dept> depts = deptService.getAll();
}
}
管理员控制层:
@Controller
public class TmsController {
@Autowired
private TmsService tmsService;
@RequestMapping(value = "/login")
public String login(Tms tms, Model model, HttpSession session){
// 通过账号和密码查询用户
tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
Tms ad = tmsService.findTms(tms);
if(ad!=null){
session.setAttribute("ad", ad);
return "homepage";
}
session.setAttribute("u",tmsUser);
session.setAttribute("t",tmsName);
return "admin_list";
}
/**
* 添加管理员信息
*/
@RequestMapping(value = "/addAdmin" ,method = RequestMethod.POST)
@ResponseBody
public String addAdmin(@RequestBody Tms tms) {
tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
int a = tmsService.addTms(tms);
return "admin_list";
}
/**
* 删除管理员信息
*/
}
管理员控制层:
@Controller
public class TmsController {
@Autowired
private TmsService tmsService;
@RequestMapping(value = "/login")
public String login(Tms tms, Model model, HttpSession session){
// 通过账号和密码查询用户
tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
Tms ad = tmsService.findTms(tms);
if(ad!=null){
session.setAttribute("ad", ad);
return "homepage";
}
}
/**
* 部门人员信息查询
*/
@RequestMapping(value = "/findDeptPersonnel")
public String findClassStudent(Dept dept,Model model, HttpSession session) {
List<Dept> dep = deptService.findDeptPersonnel(dept);
model.addAttribute("dep",dep);
return "dept_Personnellist";
}
}
病人控制层:
@Controller
PageInfo<Tms> ai = tmsService.findPageInfo(tmsUser,tmsName, pageIndex,pageSize);
model.addAttribute("ai",ai);
session.setAttribute("u",tmsUser);
session.setAttribute("t",tmsName);
return "admin_list";
}
/**
* 添加管理员信息
*/
@RequestMapping(value = "/addAdmin" ,method = RequestMethod.POST)
@ResponseBody
public String addAdmin(@RequestBody Tms tms) {
tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
return paitients;
}
/**
* 部门人员信息查询
*/
@RequestMapping(value = "/findPP")
public String findPP(Personnel personnel, Model model) {
List<Paitient> paitients = paitientService.findPP(personnel);
model.addAttribute("pas",paitients);
return "PP_list";
int a = tmsService.deleteTms(tmsId);
return "admin_list";
}
/**
* 导出Excel
*/
@RequestMapping(value = "/exportadminlist" , method = RequestMethod.POST)
@ResponseBody
public List<Tms> exportAdmin(){
List<Tms> admin = tmsService.getAll();
return admin;
}
/**
* 根据管理员Id搜索;
*/
@RequestMapping( "/findAdminById")
public String findAdminById( Integer tmId,HttpSession session) {
Tms a= tmsService.findTmsById(tmId);
}
/**
* 添加管理员信息
*/
@RequestMapping(value = "/addAdmin" ,method = RequestMethod.POST)
@ResponseBody
public String addAdmin(@RequestBody Tms tms) {
tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
int a = tmsService.addTms(tms);
return "admin_list";
}
/**
* 删除管理员信息
*/
@RequestMapping( "/deleteAdmin")
@ResponseBody
public String deleteAdmin(Integer tmsId) {
tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
Tms ad = tmsService.findTms(tms);
if(ad!=null){
session.setAttribute("ad", ad);
return "homepage";
}
model.addAttribute("msg", "error");
return "login";
}
/**
* 退出登录
*/
@RequestMapping(value = "/loginOut")
public String loginOut(Tms tms, Model model, HttpSession session) {
session.invalidate();
return "login";
}
/**
* 分页查询
*/
@RequestMapping(value = "/findAdmin")
public String findAdmin(String tmsUser, String tmsName,Integer pageIndex
@RequestMapping("/findPaitientById")
public String findPaitientById(Integer paitientId, HttpSession session) {
Paitient pa2= paitientService.findPaitientById(paitientId);
session.setAttribute("pa2",pa2);
return "paitient_edit";
}
/**
* 导出Excel
*/
@RequestMapping(value = "/exportPaitientlist" , method = RequestMethod.POST)
@ResponseBody
/**
* 添加管理员信息
*/
@RequestMapping(value = "/addDept" ,method = RequestMethod.POST)
@ResponseBody
public String addDept(@RequestBody Dept dept) {
int a = deptService.addDept(dept);
return "Dept_list";
}
/**
* 修改信息
*/
@RequestMapping( value = "/updateDept", method = RequestMethod.POST)
public String updateDept(Dept dept) {
int a = deptService.updateDept(dept);
return "redirect:/findDept";
}
/**
* 根据Id搜索;
*/
@RequestMapping("/findDeptById")
*/
@RequestMapping("/findDept")
public String findDept(String deptNo, String deptName,Integer pageIndex
, Integer pageSize, Model model,HttpSession session){
PageInfo<Dept> de = deptService.findPageInfo(deptNo,deptName, pageIndex,pageSize);
model.addAttribute("de",de);
session.setAttribute("u",deptNo);
session.setAttribute("t",deptName);
return "Dept_list";
}
/**
* 添加管理员信息
*/
@RequestMapping(value = "/addDept" ,method = RequestMethod.POST)
@ResponseBody
int a = tmsService.updateTms(tms);
return "redirect:/findAdmin";
}
}
部门控制层:
@Controller
public class DeptController {
@Autowired
private DeptService deptService;
/**
* 分页查询
*/
@RequestMapping("/findDept")
public String findDept(String deptNo, String deptName,Integer pageIndex
, Integer pageSize, Model model,HttpSession session){
PageInfo<Dept> de = deptService.findPageInfo(deptNo,deptName, pageIndex,pageSize);
model.addAttribute("de",de);
session.setAttribute("u",deptNo);
session.setAttribute("t",deptName);
return "Dept_list";
}
public class TmsController {
@Autowired
private TmsService tmsService;
@RequestMapping(value = "/login")
public String login(Tms tms, Model model, HttpSession session){
// 通过账号和密码查询用户
tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
Tms ad = tmsService.findTms(tms);
if(ad!=null){
session.setAttribute("ad", ad);
public List<Tms> exportAdmin(){
List<Tms> admin = tmsService.getAll();
return admin;
}
/**
* 根据管理员Id搜索;
*/
@RequestMapping( "/findAdminById")
public String findAdminById( Integer tmId,HttpSession session) {
Tms a= tmsService.findTmsById(tmId);
session.setAttribute("a",a);
return "admin_edit";
}
/**
* 修改管理员信息
*/
/**
* 将提交数据写入Tms对象
*/
@RequestMapping( value = "/updateAdmin", method = RequestMethod.POST)
public String updateAdmin(Tms tms) {
tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
int a = tmsService.updateTms(tms);
* 添加管理员信息
*/
@RequestMapping(value = "/addPaitient" ,method = RequestMethod.POST)
@ResponseBody
public String addPaitient(@RequestBody Paitient paitient) {
int a = paitientService.addPaitient(paitient);
return "paitient_list";
}
/**
* 删除仪器信息
*/
int a = paitientService.updatePaitient(paitient);
return "redirect:/findPaitient";
}
/**
* 根据管理员Id搜索;将请求数据a_id写入参数a_id
*/
@RequestMapping("/findPaitientById")
public String findPaitientById(Integer paitientId, HttpSession session) {
Paitient pa2= paitientService.findPaitientById(paitientId);
session.setAttribute("pa2",pa2);
return "paitient_edit";
}
/**
* 导出Excel
*/
@RequestMapping(value = "/exportPaitientlist" , method = RequestMethod.POST)
@ResponseBody
public List<Paitient> exportPotion(){
List<Paitient> paitients = paitientService.getAll();
return paitients;
}
return "Dept_edit";
}
/**
* 导出Excel
*/
@RequestMapping(value = "/exportDeptlist" , method = RequestMethod.POST)
@ResponseBody
public List<Dept> exportDept(){
List<Dept> depts = deptService.getAll();
return depts;
}
/**
* 部门人员信息查询
*/
@RequestMapping(value = "/findDeptPersonnel")
public String findClassStudent(Dept dept,Model model, HttpSession session) {
List<Dept> dep = deptService.findDeptPersonnel(dept);
}
/**
* 导出Excel
*/
@RequestMapping(value = "/exportDeptlist" , method = RequestMethod.POST)
@ResponseBody
public List<Dept> exportDept(){
List<Dept> depts = deptService.getAll();
return depts;
}
/**
* 部门人员信息查询
*/
@RequestMapping(value = "/findDeptPersonnel")
public String findClassStudent(Dept dept,Model model, HttpSession session) {
List<Dept> dep = deptService.findDeptPersonnel(dept);
model.addAttribute("dep",dep);
return "dept_Personnellist";
/**
* 根据Id搜索;
*/
@RequestMapping("/findDeptById")
public String findDeptById(Integer deptId, HttpSession session) {
Dept de2= deptService.findDeptById(deptId);
session.setAttribute("de2",de2);
return "Dept_edit";
}
/**
* 导出Excel
*/
@RequestMapping(value = "/exportDeptlist" , method = RequestMethod.POST)
@ResponseBody
public List<Dept> exportDept(){
@RequestMapping( value = "/updatePaitient", method = RequestMethod.POST)
public String updatePaitient(Paitient paitient) {
int a = paitientService.updatePaitient(paitient);
return "redirect:/findPaitient";
}
/**
* 根据管理员Id搜索;将请求数据a_id写入参数a_id
*/
@RequestMapping("/findPaitientById")
public String findPaitientById(Integer paitientId, HttpSession session) {
Paitient pa2= paitientService.findPaitientById(paitientId);
session.setAttribute("pa2",pa2);
return "paitient_edit";
public class PaitientController {
@Autowired
private PaitientService paitientService;
/**
* 分页查询
*/
@RequestMapping("/findPaitient")
public String findPaitient(String paitientId, String paitientName,String paitientGender,Integer pageIndex
, Integer pageSize, Model model,HttpSession session){
PageInfo<Paitient> pa = paitientService.findPageInfo(paitientId,paitientName,paitientGender, pageIndex,pageSize);
model.addAttribute("pa",pa);
session.setAttribute("u",paitientId);
}
}
管理员控制层:
@Controller
public class TmsController {
@Autowired
private TmsService tmsService;
@RequestMapping(value = "/login")
public String login(Tms tms, Model model, HttpSession session){
// 通过账号和密码查询用户
tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
Tms ad = tmsService.findTms(tms);
if(ad!=null){
session.setAttribute("ad", ad);
return "homepage";
}
model.addAttribute("msg", "error");
return "login";
}
/**
return "paitient_list";
}
/**
* 修改仪器信息
*/
@RequestMapping( value = "/updatePaitient", method = RequestMethod.POST)
public String updatePaitient(Paitient paitient) {
int a = paitientService.updatePaitient(paitient);
return "redirect:/findPaitient";
}