打印消息队列新增透传参数
This commit is contained in:
parent
37dc169607
commit
a0d9a1f591
|
|
@ -12,6 +12,7 @@ import org.springframework.security.core.Authentication;
|
|||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -57,6 +58,15 @@ public class SecurityUtils {
|
|||
return new JSONObject(new JSONObject(userDetails).get("user")).get("id", Long.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统用户nickName
|
||||
* @return 系统用户NickName
|
||||
*/
|
||||
public static String getCurrentUserNickName() {
|
||||
UserDetails userDetails = getCurrentUser();
|
||||
return new JSONObject(new JSONObject(userDetails).get("user")).get("nickName", String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户的数据权限
|
||||
* @return /
|
||||
|
|
|
|||
|
|
@ -9,4 +9,5 @@ public class CallNumPrintDTO {
|
|||
|
||||
private Long currentUserId;
|
||||
private String currentUserName;
|
||||
private String currentUserNickName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ public class RabbitMsgUtils implements RabbitTemplate.ConfirmCallback {
|
|||
try {
|
||||
printDTO.setCurrentUserId(SecurityUtils.getCurrentUserId());
|
||||
printDTO.setCurrentUserName(SecurityUtils.getCurrentUsername());
|
||||
printDTO.setCurrentUserNickName(SecurityUtils.getCurrentUserNickName());
|
||||
}catch (Exception e){
|
||||
log.error("获取当前用户信息失败", e);
|
||||
}
|
||||
|
|
@ -102,6 +103,7 @@ public class RabbitMsgUtils implements RabbitTemplate.ConfirmCallback {
|
|||
try {
|
||||
jsonObject.put("currentUserId", SecurityUtils.getCurrentUserId());
|
||||
jsonObject.put("currentUserName", SecurityUtils.getCurrentUsername());
|
||||
jsonObject.put("currentUserNickName", SecurityUtils.getCurrentUserNickName());
|
||||
}catch (Exception e){
|
||||
log.error("获取当前用户信息失败", e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue