|
|
@@ -9,6 +9,7 @@ import com.ningdatech.basic.exception.BizException; |
|
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
|
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; |
|
|
|
import com.ningdatech.pmapi.organization.model.entity.DingOrganization; |
|
|
|
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; |
|
|
|
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; |
|
|
|
import com.ningdatech.pmapi.sys.model.entity.Role; |
|
|
@@ -52,18 +53,28 @@ public class UserInfoManage { |
|
|
|
private final UserInfoHelper userInfoHelper; |
|
|
|
|
|
|
|
public PageVo<ResUserInfoListVO> list(ReqUserInfoListPO reqUserInfoListPO) { |
|
|
|
PageVo<ResUserInfoListVO> pageVo = new PageVo<>(); |
|
|
|
|
|
|
|
String phoneNo = reqUserInfoListPO.getPhoneNo(); |
|
|
|
String orgCode = reqUserInfoListPO.getOrgCode(); |
|
|
|
String name = reqUserInfoListPO.getName(); |
|
|
|
|
|
|
|
List<String> roleCompliantEmployeeCodeList = getRoleCompliantEmployeeCodeList(reqUserInfoListPO.getUserRoleList()); |
|
|
|
if (roleCompliantEmployeeCodeList != null && roleCompliantEmployeeCodeList.size() == 0) { |
|
|
|
return pageVo; |
|
|
|
} |
|
|
|
List<String> orgNameCompliantOrgCodeList = getOrgNameCompliantOrgCodeList(reqUserInfoListPO.getOrgName()); |
|
|
|
if (orgNameCompliantOrgCodeList != null && orgNameCompliantOrgCodeList.size() == 0) { |
|
|
|
return pageVo; |
|
|
|
} |
|
|
|
|
|
|
|
LambdaQueryWrapper<DingEmployeeInfo> wrapper = Wrappers.lambdaQuery(DingEmployeeInfo.class) |
|
|
|
.eq(DingEmployeeInfo::getMainJob, "true") |
|
|
|
.eq(StringUtils.isNotBlank(orgCode), DingEmployeeInfo::getOrganizationCode, orgCode) |
|
|
|
.like(StringUtils.isNotBlank(phoneNo), DingEmployeeInfo::getBindUserMobile, phoneNo) |
|
|
|
.like(StringUtils.isNotBlank(name), DingEmployeeInfo::getEmployeeName, name) |
|
|
|
.in(Objects.nonNull(roleCompliantEmployeeCodeList),DingEmployeeInfo::getEmployeeCode,roleCompliantEmployeeCodeList); |
|
|
|
.in(Objects.nonNull(roleCompliantEmployeeCodeList), DingEmployeeInfo::getEmployeeCode, roleCompliantEmployeeCodeList) |
|
|
|
.in(Objects.nonNull(orgNameCompliantOrgCodeList), DingEmployeeInfo::getOrganizationCode, orgNameCompliantOrgCodeList); |
|
|
|
|
|
|
|
Page<DingEmployeeInfo> page = iDingEmployeeInfoService.page(new Page<>(reqUserInfoListPO.getPageNumber(), reqUserInfoListPO.getPageSize()), wrapper); |
|
|
|
List<DingEmployeeInfo> records = page.getRecords(); |
|
|
@@ -109,12 +120,24 @@ public class UserInfoManage { |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
|
|
|
|
PageVo<ResUserInfoListVO> pageVo = new PageVo<>(); |
|
|
|
pageVo.setTotal(total); |
|
|
|
pageVo.setRecords(resUserInfoListVOList); |
|
|
|
return pageVo; |
|
|
|
} |
|
|
|
|
|
|
|
private List<String> getOrgNameCompliantOrgCodeList(String orgName) { |
|
|
|
if (StringUtils.isBlank(orgName)) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
List<DingOrganization> dingOrganizationList = iDingOrganizationService.list(Wrappers.lambdaQuery(DingOrganization.class) |
|
|
|
.like(DingOrganization::getOrganizationName, orgName)); |
|
|
|
|
|
|
|
List<String> orgCodeList = dingOrganizationList.stream() |
|
|
|
.map(DingOrganization::getOrganizationCode) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
return orgCodeList; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取符合查询条件的 用户 employeeCode |
|
|
|
* |
|
|
|