Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
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
8timerv2
8timerapiv200
Commits
ddfab24c
Commit
ddfab24c
authored
Jun 20, 2020
by
dengshichuan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dsc' into 'develop'
Dsc See merge request 8timerv2/8timerapiv200!238
parents
e2e63837
e9a4251b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
4 deletions
+53
-4
src/main/java/cn/timer/api/controller/qyzx/Auth.java
+18
-4
src/main/java/cn/timer/api/dto/qyzx/QyzxAuthDto.java
+35
-0
No files found.
src/main/java/cn/timer/api/controller/qyzx/Auth.java
View file @
ddfab24c
...
...
@@ -8,10 +8,11 @@
package
cn
.
timer
.
api
.
controller
.
qyzx
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -29,6 +30,7 @@ import cn.timer.api.bean.yggl.YgglMainEmp;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.config.enums.SysRoleType
;
import
cn.timer.api.dto.qyzx.QyzxAuthDto
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
io.swagger.annotations.Api
;
...
...
@@ -116,23 +118,35 @@ public class Auth {
@GetMapping
(
value
=
"/getAll"
)
@ApiOperation
(
value
=
"获取全部账号信息"
,
httpMethod
=
"GET"
,
notes
=
"接口发布说明"
)
public
Result
<
List
<
YgglMainEmp
>>
getAll
(
@CurrentUser
UserBean
userBean
)
{
public
Result
<
List
<
QyzxAuthDto
>>
getAll
(
@CurrentUser
UserBean
userBean
)
{
List
<
Integer
>
roles
=
new
ArrayList
<
Integer
>();
roles
.
add
(
SysRoleType
.
U_TYPE_ADMIN
.
getType
());
roles
.
add
(
SysRoleType
.
U_TYPE_C_ADMIN
.
getType
());
List
<
QyzxEmpEntAsso
>
list
=
QyzxEmpEntAsso
.
builder
().
build
().
selectList
(
new
LambdaQueryWrapper
<
QyzxEmpEntAsso
>().
eq
(
QyzxEmpEntAsso:
:
getOrgCode
,
userBean
.
getOrgCode
())
.
in
(
QyzxEmpEntAsso:
:
getUserType
,
roles
).
select
(
QyzxEmpEntAsso:
:
getEmpNum
));
List
<
YgglMainEmp
>
ygs
=
new
ArrayList
<
YgglMainEmp
>();
List
<
QyzxAuthDto
>
ygs
=
new
ArrayList
<
QyzxAuthDto
>();
List
<
Integer
>
empNums
=
list
.
stream
().
map
(
QyzxEmpEntAsso:
:
getEmpNum
).
collect
(
Collectors
.
toList
());
for
(
Integer
empNum
:
empNums
)
{
YgglMainEmp
yg
=
YgglMainEmp
.
builder
().
build
()
.
selectOne
(
new
LambdaQueryWrapper
<
YgglMainEmp
>().
eq
(
YgglMainEmp:
:
getOrgCode
,
userBean
.
getOrgCode
())
.
eq
(
YgglMainEmp:
:
getEmpNum
,
empNum
)
.
select
(
YgglMainEmp:
:
getName
,
YgglMainEmp:
:
getPhone
,
YgglMainEmp:
:
getEmpNum
));
QyzxEmpEntAsso
qyzxEmpEntAsso
=
QyzxEmpEntAsso
.
builder
().
build
()
.
selectOne
(
new
LambdaQueryWrapper
<
QyzxEmpEntAsso
>()
.
eq
(
QyzxEmpEntAsso:
:
getOrgCode
,
userBean
.
getOrgCode
()).
eq
(
QyzxEmpEntAsso:
:
getEmpNum
,
empNum
)
.
select
(
QyzxEmpEntAsso:
:
getUserType
));
QyzxAuthDto
dto
=
new
QyzxAuthDto
();
dto
.
setEmpNum
(
empNum
);
dto
.
setName
(
yg
.
getName
());
dto
.
setPhone
(
yg
.
getPhone
());
if
(
qyzxEmpEntAsso
!=
null
)
dto
.
setUserType
(
qyzxEmpEntAsso
.
getUserType
());
if
(
yg
!=
null
)
ygs
.
add
(
yg
);
ygs
.
add
(
dto
);
}
Collections
.
sort
(
ygs
,
Comparator
.
comparing
(
QyzxAuthDto:
:
getUserType
));
return
ResultUtil
.
data
(
ygs
,
"查询成功"
);
}
...
...
src/main/java/cn/timer/api/dto/qyzx/QyzxAuthDto.java
0 → 100644
View file @
ddfab24c
/**
* Title: QyzxAuthDto.java
* Description:
* @author dsc
* @date 2020年6月19日
* @version 1.0
*/
package
cn
.
timer
.
api
.
dto
.
qyzx
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* Title: QyzxAuthDto.java
*
* @Description:
* @author dsc
* @date 2020年6月19日
* @version 1.0
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
QyzxAuthDto
{
private
Integer
empNum
;
private
String
name
;
private
String
phone
;
private
Integer
userType
;
}
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