Compare commits
No commits in common. "a111f493e1ac78829e55b04402da95cc0f128ef9" and "159b6441263d4bd956d9a1592a5a56bf0eacff76" have entirely different histories.
a111f493e1
...
159b644126
|
|
@ -1,6 +1,6 @@
|
||||||
from apps.wpm.models import BatchSt
|
from apps.wpm.models import BatchSt
|
||||||
import logging
|
import logging
|
||||||
from apps.wpm.models import Mlogb, Mlogbw, MlogbDefect, MlogUser
|
from apps.wpm.models import Mlogb, Mlogbw, MlogbDefect
|
||||||
from apps.mtm.models import Mgroup
|
from apps.mtm.models import Mgroup
|
||||||
import decimal
|
import decimal
|
||||||
from django.db.models import Sum
|
from django.db.models import Sum
|
||||||
|
|
@ -27,7 +27,7 @@ def main(batch: str, mgroup_obj:Mgroup=None):
|
||||||
mgroup_name = mgroup.name
|
mgroup_name = mgroup.name
|
||||||
mlogb1_qs = Mlogb.objects.filter(mlog__submit_time__isnull=False,
|
mlogb1_qs = Mlogb.objects.filter(mlog__submit_time__isnull=False,
|
||||||
material_out__isnull=False, mlog__mgroup=mgroup,
|
material_out__isnull=False, mlog__mgroup=mgroup,
|
||||||
mlog__is_fix=False, batch=batch, need_inout=True).order_by("mlog__submit_time")
|
mlog__is_fix=False, batch=batch, need_inout=True)
|
||||||
if mlogb1_qs.exists():
|
if mlogb1_qs.exists():
|
||||||
data[f"{mgroup_name}_日期"] = []
|
data[f"{mgroup_name}_日期"] = []
|
||||||
data[f"{mgroup_name}_操作人"] = []
|
data[f"{mgroup_name}_操作人"] = []
|
||||||
|
|
@ -38,7 +38,6 @@ def main(batch: str, mgroup_obj:Mgroup=None):
|
||||||
data[f"{mgroup_name}_count_ok_full"] = 0
|
data[f"{mgroup_name}_count_ok_full"] = 0
|
||||||
data[f"{mgroup_name}_count_pn_jgqbl"] = 0
|
data[f"{mgroup_name}_count_pn_jgqbl"] = 0
|
||||||
mlogb_q_ids = []
|
mlogb_q_ids = []
|
||||||
cal_mlog = []
|
|
||||||
for item in mlogb1_qs:
|
for item in mlogb1_qs:
|
||||||
# 找到对应的输入
|
# 找到对应的输入
|
||||||
mlogb_from:Mlogb = item.mlogb_from
|
mlogb_from:Mlogb = item.mlogb_from
|
||||||
|
|
@ -52,13 +51,6 @@ def main(batch: str, mgroup_obj:Mgroup=None):
|
||||||
data[f"{mgroup_name}_count_pn_jgqbl"] += 0
|
data[f"{mgroup_name}_count_pn_jgqbl"] += 0
|
||||||
if item.mlog.handle_user:
|
if item.mlog.handle_user:
|
||||||
data[f"{mgroup_name}_操作人"].append(item.mlog.handle_user)
|
data[f"{mgroup_name}_操作人"].append(item.mlog.handle_user)
|
||||||
# 子工序操作人
|
|
||||||
if item.mlog not in cal_mlog:
|
|
||||||
mlog_users_qs = MlogUser.objects.filter(mlog=item.mlog)
|
|
||||||
if mlog_users_qs.exists():
|
|
||||||
for mlog_user in mlog_users_qs:
|
|
||||||
data[f"{mgroup_name}_{mlog_user.process.name}_操作人"] = mlog_user.handle_user.name
|
|
||||||
cal_mlog.append(item.mlog)
|
|
||||||
if item.mlog.handle_date:
|
if item.mlog.handle_date:
|
||||||
data[f"{mgroup_name}_日期"].append(item.mlog.handle_date)
|
data[f"{mgroup_name}_日期"].append(item.mlog.handle_date)
|
||||||
data[f"{mgroup_name}_count_real"] += item.count_real
|
data[f"{mgroup_name}_count_real"] += item.count_real
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue