package com.lhf.controller.user;
import com.lhf.entity.*;
import com.lhf.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import javax.servlet.http.HttpSession;
import java.text.SimpleDateFormat;
import java.util.List;
@Controller
public class UsersNavController {
@Autowired
private UsersService usersService;
@GetMapping("/UserFrontPage")
String usersFrontPage(HttpSession httpSession){
if(httpSession.getAttribute("user")!=null){
return "user/UserFrontPage";
}else{
return "redirect:/alllogin";
}
}
@GetMapping("/HelpPage")
String helpPage(HttpSession httpSession){
if(httpSession.getAttribute("user")!=null){
return "user/HelpPage";
}else{
return "redirect:/alllogin";
}
}
@GetMapping("/PasswordChange")
String passwordChange(HttpSession httpSession){
if(httpSession.getAttribute("user")!=null){
Users users=(Users)httpSession.getAttribute("user");
httpSession.setAttribute("old_pwd",users.getPassword());
return "user/PasswordChange";
}else{
return "redirect:/alllogin";
}
}
@GetMapping("/PatientInfo")
String getPatientInfo(HttpSession httpSession, Model model){
if(httpSession.getAttribute("user")!=null){
Users users=(Users)httpSession.getAttribute("user");
Patient patient=usersService.getPatient(users.getUsername());
model.addAttribute("patient_name",patient.getPatient_name());
model.addAttribute("resident_id",patient.getResident_id());
model.addAttribute("patient_sex",patient.getPatient_sex());
model.addAttribute("patient_age",patient.getPatient_age());
model.addAttribute("patient_ph",patient.getPatient_ph());
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
String in_time=df.format(patient.getIn_time());
model.addAttribute("in_time",in_time);
String out_time=df.format(patient.getOut_time());
model.addAttribute("out_time",out_time);
model.addAttribute("doctor_name",patient.getDoctor().getDoctor_name());
model.addAttribute("ward_id",patient.getBed().getWard_id());
model.addAttribute("bed_id",patient.getBed().getBed_id());
model.addAttribute("address",patient.getAddress());
return "user/PatientInfo";
}else{
return "redirect:/alllogin";
}
}
@GetMapping("/PrescribeInfo")
String getPrescribeInfo(HttpSession httpSession,Model model){
if(httpSession.getAttribute("user")!=null){
Users users=(Users)httpSession.getAttribute("user");
Prescribe prescribe=usersService.getPrescribe(users.getUsername());
model.addAttribute("prescribe_id",prescribe.getPrescribe_id());
model.addAttribute("patient_name",prescribe.getPatient().getPatient_name());
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
String create_time=df.format(prescribe.getCreate_time());
model.addAttribute("create_time",create_time);
model.addAttribute("doctor_name",prescribe.getDoctor().getDoctor_name());
model.addAttribute("prescribe_detail",prescribe.getPrescribe_detail());
return "user/PrescribeInfo";
}else{
return "redirect:/alllogin";
}
}
@GetMapping("/ReportInfo")
String getReportInfo(HttpSession httpSession,Model model){
if(httpSession.getAttribute("user")!=null){
Users users=(Users)httpSession.getAttribute("user");
Report report=usersService.getReport(users.getUsername());
model.addAttribute("report_id",report.getReport_id());
model.addAttribute("patient_name",report.getPatient().getPatient_name());
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
String create_time=df.format(report.getCreate_time());
model.addAttribute("create_time",create_time);
model.addAttribute("department_name",report.getDepartment().getDepartment_name());
model.addAttribute("report_detail",report.getReport_detail());
return "user/ReportInfo";
}else{
return "redirect:/alllogin";
}
}
@GetMapping("/DoctorInfo")
String getDoctorInfo(HttpSession httpSession,Model model){
if(httpSession.getAttribute("user")!=null){
Users users=(Users)httpSession.getAttribute("user");
Doctor doctor=usersService.getPatient(users.getUsername()).getDoctor();
model.addAttribute("doctor_id",doctor.getDoctor_id());
model.addAttribute("doctor_name",doctor.getDoctor_name());
model.addAttribute("doctor_sex",doctor.getDoctor_sex());
model.addAttribute("doctor_age",doctor.getDoctor_age());
model.addAttribute("doctor_ph",doctor.getDoctor_ph());
model.addAttribute("department_name",doctor.getDepartment().getDepartment_name());
model.addAttribute("introduction",doctor.getIntroduction());
return "user/DoctorInfo";
}else{
return "redirect:/alllogin";
}
}
@GetMapping("/WardInfo")
String getWardInfo(HttpSession httpSession,Model model){
if(httpSession.getAttribute("user")!=null){
Users users=(Users)httpSession.getAttribute("user");
String ward_id=usersService.getPatient(users.getUsername()).getBed().getWard_id();
model.addAttribute("ward_id",ward_id);
model.addAttribute("bed_id",usersService.getPatient(users.getUsername()).getBed().getBed_id());
model.addAttribute("bed_num",usersService.getWard(ward_id).getBed_num());
model.addAttribute("patients",usersService.getPatientsByWardId(ward_id));
return "user/WardInfo";
}else{
return "redirect:/alllogin";
}
}
@GetMapping("/WardChange")
String getWardChange(HttpSession httpSession,Model model){
if(httpSession.getAttribute("user")!=null){
Users users=(Users)httpSession.getAttribute("user");
Bed bed=usersService.getPatient(users.getUsername()).getBed();
model.addAttribute("ward_id",bed.getWard_id());
model.addAttribute("bed_id",bed.getBed_id());
model.addAttribute("free_bed",usersService.getAllFreeBed());
List<WardEx> wardEx=usersService.getWardEx(users.getUsername());
model.addAttribute("ward_ex",wardEx);
return "user/WardChange";
}else{
return "redirect:/alllogin";
}
}
@GetMapping("/RegisterDoc")
String getRegisterDoc(HttpSession httpSession,Model model){
if(httpSession.getAttribute("user")!=null){
Users users=(Users)httpSession.getAttribute("user");
List<Doctor> all_doc=usersService.getAllDoctor();
model.addAttribute("all_doc",all_doc);
List<RegisterDoc> registerDocs=usersService.getRegisterDoc(users.getUsername());
model.addAttribute("reg_doc",registerDocs);
return "user/RegisterDoc";
}else{
return "redirect:/alllogin";
}
}
@GetMapping("/OutHospital")
String getOutHospital(HttpSession httpSession,Model model){
if(httpSession.getAttribute("user")!=null){
Users users=(Users)httpSession.getAttribute("user");
Patient patient=usersService.getPatient(users.getUsername());
SimpleDateFormat df=new SimpleDateFormat("yyyy-MM-dd");
String in_time=df.format(patient.getIn_time());
model.addAttribute("in_time",in_
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
【ssm项目源码】医院住院管理系统.zip (141个子文件)
style.css 11KB
login.css 7KB
Thumbs.db 23KB
SSM_test.iml 5KB
UsersNavController.java 10KB
AdminOperController.java 9KB
AdminNavController.java 7KB
DoctorNavController.java 5KB
DoctorOperController.java 4KB
Patient.java 3KB
AdminsServiceImpl.java 3KB
UsersServiceImpl.java 3KB
History.java 2KB
UserOperController.java 2KB
Report.java 2KB
Prescribe.java 2KB
DoctorsServiceImpl.java 2KB
Doctor.java 2KB
WardEx.java 2KB
RegisterDoc.java 2KB
PatientMapper.java 2KB
OutHospital.java 1KB
DoctorMapper.java 1KB
Ward.java 1KB
UsersLoginController.java 1KB
RegisterDocMapper.java 1KB
PrescribeMapper.java 1KB
WardExMapper.java 1KB
Department.java 993B
DoctorsLoginController.java 990B
Bed.java 922B
AdminsService.java 912B
ReportMapper.java 894B
OutHospitalMapper.java 882B
UsersService.java 840B
AdminsLoginController.java 821B
DepartmentMapper.java 771B
DoctorsMapper.java 762B
Doctors.java 734B
AdminsMapper.java 708B
Admins.java 678B
WardMapper.java 664B
UsersMapper.java 639B
Users.java 606B
DoctorsService.java 599B
HistoryMapper.java 411B
BedMapper.java 401B
jquery.min.js 89KB
login.js 3KB
jquery.tabify.js 704B
AdminAddPatient.jsp 15KB
AdminConfirm.jsp 11KB
WardChange.jsp 9KB
RegisterDoc.jsp 9KB
DoctorPatientInfo.jsp 8KB
DoctorInfoChange.jsp 8KB
AdminAddDoctor.jsp 8KB
DoctorPrescribeChange.jsp 8KB
PatientInfo.jsp 8KB
alllogin.jsp 8KB
AdminDepartmentInfo.jsp 7KB
PasswordChange.jsp 7KB
AdminPasswordChange.jsp 7KB
DoctorRegisterInfo.jsp 7KB
DoctorInfo.jsp 7KB
History.jsp 7KB
AdminAddWard.jsp 7KB
AdminWardInfo.jsp 7KB
DoctorPasswordChange.jsp 7KB
OutHospital.jsp 6KB
WardInfo.jsp 6KB
AdminAddDepartment.jsp 6KB
DoctorDepartmentInfo.jsp 6KB
AdminPatientInfo.jsp 6KB
PayPrice.jsp 6KB
PrescribeInfo.jsp 6KB
ReportInfo.jsp 6KB
AdminDoctorInfo.jsp 5KB
HelpPage.jsp 4KB
AdminHelpPage.jsp 4KB
UserFrontPage.jsp 4KB
AdminFrontPage.jsp 4KB
DoctorFrontPage.jsp 4KB
hospital.sql 21KB
workspace.xml 58KB
uiDesigner.xml 9KB
pom.xml 6KB
SSM_test_war_exploded.xml 4KB
applicationContext.xml 2KB
web.xml 1KB
springMVC.xml 1KB
Maven__org_springframework_spring_expression_5_0_6_RELEASE.xml 646B
Maven__org_mybatis_generator_mybatis_generator_core_1_3_5.xml 633B
compiler.xml 628B
Maven__org_springframework_spring_context_5_0_6_RELEASE.xml 625B
Maven__org_springframework_spring_aspects_5_0_6_RELEASE.xml 625B
Maven__org_springframework_spring_webmvc_5_0_6_RELEASE.xml 618B
Maven__org_springframework_spring_beans_5_0_6_RELEASE.xml 611B
Maven__org_springframework_spring_core_5_0_6_RELEASE.xml 604B
Maven__org_springframework_spring_jdbc_5_0_6_RELEASE.xml 604B
共 141 条
- 1
- 2
资源评论
- weixin_438503102021-03-19用户下载后在一定时间内未进行评价,系统默认好评。
高谈阔论篇幅起
- 粉丝: 269
- 资源: 520
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Windows 常见运行运行库32+64
- 基于3KW光伏并网单相逆变器设计(TMS320F28035控制板+显示板+STM32F103功率板)硬件(原理图+PCB)工程
- 正点原子HAL库 STM32F4 外部中断(学习自用附源码)
- delphi rzcombobox DropDownList 灰色背景改为白色
- sap sd.docsap sd.doc
- torch-1.10.2-cp38-cp38-win-amd64.whl
- 菜单栏实现增加数据,修改数据,查询数据,删除数据
- 全国省市区三级联动json文件,带code
- C8_全局&局部&static.zip
- Unity和安卓交互插件Unity调Android Native Goodies PRO
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功