From 5628a1ff83702e1b489b3ac6084b1bbe4c0f4d44 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 19 Sep 2024 15:08:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20ftestwork=E5=A2=9E=E5=8A=A0=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/qm/serializers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/qm/serializers.py b/apps/qm/serializers.py index 29c56cf0..060acccc 100644 --- a/apps/qm/serializers.py +++ b/apps/qm/serializers.py @@ -93,6 +93,8 @@ class FtestWorkCreateUpdateSerializer(CustomModelSerializer): else: raise ValidationError(f'不合格项{k_2}必须为非负整数') attrs['count_notok'] = count_notok + if type2 == 20 and attrs['count'] != attrs['count_ok'] + attrs['count_notok']: + raise ValidationError('全检时总数必须等于合格数+不合格数') elif 'mb' in attrs and attrs['mb']: attrs['wm'] = None attrs['material'] = attrs['mb'].material