Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
1852dda7
authored
2020-09-24 10:18:54 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
db table add retry field
1 parent
9af4935a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletions
src/apps/doc/models.py
src/apps/doc/named_enum.py
src/common/tools/mssql_script.py
src/apps/doc/models.py
View file @
1852dda
from
django.db
import
models
from
.named_enum
import
DocStatus
,
KeywordsType
from
.named_enum
import
DocStatus
,
KeywordsType
,
RetryStep
# Create your models here.
...
...
@@ -31,6 +31,9 @@ class HILDoc(models.Model):
metadata_version_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"元数据版本id"
)
application_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id"
)
# 联合索引
status
=
models
.
SmallIntegerField
(
default
=
DocStatus
.
INIT
.
value
,
verbose_name
=
"文件状态"
)
# 联合索引
retry_step
=
models
.
SmallIntegerField
(
null
=
True
,
verbose_name
=
"重试环节"
)
retry_times
=
models
.
SmallIntegerField
(
default
=
0
,
verbose_name
=
"重试次数"
)
is_retry
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
"是否需要重试"
)
main_applicant
=
models
.
CharField
(
max_length
=
16
,
verbose_name
=
"主申请人"
)
co_applicant
=
models
.
CharField
(
max_length
=
16
,
verbose_name
=
"共同申请人"
)
guarantor_1
=
models
.
CharField
(
max_length
=
16
,
verbose_name
=
"担保人1"
)
...
...
@@ -52,6 +55,9 @@ class AFCDoc(models.Model):
metadata_version_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"元数据版本id"
)
application_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id"
)
status
=
models
.
SmallIntegerField
(
default
=
DocStatus
.
INIT
.
value
,
verbose_name
=
"文件状态"
)
retry_step
=
models
.
SmallIntegerField
(
null
=
True
,
verbose_name
=
"重试环节"
)
retry_times
=
models
.
SmallIntegerField
(
default
=
0
,
verbose_name
=
"重试次数"
)
is_retry
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
"是否需要重试"
)
main_applicant
=
models
.
CharField
(
max_length
=
16
,
verbose_name
=
"主申请人"
)
co_applicant
=
models
.
CharField
(
max_length
=
16
,
verbose_name
=
"共同申请人"
)
guarantor_1
=
models
.
CharField
(
max_length
=
16
,
verbose_name
=
"担保人1"
)
...
...
src/apps/doc/named_enum.py
View file @
1852dda
...
...
@@ -9,6 +9,11 @@ class DocStatus(NamedEnum):
COMPLETE
=
(
4
,
'已完成'
)
class
RetryStep
(
NamedEnum
):
OCR
=
(
0
,
'OCR识别'
)
UPLOAD
=
(
1
,
'同步EDMS'
)
class
KeywordsType
(
NamedEnum
):
INTEREST
=
(
0
,
"利息"
)
SALARY
=
(
1
,
'薪资'
)
...
...
src/common/tools/mssql_script.py
View file @
1852dda
...
...
@@ -9,6 +9,13 @@ cursor.execute("create database hil")
cursor
.
close
()
cnxn
.
close
()
# retry_step = models.SmallIntegerField(null=True, verbose_name="重试环节")
# retry_times = models.SmallIntegerField(default=0, verbose_name="重试次数")
# is_retry = models.BooleanField(default=False, verbose_name="是否需要重试")
# retry_step tinyint,
# retry_times tinyint default 0 not null,
# is_retry bit default 0 not null,
hil_sql_1
=
"""
create table auth_group
(
...
...
@@ -305,6 +312,9 @@ hil_sql_2 = """
metadata_version_id nvarchar(64) not null,
application_id nvarchar(64) not null,
status tinyint default 0 not null,
retry_step tinyint,
retry_times tinyint default 0 not null,
is_retry bit default 0 not null,
main_applicant nvarchar(16) not null,
co_applicant nvarchar(16) not null,
guarantor_1 nvarchar(16) not null,
...
...
@@ -394,6 +404,9 @@ create table keywords
metadata_version_id nvarchar(64) not null,
application_id nvarchar(64) not null,
status tinyint default 0 not null,
retry_step tinyint,
retry_times tinyint default 0 not null,
is_retry bit default 0 not null,
main_applicant nvarchar(16) not null,
co_applicant nvarchar(16) not null,
guarantor_1 nvarchar(16) not null,
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment