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
e52c8cf9
Commit
e52c8cf9
authored
Jun 30, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
98bc5fee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
5 deletions
+78
-5
esign-sve-order/app/base/api/impl/op/action.js
+6
-0
esign-sve-order/app/base/service/impl/eorder/eorderSve.js
+54
-5
esign-sve-order/app/base/service/impl/eorder/eorderproductSve.js
+18
-0
No files found.
esign-sve-order/app/base/api/impl/op/action.js
View file @
e52c8cf9
...
@@ -41,6 +41,9 @@ class ActionAPI extends APIBase {
...
@@ -41,6 +41,9 @@ class ActionAPI extends APIBase {
case
"auditEorder"
:
// 审核订单
case
"auditEorder"
:
// 审核订单
opResult
=
await
this
.
eorderSve
.
auditEorder
(
action_body
);
opResult
=
await
this
.
eorderSve
.
auditEorder
(
action_body
);
break
;
break
;
case
"updEorderStatus"
:
// 更改订单状态
opResult
=
await
this
.
eorderSve
.
updEorderStatus
(
action_body
);
break
;
case
"getEorderById"
:
// 查看订单
case
"getEorderById"
:
// 查看订单
opResult
=
await
this
.
eorderSve
.
getEorderById
(
action_body
);
opResult
=
await
this
.
eorderSve
.
getEorderById
(
action_body
);
break
;
break
;
...
@@ -50,6 +53,9 @@ class ActionAPI extends APIBase {
...
@@ -50,6 +53,9 @@ class ActionAPI extends APIBase {
case
"listEorderProduct"
:
// 查看订单列表
case
"listEorderProduct"
:
// 查看订单列表
opResult
=
await
this
.
eorderproductSve
.
listEorderProduct
(
action_body
);
opResult
=
await
this
.
eorderproductSve
.
listEorderProduct
(
action_body
);
break
;
break
;
case
"listEorderProductByMerchantId"
:
// 查看当前商户下所有的订单相关的产品(没有分页)
opResult
=
await
this
.
eorderproductSve
.
listEorderProductByMerchantId
(
action_body
);
break
;
case
"saveEorderAuthLog"
:
// 保存身份认证日志
case
"saveEorderAuthLog"
:
// 保存身份认证日志
opResult
=
await
this
.
eorderauthlogSve
.
saveEorderAuthLog
(
action_body
);
opResult
=
await
this
.
eorderauthlogSve
.
saveEorderAuthLog
(
action_body
);
break
;
break
;
...
...
esign-sve-order/app/base/service/impl/eorder/eorderSve.js
View file @
e52c8cf9
...
@@ -6,7 +6,10 @@ class EorderSve extends ServiceBase {
...
@@ -6,7 +6,10 @@ class EorderSve extends ServiceBase {
super
(
"eorder"
,
ServiceBase
.
getDaoName
(
EorderSve
));
super
(
"eorder"
,
ServiceBase
.
getDaoName
(
EorderSve
));
this
.
eorderproductDao
=
system
.
getObject
(
"db.eorder.eorderproductDao"
);
this
.
eorderproductDao
=
system
.
getObject
(
"db.eorder.eorderproductDao"
);
this
.
GROUP_PRODUCT_TYPE
=
"2"
;
this
.
GROUP_PRODUCT_TYPE
=
"2"
;
this
.
AUDIT_STATUS
=
[
'10'
,
'20'
,
'30'
]
this
.
SIGNLE_PRODUCT_TYPE
=
"1"
;
this
.
AUDIT_STATUS
=
[
'10'
,
'20'
,
'30'
];
this
.
PAY_STATUS
=
[
'10'
,
'20'
,
'30'
];
this
.
PRODUCT_TYPE_ARRAY
=
[
'1'
,
'2'
];
}
}
/**
/**
...
@@ -27,12 +30,16 @@ class EorderSve extends ServiceBase {
...
@@ -27,12 +30,16 @@ class EorderSve extends ServiceBase {
if
(
!
params
.
product_id
){
if
(
!
params
.
product_id
){
return
system
.
getResult
(
null
,
`参数错误 父产品ID列表不能为空`
);
return
system
.
getResult
(
null
,
`参数错误 父产品ID列表不能为空`
);
}
}
if
(
!
params
.
product_type
){
if
(
!
params
.
product_type
||
!
this
.
PRODUCT_TYPE_ARRAY
.
includes
(
this
.
trim
(
params
.
product_type
))
){
return
system
.
getResult
(
null
,
`参数错误 未知的产品类型`
);
return
system
.
getResult
(
null
,
`参数错误 未知的产品类型`
);
}
}
if
(
params
.
product_type
==
this
.
GROUP
_PRODUCT_TYPE
&&
!
params
.
product_unit_price
){
if
(
params
.
product_type
==
this
.
SIGNLE
_PRODUCT_TYPE
&&
!
params
.
product_unit_price
){
return
system
.
getResult
(
null
,
`参数错误 商品单价不能为空`
);
return
system
.
getResult
(
null
,
`参数错误 商品单价不能为空`
);
}
}
//如果是组合产品 单价为-1
if
(
params
.
product_type
==
this
.
GROUP_PRODUCT_TYPE
){
params
.
product_unit_price
=-
1
;
}
if
(
!
params
.
contract_url
){
if
(
!
params
.
contract_url
){
return
system
.
getResult
(
null
,
`参数错误 业务合同不能为空`
);
return
system
.
getResult
(
null
,
`参数错误 业务合同不能为空`
);
}
}
...
@@ -142,10 +149,12 @@ class EorderSve extends ServiceBase {
...
@@ -142,10 +149,12 @@ class EorderSve extends ServiceBase {
let
orderBean
=
await
this
.
dao
.
getById
(
this
.
trim
(
params
.
id
));
let
orderBean
=
await
this
.
dao
.
getById
(
this
.
trim
(
params
.
id
));
if
(
!
orderBean
){
if
(
!
orderBean
){
return
system
.
getResult
(
null
,
`订单不存在`
);
return
system
.
getResult
(
null
,
`订单
【
${
params
.
id
}
】
不存在`
);
}
}
try
{
try
{
await
orderBean
.
dao
.
update
({
id
:
orderBean
.
id
,
audit_status
:
this
.
trim
(
params
.
audit_status
),
audit_remark
:
this
.
trim
(
params
.
audit_remark
)
||
""
});
let
orderProperties
=
{
id
:
orderBean
.
id
,
audit_status
:
this
.
trim
(
params
.
audit_status
),
audit_remark
:
this
.
trim
(
params
.
audit_remark
)
||
""
};
orderProperties
.
live_status
=
params
.
audit_status
==
'20'
?
'20'
:
'30'
;
await
orderBean
.
dao
.
update
(
orderProperties
);
return
system
.
getResultSuccess
();
return
system
.
getResultSuccess
();
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
);
console
.
log
(
e
);
...
@@ -154,6 +163,46 @@ class EorderSve extends ServiceBase {
...
@@ -154,6 +163,46 @@ class EorderSve extends ServiceBase {
}
}
/**
/**
* fn:更改订单状态
* @param params
* @returns {Promise<void>}
*/
async
updEorderStatus
(
params
){
if
(
!
params
.
id
){
return
system
.
getResult
(
null
,
`参数错误 订单ID 不能为空`
);
}
try
{
let
orderBean
=
await
this
.
dao
.
model
.
findOne
(
this
.
trim
(
params
.
id
));
if
(
!
orderBean
){
return
system
.
getResult
(
null
,
`订单【
${
params
.
id
}
】不存在`
);
}
//如果支付状态
if
(
params
.
pay_status
&&
orderBean
.
pay_status
==
'10'
&&
this
.
PAY_STATUS
.
includes
(
this
.
trim
(
params
.
pay_status
)))
{
orderBean
.
pay_status
=
this
.
trim
(
params
.
pay_status
);
await
orderBean
.
save
();
return
system
.
getResult
(
orderBean
);
}
//如果更新的是订单审核的状态
if
(
params
.
audit_status
&&
orderBean
.
pay_status
==
'20'
&&
orderBean
.
audit_status
==
'10'
){
orderBean
.
live_status
=
params
.
audit_status
==
'20'
?
'20'
:
'30'
;
orderBean
.
audit_status
=
this
.
trim
(
params
.
audit_status
);
await
orderBean
.
save
();
return
system
.
getResult
(
orderBean
);
}
//如果更新的是生效的状态
if
(
params
.
live_status
&&
orderBean
.
pay_status
==
'20'
&&
orderBean
.
audit_status
==
'20'
&&
orderBean
==
'10'
){
orderBean
.
live_status
=
this
.
trim
(
params
.
live_status
);
await
orderBean
.
save
();
return
system
.
getResult
(
orderBean
);
}
return
system
.
getResult
(
null
,
`更新状态异常`
);
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/**
* fn:根据ID查询订单信息
* fn:根据ID查询订单信息
* @param params
* @param params
* @returns {Promise<void>}
* @returns {Promise<void>}
...
...
esign-sve-order/app/base/service/impl/eorder/eorderproductSve.js
View file @
e52c8cf9
...
@@ -25,6 +25,23 @@ class EorderproductSve extends ServiceBase {
...
@@ -25,6 +25,23 @@ class EorderproductSve extends ServiceBase {
}
}
}
}
/**
* fn:查看当前商户下所有的订单相关的产品(没有分页)
* @param params
* @returns {Promise<void>}
*/
async
listEorderProductByMerchantId
(
params
){
if
(
!
params
.
merchant_id
){
return
system
.
getResult
(
null
,
`参数错误 商户ID 不能为空`
);
}
let
list
=
await
this
.
dao
.
model
.
findAll
({
where
:{
merchant_id
:
this
.
trim
(
params
.
merchant
)
},
attributes
:[
'product_id'
]
});
return
system
.
getResult
(
list
);
}
}
}
module
.
exports
=
EorderproductSve
;
module
.
exports
=
EorderproductSve
;
\ 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