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
fc360367
authored
2021-05-07 17:54:07 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
report part 1
1 parent
9b2170ec
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
1 deletions
src/apps/doc/management/commands/ocr_process.py
src/apps/doc/models.py
src/apps/doc/named_enum.py
src/apps/doc/management/commands/ocr_process.py
View file @
fc36036
This diff is collapsed.
Click to expand it.
src/apps/doc/models.py
View file @
fc36036
from
django.db
import
models
from
.named_enum
import
DocStatus
,
KeywordsType
,
Re
tryStep
from
.named_enum
import
DocStatus
,
KeywordsType
,
Re
questTeam
,
RequestTrigger
,
FailureReason
,
ProcessName
,
WorkflowName
# Create your models here.
...
...
@@ -267,3 +267,45 @@ class HILOCRResult(models.Model):
managed
=
False
db_table
=
'hil_ocr_result'
# OCR Report
class
HILOCRReport
(
models
.
Model
):
id
=
models
.
AutoField
(
primary_key
=
True
,
verbose_name
=
"id"
)
# 主键
case_number
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id"
)
request_team
=
models
.
SmallIntegerField
(
default
=
RequestTeam
.
ACCEPTANCE
.
value
,
verbose_name
=
"来源"
)
request_trigger
=
models
.
SmallIntegerField
(
default
=
RequestTrigger
.
POS
.
value
,
verbose_name
=
"触发者"
)
input_file
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
"文件名"
)
transaction_start
=
models
.
DateTimeField
(
null
=
True
,
verbose_name
=
'开始时间'
)
# 索引
transaction_end
=
models
.
DateTimeField
(
null
=
True
,
verbose_name
=
'结束时间'
)
successful_at_this_level
=
models
.
BooleanField
(
default
=
True
,
verbose_name
=
"是否成功"
)
failure_reason
=
models
.
SmallIntegerField
(
null
=
True
,
verbose_name
=
"失败原因"
)
process_name
=
models
.
SmallIntegerField
(
default
=
ProcessName
.
ALL
.
value
,
verbose_name
=
"流程名称"
)
total_fields
=
models
.
IntegerField
(
null
=
True
,
verbose_name
=
'比对字段数目'
)
workflow_name
=
models
.
SmallIntegerField
(
null
=
True
,
verbose_name
=
"工作流程"
)
class
Meta
:
managed
=
False
db_table
=
'hil_ocr_report'
class
AFCOCRReport
(
models
.
Model
):
id
=
models
.
AutoField
(
primary_key
=
True
,
verbose_name
=
"id"
)
# 主键
case_number
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id"
)
request_team
=
models
.
SmallIntegerField
(
default
=
RequestTeam
.
ACCEPTANCE
.
value
,
verbose_name
=
"来源"
)
request_trigger
=
models
.
SmallIntegerField
(
default
=
RequestTrigger
.
POS
.
value
,
verbose_name
=
"触发者"
)
input_file
=
models
.
CharField
(
max_length
=
255
,
verbose_name
=
"文件名"
)
transaction_start
=
models
.
DateTimeField
(
null
=
True
,
verbose_name
=
'开始时间'
)
# 索引
transaction_end
=
models
.
DateTimeField
(
null
=
True
,
verbose_name
=
'结束时间'
)
successful_at_this_level
=
models
.
BooleanField
(
default
=
True
,
verbose_name
=
"是否成功"
)
failure_reason
=
models
.
SmallIntegerField
(
null
=
True
,
verbose_name
=
"失败原因"
)
process_name
=
models
.
SmallIntegerField
(
default
=
ProcessName
.
ALL
.
value
,
verbose_name
=
"流程名称"
)
total_fields
=
models
.
IntegerField
(
null
=
True
,
verbose_name
=
'比对字段数目'
)
workflow_name
=
models
.
SmallIntegerField
(
null
=
True
,
verbose_name
=
"工作流程"
)
class
Meta
:
managed
=
False
db_table
=
'afc_ocr_report'
situ_db_label
=
'afc'
...
...
src/apps/doc/named_enum.py
View file @
fc36036
...
...
@@ -19,3 +19,36 @@ class KeywordsType(NamedEnum):
SALARY
=
(
1
,
'薪资'
)
LOAN
=
(
2
,
'贷款'
)
ALI_WECHART
=
(
3
,
'微信/支付宝'
)
class
RequestTeam
(
NamedEnum
):
ACCEPTANCE
=
(
0
,
'ACCEPTANCE'
)
SETTLEMENT
=
(
1
,
'SETTLEMENT'
)
CONTRACTMANAGEMENT
=
(
2
,
'CONTRACTMANAGEMENT'
)
CONTROLLING
=
(
3
,
'CONTROLLING'
)
class
RequestTrigger
(
NamedEnum
):
POS
=
(
0
,
'POS'
)
EAPP
=
(
1
,
'EAPP'
)
ECONTRACT
=
(
2
,
'ECONTRACT'
)
DOCUPLOAD
=
(
3
,
'Document Upload'
)
class
FailureReason
(
NamedEnum
):
PDF
=
(
0
,
'PDF处理失败'
)
EXCEL
=
(
1
,
'构建excel失败'
)
EDMS
=
(
2
,
'EDMS上传失败'
)
class
ProcessName
(
NamedEnum
):
ALL
=
(
0
,
'S1_All_DocumentUpload'
)
BS
=
(
1
,
'S1_CA_BankStatementCalculation'
)
IDCARD
=
(
2
,
'F2_IDReport'
)
DDA
=
(
3
,
'CL_S1_DDAConsolidation'
)
class
WorkflowName
(
NamedEnum
):
NORMAL
=
(
0
,
'Normal BS'
)
MOBILE
=
(
0
,
'Mobile BS'
)
...
...
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