消耗产出校验bug
This commit is contained in:
parent
95f444ce83
commit
8a162fbe58
|
@ -261,7 +261,8 @@ class OperationListSerializer(serializers.ModelSerializer):
|
|||
if obj.step.type == Step.STEP_TYPE_NOM:
|
||||
count_work = OperationWproduct.objects.filter(operation=obj).count()
|
||||
else:
|
||||
count_work = 0
|
||||
count_work = OperationMaterial.objects.filter(operation=obj).annotate(count_work=Sum('count'))
|
||||
print(count_work)
|
||||
return count_work
|
||||
|
||||
def get_equip_(self, obj):
|
||||
|
|
|
@ -616,9 +616,7 @@ class OperationViewSet(ListModelMixin, RetrieveModelMixin, CreateModelMixin, Upd
|
|||
omos = OperationMaterial.objects.filter(operation=op,
|
||||
type=SubprodctionMaterial.SUB_MA_TYPE_OUT)
|
||||
sps_omo_l = omos.filter(use_scrap=False).values_list('subproduction_plan', flat=True)
|
||||
if set(list(sps_omi_l)) == set(list(sps_omo_l)) and op.step.type == Step.STEP_TYPE_DIV:
|
||||
pass
|
||||
else:
|
||||
if not (set(list(sps_omi_l)) == set(list(sps_omo_l)) and op.step.type == Step.STEP_TYPE_DIV):
|
||||
raise exceptions.APIException('消耗与产出不一致')
|
||||
# 实际消耗物料校验
|
||||
|
||||
|
|
Loading…
Reference in New Issue