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
03797396
Commit
03797396
authored
Jul 02, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
ab5e7da1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletions
+51
-1
esign-admin/app/base/controller/impl/order/orderCtl.js
+42
-1
esign-admin/app/base/service/impl/order/orderSve.js
+9
-0
No files found.
esign-admin/app/base/controller/impl/order/orderCtl.js
View file @
03797396
...
...
@@ -10,6 +10,9 @@ class OrderCtl extends CtlBase {
this
.
merchantaccountSve
=
system
.
getObject
(
"service.merchant.merchantaccountSve"
);
this
.
merchanttradeSve
=
system
.
getObject
(
"service.merchant.merchanttradeSve"
);
// this.redisClient = system.getObject("util.redisClient");
this
.
productSve
=
system
.
getObject
(
"service.product.productSve"
);
this
.
ordersignlogSve
=
system
.
getObject
(
"service.order.ordersignlogSve"
);
this
.
orderauthlogSve
=
system
.
getObject
(
"service.order.orderauthlogSve"
);
}
/**
...
...
@@ -118,7 +121,12 @@ class OrderCtl extends CtlBase {
let
res
=
await
this
.
merchantaccountSve
.
reduceAccountBalance
({
merchant_id
:
orderBean
.
merchant_id
,
amount
:
orderBean
.
price
});
if
(
res
.
status
==
0
){
console
.
log
(
"扣除余额成功 返回结果:"
+
JSON
.
stringify
(
res
));
this
.
merchanttradeSve
.
valetorder
({
merchant_id
:
orderBean
.
merchant_id
,
amount
:
orderBean
.
price
,
trade_data_id
:
orderBean
.
id
,
trade_voucher
:
null
});
let
res
=
await
this
.
merchanttradeSve
.
valetorder
({
merchant_id
:
orderBean
.
merchant_id
,
amount
:
orderBean
.
price
,
trade_data_id
:
orderBean
.
id
});
if
(
res
.
status
==
0
&&
res
.
data
&&
res
.
data
.
id
){
console
.
log
(
'交易流水创建完成 结果:'
+
JSON
.
stringify
(
res
));
let
r
=
await
this
.
orderSve
.
updOrderSimple
({
id
:
orderBean
.
id
,
trade_id
:
res
.
data
.
id
});
console
.
log
(
"更新交易流水ID完成 结果:"
+
JSON
.
stringify
(
r
));
}
}
}
if
(
params
.
audit_status
==
'30'
){
//订单审核失败
...
...
@@ -164,6 +172,8 @@ class OrderCtl extends CtlBase {
if
(
res
.
status
!=
0
||
res
.
data
.
count
==
0
){
return
res
;
}
//格式化产品信息
let
ids
=
[],
productMap
=
{};
for
(
let
item
of
res
.
data
.
rows
)
{
item
.
price
=
system
.
f2y
(
item
.
price
);
if
(
item
.
product_type
==
'1'
){
...
...
@@ -172,6 +182,18 @@ class OrderCtl extends CtlBase {
if
(
item
.
product_type
==
'2'
){
item
.
product_specifications
=
system
.
f2y
(
item
.
product_specifications
);
}
ids
.
push
(
item
.
product_id
);
}
let
p_listRes
=
await
this
.
productSve
.
getByIds
({
ids
:
ids
});
if
(
p_listRes
.
status
!=
0
){
return
system
.
getResul
(
`获取订单产品失败`
);
}
//将产品列表映射成Map结构
for
(
let
ele
of
p_listRes
.
data
)
{
productMap
[
ele
.
id
]
=
ele
;
}
for
(
let
item
of
res
.
data
.
rows
)
{
item
.
product_info
=
productMap
[
item
.
product_id
];
}
return
res
;
}
catch
(
e
)
{
...
...
@@ -202,6 +224,24 @@ class OrderCtl extends CtlBase {
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/**
* fn:查看日志
* @param pobj
* @param pobj2
* @param req
* @param res
* @returns {Promise<void>}
*/
async
pageEorderLog
(
pobj
,
pobj2
,
req
,
res
){
if
(
pobj
.
product_property
==
'1'
){
return
await
this
.
orderauthlogCtl
.
pageEorderAuthLog
(
pobj
);
}
else
if
(
pobj
.
product_property
==
'2'
){
return
await
this
.
ordersignlogSve
.
pageEorderSignLog
(
pobj
);
}
else
{
return
system
.
getResult
(
null
,
`参数错误 产品类型属性不存在`
);
}
}
}
module
.
exports
=
OrderCtl
;
\ No newline at end of file
esign-admin/app/base/service/impl/order/orderSve.js
View file @
03797396
...
...
@@ -51,6 +51,15 @@ class UserService extends ServiceBase {
return
await
this
.
callms
(
"sve_order"
,
"updEorderStatus"
,
params
);
}
/**
* fn:更新订单(单表更新)
* @param params
* @returns {Promise<void>}
*/
async
updOrderSimple
(
params
){
return
await
this
.
callms
(
"sve_order"
,
"updOrderSimple"
,
params
);
}
...
...
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