This commit is contained in:
caoqianming 2025-04-19 21:15:35 +08:00
commit 101a51050d
1 changed files with 8 additions and 0 deletions

View File

@ -564,8 +564,12 @@ class MlogSerializer(CustomModelSerializer):
count_notok = 0
for i in attrs:
if 'count_n_' in i:
if attrs[i] < 0:
raise ParseError(f'{attrs[i]}不能小于0')
count_notok = count_notok + attrs[i]
attrs['count_notok'] = count_notok
if attrs['count_ok'] < 0:
raise ParseError('合格数量不能小于0')
if attrs['count_real'] >= attrs['count_ok'] + attrs['count_notok']:
pass
else:
@ -991,6 +995,10 @@ class HandoverSerializer(CustomModelSerializer):
t_count = 0
tracking = attrs["material"].tracking
for ind, item in enumerate(attrs['handoverb']):
if item["count"] > 0:
pass
else:
raise ParseError(f'{ind+1}行-交接数量必须大于0')
wm = item["wm"]
if mtype == Handover.H_MERGE:
if new_state is None: