feat: 完善equip_last_mlog4
This commit is contained in:
parent
4d5195308f
commit
1b6e947492
|
@ -56,8 +56,8 @@ class AnaViewSet(GenericViewSet):
|
||||||
mlog_dict_v = mlog_dict[item['id']]
|
mlog_dict_v = mlog_dict[item['id']]
|
||||||
item['t_count_use'] = mlog_dict_v['t_count_use']
|
item['t_count_use'] = mlog_dict_v['t_count_use']
|
||||||
item['reminder_interval_list'] = mlog_dict_v['reminder_interval_list']
|
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_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'] = mlog_dict_v['work_end_time'].strftime('%Y-%m-%d %H:%M:%S') if mlog_dict_v['work_end_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)
|
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]:
|
if item['state'] in [Equipment.EQUIP_STATE_SCRAP, Equipment.EQUIP_STATE_FIX]:
|
||||||
|
@ -73,7 +73,7 @@ class AnaViewSet(GenericViewSet):
|
||||||
故障 += 1
|
故障 += 1
|
||||||
ret = {"保温": 保温, "冷却": 冷却, "未运行": 未运行, "故障": 故障}
|
ret = {"保温": 保温, "冷却": 冷却, "未运行": 未运行, "故障": 故障}
|
||||||
ret['mstate_json'] = mstate_json
|
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
|
ret["rows"] = equip_qs_l
|
||||||
return Response(ret)
|
return Response(ret)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue