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
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![jar](https://img-home.csdnimg.cn/images/20210720083455.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 8 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/3b793c3a537943af912f23eacce60f55_2301_79271343.jpg!1)
Douglas_fan
- 粉丝: 422
- 资源: 3
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)