feat: 完善equip_last_mlog4

This commit is contained in:
caoqianming 2024-09-09 14:01:57 +08:00
parent 4d5195308f
commit 1b6e947492
1 changed files with 3 additions and 3 deletions

View File

@ -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)