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
59ae67bd
Commit
59ae67bd
authored
Dec 03, 2019
by
王昆
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xggsve-uc' of gitlab.gongsibao.com:jiangyong/zhichan into xggsve-uc
parents
0cec34cb
ea8dfdd3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
17 deletions
+51
-17
xggsve-uc/app/base/db/impl/user/userDao.js
+13
-6
xggsve-uc/app/base/service/impl/auth/authSve.js
+2
-1
xggsve-uc/app/base/service/impl/org/orgSve.js
+12
-7
xggsve-uc/app/base/service/impl/role/roleSve.js
+9
-3
xggsve-uc/app/base/service/impl/user/userSve.js
+15
-0
No files found.
xggsve-uc/app/base/db/impl/user/userDao.js
View file @
59ae67bd
...
...
@@ -62,6 +62,8 @@ class UserDao extends Dao {
sql
.
push
(
"INNER JOIN uc_user_info t2 ON t1.id = t2.id"
);
sql
.
push
(
"WHERE t1.deleted_at IS NULL"
);
this
.
setCondition
(
sql
,
params
);
var
list
=
await
this
.
customQuery
(
sql
.
join
(
" "
),
params
);
if
(
!
list
||
list
.
length
==
0
)
{
return
0
;
...
...
@@ -97,16 +99,16 @@ class UserDao extends Dao {
sql
.
push
(
"AND t1.saas_id = :saas_id"
);
}
if
(
params
.
ucname
Like
)
{
sql
.
push
(
"AND t1.ucname LIKE :ucname
Like
"
);
if
(
params
.
ucname
)
{
sql
.
push
(
"AND t1.ucname LIKE :ucname"
);
}
if
(
params
.
mobile
Like
)
{
sql
.
push
(
"AND t2.mobile LIKE :mobile
Like
"
);
if
(
params
.
mobile
)
{
sql
.
push
(
"AND t2.mobile LIKE :mobile"
);
}
if
(
params
.
realName
Like
)
{
sql
.
push
(
"AND t2.realName LIKE :realName
Like
"
);
if
(
params
.
realName
)
{
sql
.
push
(
"AND t2.realName LIKE :realName"
);
}
if
(
params
.
uctype
)
{
...
...
@@ -124,6 +126,10 @@ class UserDao extends Dao {
if
(
params
.
isEnabled
===
0
||
params
.
isEnabled
===
1
)
{
sql
.
push
(
"AND t1.isEnabled = :isEnabled"
);
}
if
(
params
.
orgpath
)
{
sql
.
push
(
"AND t1.orgpath LIKE :orgpath"
);
}
}
}
module
.
exports
=
UserDao
;
\ No newline at end of file
xggsve-uc/app/base/service/impl/auth/authSve.js
View file @
59ae67bd
...
...
@@ -76,6 +76,7 @@ class AuthService extends ServiceBase {
var
pmap
=
{};
for
(
var
item
of
all
)
{
item
.
label
=
item
.
name
;
var
list
=
pmap
[
item
.
pid
];
if
(
!
list
)
{
list
=
[];
...
...
@@ -85,7 +86,7 @@ class AuthService extends ServiceBase {
}
for
(
var
item
of
all
)
{
item
.
child
s
=
pmap
[
item
.
id
]
||
[];
item
.
child
ren
=
pmap
[
item
.
id
]
||
[];
}
return
system
.
getResultSuccess
(
pmap
[
0
][
0
]);
}
...
...
xggsve-uc/app/base/service/impl/org/orgSve.js
View file @
59ae67bd
...
...
@@ -220,8 +220,8 @@ class OrgService extends ServiceBase {
*/
async
listOrg
(
params
)
{
let
where
=
{};
let
pageIndex
=
params
.
pageIndex
||
1
;
let
pageSize
=
params
.
pageSize
||
10
;
let
pageIndex
=
Number
(
params
.
pageIndex
||
1
)
;
let
pageSize
=
Number
(
params
.
pageSize
||
10
)
;
if
(
params
.
orgname
)
{
where
.
orgname
=
this
.
trim
(
params
.
orgname
);
}
...
...
@@ -239,6 +239,10 @@ class OrgService extends ServiceBase {
}
try
{
let
orgList
=
await
this
.
getPageList
(
pageIndex
,
pageSize
,
where
);
for
(
let
item
of
orgList
.
rows
)
{
this
.
handleDate
(
item
,[
'created_at'
],
null
,
-
8
);
this
.
handleDate
(
item
,[
'updated_at'
],
null
,
-
8
);
}
return
system
.
getResult
(
orgList
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
...
...
@@ -250,9 +254,9 @@ class OrgService extends ServiceBase {
return
system
.
getResult
(
-
1
,
`参数错误 ID不能为空`
);
}
try
{
let
_org
=
await
this
.
findOne
({
id
:
this
.
trim
(
params
.
id
)
}
);
let
_org
=
await
this
.
dao
.
getById
(
this
.
trim
(
params
.
id
));
this
.
handleDate
(
_org
,[
'created_at'
],
null
,
-
8
);
this
.
handleDate
(
_org
,[
'updated_at'
],
null
,
-
8
);
return
system
.
getResult
(
_org
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
...
...
@@ -293,6 +297,7 @@ class OrgService extends ServiceBase {
var
all
=
await
this
.
dao
.
all
(
params
.
saas_id
);
var
pmap
=
{};
for
(
var
item
of
all
)
{
item
.
label
=
item
.
orgname
;
var
list
=
pmap
[
item
.
pid
];
if
(
!
list
)
{
list
=
[];
...
...
@@ -300,8 +305,8 @@ class OrgService extends ServiceBase {
list
.
push
(
item
);
pmap
[
item
.
pid
]
=
list
;
}
for
(
var
item
of
all
)
{
item
.
child
s
=
pmap
[
item
.
id
]
||
[];
for
(
var
item
of
all
)
{
item
.
child
ren
=
pmap
[
item
.
id
]
||
[];
}
return
system
.
getResult
(
pmap
[
0
]);
}
catch
(
error
)
{
...
...
xggsve-uc/app/base/service/impl/role/roleSve.js
View file @
59ae67bd
...
...
@@ -179,10 +179,12 @@ class RoleService extends ServiceBase {
if
(
!
params
.
id
){
return
system
.
getResult
(
-
1
,
`参数错误 ID不能为空`
);
}
let
_role
=
await
this
.
find
ById
(
this
.
trim
(
params
.
id
));
let
_role
=
await
this
.
dao
.
get
ById
(
this
.
trim
(
params
.
id
));
if
(
!
_role
){
return
system
.
getResult
(
-
1
,
`角色不存在`
);
}
this
.
handleDate
(
_role
,[
'created_at'
],
null
,
-
8
);
this
.
handleDate
(
_role
,[
'updated_at'
],
null
,
-
8
);
return
system
.
getResult
(
_role
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
...
...
@@ -195,8 +197,8 @@ class RoleService extends ServiceBase {
*/
async
listRole
(
params
)
{
let
where
=
{};
let
pageIndex
=
params
.
pageIndex
||
1
;
let
pageSize
=
params
.
pageSize
||
10
;
let
pageIndex
=
Number
(
params
.
pageIndex
||
1
)
;
let
pageSize
=
Number
(
params
.
pageSize
||
10
)
;
if
(
params
.
code
)
{
where
.
code
=
this
.
trim
(
params
.
code
);
}
...
...
@@ -208,6 +210,10 @@ class RoleService extends ServiceBase {
}
try
{
let
roleList
=
await
this
.
getPageList
(
pageIndex
,
pageSize
,
where
);
for
(
let
item
of
roleList
.
rows
)
{
this
.
handleDate
(
item
,[
'created_at'
],
null
,
-
8
);
this
.
handleDate
(
item
,[
'updated_at'
],
null
,
-
8
);
}
return
system
.
getResult
(
roleList
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
...
...
xggsve-uc/app/base/service/impl/user/userSve.js
View file @
59ae67bd
...
...
@@ -24,6 +24,18 @@ class UserService extends ServiceBase {
}
}
/**
* 根据path查询所有的用户
* @param {*} params
*/
async
apiQueryUserByPath
(
params
){
try
{
return
await
this
.
queryUserByPath
(
params
);
}
catch
(
error
)
{
return
system
.
getResult
(
-
1
,
`系统错误 错误信息
${
error
}
`
);
}
}
/**************************************************************** */
...
...
@@ -257,6 +269,9 @@ class UserService extends ServiceBase {
};
var
currentPage
=
Number
(
params
.
currentPage
||
1
);
var
pageSize
=
Number
(
params
.
pageSize
||
10
);
if
(
params
.
orgpath
)
{
params
.
orgpath
=
params
.
orgpath
+
"%"
;
}
var
total
=
await
this
.
dao
.
countByCondition
(
params
);
if
(
total
==
0
)
{
...
...
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