Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
taxh5
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data_server
taxh5
Commits
3bb20aca
Commit
3bb20aca
authored
May 07, 2019
by
何娜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taxh5 拉数据优化
parent
5c96b54d
Pipeline
#7082
passed with stage
in 2 seconds
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
order.js
app/controller/order.js
+10
-6
partner.js
app/service/partner.js
+0
-6
No files found.
app/controller/order.js
View file @
3bb20aca
...
...
@@ -97,11 +97,16 @@ class OrderController extends Controller {
async
partnerData
()
{
const
{
ctx
,
service
}
=
this
;
ctx
.
validate
(
this
.
showRule
);
const
{
appKey
,
orderSn
}
=
ctx
.
request
.
body
.
params
;
let
{
appKey
,
orderSn
,
orderId
}
=
ctx
.
request
.
body
.
params
;
orderId
=
orderId
||
orderSn
;
const
appKeyInfo
=
await
service
.
partner
.
fetchInfo
(
appKey
);
if
(
!
(
appKeyInfo
&&
appKeyInfo
.
valid
===
true
&&
appKeyInfo
.
enableHfData
===
true
))
{
return
ctx
.
fail
(
'未开通此服务'
);
}
await
service
.
signature
.
signatureCheck
(
ctx
.
request
.
body
);
const
data
=
await
service
.
order
.
getOneByOrderId
(
orderSn
);
if
(
data
&&
data
.
status
===
'success'
)
{
const
result
=
await
service
.
storage
.
read
(
order
Sn
,
appKey
);
const
data
=
await
service
.
order
.
getOneByOrderId
(
{
orderId
,
status
:
'success'
}
);
if
(
data
)
{
const
result
=
await
service
.
storage
.
read
(
order
Id
,
appKey
);
ctx
.
body
=
{
code
:
0
,
data
:
result
...
...
@@ -121,8 +126,7 @@ class OrderController extends Controller {
if
(
!
(
appKeyInfo
&&
appKeyInfo
.
valid
===
true
&&
appKeyInfo
.
enableItView
===
true
))
{
return
ctx
.
fail
(
'未开通此服务'
);
}
const
data
=
await
service
.
order
.
getOneByOrderId
(
orderId
);
ctx
.
logger
.
info
(
'【orderShow】 getOneByOrderId'
,
data
)
const
data
=
await
service
.
order
.
getOneByOrderId
({
orderId
,
status
:
'success'
});
if
(
data
)
{
if
(
data
.
status
===
'success'
&&
(
data
.
appkey
===
appKey
))
{
const
result
=
await
service
.
storage
.
read
(
orderId
,
appKey
);
...
...
app/service/partner.js
View file @
3bb20aca
...
...
@@ -125,14 +125,8 @@ class PartnerService extends Service {
async
notice
(
order
)
{
const
{
ctx
,
service
}
=
this
;
ctx
.
logger
.
info
(
'【notice】order------'
,
order
);
const
{
orderId
,
notifyUrl
,
userId
,
notice
}
=
order
;
ctx
.
logger
.
info
(
'【notice】orderId------'
,
orderId
);
ctx
.
logger
.
info
(
'【notice】notifyUrl------'
,
notifyUrl
);
ctx
.
logger
.
info
(
'【notice】userId------'
,
userId
);
ctx
.
logger
.
info
(
'【notice】notice------'
,
notice
);
const
dbRes
=
await
service
.
order
.
getOneByOrderId
({
orderId
,
notice
:
1
});
ctx
.
logger
.
info
(
'【notice】dbRes------'
,
dbRes
);
if
(
!
dbRes
&&
notifyUrl
&&
notice
!==
'1'
)
{
try
{
const
ret
=
await
ctx
.
curl
(
notifyUrl
,
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment