From 1b6e947492f858d1acf80d57b6dbaf04e4db7f96 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 9 Sep 2024 14:01:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84equip=5Flast=5Fmlog4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/datax.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/wpm/datax.py b/apps/wpm/datax.py index aea4f723..6ee8bad0 100644 --- a/apps/wpm/datax.py +++ b/apps/wpm/datax.py @@ -56,8 +56,8 @@ class AnaViewSet(GenericViewSet): mlog_dict_v = mlog_dict[item['id']] item['t_count_use'] = mlog_dict_v['t_count_use'] item['reminder_interval_list'] = mlog_dict_v['reminder_interval_list'] - item['work_start_time'] = mlog_dict_v['work_start_time'].strftime('%Y-%m-%d %H:%M:%S') if mlog_dict_v['work_start_time'] else None - item['work_end_time'] = mlog_dict_v['work_end_time'].strftime('%Y-%m-%d %H:%M:%S') if mlog_dict_v['work_end_time'] else None + item['work_start_time'] = timezone.localtime(mlog_dict_v['work_start_time']).strftime('%Y-%m-%d %H:%M:%S') if mlog_dict_v['work_start_time'] else None + item['work_end_time'] = timezone.localtime(mlog_dict_v['work_end_time']).strftime('%Y-%m-%d %H:%M:%S') if mlog_dict_v['work_end_time'] else None item['mstate'] = tran_time_to_mstate(mstate_json, mlog_dict_v['reminder_interval_list'], mlog_dict_v['work_start_time'], now) if item['state'] in [Equipment.EQUIP_STATE_SCRAP, Equipment.EQUIP_STATE_FIX]: @@ -73,7 +73,7 @@ class AnaViewSet(GenericViewSet): 故障 += 1 ret = {"保温": 保温, "冷却": 冷却, "未运行": 未运行, "故障": 故障} ret['mstate_json'] = mstate_json - ret['now'] = now.strftime('%Y-%m-%d %H:%M:%S') + ret['now'] = timezone.localtime(now).strftime('%Y-%m-%d %H:%M:%S') ret["rows"] = equip_qs_l return Response(ret)