Forráskód Böngészése

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

zc 2 hónapja
szülő
commit
39474c0d19

+ 9 - 0
alien-store-platform/src/main/java/shop/alien/storeplatform/service/impl/PlatformOperationLogServiceImpl.java

@@ -10,8 +10,10 @@ import org.springframework.util.StringUtils;
 import shop.alien.entity.storePlatform.StorePlatformOperationLog;
 import shop.alien.mapper.StorePlatformOperationLogMapper;
 import shop.alien.storeplatform.service.PlatformOperationLogService;
+import shop.alien.storeplatform.util.LoginUserUtil;
 
 import java.util.Date;
+import java.util.Collections;
 
 /**
  * 平台操作记录服务实现类
@@ -38,7 +40,14 @@ public class PlatformOperationLogServiceImpl implements PlatformOperationLogServ
     @Override
     public IPage<StorePlatformOperationLog> getOperationLogPage(int page, int size, String module, String account, Date startTime, Date endTime) {
         Page<StorePlatformOperationLog> pageInfo = new Page<>(page, size);
+        Integer storeId = LoginUserUtil.getCurrentStoreId();
+        if (storeId == null) {
+            pageInfo.setRecords(Collections.emptyList());
+            pageInfo.setTotal(0);
+            return pageInfo;
+        }
         LambdaQueryWrapper<StorePlatformOperationLog> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(StorePlatformOperationLog::getStoreId, storeId);
         if (StringUtils.hasText(module)) {
             wrapper.eq(StorePlatformOperationLog::getOperationModule, module);
         }