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
074a39de
Commit
074a39de
authored
May 26, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
77358bd1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
25 deletions
+23
-25
bpo-web/app/base/db/impl/econtractDao.js
+8
-8
bpo-web/app/base/service/impl/econtractSve.js
+15
-17
No files found.
bpo-web/app/base/db/impl/econtractDao.js
View file @
074a39de
...
@@ -77,24 +77,24 @@ class EcontractDao extends Dao {
...
@@ -77,24 +77,24 @@ class EcontractDao extends Dao {
return
rs
;
return
rs
;
}
}
async
countSignTimes
(
params
)
{
async
findSignedContractId
(
params
)
{
// idno, begin, end
// idno, begin, end
let
sql
=
[];
let
sql
=
[];
sql
.
push
(
"SELECT
COUNT(1) AS num
FROM `c_econtract` t1"
);
sql
.
push
(
"SELECT
t1.id
FROM `c_econtract` t1"
);
sql
.
push
(
"INNER JOIN `p_user_eaccount` t2 ON t1.`usereaccount_id` = t2.`id`"
);
sql
.
push
(
"INNER JOIN `p_user_eaccount` t2 ON t1.`usereaccount_id` = t2.`id`"
);
sql
.
push
(
"WHERE t2.`personsSign` = :idno"
);
sql
.
push
(
"WHERE t2.`personsSign` = :idno
AND t1.eflowstatus = '2'
"
);
if
(
params
.
begin
)
{
if
(
params
.
ecid
)
{
sql
.
push
(
"AND t1.`
created_at` >= :begin
"
);
sql
.
push
(
"AND t1.`
etemplate_id` = :ecid
"
);
}
}
if
(
params
.
end
)
{
if
(
params
.
today
)
{
sql
.
push
(
"AND t1.`
created_at` <= :begin
"
);
sql
.
push
(
"AND t1.`
end_at` >= :today AND t1.`begin_at` <= :today
"
);
}
}
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
let
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
if
(
!
list
||
list
.
length
==
0
)
{
if
(
!
list
||
list
.
length
==
0
)
{
return
0
;
return
0
;
}
}
return
list
[
0
].
num
||
0
;
return
list
[
0
].
id
||
0
;
}
}
}
}
...
...
bpo-web/app/base/service/impl/econtractSve.js
View file @
074a39de
...
@@ -1357,25 +1357,23 @@ class EcontractService extends ServiceBase {
...
@@ -1357,25 +1357,23 @@ class EcontractService extends ServiceBase {
}
}
// c_econtract
// c_econtract
var
econtract
=
await
this
.
dao
.
findOne
({
//
var econtract = await this.dao.findOne({
eflowstatus
:
'2'
,
//
eflowstatus: '2',
usereaccount_id
:
eaccount
.
id
,
//
usereaccount_id: eaccount.id,
etemplate_id
:
ecid
,
//
etemplate_id: ecid,
});
//
});
let
contractId
=
await
this
.
dao
.
findSignedContractId
({
idno
:
eaccount
.
personsSign
,
ecid
:
ecid
})
||
0
;
if
(
econtract
)
{
if
(
contractId
)
{
return
this
.
returnjson
(
0
,
"用户已经签约"
,
{
return
this
.
returnjson
(
0
,
"用户已经签约"
,
{
contractId
:
econtract
.
i
d
contractId
:
contractI
d
});
});
}
}
// let begin = moment().subtract(30, "days").format("YYYY-MM-DD HH:mm:ss");
let
begin
=
moment
().
subtract
(
30
,
"days"
).
format
(
"YYYY-MM-DD HH:mm:ss"
);
// if (times > 5) {
let
times
=
await
this
.
dao
.
countSignTimes
({
idno
:
eaccount
.
personsSign
,
begin
:
begin
})
||
0
;
// let timesMsg = `该用户[${eaccount.personsSign}]签约次数过多,30天内已经签约${times}次`;
if
(
times
>
5
)
{
// console.log(timesMsg);
let
timesMsg
=
`该用户[
${
eaccount
.
personsSign
}
]签约次数过多,30天内已经签约
${
times
}
次`
;
// return this.returnjson(-1, timesMsg);
console
.
log
(
timesMsg
);
// }
return
this
.
returnjson
(
-
1
,
timesMsg
);
}
// e签宝流程
// e签宝流程
if
(
isNeedCreate
)
{
if
(
isNeedCreate
)
{
...
@@ -1413,7 +1411,7 @@ class EcontractService extends ServiceBase {
...
@@ -1413,7 +1411,7 @@ class EcontractService extends ServiceBase {
}
}
// 创建合同 fileurl、esignUrl 怎么赋值????????????
// 创建合同 fileurl、esignUrl 怎么赋值????????????
econtract
=
{
let
econtract
=
{
name
:
ecompany
.
name
,
name
:
ecompany
.
name
,
eflowstatusname
:
"签约中"
,
eflowstatusname
:
"签约中"
,
eflowstatus
:
"1"
,
eflowstatus
:
"1"
,
...
...
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