This commit is contained in:
jsh
2025-10-02 22:03:19 +08:00
commit 06d68a46fe
18 changed files with 460 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
package com.dota;
import com.dota.domain.Doctor;
import com.dota.domain.Week;
import com.dota.domain.doctors.*;
public class Main {
public static void main(String[] args) {
var gl = new GuLei();
var zl = new ZhangLiang();
var ttt = new TangTingTing();
var zy = new ZuYi();
var ln = new LiNing();
var zh = new ZhouHui();
var tgy = new TianGuoYan();
var doctorOrder = new Doctor[]{
gl,zl,ttt,zy,ln,zh
};
var outputOrder = new Doctor[] {
ln,zy,ttt,zl,zh,gl,tgy
};
schedule(doctorOrder);
print(2, outputOrder);
}
static void schedule(Doctor[] doctorOrder) {
}
static void print(int weeks, Doctor[] outputOrder) {
for (int i = 0; i < weeks; i++) {
for (Week value : Week.values()) {
System.out.print(value.getValue());
}
System.out.println(" ");
}
}
}

View File

@@ -0,0 +1,22 @@
package com.dota.domain;
public class Doctor {
// 有多少调休
public int restCount = 0;
// 门诊时间
public Week opd;
// 值班
public Week duty;
public WorkEnum[] works = new WorkEnum[]{
WorkEnum.WORK,
WorkEnum.WORK,
WorkEnum.WORK,
WorkEnum.WORK,
WorkEnum.WORK,
WorkEnum.REST,
WorkEnum.REST,
};
}

View File

@@ -0,0 +1,19 @@
package com.dota.domain;
public enum Week {
MON("周一"),
TUES("周二"),
WED("周三"),
THUR("周四"),
FRI("周五"),
SAT("周六"),
SUM("周日");
private String value;
Week(String value) {
this.value= value;
}
public String getValue(){
return value;
}
}

View File

@@ -0,0 +1,13 @@
package com.dota.domain;
public enum WorkEnum {
OPD("门诊"),
REST("休息"),
WORK("白班"),
DUTY("值班"),
HOLIDAY("调休"),
OPD_AND_WORK("门诊值班");
WorkEnum(String name){}
}

View File

@@ -0,0 +1,8 @@
package com.dota.domain.doctors;
import com.dota.domain.Doctor;
public class GuLei extends Doctor {
public GuLei(){
}
}

View File

@@ -0,0 +1,10 @@
package com.dota.domain.doctors;
import com.dota.domain.Doctor;
import com.dota.domain.WorkEnum;
public class LiNing extends Doctor {
public LiNing(){
this.works[4] = WorkEnum.OPD;
}
}

View File

@@ -0,0 +1,10 @@
package com.dota.domain.doctors;
import com.dota.domain.Doctor;
import com.dota.domain.WorkEnum;
public class TangTingTing extends Doctor {
public TangTingTing(){
this.works[2] = WorkEnum.OPD;
}
}

View File

@@ -0,0 +1,10 @@
package com.dota.domain.doctors;
import com.dota.domain.Doctor;
import com.dota.domain.WorkEnum;
public class TianGuoYan extends Doctor {
public TianGuoYan(){
this.works[0] = WorkEnum.OPD;
}
}

View File

@@ -0,0 +1,10 @@
package com.dota.domain.doctors;
import com.dota.domain.Doctor;
import com.dota.domain.WorkEnum;
public class ZhangLiang extends Doctor {
public ZhangLiang(){
this.works[3] = WorkEnum.OPD;
}
}

View File

@@ -0,0 +1,10 @@
package com.dota.domain.doctors;
import com.dota.domain.Doctor;
import com.dota.domain.WorkEnum;
public class ZhouHui extends Doctor {
public ZhouHui(){
this.works[1] = WorkEnum.OPD;
}
}

View File

@@ -0,0 +1,6 @@
package com.dota.domain.doctors;
import com.dota.domain.Doctor;
public class ZuYi extends Doctor {
}