Explorar el Código

Merge remote-tracking branch 'origin/master'

tags/24080901
niohe·erbao hace 1 año
padre
commit
621e1c6e6c
Se han modificado 3 ficheros con 31 adiciones y 1 borrados
  1. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/utils/BuildUserUtils.java
  2. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java
  3. +28
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/utils/BuildUserUtils.java Ver fichero

@@ -37,7 +37,7 @@ public class BuildUserUtils {
userSet.add(node.getUserId());
}
});
Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByIds(userSet);
Map<String, ProcessInstanceUserDto> userMap = userInfoService.getUserMapByEmployeeCode(userSet);
buildUser(progressInfo,userMap);
}
private void buildUser(List<ProgressNode> progressInfo, Map<String, ProcessInstanceUserDto> userMap) {


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/service/IUserInfoService.java Ver fichero

@@ -18,6 +18,8 @@ import java.util.Set;
public interface IUserInfoService extends IService<UserInfo> {
Map<String, ProcessInstanceUserDto> getUserMapByIds(Set<String> staterUsers);

Map<String, ProcessInstanceUserDto> getUserMapByEmployeeCode(Set<String> staterUsers);

ProcessInstanceUserDto getUserInfo(String userId);

UserInfo getUserInfoByPhoneNo(String phoneNo);


+ 28
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java Ver fichero

@@ -66,6 +66,34 @@ public class UserInfoServiceImpl extends ServiceImpl<NdUserInfoMapper, UserInfo>
}

@Override
public Map<String, ProcessInstanceUserDto> getUserMapByEmployeeCode(Set<String> staterUsers) {
List<UserInfo> userInfos = userInfoMapper.selectList(Wrappers.lambdaQuery(UserInfo.class)
.eq(UserInfo::getEmployeeCode,staterUsers));
return userInfos.stream().map(u -> {
ProcessInstanceUserDto userInfo = new ProcessInstanceUserDto();
userInfo.setUserId(String.valueOf(u.getId()));
userInfo.setUserName(u.getRealName());
Long accountId = u.getAccountId();
if (Objects.isNull(accountId)) {
throw new BizException("该用户没有录入浙政钉用户信息!");
}
// 根据浙政钉用户ID获取单位code
DingEmployeeInfo employeeInfo = dingEmployeeInfoService.getOne(Wrappers.lambdaQuery(DingEmployeeInfo.class)
.eq(DingEmployeeInfo::getAccountId, accountId)
.eq(DingEmployeeInfo::getMainJob, String.valueOf(Boolean.TRUE))
.last("limit 1"));
String organizationCode = employeeInfo.getOrganizationCode();
// 根据 单位code获取单位名称
DingOrganization dingOrganization = dingOrganizationService.getOne(Wrappers.lambdaQuery(DingOrganization.class)
.eq(DingOrganization::getOrganizationCode, organizationCode).last("limit 1"));
String organizationName = dingOrganization.getOrganizationName();
userInfo.setOrgCode(organizationCode);
userInfo.setOrgName(organizationName);
return userInfo;
}).collect(Collectors.toMap((ProcessInstanceUserDto::getUserId), v -> v));
}

@Override
public ProcessInstanceUserDto getUserInfo(String userId) {
UserInfo userInfo = userInfoMapper.selectById(Long.valueOf(userId));
ProcessInstanceUserDto processInstanceUserDto = new ProcessInstanceUserDto();


Cargando…
Cancelar
Guardar