fix: cal_material_count 只统计合格品

This commit is contained in:
caoqianming 2025-02-18 10:56:09 +08:00
parent edac22b701
commit 56d49b4d26
1 changed files with 2 additions and 2 deletions

View File

@ -24,8 +24,8 @@ def cal_material_count(materialId_list: List[str]=None):
else:
objs = Material.objects.all()
for material in objs:
mb_count = MaterialBatch.objects.filter(material=material).aggregate(total=Sum("count"))["total"] or 0
wm_count = WMaterial.objects.filter(material=material).aggregate(total=Sum("count"))["total"] or 0
mb_count = MaterialBatch.objects.filter(material=material, state=10).aggregate(total=Sum("count"))["total"] or 0
wm_count = WMaterial.objects.filter(material=material, state=10).aggregate(total=Sum("count"))["total"] or 0
if mb_count is None:
mb_count = 0
if wm_count is None: