From 821b88eb90badbe92391645a1afaa3d42e0e89f7 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 5 Feb 2025 10:55:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20handover=20submit=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=94=B9=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/services.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/apps/wpm/services.py b/apps/wpm/services.py index 0f5c96fd..b06e4bd8 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -732,6 +732,25 @@ def handover_submit(handover:Handover, user: User, now: Union[datetime.datetime, ) else: raise ParseError("不支持非工段报废") + elif handover.type == Handover.H_CHANGE: + if handover.recive_mgroup: + wm_to, _ = WMaterial.objects.get_or_create( + batch=batch, + material=handover.material_changed, + mgroup=recive_mgroup, + belong_dept=recive_dept, + notok_sign=None, + defect=None, + material_origin=material, + state=WMaterial.WM_OK, + defaults={ + "batch_ofrom": wm_from.batch_ofrom, + "material_ofrom": wm_from.material_ofrom, + "create_by": user + } + ) + else: + raise ParseError("改版交接必须指定接收工段") else: raise ParseError("不支持该交接类型")