|
@@ -82,15 +82,17 @@ class SerialNumberView(View):
|
|
|
return response.json(0, result)
|
|
|
first_serial_qs = first_serial_qs.filter(type=p_type)
|
|
|
if first_serial_qs.exists():
|
|
|
- result = {
|
|
|
- "serialNumber": serial_no,
|
|
|
- "phoneModel": '',
|
|
|
- "createdTime": '',
|
|
|
- }
|
|
|
# APP扫码工具记录+1
|
|
|
params = {'serial_number': first_serial, 'created_time': n_time,
|
|
|
'full_serial_number': serial_no, 'type': p_type, 'phone_model': phone_model}
|
|
|
SerialNumberCheckLog.objects.create(**params)
|
|
|
+ # 返回当前序列号数据结构
|
|
|
+ log_dict = {'fullSerialNumber': first_serial_qs[0].full_serial_number,
|
|
|
+ 'count': first_serial_qs[0].count, 'type': first_serial_qs[0].type,
|
|
|
+ 'createdTime': first_serial_qs[0].created_time,
|
|
|
+ 'stationName': dict_type[str(first_serial_qs[0].type)],
|
|
|
+ 'phoneModel': first_serial_qs[0].phone_model}
|
|
|
+ result = {'logs': [log_dict]}
|
|
|
return response.json(174, result)
|
|
|
else:
|
|
|
params = {'serial_number': first_serial, 'created_time': n_time,
|