Kaynağa Gözat

修改日志输出,新增店铺ID

zc 2 ay önce
ebeveyn
işleme
b565e32476

+ 4 - 0
alien-entity/src/main/java/shop/alien/entity/storePlatform/StorePlatformOperationLog.java

@@ -55,6 +55,10 @@ public class StorePlatformOperationLog {
     @TableField("operator_name")
     private String operatorName;
 
+    @ApiModelProperty(value = "操作者店铺ID")
+    @TableField("store_id")
+    private Integer storeId;
+
     @ApiModelProperty(value = "用户类型")
     @TableField("user_type")
     private String userType;

+ 4 - 2
alien-store-platform/src/main/java/shop/alien/storeplatform/aspect/PlatformOperationLogAspect.java

@@ -33,7 +33,6 @@ import shop.alien.storeplatform.service.PlatformOperationLogService;
 import com.alibaba.fastjson.JSONObject;
 import shop.alien.storeplatform.service.StorePlatformRoleMenuService;
 import shop.alien.storeplatform.service.StorePlatformRoleQueryService;
-import shop.alien.storeplatform.service.StorePlatformRoleService;
 import shop.alien.storeplatform.util.LoginUserUtil;
 
 import javax.servlet.http.HttpServletRequest;
@@ -57,7 +56,6 @@ import java.util.stream.Collectors;
 public class PlatformOperationLogAspect {
 
     private final PlatformOperationLogService platformOperationLogService;
-    private final StorePlatformRoleService storePlatformRoleService;
     private final StorePlatformRoleMenuService storePlatformRoleMenuService;
     private final StorePlatformMenuMapper storePlatformMenuMapper;
     private final StoreUserMapper storeUserMapper;
@@ -149,6 +147,10 @@ public class PlatformOperationLogAspect {
                     name = userInfo.getString("name");
                 }
                 logRecord.setOperatorName(name);
+                Integer storeId = LoginUserUtil.getCurrentStoreId();
+                if (storeId != null) {
+                    logRecord.setStoreId(storeId);
+                }
                 String userType = userInfo.getString("userType");
                 logRecord.setUserType(StringUtils.hasText(userType) ? userType : "platform");
             }