|
@@ -69,7 +69,10 @@ class SerialNumberView(View):
|
|
|
algorithm = AlgorithmBaseOn35()
|
|
|
|
|
|
for i in range(quantity):
|
|
|
- sum = SerialNumberModel.objects.last().id + 1
|
|
|
+ try:
|
|
|
+ sum = SerialNumberModel.objects.last().id
|
|
|
+ except:
|
|
|
+ sum = 0
|
|
|
serial_number = algorithm.getLetter(sum)
|
|
|
tmp_len = 6 - len(serial_number)
|
|
|
# 前面补0
|