1852dda7 by 周伟奇

db table add retry field

1 parent 9af4935a
1 from django.db import models 1 from django.db import models
2 from .named_enum import DocStatus, KeywordsType 2 from .named_enum import DocStatus, KeywordsType, RetryStep
3 3
4 # Create your models here. 4 # Create your models here.
5 5
...@@ -31,6 +31,9 @@ class HILDoc(models.Model): ...@@ -31,6 +31,9 @@ class HILDoc(models.Model):
31 metadata_version_id = models.CharField(max_length=64, verbose_name="元数据版本id") 31 metadata_version_id = models.CharField(max_length=64, verbose_name="元数据版本id")
32 application_id = models.CharField(max_length=64, verbose_name="申请id") # 联合索引 32 application_id = models.CharField(max_length=64, verbose_name="申请id") # 联合索引
33 status = models.SmallIntegerField(default=DocStatus.INIT.value, verbose_name="文件状态") # 联合索引 33 status = models.SmallIntegerField(default=DocStatus.INIT.value, verbose_name="文件状态") # 联合索引
34 retry_step = models.SmallIntegerField(null=True, verbose_name="重试环节")
35 retry_times = models.SmallIntegerField(default=0, verbose_name="重试次数")
36 is_retry = models.BooleanField(default=False, verbose_name="是否需要重试")
34 main_applicant = models.CharField(max_length=16, verbose_name="主申请人") 37 main_applicant = models.CharField(max_length=16, verbose_name="主申请人")
35 co_applicant = models.CharField(max_length=16, verbose_name="共同申请人") 38 co_applicant = models.CharField(max_length=16, verbose_name="共同申请人")
36 guarantor_1 = models.CharField(max_length=16, verbose_name="担保人1") 39 guarantor_1 = models.CharField(max_length=16, verbose_name="担保人1")
...@@ -52,6 +55,9 @@ class AFCDoc(models.Model): ...@@ -52,6 +55,9 @@ class AFCDoc(models.Model):
52 metadata_version_id = models.CharField(max_length=64, verbose_name="元数据版本id") 55 metadata_version_id = models.CharField(max_length=64, verbose_name="元数据版本id")
53 application_id = models.CharField(max_length=64, verbose_name="申请id") 56 application_id = models.CharField(max_length=64, verbose_name="申请id")
54 status = models.SmallIntegerField(default=DocStatus.INIT.value, verbose_name="文件状态") 57 status = models.SmallIntegerField(default=DocStatus.INIT.value, verbose_name="文件状态")
58 retry_step = models.SmallIntegerField(null=True, verbose_name="重试环节")
59 retry_times = models.SmallIntegerField(default=0, verbose_name="重试次数")
60 is_retry = models.BooleanField(default=False, verbose_name="是否需要重试")
55 main_applicant = models.CharField(max_length=16, verbose_name="主申请人") 61 main_applicant = models.CharField(max_length=16, verbose_name="主申请人")
56 co_applicant = models.CharField(max_length=16, verbose_name="共同申请人") 62 co_applicant = models.CharField(max_length=16, verbose_name="共同申请人")
57 guarantor_1 = models.CharField(max_length=16, verbose_name="担保人1") 63 guarantor_1 = models.CharField(max_length=16, verbose_name="担保人1")
......
...@@ -9,6 +9,11 @@ class DocStatus(NamedEnum): ...@@ -9,6 +9,11 @@ class DocStatus(NamedEnum):
9 COMPLETE = (4, '已完成') 9 COMPLETE = (4, '已完成')
10 10
11 11
12 class RetryStep(NamedEnum):
13 OCR = (0, 'OCR识别')
14 UPLOAD = (1, '同步EDMS')
15
16
12 class KeywordsType(NamedEnum): 17 class KeywordsType(NamedEnum):
13 INTEREST = (0, "利息") 18 INTEREST = (0, "利息")
14 SALARY = (1, '薪资') 19 SALARY = (1, '薪资')
......
...@@ -9,6 +9,13 @@ cursor.execute("create database hil") ...@@ -9,6 +9,13 @@ cursor.execute("create database hil")
9 cursor.close() 9 cursor.close()
10 cnxn.close() 10 cnxn.close()
11 11
12 # retry_step = models.SmallIntegerField(null=True, verbose_name="重试环节")
13 # retry_times = models.SmallIntegerField(default=0, verbose_name="重试次数")
14 # is_retry = models.BooleanField(default=False, verbose_name="是否需要重试")
15 # retry_step tinyint,
16 # retry_times tinyint default 0 not null,
17 # is_retry bit default 0 not null,
18
12 hil_sql_1 = """ 19 hil_sql_1 = """
13 create table auth_group 20 create table auth_group
14 ( 21 (
...@@ -305,6 +312,9 @@ hil_sql_2 = """ ...@@ -305,6 +312,9 @@ hil_sql_2 = """
305 metadata_version_id nvarchar(64) not null, 312 metadata_version_id nvarchar(64) not null,
306 application_id nvarchar(64) not null, 313 application_id nvarchar(64) not null,
307 status tinyint default 0 not null, 314 status tinyint default 0 not null,
315 retry_step tinyint,
316 retry_times tinyint default 0 not null,
317 is_retry bit default 0 not null,
308 main_applicant nvarchar(16) not null, 318 main_applicant nvarchar(16) not null,
309 co_applicant nvarchar(16) not null, 319 co_applicant nvarchar(16) not null,
310 guarantor_1 nvarchar(16) not null, 320 guarantor_1 nvarchar(16) not null,
...@@ -394,6 +404,9 @@ create table keywords ...@@ -394,6 +404,9 @@ create table keywords
394 metadata_version_id nvarchar(64) not null, 404 metadata_version_id nvarchar(64) not null,
395 application_id nvarchar(64) not null, 405 application_id nvarchar(64) not null,
396 status tinyint default 0 not null, 406 status tinyint default 0 not null,
407 retry_step tinyint,
408 retry_times tinyint default 0 not null,
409 is_retry bit default 0 not null,
397 main_applicant nvarchar(16) not null, 410 main_applicant nvarchar(16) not null,
398 co_applicant nvarchar(16) not null, 411 co_applicant nvarchar(16) not null,
399 guarantor_1 nvarchar(16) not null, 412 guarantor_1 nvarchar(16) not null,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!