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
b79710d4
Commit
b79710d4
authored
Jan 17, 2020
by
王昆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
741c419c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
154 additions
and
19 deletions
+154
-19
bpo-web/app/base/api/impl/econtractApi.js
+27
-19
bpo-web/app/base/db/impl/etemplatebusiDao.js
+9
-0
bpo-web/app/base/db/models/etemplatebusi.js
+50
-0
bpo-web/app/base/service/impl/esettleSve.js
+19
-0
bpo-web/app/base/service/impl/etemplatebusiSve.js
+49
-0
No files found.
bpo-web/app/base/api/impl/econtractApi.js
View file @
b79710d4
...
...
@@ -19,6 +19,7 @@ class EcontractApi {
this
.
wxSve
=
system
.
getObject
(
"service.wxSve"
);
this
.
esettleSve
=
system
.
getObject
(
"service.esettleSve"
);
this
.
etemplatebusiSve
=
system
.
getObject
(
"service.etemplatebusiSve"
);
this
.
bankthreelogSve
=
system
.
getObject
(
"service.bankthreelogSve"
);
this
.
bankthreelog2Sve
=
system
.
getObject
(
"service.bankthreelog2Sve"
);
...
...
@@ -738,25 +739,32 @@ class EcontractApi {
if
(
!
param
.
idNo
)
{
return
this
.
returnjson
(
-
1
,
"请提供该用户身份证号"
)
}
// else {
// if (!await this.idcardClient.checkIDCard(param.idNo)) {
// return this.returnjson(-1, "身份证格式不正确");
// }
// let card = await this.idcardClient.cardInfo(param.idNo);
// let age = card.age || 0;
// if(!age) {
// return this.returnjson(-1, "身份证号格式错误, 只支持18位身份证号码");
// }
// if(card.sex == 'male') {
// if (age < 18 || age > 60) {
// return this.returnjson(-1, "签约失败,男限制18-60岁之间")
// }
// } else {
// if (age < 18 || age > 55) {
// return this.returnjson(-1, "签约失败,女限制18-55岁之间")
// }
// }
// }
if
(
!
await
this
.
idcardClient
.
checkIDCard
(
param
.
idNo
))
{
return
this
.
returnjson
(
-
1
,
"身份证格式不正确"
);
}
// TODO 赵庆测试
let
busiIds
=
await
etemplatebusiSve
.
busiIdsByTemplateId
(
param
.
ecid
);
let
num
=
await
this
.
esettleSve
.
isValidAge
(
busiIds
);
if
(
num
)
{
let
card
=
await
this
.
idcardClient
.
cardInfo
(
param
.
idNo
);
let
age
=
card
.
age
||
0
;
if
(
!
age
)
{
return
this
.
returnjson
(
-
1
,
"身份证号格式错误, 只支持18位身份证号码"
);
}
if
(
card
.
sex
==
'male'
)
{
if
(
age
<
18
||
age
>
60
)
{
return
this
.
returnjson
(
-
1
,
"签约失败,男限制18-60岁之间"
)
}
}
else
{
if
(
age
<
18
||
age
>
55
)
{
return
this
.
returnjson
(
-
1
,
"签约失败,女限制18-55岁之间"
)
}
}
}
// TODO END
if
(
!
param
.
bankno
)
{
return
this
.
returnjson
(
-
1
,
"请提供该用户银行卡号"
)
}
...
...
bpo-web/app/base/db/impl/etemplatebusiDao.js
0 → 100644
View file @
b79710d4
const
Dao
=
require
(
"../dao.base"
);
class
EtemplatebusiDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
EtemplatebusiDao
));
}
}
module
.
exports
=
EtemplatebusiDao
;
bpo-web/app/base/db/models/etemplatebusi.js
0 → 100644
View file @
b79710d4
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"etemplatebusi"
,
{
template_type
:
DataTypes
.
BIGINT
,
template_id
:
DataTypes
.
BIGINT
,
busi_id
:
DataTypes
.
BIGINT
,
busi_company_name
:
DataTypes
.
BIGINT
,
},{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'c_etemplate_busi'
,
validate
:
{
},
indexes
:[
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
bpo-web/app/base/service/impl/esettleSve.js
View file @
b79710d4
...
...
@@ -851,6 +851,24 @@ class EsettleService extends ServiceBase {
return
getTax
;
}
async
isValidAge
(
ids
)
{
if
(
!
ids
||
ids
.
length
==
0
)
{
return
0
;
}
let
sql
=
"SELECT COUNT(1) AS num FROM tbl_busi WHERE id IN (:ids) AND age_flag = 1 "
;
let
list
=
await
this
.
settledb
.
query
(
sql
.
join
(
" "
),
{
replacements
:
{
ids
:
ids
}});
if
(
list
&&
list
.
length
>
0
)
{
list
=
list
[
0
,
0
]
||
[];
if
(
!
list
||
list
.
length
==
0
)
{
return
0
;
}
return
list
[
0
].
num
||
0
;
}
return
0
;
}
}
module
.
exports
=
EsettleService
;
\ No newline at end of file
bpo-web/app/base/service/impl/etemplatebusiSve.js
0 → 100644
View file @
b79710d4
const
ServiceBase
=
require
(
"../sve.base"
);
class
EtemplatebusiService
extends
ServiceBase
{
constructor
()
{
super
(
ServiceBase
.
getDaoName
(
EtemplatebusiService
));
}
async
getlist
(
id
)
{
var
sql
=
"SELECT * FROM c_etemplate_busi WHERE template_id = "
+
id
;
var
page
=
await
this
.
customQuery
(
sql
);
return
page
;
}
async
busiIdsByTemplateId
(
id
)
{
var
sql
=
"SELECT busi_id FROM c_etemplate_busi WHERE template_id = "
+
id
;
var
list
=
await
this
.
customQuery
(
sql
);
let
rs
=
[];
if
(
!
list
||
list
.
length
==
0
)
{
return
rs
;
}
for
(
let
item
of
list
)
{
rs
.
push
(
item
.
busi_id
);
}
return
rs
;
}
async
getinfo
(
qobj
)
{
var
sql
=
"SELECT * FROM c_etemplate_busi WHERE template_id = "
+
qobj
.
template_id
+
" AND busi_id = "
+
qobj
.
company_id
;
var
page
=
await
this
.
customQuery
(
sql
);
return
page
;
}
async
deleteTetId
(
qobj
)
{
let
sql
=
"DELETE FROM c_etemplate_busi WHERE id = "
+
qobj
.
id
;
await
this
.
customExecAddOrPutSql
(
sql
);
return
1
;
}
async
suggest
(
name
,
ownerIds
)
{
return
await
this
.
dao
.
suggest
(
name
,
ownerIds
);
}
async
saveto
(
etebusi
)
{
return
await
this
.
create
(
etebusi
);
}
}
module
.
exports
=
EtemplatebusiService
;
\ 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