微服务情况下 emputils.get 有时候没有数据问题

This commit is contained in:
thinkgem
2022-11-02 16:36:51 +08:00
parent 7a33736d43
commit 4103bf1d6a

View File

@@ -55,7 +55,11 @@ public class EmpUtils {
*/
public static Employee get(User user){
if (user != null && User.USER_TYPE_EMPLOYEE.equals(user.getUserType())){
return user.getRefObj();
Employee employee = user.getRefObj();
if (employee == null) {
employee = Static.employeeService.get(user.getRefCode());
}
return employee;
}
return null;
}