Skip to content

Commit de137cb

Browse files
committed
Update message.py : Update Work Checking Function - Apply New Work Schedule
1 parent 4b4cdee commit de137cb

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

message.py

+5-28
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ def messageWorkDate(year, month, day):
581581

582582
countDays = (dateToday - dateStart).days
583583

584-
strMessage = "%s 근무현황\\n병사\\n%s\\n간부\\n%s"%(dateToday.strftime("%Y년 %m월 %d일"), calcByeongsa(countDays), calcGanbu(countDays))
584+
strMessage = "%s 근무현황\\n%s"%(dateToday.strftime("%Y년 %m월 %d일"), calcWork(countDays))
585585
except:
586586
strMessage = "그게 날짜냐?"
587587

@@ -593,7 +593,7 @@ def messageWorkToday():
593593

594594
countDays = (dateToday - dateStart).days
595595

596-
strMessage = "%s 근무현황\\n병사\\n%s\\n간부\\n%s"%(dateToday.strftime("%Y년 %m월 %d일"), calcByeongsa(countDays), calcGanbu(countDays))
596+
strMessage = "%s 근무현황\\n%s"%(dateToday.strftime("%Y년 %m월 %d일"), calcWork(countDays))
597597

598598
return strMessage
599599

@@ -603,7 +603,7 @@ def messageWorkTomorrow():
603603

604604
countDays = (dateToday - dateStart).days
605605

606-
strMessage = "%s 근무현황\\n병사\\n%s\\n간부\\n%s"%(dateToday.strftime("%Y년 %m월 %d일"), calcByeongsa(countDays), calcGanbu(countDays))
606+
strMessage = "%s 근무현황\\n%s"%(dateToday.strftime("%Y년 %m월 %d일"), calcWork(countDays))
607607

608608
return strMessage
609609

@@ -653,7 +653,7 @@ def messageZayazi():
653653

654654
return strMessage
655655

656-
def calcByeongsa(days):
656+
def calcWork(days):
657657
calcValue = days % 5
658658
strResult = ""
659659

@@ -668,27 +668,4 @@ def calcByeongsa(days):
668668
elif calcValue == 4:
669669
strResult = "1조 1BRK\\n2조 MOR(07:10 ~ 12:10)\\n3조 AFT(12:00 ~ 17:50)\\n4조 2BRK\\n5조 MID(23:40 ~ 07:20)/SWI(17:40 ~ 23:50)"
670670

671-
return strResult
672-
673-
def calcGanbu(days):
674-
calcValue = days % 8
675-
strResult = ""
676-
677-
if calcValue == 0:
678-
strResult = "A조 S/B\\nB조 2MID(23:20 ~ 07:30)/1SWI(17:00 ~ 23:30)\\nC조 1BRK\\nD조 1DAY(07:20 ~ 17:10)"
679-
elif calcValue == 1:
680-
strResult = "A조 1MID(23:20 ~ 07:30)\\nB조 2SWI(17:00 ~ 23:30)\\nC조 2BRK\\nD조 2DAY(07:20 ~ 17:10)"
681-
elif calcValue == 2:
682-
strResult = "A조 2MID(23:20 ~ 07:30)/1SWI(17:00 ~ 23:30)\\nB조 1BRK\\nC조 1DAY(07:20 ~ 17:10)\\nD조 S/B"
683-
elif calcValue == 3:
684-
strResult = "A조 2SWI(17:00 ~ 23:30)\\nB조 2BRK\\nC조 2DAY(07:20 ~ 17:10)\\nD조 1MID(23:20 ~ 07:30)"
685-
elif calcValue == 4:
686-
strResult = "A조 1BRK\\nB조 1DAY(07:20 ~ 17:10)\\nC조 S/B\\nD조 2MID(23:20 ~ 07:30)/1SWI(17:00 ~ 23:30)"
687-
elif calcValue == 5:
688-
strResult = "A조 2BRK\\nB조 2DAY(07:20 ~ 17:10)\\nC조 1MID(23:20 ~ 07:30)\\nD조 2SWI(17:00 ~ 23:30)"
689-
elif calcValue == 6:
690-
strResult = "A조 1DAY(07:20 ~ 17:10)\\nB조 S/B\\nC조 2MID(23:20 ~ 07:30)/1SWI(17:00 ~ 23:30)\\nD조 1BRK"
691-
elif calcValue == 7:
692-
strResult = "A조 2DAY(07:20 ~ 17:10)\\nB조 1MID(23:20 ~ 07:30)\\nC조 2SWI(17:00 ~ 23:30)\\nD조 2BRK"
693-
694-
return strResult
671+
return strResult

0 commit comments

Comments
 (0)