feat: 优化mlog_submit 返工后产品放在本工段下2
This commit is contained in:
parent
29f4e2f76a
commit
c3c7675ac5
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in New Issue