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
eddb7e69
Commit
eddb7e69
authored
Apr 11, 2019
by
何娜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重新获取任务时,增加对之前订单号的判断
parent
df23894f
Pipeline
#5879
passed with stage
in 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
order.js
app/service/order.js
+14
-10
No files found.
app/service/order.js
View file @
eddb7e69
...
@@ -33,23 +33,27 @@ class OrderService extends Service {
...
@@ -33,23 +33,27 @@ class OrderService extends Service {
async
update
(
params
)
{
async
update
(
params
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
order
=
await
ctx
.
model
.
TaskStatus
.
find
One
({
const
order
=
await
ctx
.
model
.
TaskStatus
.
find
All
({
where
:
{
orderId
:
params
.
orderId
},
where
:
{
orderId
:
params
.
orderId
},
order
:
[[
'createDate'
,
'DESC'
]],
});
});
if
(
!
order
)
{
if
(
order
.
length
===
0
)
{
ctx
.
throw
(
400
,
{
message
:
'no order'
});
ctx
.
throw
(
400
,
{
message
:
'no order'
});
return
;
}
}
const
{
appKey
,
taskId
,
notifyUrl
,
callbackUrl
,
userId
}
=
order
;
for
(
const
item
of
order
)
{
if
(
taskId
)
{
if
(
item
.
status
===
'success'
)
{
if
(
params
.
userId
)
{
ctx
.
throw
(
400
,
{
message
:
'orderId success'
});
await
ctx
.
model
.
TaskStatus
.
create
({
appKey
,
status
:
'init'
,
notifyUrl
,
callbackUrl
,
...
params
})
return
;
}
else
{
await
ctx
.
model
.
TaskStatus
.
create
({
appKey
,
status
:
'init'
,
notifyUrl
,
callbackUrl
,
...
params
,
userId
})
}
}
}
const
{
appKey
,
taskId
,
notifyUrl
,
backUrl
,
userId
}
=
order
[
0
];
if
(
taskId
)
{
await
ctx
.
model
.
TaskStatus
.
create
({
appKey
,
status
:
'init'
,
notifyUrl
,
backUrl
,
userId
,
...
params
})
}
else
{
}
else
{
await
order
.
update
(
params
);
await
order
[
0
]
.
update
(
params
);
}
}
return
order
;
return
order
[
0
]
;
}
}
}
}
...
...
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