From d01ca7df0f0ef326d1001427e935596746b3c9b9 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 20 Jan 2022 09:13:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=B7=E5=8A=A0=E5=B7=A5=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E5=90=88=E6=A0=BC=E7=8E=87=E4=B8=BA1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/srm/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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