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
ec4ef15b
authored
2023-01-06 01:15:54 +0800
by
王聪
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fsm update
1 parent
a1504767
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
39 deletions
src/apps/doc/models.py
src/pos/views.py
src/apps/doc/models.py
View file @
ec4ef15
...
...
@@ -1063,48 +1063,12 @@ class AFCCompareReportNew(models.Model):
situ_db_label
=
'afc'
invoice_code
=
content
.
get
(
'invoiceCode'
,
''
)
invoice_number
=
content
.
get
(
'invoiceNumber'
,
''
)
issue_date
=
content
.
get
(
'issueDate'
,
None
)
buyer_name
=
content
.
get
(
'buyerName'
,
''
)
buyer_id
=
content
.
get
(
'buyerId'
,
0
)
vin
=
content
.
get
(
'vin'
,
''
)
dealer
=
content
.
get
(
'dealer'
,
''
)
price_with_vat
=
content
.
get
(
'priceWithVat'
,
0.0
)
price_no_vat
=
content
.
get
(
'priceNoVat'
,
0.0
)
price_in_capitals
=
content
.
get
(
'priceInCapitals'
,
''
)
vat
=
content
.
get
(
'vat'
,
0.0
)
vat_rate
=
content
.
get
(
'vatRate'
,
0.0
)
class
AFCNscInvoice
(
models
.
Model
):
id
=
models
.
AutoField
(
primary_key
=
True
,
verbose_name
=
"id"
)
# 主键
application_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"申请id
"
)
# 索引
vin
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"车架号
"
)
# 索引
content
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"nsc发票信息"
)
create_time
=
models
.
DateTimeField
(
verbose_name
=
'创建时间'
)
# 索引
invoice_code
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"发票码"
)
issue_date
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"开票日期"
)
buyer_name
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"开票日期"
)
buyer_id
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"开票日期"
)
vin
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"开票日期"
)
dealer
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"开票日期"
)
price_with_vat
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"开票日期"
)
price_no_vat
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"开票日期"
)
price_in_capitals
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"开票日期"
)
vat
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"开票日期"
)
vat_rate
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"开票日期"
)
is_se
=
models
.
BooleanField
(
default
=
True
,
verbose_name
=
"是否Settlement"
)
is_auto
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
"是否Settlement Auto"
)
is_pass
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
"是否全对"
)
create_time
=
models
.
DateTimeField
(
verbose_name
=
'创建时间'
)
full_result
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"完整比对结果"
)
field_result
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"各证件字段统计"
)
start_time
=
models
.
DateTimeField
(
verbose_name
=
'开始时间'
)
# 索引
end_time
=
models
.
DateTimeField
(
verbose_name
=
'结束时间'
)
class
Meta
:
managed
=
False
db_table
=
'afc_nsc_invoice'
...
...
@@ -1112,6 +1076,10 @@ class AFCNscInvoice(models.Model):
class
HILNscInvoice
(
models
.
Model
):
id
=
models
.
AutoField
(
primary_key
=
True
,
verbose_name
=
"id"
)
# 主键
vin
=
models
.
CharField
(
max_length
=
64
,
verbose_name
=
"车架号"
)
# 索引
content
=
models
.
TextField
(
null
=
True
,
verbose_name
=
"nsc发票信息"
)
create_time
=
models
.
DateTimeField
(
verbose_name
=
'创建时间'
)
# 索引
class
Meta
:
managed
=
False
...
...
src/pos/views.py
View file @
ec4ef15
...
...
@@ -8,6 +8,9 @@ from common.tools.comparison import cp
from
common.mixins
import
LoggerMixin
from
rest_framework.permissions
import
IsAuthenticated
from
apps.account.authentication
import
OAuth2AuthenticationWithUser
from
apps.doc.models
import
HILNscInvoice
,
AFCNscInvoice
import
json
from
datetime
import
datetime
params
=
{
'invoiceCode'
:
fields
.
Str
(
required
=
True
,
validate
=
validate
.
Length
(
max
=
128
)),
...
...
@@ -29,7 +32,7 @@ input_args = {
}
# pos
s
接口接收NSC 发票信息
# pos 接口接收NSC 发票信息
class
NSCInvoiceView
(
GenericView
):
permission_classes
=
[
IsAuthenticated
]
authentication_classes
=
[
OAuth2AuthenticationWithUser
]
...
...
@@ -50,6 +53,7 @@ class NSCInvoiceView(GenericView):
vat
=
content
.
get
(
'vat'
,
0.0
)
vat_rate
=
content
.
get
(
'vatRate'
,
0.0
)
HILNscInvoice
.
objects
.
create
(
vin
=
vin
,
content
=
json
.
dumps
(
content
),
create_time
=
datetime
.
now
())
return
response
.
ok
()
...
...
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