From 18fe3466615558dcb548a444c27b65b6013e27db Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 10 Sep 2024 15:12:14 +0800 Subject: [PATCH] fix: tran_time_to_mstate --- apps/wpm/datax.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/wpm/datax.py b/apps/wpm/datax.py index eb52d7c2..2637fa14 100644 --- a/apps/wpm/datax.py +++ b/apps/wpm/datax.py @@ -13,8 +13,10 @@ from apps.inm.models import MIOItem, MIO def tran_time_to_mstate(mstate_json, reminder_interval_list, work_start_time: datetime, now: datetime): if len(reminder_interval_list) != len(mstate_json): return '未运行' + xval = 0 for ind, val in enumerate(reminder_interval_list): - if work_start_time + timedelta(minutes=val) > now: + xval += val + if work_start_time + timedelta(minutes=xval) > now: return mstate_json[ind]['name'] return '未运行'