diff --git a/hb_server/apps/srm/views.py b/hb_server/apps/srm/views.py index 57a6a75..b5a7158 100644 --- a/hb_server/apps/srm/views.py +++ b/hb_server/apps/srm/views.py @@ -50,7 +50,9 @@ class ProcessYieldView(CreateAPIView): if m['step__process__id'] == ret_item['id']: ret_item['count_ok'] = m['count_ok'] for n in count_notok_g: - if n['step__process__id'] == ret_item['id']: + if n['step__process__id'] == 1: # 如果是冷加工 + ret['count_notok'] = ret_item['count_ok'] + elif n['step__process__id'] == ret_item['id']: ret_item['count_notok'] = n['count_notok'] rate = (ret_item['count_ok']/(ret_item['count_ok']+ret_item['count_notok'])) \ if ret_item['count_ok']+ret_item['count_notok']>0 else 1