瀏覽代碼

Merge remote-tracking branch 'origin/master'

master
niohe·erbao 1 年之前
父節點
當前提交
621e1c6e6c
共有 3 個檔案被更改,包括 31 行新增1 行删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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();


Loading…
取消
儲存