From 9ff72b2da148412ed0b5d58b3c9bde86c9402293 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 24 Jun 2025 11:23:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=89=E5=AD=90get=5Falldata=5Fwith?= =?UTF-8?q?=5Fbatch=E4=BC=98=E5=8C=962?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/services_2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/wpm/services_2.py b/apps/wpm/services_2.py index 3769da35..534215a2 100644 --- a/apps/wpm/services_2.py +++ b/apps/wpm/services_2.py @@ -101,7 +101,7 @@ def get_alldata_with_batch(batch: str): data["棒料成型_切料人"] = list(set(data["棒料成型_切料人"])) data["棒料成型_切料人"] = ";".join([item.name for item in data["棒料成型_切料人"]]) data["棒料成型_日期"] = list(set(data["棒料成型_日期"])) - data["棒料成型_日期"] = [item.strftime("%Y-%m-%d") for item in data["棒料成型_日期"]] + data["棒料成型_日期"] = ";".join([item.strftime("%Y-%m-%d") for item in data["棒料成型_日期"]]) try: data["棒料成型_合格率"] = round((data["棒料成型_count_ok"] * 100/ data["棒料成型_count_real"]), 1) except ZeroDivisionError: @@ -134,7 +134,7 @@ def get_alldata_with_batch(batch: str): data["产品规格"] = ";".join([item.specification for item in data["产品规格"]]) data["管料成型_合格率"] = round((data["管料成型_count_ok"] * 100 / data["管料成型_count_real"]), 1) data["管料成型_日期"] = list(set(data["管料成型_日期"])) - data["管料成型_日期"] = [item.strftime("%Y-%m-%d") for item in data["管料成型_日期"]] + data["管料成型_日期"] = ";".join([item.strftime("%Y-%m-%d") for item in data["管料成型_日期"]]) # 7车间生产入库数据/ 8车间中检数据 mioitem_count_fields = MIOItem.count_fields() @@ -483,6 +483,8 @@ def get_f_l_date(data): for k, v in data.items(): if k.endswith("_日期"): if v: + if isinstance(v, list): + myLogger.error(f"get_f_l_date {k} {v}") v = v.split(";") if first_date is None: first_date = min(v)