|
@@ -66,6 +66,34 @@ public class UserInfoServiceImpl extends ServiceImpl<NdUserInfoMapper, UserInfo> |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@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) { |
|
|
public ProcessInstanceUserDto getUserInfo(String userId) { |
|
|
UserInfo userInfo = userInfoMapper.selectById(Long.valueOf(userId)); |
|
|
UserInfo userInfo = userInfoMapper.selectById(Long.valueOf(userId)); |
|
|
ProcessInstanceUserDto processInstanceUserDto = new ProcessInstanceUserDto(); |
|
|
ProcessInstanceUserDto processInstanceUserDto = new ProcessInstanceUserDto(); |
|
|