Commit 3db0c41bf3667749fad2655f32ed436c9b3c7bcc

Authored by YunaiV
1 parent cfcf0dc1

feat:【mall】优化订单日志切面中的用户信息获取逻辑,同步 https://gitee.com/zhijiantianya/yudao-cloud/pulls/231/files

yudao-module-mall/yudao-module-trade/src/main/java/cn/iocoder/yudao/module/trade/framework/order/core/aop/TradeOrderLogAspect.java
... ... @@ -65,11 +65,17 @@ public class TradeOrderLogAspect {
65 65 public void doAfterReturning(JoinPoint joinPoint, TradeOrderLog orderLog) {
66 66 try {
67 67 // 1.1 操作用户
68   - Integer userType = getUserType();
69   - Long userId = getUserId();
  68 + Integer userType = USER_TYPE.get();
  69 + if (ObjectUtil.isNull(userType)) {
  70 + userType = getUserType();
  71 + }
  72 + Long userId = USER_ID.get();
  73 + if (ObjectUtil.isNull(userId)) {
  74 + userId = getUserId();
  75 + }
70 76 // 1.2 订单信息
71 77 Long orderId = ORDER_ID.get();
72   - if (orderId == null) { // 如果未设置,只有注解,说明不需要记录日志
  78 + if (ObjectUtil.isNull(orderId)) { // 如果未设置,只有注解,说明不需要记录日志
73 79 return;
74 80 }
75 81 Integer beforeStatus = BEFORE_STATUS.get();
... ... @@ -136,4 +142,4 @@ public class TradeOrderLogAspect {
136 142 EXTS.remove();
137 143 }
138 144  
139 145 -}
  146 +}
140 147 \ No newline at end of file
... ...