From 109cbb50d48867083e1a2c746a7ebc3c95cf3569 Mon Sep 17 00:00:00 2001
From: zepengdev <lzpsmith@outlook.com>
Date: Thu, 26 Jun 2025 22:54:12 +0800
Subject: [PATCH] fix: 修正分页查询返回错误总数的问题

---
 oying-system/src/main/java/com/oying/modules/pc/store/domain/dto/StoreQueryCriteria.java |   33 ++++++++++++++-------------------
 1 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/oying-system/src/main/java/com/oying/modules/pc/store/domain/dto/StoreQueryCriteria.java b/oying-system/src/main/java/com/oying/modules/pc/store/domain/dto/StoreQueryCriteria.java
index ad86796..f2791d4 100644
--- a/oying-system/src/main/java/com/oying/modules/pc/store/domain/dto/StoreQueryCriteria.java
+++ b/oying-system/src/main/java/com/oying/modules/pc/store/domain/dto/StoreQueryCriteria.java
@@ -1,8 +1,7 @@
 package com.oying.modules.pc.store.domain.dto;
 
-import com.oying.utils.StringUtils;
-import lombok.Data;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import org.springframework.util.DigestUtils;
 
 import java.io.Serializable;
@@ -18,13 +17,13 @@
     @ApiModelProperty(value = "商户ID", example = "1")
     private Long merchantId;
 
-    private String storeName;
-
-    private Integer status;
-
     private Long storeId;
 
     private Long platformCategoryId;
+
+    private String storeName;
+
+    private Integer status;
 
     private String blurry;
 
@@ -44,19 +43,15 @@
 
     public String buildConditionCacheKey() {
         StringJoiner baseKeyJoiner = new StringJoiner("|");
-        if (platformCategoryId != null) {
-            baseKeyJoiner.add("platformCategoryId=" + platformCategoryId);
-        }
-        if (StringUtils.isNotEmpty(blurry)) {
-            baseKeyJoiner.add("blurry=" + blurry);
-        }
-        if (longitude != null && latitude != null) {
-            baseKeyJoiner.add("longitude=" + longitude);
-            baseKeyJoiner.add("latitude=" + latitude);
-        }
-        if (StringUtils.isNotEmpty(blurry)) {
-            baseKeyJoiner.add("radius=" + radius);
-        }
+        baseKeyJoiner.add("merchantId=" + merchantId);
+        baseKeyJoiner.add("storeId=" + storeId);
+        baseKeyJoiner.add("platformCategoryId=" + platformCategoryId);
+        baseKeyJoiner.add("storeName=" + storeName);
+        baseKeyJoiner.add("status=" + status);
+        baseKeyJoiner.add("blurry=" + blurry);
+        baseKeyJoiner.add("longitude=" + longitude);
+        baseKeyJoiner.add("latitude=" + latitude);
+        baseKeyJoiner.add("radius=" + radius);
         // 使用MD5或SHA缩短键长度
         return "store:search:page:" + DigestUtils.md5DigestAsHex(baseKeyJoiner.toString().getBytes());
     }

--
Gitblit v1.9.3