feat: wpr_bxerp优化mlogbw的获取

This commit is contained in:
caoqianming 2025-11-20 12:00:44 +08:00
parent 29f1a96c3b
commit 706cfd502b
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ def main(wprId, mgroup:Mgroup):
wpr = Wpr.objects.get(id=wprId)
data = {}
mgroup_name = mgroup.name
mlogbw = Mlogbw.objects.filter(wpr=wpr, mlogb__mlog__submit_time__isnull=False).order_by("-update_time").first()
mlogbw = Mlogbw.objects.filter(wpr=wpr, mlogb__mlog__mgroup=mgroup, mlogb__mlog__submit_time__isnull=False).order_by("-update_time").first()
if mlogbw:
data[f"{mgroup_name}_批次号"] = mlogbw.mlogb.batch
data[f"{mgroup_name}_日期"] = mlogbw.mlogb.mlog.handle_date.strftime("%Y-%m-%d")