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)