Commit d3297dc5 authored by xixinzhao's avatar xixinzhao

修改根据登陆人获取机场人员信息

parent d4aff270
......@@ -223,7 +223,7 @@ public interface IOrgUsrService {
/**
* 获取登陆人关联机场单位人员信息,部门信息
*/
List<Map<String, Object>> getLoginUserDetails(AgencyUserModel user);
List<Map<String, Object>> getLoginUserDetails(String userId);
List<OrgUsr> getPersonListByParentId(Long id);
......
......@@ -402,10 +402,13 @@ public class OrgUsrController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/getLoginUserDetails", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取登陆人绑定的人员关系", notes = "获取登陆人绑定的人员关系")
public ResponseModel<List<Map<String, Object>>> getLoginUserDetails() {
// 获取登陆人角色
public ResponseModel<List<Map<String, Object>>> getLoginUserDetails(@RequestParam(value = "userId", required = false) String userId) {
AgencyUserModel user = getUserInfo();
List<Map<String, Object>> loginUserDetails = iOrgUsrService.getLoginUserDetails(user);
String userIds = userId;
if (StringUtils.isEmpty(userIds)) {
userIds = user.getUserId();
}
List<Map<String, Object>> loginUserDetails = iOrgUsrService.getLoginUserDetails(userIds);
return ResponseHelper.buildResponse(loginUserDetails);
}
......
......@@ -1348,10 +1348,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
public List<Map<String, Object>> getLoginUserDetails (AgencyUserModel user) {
public List<Map<String, Object>> getLoginUserDetails (String userId) {
// 获取登陆人关联账号
List<OrgUsr> orgUsrs = orgUsrList(user);
List<OrgUsr> orgUsrs = getUsrList(userId);
List<Map<String, Object>> list = new ArrayList<>();
if (!ObjectUtils.isEmpty(orgUsrs)) {
orgUsrs.forEach(orgUsr -> {
......@@ -1370,6 +1370,19 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return list;
}
/**
* 获取登陆人关联账号
*/
private List<OrgUsr> getUsrList(String userId) {
// 获取登陆人角色
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrgUsr::getIsDelete, false);
wrapper.eq(OrgUsr::getAmosOrgId, userId);
wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey());
List<OrgUsr> orgUsrList = this.baseMapper.selectList(wrapper);
return orgUsrList;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment