package frame;
import bean.Appointment;
import bean.Department;
import bean.Doctor;
import bean.Schedule;
import jdk.swing.interop.SwingInterOpUtils;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.format.DateTimeParseException;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.UUID;
public class HospitalManager {
//1.系统需要储存全部信息
private ArrayList<Department> allDepartments = new ArrayList();
//2.系统需要储存全部预约信息
private ArrayList<Appointment> allAppointments = new ArrayList();
private Scanner input = new Scanner(System.in);
public void start() {
while (true) {
System.out.println("========欢迎进入大数据与人工智能实验室附属医院=========");
System.out.println("1.科室管理-添加科室");
System.out.println("2.科室管理-删除科室");
System.out.println("3.科室管理-修改科室");
System.out.println("4.医生管理-录入医生");
System.out.println("5.医生管理-医生坐诊设置(当前和未来6天的坐诊信息)");
System.out.println("6.医生管理-展示全部医生的坐诊信息(当前和未来6天的坐诊信息)");
System.out.println("7.医生管理-挂号预约");
System.out.println("8.搜索某个医生当前和未来6天内的病人预约信息");
System.out.println("请输入操作命令:");
Scanner sc = new Scanner(System.in);
switch (input.next()) {
case "1":
addDepartment();
break;
case "2":
deleteDepartment();
break;
case "3":
break;
case "4":
addDector();
break;
case "5":
setDoctorjob();
break;
case "6":
showAllDoctoerInfos();
break;
case "7":
appointmentDoctor();
break;
case "8":
SearchDoctorInfos();
break;
default:
System.out.println("当前输入指令错误,请重新输入!");
}
}
}
private void showAllDoctoerInfos() {
System.out.println("=======医生的全部坐诊信息如下=======");
for (int i = 0; i < allDepartments.size(); i++) {
Department department = allDepartments.get(i);
System.out.println((i + 1) + "," + department.getName());
System.out.println("----------------------------------------");
ArrayList<Doctor> doctors = department.getDoctors();
for (int j = 0; j < doctors.size(); j++) {
Doctor doctor = doctors.get(j);
System.out.println(doctor.getName() + "医生的坐诊情况如下:");
ArrayList<Schedule> schedules = doctor.getSchedules();
updateSchedules(schedules);//更新一下时间
for (int k = 0; k < schedules.size(); k++) {
Schedule schedule = schedules.get(k);
System.out.println(schedule.getToday());//获取今天日期
if (!schedule.isUpdate()) //是否排班过
{
System.out.println("未排班~~~~~~\t\t\t");
continue;
}
if (schedule.isMorning()) {
System.out.println("上午" + schedule.getMstart() + "-" + schedule.getMend() + "已预约/总数" + schedule.getmTotalNumber() + "/" +schedule.getmAppointNumber() );
} else {
System.out.println("上午休息");
}
if (schedule.isAfternoon()) {
System.out.println("下午" + schedule.getAstart() + "-" + schedule.getAend() + "已预约/总数" + schedule.getaTotalNumber() + "/" + schedule.getaAppointNumber());
}
}
}
}
}
public void setDoctorjob() {
System.out.println("=======设置医生坐诊时间=======");
Department department = getDepartmentByUser();
//选择医生
ArrayList<Doctor> doctors = department.getDoctors();
if (doctors.size() == 0) {
System.out.println("当前科室下没有医生~~~~~~~~~");
return;
}
while (true) {
System.out.println("当前科室的医生有:");
for (int i = 0; i < doctors.size(); i++) {
Doctor doctor = doctors.get(i);
System.out.println((i + 1) + "," + doctor.getName());
}
System.out.println("请输入数字选择医生:");
//2.接受命令
int commend = input.nextInt();
if (commend < 1 || commend > doctors.size()) {
System.out.println("输入有误,请重新输入!!!");
continue;
}
Doctor doctor = doctors.get(commend - 1);
//3.为这个医生设置未来七天的坐诊情况
ArrayList<Schedule> schedules = doctor.getSchedules();
//更新未来七天时间
updateSchedules(schedules);
//4.修改坐诊信息,依次展示这个医生的坐诊信息
for (int k = 0; k < schedules.size(); k++) {
Schedule schedule = schedules.get(k);
updateDoctorSchedule(schedule);
}
break;
}
}
private void updateDoctorSchedule(Schedule schedule) {
LocalDate today = schedule.getToday();
System.out.println(today + "的安排如下:");
if (!schedule.isUpdate()) {
System.out.println("未排班\t\t\t");
} else {
System.out.println("\t上午\t");
if (schedule.isMorning()) {
System.out.println("上午" + schedule.getMstart() + "-" + schedule.getMend() + "已预约/总数:\t" +schedule.getmTotalNumber() + "/" + schedule.getmAppointNumber() );
} else {
System.out.println("休息!");
}
System.out.println("\t下午\t");
if (schedule.isAfternoon()) {
System.out.println("下午" + schedule.getAstart() + "-" + schedule.getAend() + "已预约/总数" + schedule.getaTotalNumber() + "/" +schedule.getaAppointNumber());
} else {
System.out.println("休息!");
}
}
System.out.println("是否修改?y/n");
String answer = input.next();
if (answer.equals("y")) {
schedule.setUpdate(true);
System.out.println("上午是否上班?y/n");
String answer2 = input.next();
if (answer2.equals("y")) {
schedule.setMorning(true);
System.out.println("上班的开始时间和结束时间是:");
String start = input.next();
String end = input.next();
System.out.println("可预约人数是:");
int appointNumber = input.nextInt();
schedule.setMstart(LocalTime.parse(start));
schedule.setMend(LocalTime.parse(end));
schedule.setmAppointNumber(appointNumber);
} else {
schedule.setMorning(false);
}
System.out.p
Douglas_fan
- 粉丝: 453
- 资源: 4
最新资源
- 《铭仕基本法》(2006年定稿版)-17页.doc
- 海尔企业文化手册.doc
- xx有限公司企业文化手册.doc
- 【案例分析】企业文化案例精选.doc
- 陕西省地方电力集团公司企业文化手册道德礼仪规范.doc
- 微信小程序 实现计算器代码
- 01-【目标体系构建】-企业文化建设规划与实施细则方案撰写指导说明.doc
- 03-【目标体系构建】-企业文化建设工作任务分解与工作推进表.docx
- 02-【目标体系构建】-企业文化建设三年实施规划甘特图.docx
- 04-【识别体系构建】-员工行为规范制定指导书.doc
- 07-【保障体系构建】-职务说明书——企业文化专员.doc
- 06-【保障体系构建】-职务说明书——企业文化建设职能部门(负责人).doc
- 08-【保障体系构建】-企业文化建设经费预算表(年度).doc.docx
- 12-【保障体系构建】-企业文化培训成本费用预算表.doc.docx
- 10-【保障体系构建】-企业文化培训效果综合评估表.doc.docx
- 11-【保障体系构建】-企业文化培训计划表.doc.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈