fix: get_alldata_with_batch 除0bug
This commit is contained in:
parent
31e8b92d29
commit
a2fb5598f8
|
@ -74,7 +74,10 @@ def get_alldata_with_batch(batch: str):
|
|||
data["棒料成型_出料人"] = ";".join([item.name for item in data["棒料成型_出料人"]])
|
||||
data["棒料成型_切料人"] = list(set(data["棒料成型_切料人"]))
|
||||
data["棒料成型_切料人"] = ";".join([item.name for item in data["棒料成型_切料人"]])
|
||||
data["棒料成型_合格率"] = round((data["棒料成型_count_ok"] * 100/ data["棒料成型_count_real"]), 1)
|
||||
try:
|
||||
data["棒料成型_合格率"] = round((data["棒料成型_count_ok"] * 100/ data["棒料成型_count_real"]), 1)
|
||||
except ZeroDivisionError:
|
||||
data["棒料成型_合格率"] = 0
|
||||
|
||||
# 管料成型数据
|
||||
mgroup_glcx = Mgroup.objects.get(name="管料成型")
|
||||
|
|
Loading…
Reference in New Issue