冷加工产品合格率为1

This commit is contained in:
caoqianming 2022-01-20 09:13:59 +08:00
parent db270f7914
commit d01ca7df0f
1 changed files with 3 additions and 1 deletions

View File

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