Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

tags/24080901
PoffyZhang 1 anno fa
parent
commit
fa1235410d
2 ha cambiato i file con 28 aggiunte e 7 eliminazioni
  1. +27
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java

+ 27
- 6
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java Vedi File

@@ -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,13 +76,23 @@ 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());
}
resListVO.setUserId(userInfo.getId());
} else {
resListVO.setStatus(UserAvailableEnum.DISABLE.name());
}
resListVO.setUpdateTime(r.getUpdateOn());
// 从用户信息中获取
resListVO.setUserId(1L);
resListVO.setEmployeeCode(r.getEmployeeCode());
resListVO.setUserRoleList(new ArrayList<>());
return resListVO;


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserInfoListVO.java Vedi File

@@ -41,7 +41,7 @@ public class ResUserInfoListVO {
private List<Role> userRoleList;

@ApiModelProperty("状态")
private Boolean status;
private String status;

@ApiModelProperty("更新时间")
private LocalDateTime updateTime;


Loading…
Annulla
Salva