From c3c7675ac51dc8b4d6585005849da084016db352 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 29 Dec 2025 15:54:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96mlog=5Fsubmit=20?= =?UTF-8?q?=E8=BF=94=E5=B7=A5=E5=90=8E=E4=BA=A7=E5=93=81=E6=94=BE=E5=9C=A8?= =?UTF-8?q?=E6=9C=AC=E5=B7=A5=E6=AE=B5=E4=B8=8B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/services.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/wpm/services.py b/apps/wpm/services.py index 86d18917..37db83d0 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -173,7 +173,7 @@ def mlog_submit(mlog: Mlog, user: User, now: Union[datetime.datetime, None]): mgroup = mlog.mgroup process = mgroup.process stored_mgroup = process.into_wm_mgroup - need_store_notok = process.store_notok + stored_notok = process.store_notok belong_dept = mgroup.belong_dept material_out: Material = mlog.material_out material_in: Material = mlog.material_in @@ -254,7 +254,7 @@ def mlog_submit(mlog: Mlog, user: User, now: Union[datetime.datetime, None]): Wpr.change_or_new(wpr=item.wpr, old_wm=wm, ftest=item.ftest) # 针对加工前不良的暂时额外处理 - if need_store_notok: + if stored_notok: for item in m_ins_bl_list: material, batch, count, defect, mi_ = item if count <= 0: @@ -280,7 +280,7 @@ def mlog_submit(mlog: Mlog, user: User, now: Union[datetime.datetime, None]): if mlogb_out_qs.exists(): mlogb_out_qs = mlogb_out_qs.filter(need_inout=True) m_outs_list = [(mo.material_out, mo.batch if mo.batch else mlog.batch, mo.count_ok_full if mo.count_ok_full is not None else mo.count_ok, mlog.count_real_eweight, None, mo) for mo in mlogb_out_qs.all()] - if need_store_notok: + if stored_notok: for item in mlogb_out_qs: mbd_qs = MlogbDefect.get_defect_qs_from_mlogb(item) if item.qct is not None or mbd_qs.exists(): @@ -309,7 +309,6 @@ def mlog_submit(mlog: Mlog, user: User, now: Union[datetime.datetime, None]): if 'count_n_' in f.name and getattr(item, f.name) > 0: notok_sign = f.name.replace('count_n_', '') m_outs_list.append( (item.material_out, item.batch if item.batch else mlog.batch, getattr(item, f.name), mlog.count_real_eweight, notok_sign, item)) - stored_notok = True # 这里有一个漏洞,在产出物为兄弟件的情况下,不合格品的数量是记录在mlog上的, # 而不是mlogb上,以上的额外处理就没有效果了, 不过光子不记录不合格品 else: