commit 06d68a46fe4ca7a8ea4837e103dbcadd9d7aa856 Author: jsh <1209700525@qq.com> Date: Thu Oct 2 22:03:19 2025 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ff6309 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..fdc35ea --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..cf0fa2a --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1759408913305 + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..9ffaa54 --- /dev/null +++ b/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + com.dota + zy-schedult + 1.0-SNAPSHOT + + + 21 + 21 + UTF-8 + + + \ No newline at end of file diff --git a/src/main/java/com/dota/Main.java b/src/main/java/com/dota/Main.java new file mode 100644 index 0000000..2bfd999 --- /dev/null +++ b/src/main/java/com/dota/Main.java @@ -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(" "); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/dota/domain/Doctor.java b/src/main/java/com/dota/domain/Doctor.java new file mode 100644 index 0000000..2b1a0f6 --- /dev/null +++ b/src/main/java/com/dota/domain/Doctor.java @@ -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, + }; +} diff --git a/src/main/java/com/dota/domain/Week.java b/src/main/java/com/dota/domain/Week.java new file mode 100644 index 0000000..970bbf6 --- /dev/null +++ b/src/main/java/com/dota/domain/Week.java @@ -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; + } +} diff --git a/src/main/java/com/dota/domain/WorkEnum.java b/src/main/java/com/dota/domain/WorkEnum.java new file mode 100644 index 0000000..ead086a --- /dev/null +++ b/src/main/java/com/dota/domain/WorkEnum.java @@ -0,0 +1,13 @@ +package com.dota.domain; + +public enum WorkEnum { + + OPD("门诊"), + REST("休息"), + WORK("白班"), + DUTY("值班"), + HOLIDAY("调休"), + OPD_AND_WORK("门诊值班"); + + WorkEnum(String name){} +} diff --git a/src/main/java/com/dota/domain/doctors/GuLei.java b/src/main/java/com/dota/domain/doctors/GuLei.java new file mode 100644 index 0000000..6d15b10 --- /dev/null +++ b/src/main/java/com/dota/domain/doctors/GuLei.java @@ -0,0 +1,8 @@ +package com.dota.domain.doctors; + +import com.dota.domain.Doctor; + +public class GuLei extends Doctor { + public GuLei(){ + } +} diff --git a/src/main/java/com/dota/domain/doctors/LiNing.java b/src/main/java/com/dota/domain/doctors/LiNing.java new file mode 100644 index 0000000..c589443 --- /dev/null +++ b/src/main/java/com/dota/domain/doctors/LiNing.java @@ -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; + } +} diff --git a/src/main/java/com/dota/domain/doctors/TangTingTing.java b/src/main/java/com/dota/domain/doctors/TangTingTing.java new file mode 100644 index 0000000..a46e969 --- /dev/null +++ b/src/main/java/com/dota/domain/doctors/TangTingTing.java @@ -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; + } +} diff --git a/src/main/java/com/dota/domain/doctors/TianGuoYan.java b/src/main/java/com/dota/domain/doctors/TianGuoYan.java new file mode 100644 index 0000000..91c54d5 --- /dev/null +++ b/src/main/java/com/dota/domain/doctors/TianGuoYan.java @@ -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; + } +} diff --git a/src/main/java/com/dota/domain/doctors/ZhangLiang.java b/src/main/java/com/dota/domain/doctors/ZhangLiang.java new file mode 100644 index 0000000..d470d0c --- /dev/null +++ b/src/main/java/com/dota/domain/doctors/ZhangLiang.java @@ -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; + } +} diff --git a/src/main/java/com/dota/domain/doctors/ZhouHui.java b/src/main/java/com/dota/domain/doctors/ZhouHui.java new file mode 100644 index 0000000..a3b4c4e --- /dev/null +++ b/src/main/java/com/dota/domain/doctors/ZhouHui.java @@ -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; + } +} diff --git a/src/main/java/com/dota/domain/doctors/ZuYi.java b/src/main/java/com/dota/domain/doctors/ZuYi.java new file mode 100644 index 0000000..57a4153 --- /dev/null +++ b/src/main/java/com/dota/domain/doctors/ZuYi.java @@ -0,0 +1,6 @@ +package com.dota.domain.doctors; + +import com.dota.domain.Doctor; + +public class ZuYi extends Doctor { +}