fix: 粗中细磨的统计要涵盖粗磨和粗中磨的数据
This commit is contained in:
parent
44486b64a3
commit
ac41f5a105
|
|
@ -230,8 +230,11 @@ def get_alldata_with_batch(batch: str):
|
||||||
# 六车间工段生产数据
|
# 六车间工段生产数据
|
||||||
mgroup_list = ["平头", "粘铁头", "粗中细磨", "抛光", "开槽"]
|
mgroup_list = ["平头", "粘铁头", "粗中细磨", "抛光", "开槽"]
|
||||||
for mgroup_name in mgroup_list:
|
for mgroup_name in mgroup_list:
|
||||||
mgroup = Mgroup.objects.get(name=mgroup_name)
|
if mgroup_name == '粗中细磨':
|
||||||
mlogs_qs = Mlog.objects.filter(submit_time__isnull=False, mgroup=mgroup, batch=batch)
|
mgroups = Mgroup.objects.filter(name__in=['粗磨', '粗中磨', '粗中细磨'])
|
||||||
|
else:
|
||||||
|
mgroups = Mgroup.objects.filter(name=mgroup_name)
|
||||||
|
mlogs_qs = Mlog.objects.filter(submit_time__isnull=False, mgroup__in=mgroups, batch=batch)
|
||||||
if mlogs_qs.exists():
|
if mlogs_qs.exists():
|
||||||
last_time = item.update_time if item.update_time > last_time else last_time
|
last_time = item.update_time if item.update_time > last_time else last_time
|
||||||
data[f'六车间_{mgroup_name}_日期'] = []
|
data[f'六车间_{mgroup_name}_日期'] = []
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue