Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
88659bda
Commit
88659bda
authored
Jul 27, 2023
by
xixinzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取登陆人所在公司某个角色的人
parent
fc9c8894
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
2 deletions
+47
-2
IProjectService.java
...oin/amos/boot/module/ugp/api/service/IProjectService.java
+10
-0
ProjectController.java
...mos/boot/module/ugp/biz/controller/ProjectController.java
+13
-0
ProjectServiceImpl.java
.../boot/module/ugp/biz/service/impl/ProjectServiceImpl.java
+24
-2
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IProjectService.java
View file @
88659bda
...
...
@@ -8,6 +8,9 @@ import com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
java.util.List
;
import
java.util.Map
;
/**
* 项目信息表接口类
*
...
...
@@ -17,4 +20,11 @@ import com.yeejoin.amos.boot.module.ugp.api.entity.Project;
public
interface
IProjectService
{
public
IPage
<
ProjectDto
>
queryProjectPage
(
String
current
,
String
size
,
Project
project
);
/**
* 查询登陆人所在公司某个角色的人
* @param roleId 角色id
* @return 用户
*/
List
<
Map
<
String
,
String
>>
queryUserByRoleId
(
String
roleId
);
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectController.java
View file @
88659bda
...
...
@@ -31,6 +31,7 @@ import com.yeejoin.amos.boot.module.ugp.api.service.IProcessRelationService;
import
com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.*
;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -903,5 +904,17 @@ public class ProjectController extends BaseController {
return
ResponseHelper
.
buildResponse
(
null
);
}
/**
* 根据角色获取平台用户
* @param roleId 角色id
* @return 用户
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/queryUserByRoleId"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询登陆人所在公司的某个角色的人"
,
notes
=
"查询登陆人所在公司的某个角色的人"
)
public
ResponseModel
<
List
<
Map
<
String
,
String
>>>
queryUserByRoleId
(
String
roleId
)
{
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
queryUserByRoleId
(
roleId
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProjectServiceImpl.java
View file @
88659bda
...
...
@@ -27,6 +27,7 @@ import com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -554,8 +555,6 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
return
page
;
}
public
List
<
ProjectDto
>
getPage
(
List
<
ProjectDto
>
projects
){
ArrayList
<
ProjectDto
>
list
=
Lists
.
newArrayList
();
for
(
ProjectDto
projectDto:
projects
){
...
...
@@ -984,4 +983,26 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
}
});
}
@Override
public
List
<
Map
<
String
,
String
>>
queryUserByRoleId
(
String
roleId
)
{
ReginParams
reginParams
=
orgService
.
getReginParams
();
String
companyId
=
String
.
valueOf
(
reginParams
.
getBusinessInfo
().
getCompanySequenceNbr
());
List
<
Map
<
String
,
String
>>
list
=
new
ArrayList
<>();
List
<
AgencyUserModel
>
agencyUserModelList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
roleId
,
null
,
null
).
getResult
();
if
(!
CollectionUtils
.
isEmpty
(
agencyUserModelList
))
{
agencyUserModelList
.
forEach
(
user
->
{
List
<
CompanyModel
>
companys
=
user
.
getCompanys
();
companys
.
forEach
(
companyModel
->
{
if
(
String
.
valueOf
(
companyModel
.
getSequenceNbr
()).
equals
(
companyId
))
{
Map
<
String
,
String
>
map
=
new
HashMap
<>(
2
);
map
.
put
(
"id"
,
String
.
valueOf
(
user
.
getSequenceNbr
()));
map
.
put
(
"userName"
,
user
.
getRealName
());
list
.
add
(
map
);
}
});
});
}
return
list
;
}
}
\ 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