Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
94635caa
Commit
94635caa
authored
Aug 03, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
ff9dd34a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
14 deletions
+43
-14
bpo-web/app/base/api/impl/bpoSDPJApi.js
+43
-14
No files found.
bpo-web/app/base/api/impl/bpoSDPJApi.js
View file @
94635caa
...
...
@@ -471,6 +471,20 @@ class BpoSDPJApi {
}
}
// async testCashOut() {
// let cashInfo = await this.ccashinfoSve.findById(22);
// let api = await this.ecompanybusiSve.findOne({
// appId: cashInfo.app_id,
// etemplate_id: cashInfo.ecid,
// mchtId: cashInfo.mchtId,
// });
//
// let cashUser = await this.ccashuserSve.findById(1);
//
// let cashRes = await this.cashOut(cashInfo, api, cashUser);
// console.log(cashRes);
// }
async
cashOut
(
cashInfo
,
api
,
cashUser
)
{
if
(
cashInfo
.
qrcode_status
!=
1
)
{
// 1 认证页面 2 二维码已失效 3 红包领取页面 4 红包领取结果页面(心跳查询) 5 红包已被领取
...
...
@@ -551,8 +565,9 @@ class BpoSDPJApi {
return
this
.
getSuccessResult
(
"领取中"
,
{
redirect_code
:
4
});
}
else
{
cashInfo
.
trade_status
=
"02"
;
cashInfo
.
trade_desc
=
"领取失败"
;
cashInfo
.
trade_desc
=
rs
.
data
.
msg
||
"领取失败"
;
await
cashInfo
.
save
();
this
.
notifyCash
(
cashInfo
.
id
);
return
this
.
getSuccessResult
(
"领取失败"
,
{
redirect_code
:
6
});
}
}
catch
(
error
)
{
...
...
@@ -601,18 +616,18 @@ class BpoSDPJApi {
return
this
.
getBaseResult
(
0
,
"交易未完成"
,
{
complete
:
false
,
actual_amt
:
system
.
f2y
(
cashInfo
.
actual_amt
)});
}
async
testCashOutResult
(
obj
,
req
)
{
let
cashInfo
=
await
this
.
ccashinfoSve
.
findById
(
obj
.
id
);
let
api
=
await
this
.
ecompanybusiSve
.
findOne
({
appId
:
cashInfo
.
app_id
,
etemplate_id
:
cashInfo
.
ecid
,
mchtId
:
cashInfo
.
mchtId
,
});
let
item
=
await
this
.
getActualAmt
(
cashInfo
,
api
);
cashInfo
.
actual_amt
=
item
.
actualAmt
||
0
;
await
cashInfo
.
save
();
return
cashInfo
;
}
//
async testCashOutResult(obj, req) {
//
let cashInfo = await this.ccashinfoSve.findById(obj.id);
//
let api = await this.ecompanybusiSve.findOne({
//
appId: cashInfo.app_id,
//
etemplate_id: cashInfo.ecid,
//
mchtId: cashInfo.mchtId,
//
});
//
let item = await this.getActualAmt(cashInfo, api);
//
cashInfo.actual_amt = item.actualAmt || 0;
//
await cashInfo.save();
//
return cashInfo;
//
}
async
getActualAmt
(
cashInfo
,
api
)
{
let
params
=
{
...
...
@@ -726,12 +741,26 @@ class BpoSDPJApi {
}
}
//
通过postman
推送回调
// 推送回调
async
notifyGuestById
(
obj
,
req
)
{
let
res
=
await
this
.
notifyCash
(
obj
.
no
);
return
this
.
getBaseResult
(
0
,
"调用成功"
,
res
);
}
// 推送回调批量
async
notifyGuestByIds
(
obj
,
req
)
{
let
result
=
{};
let
ids
=
obj
.
ids
;
for
(
let
id
of
ids
)
{
try
{
result
[
id
]
=
await
this
.
notifyCash
(
id
);
}
catch
(
e
)
{
console
.
log
(
"notifyGuestByIds---error"
,
id
,
e
);
}
}
return
result
;
}
// 推送回调
async
notifyCash
(
id
)
{
try
{
// 签名验证
...
...
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