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
fe7d3a71
authored
2020-11-08 23:28:57 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
3bdf0e45
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
src/apps/doc/consts.py
src/apps/doc/ocr/wb.py
src/settings/conf/__init__.py
src/apps/doc/consts.py
View file @
fe7d3a7
...
...
@@ -168,6 +168,7 @@ HEADERS_MAPPING.update(
{
'支出金额'
:
OUTLAY_KEY
,
'支出'
:
OUTLAY_KEY
,
'支取'
:
OUTLAY_KEY
,
'支取金额(借)'
:
OUTLAY_KEY
,
'支取金额(借)'
:
OUTLAY_KEY
,
}
...
...
@@ -263,7 +264,7 @@ HEADERS_MAPPING.update(
HEADERS_MAPPING
.
update
(
{
'借贷发生额(借:-贷:+)'
:
AMOUNT_KEY
,
'借贷发生额
(
借:-贷:+)'
:
AMOUNT_KEY
,
'借贷发生额
(
借:-贷:+)'
:
AMOUNT_KEY
,
}
)
...
...
@@ -898,3 +899,10 @@ WECHART_HEADERS_MAPPING.update(
'交易时间'
:
DATE_KEY
,
}
)
PATTERN_LIST
=
[
'收入'
,
'存入'
,
'支出'
,
'支取'
,
'金额'
,
'余额'
,
'发生额'
,
'借贷'
,
'借贷状态'
,
'收/支'
,
'收入金额'
,
'存入金额(贷)'
,
'存入金额(贷)'
,
'支出金额'
,
'支取金额(借)'
,
'支取金额(借)'
,
'记账日期'
,
'附言'
,
'交易日期'
,
'摘要'
,
'业务摘要'
,
'收入/支出金额'
,
'工作日期'
,
'交易金额'
,
'账户余额'
,
'交易类型'
,
'金额(元)'
,
'金额(元)'
,
'时间'
,
'名称/备注'
,
'摘要/附言'
,
'交易发生额'
,
'交易摘要'
,
'借贷发生额(借:-贷:+)'
,
'借贷发生额(借:-贷:+)'
,
'联机余额'
,
'交易金额(元)'
,
'交易金额(元)'
,
'账户余额(元)'
,
'账户余额(元)'
,
'会计日期'
,
'摘要代码'
,
'摘要信息'
,
'日期'
,
'短摘要'
,
'本次余额'
,
'交易后余额'
,
'交易说明'
,
'帐户余额'
,
'交易日期 记账日期'
]
...
...
src/apps/doc/ocr/wb.py
View file @
fe7d3a7
...
...
@@ -33,13 +33,15 @@ class BSWorkbook(Workbook):
@staticmethod
def
get_header_col
(
header_value
,
classify
):
if
header_value
is
None
:
return
if
classify
==
consts
.
WECHART_CLASSIFY
:
header_dict
=
consts
.
WECHART_HEADERS_MAPPING
else
:
header_dict
=
consts
.
HEADERS_MAPPING
header_col
=
header_dict
.
get
(
header_value
)
if
header_col
is
None
:
for
pattern
in
header_dict
.
keys
()
:
for
pattern
in
consts
.
PATTERN_LIST
:
if
re
.
search
(
pattern
,
header_value
):
header_col
=
header_dict
.
get
(
pattern
)
break
...
...
src/settings/conf/__init__.py
View file @
fe7d3a7
...
...
@@ -12,7 +12,7 @@ from simple_config import Config, ConfigAttribute, converter
from
.
import
_default_config
_SERVER_TYPE_LST
=
[
'
DEV
'
,
'SIT'
,
'PRD'
]
_SERVER_TYPE_LST
=
[
'
UAT
'
,
'SIT'
,
'PRD'
]
def
service_is_online
(
server_type
):
...
...
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