feat: 工段未配置班次提醒
This commit is contained in:
parent
ddb4a6930d
commit
81a16fd37e
|
@ -188,6 +188,8 @@ class Mgroup(CommonBModel):
|
|||
w_s_time = timezone.localtime(w_s_time)
|
||||
|
||||
shifts = Shift.objects.filter(rule=self.shift_rule).order_by('sort')
|
||||
if not shifts:
|
||||
raise ParseError(f"工段{self.name}未配置班次")
|
||||
# 处理跨天班次的情况
|
||||
for shift in shifts:
|
||||
# 如果开始时间小于结束时间,表示班次在同一天内
|
||||
|
@ -202,7 +204,7 @@ class Mgroup(CommonBModel):
|
|||
# 如果当前时间在结束时间之前,属于前一天
|
||||
else:
|
||||
return (w_s_time - timedelta(days=1)).date(), shift
|
||||
return w_s_time.date(), None
|
||||
# return w_s_time.date(), None
|
||||
|
||||
|
||||
class TeamMember(BaseModel):
|
||||
|
|
Loading…
Reference in New Issue