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
81edbdbc
Commit
81edbdbc
authored
Jul 02, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
f5e9178b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
esign-admin/app/base/controller/impl/order/orderCtl.js
+8
-3
esign-admin/app/base/service/impl/fee/feeSve.js
+19
-0
No files found.
esign-admin/app/base/controller/impl/order/orderCtl.js
View file @
81edbdbc
...
...
@@ -13,6 +13,7 @@ class OrderCtl extends CtlBase {
this
.
productSve
=
system
.
getObject
(
"service.product.productSve"
);
this
.
ordersignlogSve
=
system
.
getObject
(
"service.order.ordersignlogSve"
);
this
.
orderauthlogSve
=
system
.
getObject
(
"service.order.orderauthlogSve"
);
this
.
feeSve
=
system
.
getObject
(
"service.order.feeSve"
);
}
/**
...
...
@@ -55,7 +56,7 @@ class OrderCtl extends CtlBase {
if
(
pobj
.
product_type
==
'1'
){
//如果是单个产品 需要转化单价
pobj
.
product_unit_price
=
system
.
y2f
(
pobj
.
product_unit_price
);
}
//
TODO:
需要去调用商户钱包 扣钱
// 需要去调用商户钱包 扣钱
if
(
pobj
.
id
){
let
reduceAccountBalanceRes
=
await
this
.
merchantaccountSve
.
addordelavailable
({
merchant_id
:
this
.
trim
(
pobj
.
merchant_id
),
amount
:
pobj
.
price
*
(
-
1
)});
if
(
reduceAccountBalanceRes
.
status
!=
0
){
...
...
@@ -95,7 +96,7 @@ class OrderCtl extends CtlBase {
}
pobj
.
audit_user_id
=
req
.
loginUser
.
id
;
//获取审核人
let
res
=
await
this
.
orderSve
.
auditEorder
(
pobj
);
//
TODO:
审核订单成功之后
//
审核订单成功之后
if
(
res
.
status
==
0
){
this
.
pushMerchantTrade
(
pobj
);
}
...
...
@@ -130,7 +131,7 @@ class OrderCtl extends CtlBase {
}
}
if
(
params
.
audit_status
==
'30'
){
//订单审核失败
//
TODO:
推送给赵大哥
//
推送给赵大哥
let
reduceAccountBalanceRes
=
await
this
.
merchantaccountSve
.
addordelavailable
({
merchant_id
:
this
.
trim
(
orderBean
.
merchant_id
),
amount
:
orderBean
.
price
});
console
.
log
(
"订单审核失败 余额退回 "
+
JSON
.
stringify
(
reduceAccountBalanceRes
));
}
...
...
@@ -151,6 +152,8 @@ class OrderCtl extends CtlBase {
return
system
.
getResult
(
null
,
`订单【
${
pobj
.
id
}
】不存在`
);
}
let
res
=
await
this
.
orderSve
.
getEorderById
(
pobj
);
// 计费
await
this
.
feeSve
.
setRowsFee
([
res
.
data
],
"engine_account_id"
);
return
res
;
}
catch
(
e
)
{
console
.
log
(
e
);
...
...
@@ -195,6 +198,8 @@ class OrderCtl extends CtlBase {
for
(
let
item
of
res
.
data
.
rows
)
{
item
.
product_info
=
productMap
[
item
.
product_id
];
}
// 设置计费内容
await
this
.
feeSve
.
setRowsFee
(
res
.
data
.
rows
,
"engine_account_id"
);
return
res
;
}
catch
(
e
)
{
console
.
log
(
e
);
...
...
esign-admin/app/base/service/impl/fee/feeSve.js
View file @
81edbdbc
...
...
@@ -111,6 +111,24 @@ class FeeService extends ServiceBase {
}
}
async
setRowsFee
(
rows
,
field
)
{
if
(
!
rows
||
rows
.
length
==
0
||
!
field
)
{
return
;
}
let
ids
=
[];
for
(
let
item
of
rows
)
{
let
id
=
Number
(
item
[
field
]
||
0
);
if
(
!
id
)
{
continue
;
}
ids
.
push
(
id
);
}
let
map
=
await
this
.
accountBulk
({
ids
:
ids
}).
data
||
{};
for
(
let
item
of
rows
)
{
item
.
fee
=
map
[
Number
(
item
[
field
]
||
0
)]
||
{};
}
}
}
module
.
exports
=
FeeService
;
\ No newline at end of file
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