Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjh5
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
gjjh5
Commits
9dd91203
Commit
9dd91203
authored
Apr 18, 2019
by
姜登
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gjj
parent
b995c5ad
Pipeline
#6201
passed with stage
in 2 seconds
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
28 deletions
+7
-28
order.js
app/controller/order.js
+2
-24
order.js
app/service/order.js
+2
-2
partner.js
app/service/partner.js
+3
-2
No files found.
app/controller/order.js
View file @
9dd91203
...
...
@@ -79,26 +79,6 @@ class OrderController extends Controller {
ctx
.
success
({
orderId
:
object
.
orderId
});
}
async
show
()
{
const
{
ctx
,
service
}
=
this
;
ctx
.
validate
(
this
.
showRule
);
const
{
orderId
}
=
ctx
.
params
;
await
service
.
signature
.
signatureCheck
(
ctx
.
request
.
body
);
const
data
=
await
service
.
order
.
getOneByOrderId
(
orderId
);
if
(
data
)
{
if
(
data
.
status
===
'success'
)
{
const
result
=
await
service
.
storage
.
read
(
orderId
);
ctx
.
success
(
result
);
return
;
}
ctx
.
success
({
status
:
data
.
status
,
});
return
;
}
ctx
.
fail
(
'无此订单号'
);
}
async
partnerShow
()
{
const
{
ctx
,
service
}
=
this
;
try
{
...
...
@@ -110,9 +90,8 @@ class OrderController extends Controller {
return
ctx
.
fail
(
'未开通此服务'
);
}
await
service
.
signature
.
signatureCheck
(
ctx
.
request
.
body
);
const
data
=
await
service
.
order
.
getOneByOrderId
(
orderId
);
const
data
=
await
service
.
order
.
getOneByOrderId
(
{
orderId
,
status
:
'success'
}
);
if
(
data
)
{
if
(
data
.
status
===
'success'
)
{
const
result
=
await
service
.
storage
.
read
(
orderId
,
appKey
);
ctx
.
body
=
{
code
:
0
,
...
...
@@ -120,7 +99,6 @@ class OrderController extends Controller {
};
return
;
}
}
ctx
.
body
=
{
code
:
-
1
,
msg
:
'无此订单号'
,
...
...
@@ -138,7 +116,7 @@ class OrderController extends Controller {
if
(
!
(
appKeyInfo
&&
appKeyInfo
.
valid
===
true
&&
appKeyInfo
.
enableHfView
===
true
))
{
return
ctx
.
fail
(
'未开通此服务'
);
}
const
data
=
await
service
.
order
.
getOneByOrderId
(
orderId
);
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/order.js
View file @
9dd91203
...
...
@@ -3,10 +3,10 @@
const
Service
=
require
(
'egg'
).
Service
;
class
OrderService
extends
Service
{
async
getOneByOrderId
(
orderId
)
{
async
getOneByOrderId
(
params
)
{
const
{
ctx
}
=
this
;
const
order
=
await
ctx
.
model
.
TaskStatus
.
findOne
({
where
:
{
orderId
}
,
where
:
params
,
});
return
order
;
}
...
...
app/service/partner.js
View file @
9dd91203
...
...
@@ -94,9 +94,10 @@ class PartnerService extends Service {
}
async
notice
(
order
)
{
const
{
ctx
}
=
this
;
const
{
ctx
,
service
}
=
this
;
const
{
orderId
,
notifyUrl
,
userId
,
notice
}
=
order
;
if
(
notifyUrl
&&
notice
!==
'1'
)
{
const
dbRes
=
await
service
.
order
.
getOneByOrderId
({
orderId
,
notice
:
1
});
if
(
!
dbRes
&&
notifyUrl
&&
notice
!==
'1'
)
{
const
ret
=
await
ctx
.
curl
(
notifyUrl
,
{
charset
:
'utf-8'
,
timeout
:
[
30000
,
30000
],
...
...
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