From df4b0622091e84165d124c7ea5d59b92712742aa Mon Sep 17 00:00:00 2001 From: caoqianming Date: Tue, 9 Sep 2025 16:38:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=89=A9=E6=96=99?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E4=B8=8E=E6=89=B9=E6=AC=A1=E4=B8=8D=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E7=9A=84=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/serializers.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index 85e0102e..ce24e66e 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -1275,6 +1275,13 @@ class HandoverSerializer(CustomModelSerializer): if handoverbw: item["count"] = len(handoverbw) t_count += len(handoverbw) + wprIds = [i["wpr"].id for i in handoverbw] + wm_ids = Wpr.objects.filter(id__in=wprIds).values_list("wm_id", flat=True) + if len(wm_ids) == 1 and wm_ids[0] == wm.id: + pass + else: + raise ParseError(f'第{ind+1}行-物料明细与批次不匹配') + elif wm.count == item["count"]: t_count += item["count"] else: