|
|
@@ -1,11 +1,8 @@
|
|
|
package org.dromara.server.consume.business;
|
|
|
|
|
|
-import cn.hutool.core.util.ObjectUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
-import org.dromara.backstage.api.RemoteCardService;
|
|
|
-import org.dromara.backstage.api.RemoteUserAccountService;
|
|
|
import org.dromara.backstage.api.domain.vo.RemoteCardVo;
|
|
|
import org.dromara.backstage.api.domain.vo.RemoteUserAccountVo;
|
|
|
import org.dromara.common.core.api.ReturnResult;
|
|
|
@@ -22,6 +19,8 @@ import org.dromara.system.api.domain.vo.RemoteDeptVo;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* @ClassName EmployeeBusiness
|
|
|
* @Description TODO
|
|
|
@@ -34,16 +33,15 @@ import org.springframework.stereotype.Service;
|
|
|
@Service
|
|
|
@RequiredArgsConstructor
|
|
|
public class EmployeeBusiness {
|
|
|
- @DubboReference
|
|
|
- private final RemoteUserAccountService remoteUserAccountService;
|
|
|
@DubboReference
|
|
|
private final RemoteDeptService remoteDeptService;
|
|
|
- @DubboReference
|
|
|
|
|
|
public ReturnResult getEmployeeVoByNumb(String userNumb) {
|
|
|
- RemoteUserAccountVo userAccountVo = remoteUserAccountService.getUserAccountVoByUserNumb(userNumb);
|
|
|
- // RemoteUserAccountVo userAccountVo = RedisUtils.getCacheMapValue(CacheNames);
|
|
|
- if (ObjectUtil.isEmpty(userAccountVo)) {
|
|
|
+ List<RemoteUserAccountVo> list = RedisUtils.getCacheList(CacheNames.PT_USER_ACCOUNT_LIST);
|
|
|
+ RemoteUserAccountVo userAccountVo = list.parallelStream()
|
|
|
+ .filter(p -> userNumb.equals(p.getUserNumb()))
|
|
|
+ .findFirst().orElse(null);
|
|
|
+ if (userAccountVo==null) {
|
|
|
ErrorResult result = new ErrorResult();
|
|
|
result.setStatusCode(HttpStatus.NOT_FOUND.value());
|
|
|
result.setMessage("获取用户信息失败");
|
|
|
@@ -52,7 +50,7 @@ public class EmployeeBusiness {
|
|
|
|
|
|
return ReturnResult.failure(ResultCodeEnum.DATA_NOT_FOUND, result);
|
|
|
}
|
|
|
- return ReturnResult.success(this.setReturnEmployeeVo(userAccountVo));
|
|
|
+ return ReturnResult.success(setReturnEmployeeVo(userAccountVo));
|
|
|
}
|
|
|
|
|
|
private Object setReturnEmployeeVo(RemoteUserAccountVo userAccountVo) {
|