From c1b9cc3a8feff6c7df0da8ebea6c8d959099fecc Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 30 Mar 2023 14:41:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?debug=20=E7=94=A8=E6=88=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/user/service/impl/UserInfoServiceImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java index 3c7c873..efb5f5a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java @@ -1,5 +1,6 @@ package com.ningdatech.pmapi.user.service.impl; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ningdatech.basic.exception.BizException; @@ -15,10 +16,7 @@ import lombok.RequiredArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; /** @@ -68,10 +66,13 @@ public class UserInfoServiceImpl extends ServiceImpl @Override public Map getUserMapByEmployeeCode(Set staterUsers) { List userInfos = userInfoMapper.selectList(Wrappers.lambdaQuery(UserInfo.class) - .eq(UserInfo::getEmployeeCode,staterUsers)); + .in(UserInfo::getEmployeeCode,staterUsers)); + if(CollUtil.isEmpty(userInfos)){ + return Collections.emptyMap(); + } return userInfos.stream().map(u -> { ProcessInstanceUserDto userInfo = new ProcessInstanceUserDto(); - userInfo.setUserId(String.valueOf(u.getId())); + userInfo.setUserId(String.valueOf(u.getEmployeeCode())); userInfo.setUserName(u.getRealName()); Long accountId = u.getAccountId(); if (Objects.isNull(accountId)) { From f515415a7b052d39a8b4b9148f10a0e4d497324a Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 30 Mar 2023 14:43:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?debug=20=E7=94=A8=E6=88=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java index efb5f5a..915d087 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/service/impl/UserInfoServiceImpl.java @@ -72,7 +72,7 @@ public class UserInfoServiceImpl extends ServiceImpl } return userInfos.stream().map(u -> { ProcessInstanceUserDto userInfo = new ProcessInstanceUserDto(); - userInfo.setUserId(String.valueOf(u.getEmployeeCode())); + userInfo.setUserId(u.getEmployeeCode()); userInfo.setUserName(u.getRealName()); Long accountId = u.getAccountId(); if (Objects.isNull(accountId)) {