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
ee8a9911
Commit
ee8a9911
authored
Jul 06, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
da56d68d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
72 deletions
+90
-72
esign-sve-order/app/base/api/impl/op/action.js
+1
-1
esign-sve-order/app/base/db/impl/eorder/eorderDao.js
+59
-2
esign-sve-order/app/base/db/impl/eorder/eordersignlogDao.js
+0
-38
esign-sve-order/app/base/service/impl/eorder/eorderSve.js
+30
-0
esign-sve-order/app/base/service/impl/eorder/eordersignlogSve.js
+0
-31
No files found.
esign-sve-order/app/base/api/impl/op/action.js
View file @
ee8a9911
...
...
@@ -72,7 +72,7 @@ class ActionAPI extends APIBase {
opResult
=
await
this
.
eordersignlogSve
.
pageEorderSignLog
(
action_body
);
break
;
case
"pageEorderContract"
:
// 合同列表(分页)
opResult
=
await
this
.
eorder
signlog
Sve
.
pageEorderContract
(
action_body
);
opResult
=
await
this
.
eorderSve
.
pageEorderContract
(
action_body
);
break
;
case
"getMerchantLiveProduct"
:
// 查询商户下可用订单的产品
opResult
=
await
this
.
eorderSve
.
getMerchantLiveProduct
(
action_body
);
...
...
esign-sve-order/app/base/db/impl/eorder/eorderDao.js
View file @
ee8a9911
...
...
@@ -31,8 +31,11 @@ class EorderDao extends Dao{
if
(
params
.
merchant_name
){
sql
.
push
(
'and merchant_name=:merchant_name'
);
}
if
(
params
.
sign_id
){
sql
.
push
(
'and sign_id=:sign_id'
);
if
(
params
.
contract_id
){
sql
.
push
(
'and contract_id=:contract_id'
);
}
if
(
params
.
contract_name
){
sql
.
push
(
'and contract_name=:contract_name'
);
}
if
(
params
.
product_id
){
sql
.
push
(
'and product_id=:product_id'
);
...
...
@@ -129,5 +132,59 @@ class EorderDao extends Dao{
return
await
this
.
customQuery
(
sql
.
join
(
" "
),
{
merchant_id
:
merchant_id
});
}
/**
* fn: 合同列表(分页)
* @returns {Promise<void>}
*/
async
countEorderContract
(
params
){
}
/**
* 合同列表(分页)计数
* @param params
* @returns {Promise<*|*[]>}
*/
async
countEorderContract
(
params
){
let
sql
=
[];
sql
.
push
(
`SELECT count(1) as count`
);
sql
.
push
(
`FROM e_order 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
.
id
){
sql
.
push
(
'and id=:id'
);
}
if
(
params
.
product_id
){
sql
.
push
(
'and product_id=:product_id'
);
}
if
(
params
.
merchant_id
){
sql
.
push
(
'and merchant_id=:merchant_id'
);
}
if
(
params
.
contract_id
){
sql
.
push
(
'and contract_id=:contract_id'
);
}
}
async
PageeorderContract
(
params
){
let
sql
=
[];
sql
.
push
(
`select id,contract_id,contract_url,contract_name,merchant_id,merchant_name,live_start,live_end,created_at`
);
sql
.
push
(
`FROM e_order WHERE 1 = 1 `
)
this
.
setpageEorderContractParams
(
sql
,
params
);
sql
.
push
(
"ORDER BY created_at DESC"
);
sql
.
push
(
"LIMIT :startRow, :pageSize"
);
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
return
list
||
[];
}
}
module
.
exports
=
EorderDao
;
esign-sve-order/app/base/db/impl/eorder/eordersignlogDao.js
View file @
ee8a9911
...
...
@@ -85,45 +85,7 @@ 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'
);
}
if
(
params
.
product_id
){
sql
.
push
(
'and t1.product_id=:product_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,t2.contract_url `
);
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
);
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 @
ee8a9911
...
...
@@ -470,6 +470,35 @@ class EorderService 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
.
countEorderContract
(
params
);
if
(
listContract
.
count
==
0
){
return
system
.
getResult
({
count
:
0
,
rows
:
[]});
}
let
list
=
await
this
.
dao
.
PageeorderContract
(
params
);
if
(
!
list
||
list
.
length
==
0
){
return
system
.
getResult
({
count
:
0
,
rows
:
[]});
}
for
(
let
item
of
list
)
{
this
.
handleDate
(
item
,[
'created_at'
,
'live_start'
,
'live_end'
],
null
,
null
)
}
return
system
.
getResult
({
count
:
listContract
.
count
,
rows
:
list
});
}
catch
(
e
)
{
console
.
log
(
e
);
return
system
.
getResult
(
`系统错误`
);
}
}
}
module
.
exports
=
EorderService
;
\ No newline at end of file
esign-sve-order/app/base/service/impl/eorder/eordersignlogSve.js
View file @
ee8a9911
...
...
@@ -80,36 +80,6 @@ class EordersignlogService extends ServiceBase {
return
system
.
getResult
(
null
,
`系统错误`
);
}
}
/**
* 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'
,
'live_start'
,
'live_end'
],
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