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
021ae7d5
Commit
021ae7d5
authored
Jul 02, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
46fd01aa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
0 deletions
+106
-0
esign-sve-order/app/base/api/impl/op/action.js
+6
-0
esign-sve-order/app/base/db/impl/eorder/eordersignlogDao.js
+37
-0
esign-sve-order/app/base/service/impl/eorder/eorderSve.js
+33
-0
esign-sve-order/app/base/service/impl/eorder/eordersignlogSve.js
+30
-0
No files found.
esign-sve-order/app/base/api/impl/op/action.js
View file @
021ae7d5
...
...
@@ -44,6 +44,9 @@ class ActionAPI extends APIBase {
case
"updEorderStatus"
:
// 更改订单状态
opResult
=
await
this
.
eorderSve
.
updEorderStatus
(
action_body
);
break
;
case
"updOrderSimple"
:
// 更新订单(单表更新)
opResult
=
await
this
.
eorderSve
.
updOrderSimple
(
action_body
);
break
;
case
"getEorderById"
:
// 查看订单
opResult
=
await
this
.
eorderSve
.
getEorderById
(
action_body
);
break
;
...
...
@@ -68,6 +71,9 @@ class ActionAPI extends APIBase {
case
"pageEorderSignLog"
:
// 签约日志列表
opResult
=
await
this
.
eordersignlogSve
.
pageEorderSignLog
(
action_body
);
break
;
case
"pageEorderContract"
:
// 合同列表(分页)
opResult
=
await
this
.
eordersignlogSve
.
pageEorderContract
(
action_body
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
esign-sve-order/app/base/db/impl/eorder/eordersignlogDao.js
View file @
021ae7d5
...
...
@@ -82,5 +82,42 @@ class EordersignlogDao extends Dao{
}
}
/**
* 合同列表(分页)计数
* @param params
* @returns {Promise<*|*[]>}
*/
async
countEordersignlogContract
(
params
){
let
sql
=
[];
sql
.
push
(
`SELECT count(1) as count`
);
sql
.
push
(
`FROM e_order_sign_log t1 inner join e_order t2 on t2.id =t1.order_id WHERE 1 = 1 `
)
this
.
setpageEorderContractParams
(
sql
,
params
);
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
if
(
!
list
||
list
.
length
==
0
){
return
{
count
:
0
};
}
return
list
[
0
];
}
setpageEorderContractParams
(
sql
,
params
){
if
(
params
.
engine_contract_id
){
sql
.
push
(
'and t1.engine_contract_id=:engine_contract_id'
);
}
if
(
params
.
order_id
){
sql
.
push
(
'and t1.order_id=:order_id'
);
}
}
async
PageeordersignlogContract
(
params
){
let
sql
=
[];
sql
.
push
(
`SELECT t1.engine_contract_id,t1.engine_contract_name,t1.created_at,t2.live_start,t2.live_end,t2.merchant_name,t1.order_id `
);
sql
.
push
(
`FROM e_order_sign_log t1 inner join e_order t2 on t2.order_id =t1.id WHERE 1 = 1 `
)
this
.
setpageEorderContractParams
(
sql
,
params
);
sql
.
push
(
"ORDER BY t1.created_at DESC"
);
sql
.
push
(
"LIMIT :startRow, :pageSize"
);
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
return
list
||
[];
}
}
module
.
exports
=
EordersignlogDao
;
esign-sve-order/app/base/service/impl/eorder/eorderSve.js
View file @
021ae7d5
...
...
@@ -368,6 +368,39 @@ class EorderService extends ServiceBase {
}
}
}
/**
* fn:简单的单表更新
* @param params
* @returns {Promise<void>}
*/
async
updOrderSimple
(
params
){
if
(
!
params
.
id
){
return
system
.
getResult
(
null
,
`参数错误 订单ID 不能为空`
);
}
let
orderBean
=
await
this
.
dao
.
model
.
findOne
({
where
:{
id
:
this
.
trim
(
params
.
id
)
}
});
if
(
!
orderBean
){
return
system
.
getResult
(
null
,
`订单【
${
params
.
id
}
】不存在`
);
}
if
(
params
.
trade_id
){
orderBean
.
trade_id
=
this
.
trim
(
params
.
trade_id
);
}
try
{
await
orderBean
.
save
();
return
system
.
getResultSuccess
();
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
}
...
...
esign-sve-order/app/base/service/impl/eorder/eordersignlogSve.js
View file @
021ae7d5
...
...
@@ -81,6 +81,35 @@ class EordersignlogService extends ServiceBase {
}
}
/**
* fn: 合同列表(分页)
* @param params
* @returns {Promise<void>}
*/
async
pageEorderContract
(
params
){
try
{
params
.
currentPage
=
Number
(
params
.
currentPage
||
1
);
params
.
pageSize
=
Number
(
params
.
pageSize
||
10
);
params
.
startRow
=
(
params
.
currentPage
-
1
)
*
params
.
pageSize
;
let
listContract
=
await
this
.
dao
.
countEordersignlogContract
(
params
);
if
(
listContract
.
count
==
0
){
return
system
.
getResult
({
count
:
0
,
rows
:
[]});
}
let
list
=
await
this
.
dao
.
PageeordersignlogContract
(
params
);
if
(
!
list
||
list
.
length
==
0
){
return
system
.
getResult
({
count
:
0
,
rows
:
[]});
}
for
(
let
item
of
list
)
{
this
.
handleDate
(
item
,[
'created_at'
],
null
,
null
)
}
return
system
.
getResult
({
count
:
listContract
.
count
,
rows
:
list
});
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
`系统错误`
);
}
}
}
module
.
exports
=
EordersignlogService
;
\ 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