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
cf1c4a13
Commit
cf1c4a13
authored
May 09, 2020
by
zhaoxiqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
fa88f61a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
152 additions
and
17 deletions
+152
-17
bpo-admin/app/base/controller/impl/departmentCtl.js
+12
-0
bpo-admin/app/base/controller/impl/userCtl.js
+19
-10
bpo-admin/app/base/db/impl/connection.js
+8
-2
bpo-admin/app/base/db/impl/departmentDao.js
+22
-0
bpo-admin/app/base/db/metadata/bizs/wx76a324c5d201d1a4/users.js
+4
-0
bpo-admin/app/base/db/models/department.js
+48
-0
bpo-admin/app/base/db/models/user.js
+2
-2
bpo-admin/app/base/service/impl/departmentSve.js
+14
-0
bpo-admin/app/base/service/impl/userSve.js
+22
-2
bpo-admin/app/front/vues/pages/users/users.html
+1
-1
No files found.
bpo-admin/app/base/controller/impl/departmentCtl.js
0 → 100644
View file @
cf1c4a13
var
system
=
require
(
"../../system"
)
var
settings
=
require
(
"../../../config/settings"
);
const
CtlBase
=
require
(
"../ctl.base"
);
class
DepartmentCtl
extends
CtlBase
{
constructor
()
{
super
(
CtlBase
.
getServiceName
(
DepartmentCtl
));
}
}
module
.
exports
=
DepartmentCtl
;
bpo-admin/app/base/controller/impl/userCtl.js
View file @
cf1c4a13
...
...
@@ -21,6 +21,7 @@ class UserCtl extends CtlBase {
this
.
ejobapplySve
=
system
.
getObject
(
"service.ejobapplySve"
);
this
.
redisClient
=
system
.
getObject
(
"util.redisClient"
);
this
.
mailClient
=
system
.
getObject
(
"util.mailClient"
);
this
.
departmentSve
=
system
.
getObject
(
"service.departmentSve"
)
}
async
findAndCountAll
(
queryobj
,
obj
,
req
)
{
var
pageInfo
=
obj
.
pageInfo
||
{};
...
...
@@ -118,13 +119,13 @@ class UserCtl extends CtlBase {
async
getCurrentUser
(
qobj
,
pobj
,
req
)
{
var
userid
=
req
.
headers
.
referer
.
substr
(
req
.
headers
.
referer
.
indexOf
(
'userid'
)
+
7
);
// var accountInfo = await this.redisClient.get("yd_user_" + userid);
// var mobile = accountInfo.substr(accountInfo.indexOf('mobile') + 9,11);
// var name = accountInfo.substr(accountInfo.indexOf('userName') + 11,accountInfo.indexOf('mobile')-16);
// var personSign = accountInfo.substr(accountInfo.indexOf('personsSign') + 14,18);
// var bankno = accountInfo.substr(accountInfo.indexOf('bankno') + 9,16);
var
accountInfoJson
=
await
this
.
redisClient
.
get
(
"yd_user_"
+
userid
)
||
""
;
var
accountInfo
=
{};
if
(
accountInfoJson
)
{
...
...
@@ -141,7 +142,7 @@ class UserCtl extends CtlBase {
userName
:
name
,
bankno
:
bankno
,
}
var
result
=
{
status
:
0
,
message
:
"success"
,
...
...
@@ -154,7 +155,7 @@ class UserCtl extends CtlBase {
//return system.getResult2(req.session.user);
}
async
loginUser
(
qobj
,
pobj
,
req
)
{
var
u
=
await
super
.
findById
(
req
.
session
.
user
.
id
);
...
...
@@ -230,7 +231,7 @@ class UserCtl extends CtlBase {
var
name
=
accountInfo
.
userName
||
""
;
var
personSign
=
accountInfo
.
personsSign
||
""
;
var
bankno
=
accountInfo
.
bankno
||
""
;
if
(
openid
)
{
var
existedUser
=
await
this
.
service
.
getUserByOpenId
(
openid
,
appkey
);
if
(
existedUser
){
...
...
@@ -241,7 +242,7 @@ class UserCtl extends CtlBase {
content
:
"cookie丢失,urlParam从新load,"
+
JSON
.
stringify
(
req
.
query
)
+
",headers:"
+
JSON
.
stringify
(
req
.
headers
.
referer
),
clientIp
:
""
});
var
tmp
=
{
id
:
existedUser
.
id
,
userName
:
existedUser
.
userName
==
""
?
name
:
existedUser
.
userName
,
...
...
@@ -789,8 +790,8 @@ class UserCtl extends CtlBase {
});
}
}
async
loginyd2
(
req
)
{
try
{
//日志记录
...
...
@@ -1281,5 +1282,14 @@ class UserCtl extends CtlBase {
}
}
async
suggestByName
(
qobj
,
pobj
,
req
){
var
name
=
this
.
trim
(
qobj
.
name
);
if
(
!
name
)
{
return
system
.
getResult2
([])
}
var
list
=
await
this
.
departmentSve
.
suggestByName
(
name
);
return
system
.
getResult2
(
list
);
}
}
module
.
exports
=
UserCtl
;
\ No newline at end of file
module
.
exports
=
UserCtl
;
bpo-admin/app/base/db/impl/connection.js
View file @
cf1c4a13
...
...
@@ -70,6 +70,13 @@ class DbFactory {
constraints
:
false
,
});
this
.
db
.
models
.
user
.
belongsTo
(
this
.
db
.
models
.
department
,
{
constraints
:
false
,
});
this
.
db
.
models
.
department
.
hasMany
(
this
.
db
.
models
.
user
,
{
constraints
:
false
,
});
this
.
db
.
models
.
econtract
.
belongsTo
(
this
.
db
.
models
.
etemplate
,
{
constraints
:
false
,
});
...
...
@@ -119,4 +126,4 @@ class DbFactory {
}
}
module
.
exports
=
DbFactory
;
\ No newline at end of file
module
.
exports
=
DbFactory
;
bpo-admin/app/base/db/impl/departmentDao.js
0 → 100644
View file @
cf1c4a13
const
system
=
require
(
"../../system"
);
const
Dao
=
require
(
"../dao.base"
);
class
DepartmentDao
extends
Dao
{
constructor
()
{
super
(
Dao
.
getModelName
(
DepartmentDao
));
}
async
suggest
(
name
)
{
if
(
!
name
)
{
return
[];
}
var
sql
=
"SELECT id, name FROM `p_department` WHERE name LIKE :queryLike AND deleted_at IS NULL "
;
sql
=
sql
+
" ORDER BY id ASC "
;
var
list
=
await
this
.
customQuery
(
sql
,
{
queryLike
:
"%"
+
name
+
"%"
});
return
list
||
[];
}
}
module
.
exports
=
DepartmentDao
;
bpo-admin/app/base/db/metadata/bizs/wx76a324c5d201d1a4/users.js
View file @
cf1c4a13
...
...
@@ -5,6 +5,7 @@ module.exports={
{
"width"
:
"120"
,
"label"
:
"手机号"
,
"prop"
:
"mobile"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"100"
,
"label"
:
"昵称"
,
"prop"
:
"nickName"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"100"
,
"label"
:
"角色"
,
"prop"
:
"Roles"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"200"
,
"label"
:
"所属部门"
,
"prop"
:
"department.name"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"80"
,
"label"
:
"状态"
,
"prop"
:
"isEnabled"
,
"isShowTip"
:
true
,
"isTmpl"
:
false
},
{
"width"
:
"null"
,
"label"
:
"操作"
,
"name"
:
"null"
,
"isShowTip"
:
false
,
"isTmpl"
:
true
,
"isBtns"
:
true
},
]
...
...
@@ -20,6 +21,9 @@ module.exports={
{
"type"
:
"input"
,
"label"
:
"昵称"
,
"prop"
:
"nickName"
,
"placeHolder"
:
"昵称"
,
"style"
:
""
},
// {"type":"switch","label":"管理员","prop":"isAdmin","acText":"是管理员","inactText":"否","placeHolder":"请输入单次使用消耗的宝币数","style":""},
{
"type"
:
"select"
,
"label"
:
"角色"
,
"refModel"
:
"role"
,
"isMulti"
:
true
,
"prop"
:
"roles"
,
"labelField"
:
"name"
,
"valueField"
:
"id"
,
"style"
:
""
},
{
"type"
:
"select"
,
"label"
:
"部门"
,
"refModel"
:
"department"
,
"isMulti"
:
false
,
"label"
:
"部门"
,
"placeHolder"
:
"请选择"
,
"prop"
:
"department_id"
,
"labelField"
:
"name"
,
"valueField"
:
"id"
,
"style"
:
""
,
"rules"
:
[{
"required"
:
true
,
"message"
:
'请选择所属部门'
,
"trigger"
:
'blur'
}]},
]
},
],
...
...
bpo-admin/app/base/db/models/department.js
0 → 100644
View file @
cf1c4a13
const
system
=
require
(
"../../system"
);
const
settings
=
require
(
"../../../config/settings"
);
const
uiconfig
=
system
.
getUiConfig2
(
settings
.
wxconfig
.
appId
);
module
.
exports
=
(
db
,
DataTypes
)
=>
{
return
db
.
define
(
"department"
,
{
name
:
DataTypes
.
STRING
,
},
{
paranoid
:
true
,
//假的删除
underscored
:
true
,
version
:
true
,
freezeTableName
:
true
,
//freezeTableName: true,
// define the table's name
tableName
:
'p_department'
,
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-admin/app/base/db/models/user.js
View file @
cf1c4a13
...
...
@@ -53,6 +53,7 @@ module.exports = (db, DataTypes) => {
appId3rd
:
DataTypes
.
STRING
(
64
),
userCode3rd
:
DataTypes
.
STRING
(
64
),
branchCode3rd
:
DataTypes
.
STRING
(
64
),
department_id
:
DataTypes
.
INTEGER
,
},
{
paranoid
:
true
,
//假的删除
...
...
@@ -97,4 +98,4 @@ module.exports = (db, DataTypes) => {
// }
]
});
}
\ No newline at end of file
}
bpo-admin/app/base/service/impl/departmentSve.js
0 → 100644
View file @
cf1c4a13
const
system
=
require
(
"../../system"
);
const
ServiceBase
=
require
(
"../sve.base"
);
class
DepartmentService
extends
ServiceBase
{
constructor
()
{
super
(
ServiceBase
.
getDaoName
(
DepartmentService
));
}
async
suggestByName
(
name
){
return
await
this
.
dao
.
suggest
(
name
);
}
}
module
.
exports
=
DepartmentService
;
bpo-admin/app/base/service/impl/userSve.js
View file @
cf1c4a13
...
...
@@ -60,10 +60,31 @@ class UserService extends ServiceBase {
for
(
var
row
of
page
.
rows
)
{
// this.handleDate(row, ["pay_complete_time"], "YYYY-MM-DD", -8);
await
this
.
setRoles
(
page
.
rows
);
await
this
.
serDepartment
(
page
.
rows
)
}
}
return
page
;
}
async
serDepartment
(
list
){
if
(
!
list
||
list
.
length
==
0
)
{
return
;
}
var
deIds
=
[];
for
(
var
u
of
list
)
{
deIds
.
push
(
u
.
department_id
);
}
var
sql
=
[];
sql
.
push
(
'SELECT id,name FROM `p_department` WHERE id IN (:deIds)'
);
var
deList
=
await
this
.
dao
.
customQuery
(
sql
.
join
(
" "
),
{
deIds
:
deIds
})
||
[];
var
dmap
=
{};
for
(
var
de
of
deList
)
{
dmap
[
de
.
id
]
=
de
;
}
for
(
var
u
of
list
)
{
u
.
department
=
dmap
[
u
.
department_id
]
||
{};
}
}
async
setRoles
(
list
)
{
if
(
!
list
||
list
.
length
==
0
)
{
...
...
@@ -536,4 +557,4 @@ module.exports = UserService;
// console.log((result));
// }).catch(function(e){
// console.log(e);
// });
\ No newline at end of file
// });
bpo-admin/app/front/vues/pages/users/users.html
View file @
cf1c4a13
...
...
@@ -21,7 +21,7 @@
title=
"bpo结算公司权限"
:visible
.
sync=
"showBind"
width=
"570px"
>
<el-form
:model=
"companysForm"
ref=
"companysForm"
label-width=
"100px"
label=
"right"
>
<el-form-item
v-for=
"item in companysForm.bpoCompanyList"
...
...
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