|
|
@@ -29,9 +29,8 @@ import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
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; |
|
|
|
|
|
|
|
/** |
|
|
@@ -58,6 +57,18 @@ public class UserInfoManage { |
|
|
|
long total = page.getTotal(); |
|
|
|
List<ResUserInfoListVO> resUserInfoListVOList = new ArrayList<>(); |
|
|
|
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() |
|
|
|
.map(r -> { |
|
|
|
ResUserInfoListVO resListVO = new ResUserInfoListVO(); |
|
|
@@ -65,10 +76,20 @@ public class UserInfoManage { |
|
|
|
resListVO.setOrgName(r.getOrganizationCode()); |
|
|
|
resListVO.setOrgCode(r.getOrganizationCode()); |
|
|
|
// TODO 从用户信息中获取 |
|
|
|
// resListVO.setPhoneNo(); |
|
|
|
|
|
|
|
// 从所属组织中获取 |
|
|
|
// 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()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
resListVO.setStatus(UserAvailableEnum.DISABLE.name()); |
|
|
|
} |
|
|
|
resListVO.setUpdateTime(r.getUpdateOn()); |
|
|
|
// 从用户信息中获取 |
|
|
|
resListVO.setUserId(1L); |
|
|
|