From 6678e39518fbc4aa2735399d689a6a876504d2c4 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 18 Apr 2025 11:29:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=87=E8=B4=AD=E5=92=8C=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E5=85=A5=E5=BA=93=E5=8F=AF=E5=85=A5=E5=B7=B2=E6=9C=89?= =?UTF-8?q?=E6=89=B9=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/inm/services.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/inm/services.py b/apps/inm/services.py index d736b355..2aaff0de 100644 --- a/apps/inm/services.py +++ b/apps/inm/services.py @@ -242,7 +242,10 @@ class InmService: BatchLog.clear(mio=instance) else: for item in MIOItem.objects.filter(mio=instance): - BatchSt.g_create(batch=item.batch, mio=instance, material_start=item.material) + if item.mb: # 说明录入到已有批次 + BatchSt.g_create(batch=item.batch) + else: + BatchSt.g_create(batch=item.batch, mio=instance, material_start=item.material) from apps.pum.services import PumService if is_reverse: cls.update_mb(instance, -1) @@ -254,7 +257,10 @@ class InmService: BatchLog.clear(mio=instance) else: for item in MIOItem.objects.filter(mio=instance): - BatchSt.g_create(batch=item, mio=instance, material_start=item.material) + if item.mb: + BatchSt.g_create(batch=item.batch) + else: + BatchSt.g_create(batch=item, mio=instance, material_start=item.material) if is_reverse: cls.update_mb(instance, -1) else: