|
@@ -29,9 +29,8 @@ import org.springframework.stereotype.Component; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
import java.time.LocalDateTime; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
|
|
import java.util.function.Function; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@@ -58,6 +57,18 @@ public class UserInfoManage { |
|
|
long total = page.getTotal(); |
|
|
long total = page.getTotal(); |
|
|
List<ResUserInfoListVO> resUserInfoListVOList = new ArrayList<>(); |
|
|
List<ResUserInfoListVO> resUserInfoListVOList = new ArrayList<>(); |
|
|
if (records != null && records.size() > 0) { |
|
|
if (records != null && records.size() > 0) { |
|
|
|
|
|
List<String> employeeCodeList = records.stream().map(DingEmployeeInfo::getEmployeeCode) |
|
|
|
|
|
.distinct().collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
Map<String, UserInfo> employeeCodeAvailableMap = new HashMap<>(); |
|
|
|
|
|
if (CollUtil.isNotEmpty(employeeCodeList)) { |
|
|
|
|
|
employeeCodeAvailableMap = iUserInfoService.list(Wrappers.lambdaQuery(UserInfo.class) |
|
|
|
|
|
.in(UserInfo::getEmployeeCode,employeeCodeList)) |
|
|
|
|
|
.stream().collect(Collectors.toMap(UserInfo::getEmployeeCode, Function.identity())); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, UserInfo> finalEmployeeCodeAvailableMap = employeeCodeAvailableMap; |
|
|
resUserInfoListVOList = records.stream() |
|
|
resUserInfoListVOList = records.stream() |
|
|
.map(r -> { |
|
|
.map(r -> { |
|
|
ResUserInfoListVO resListVO = new ResUserInfoListVO(); |
|
|
ResUserInfoListVO resListVO = new ResUserInfoListVO(); |
|
@@ -65,13 +76,23 @@ public class UserInfoManage { |
|
|
resListVO.setOrgName(r.getOrganizationCode()); |
|
|
resListVO.setOrgName(r.getOrganizationCode()); |
|
|
resListVO.setOrgCode(r.getOrganizationCode()); |
|
|
resListVO.setOrgCode(r.getOrganizationCode()); |
|
|
// TODO 从用户信息中获取 |
|
|
// TODO 从用户信息中获取 |
|
|
// resListVO.setPhoneNo(); |
|
|
|
|
|
|
|
|
|
|
|
// 从所属组织中获取 |
|
|
// 从所属组织中获取 |
|
|
// resListVO.setRegionId(); |
|
|
// resListVO.setRegionId(); |
|
|
resListVO.setStatus(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UserInfo userInfo = finalEmployeeCodeAvailableMap.get(r.getEmployeeCode()); |
|
|
|
|
|
if (Objects.nonNull(userInfo)) { |
|
|
|
|
|
resListVO.setPhoneNo(userInfo.getMobile()); |
|
|
|
|
|
if (StringUtils.isNotBlank(userInfo.getAvailable()) |
|
|
|
|
|
&& UserAvailableEnum.ENABLE.name().equals(userInfo.getAvailable())) { |
|
|
|
|
|
resListVO.setStatus(UserAvailableEnum.ENABLE.name()); |
|
|
|
|
|
} |
|
|
|
|
|
resListVO.setUserId(userInfo.getId()); |
|
|
|
|
|
} else { |
|
|
|
|
|
resListVO.setStatus(UserAvailableEnum.DISABLE.name()); |
|
|
|
|
|
} |
|
|
resListVO.setUpdateTime(r.getUpdateOn()); |
|
|
resListVO.setUpdateTime(r.getUpdateOn()); |
|
|
// 从用户信息中获取 |
|
|
// 从用户信息中获取 |
|
|
resListVO.setUserId(1L); |
|
|
|
|
|
resListVO.setEmployeeCode(r.getEmployeeCode()); |
|
|
resListVO.setEmployeeCode(r.getEmployeeCode()); |
|
|
resListVO.setUserRoleList(new ArrayList<>()); |
|
|
resListVO.setUserRoleList(new ArrayList<>()); |
|
|
return resListVO; |
|
|
return resListVO; |
|
|