Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_server
This commit is contained in:
commit
101a51050d
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue