From d6504fa072f159e99ed54218119ac328d738fbde Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 29 Apr 2025 14:43:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=84=E5=90=88=E4=BB=B6=E5=92=8C?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E6=A3=80=E9=AA=8C=E8=BF=BD=E5=8A=A0=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/inm/services.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/inm/services.py b/apps/inm/services.py index 368205f9..56494435 100644 --- a/apps/inm/services.py +++ b/apps/inm/services.py @@ -58,6 +58,8 @@ def do_out(item: MIOItem): raise ParseError("组合件暂不支持追踪单件") xbatches = [] + if is_zhj: + xbatches = [item.batch] for al in action_list: xmaterial:Material = al[0] xbatch:str = al[1] @@ -138,6 +140,8 @@ def do_in(item: MIOItem): production_dept = None xbatchs = [] + if is_zhj: + xbatchs = [item.batch] for al in action_list: xmaterial, xbatch, xcount = al xbatchs.append(xbatch) @@ -332,7 +336,10 @@ class InmService: if xcount > 0: defect = defects_map[defect_id] m_list.append((material, warehouse, i.batch, xcount, defect, i)) + + xbatchs = [] for material, warehouse, batch, change_count, defect, mioitem in m_list: + xbatchs.append(batch) if change_count <= 0: continue state = WMaterial.WM_OK @@ -383,6 +390,10 @@ class InmService: else: raise ParseError("不支持的操作") + # 批次统计分析 + xbatchs = list(set(xbatchs)) + for xbatch in xbatchs: + MyThread(target=get_alldata_with_batch_and_store, args=(xbatch,)).start() def daoru_mb(path: str): """