Browse Source

修改八大类筛选的入参字段名称

ldz 1 tuần trước cách đây
mục cha
commit
542c12bf4f

+ 5 - 5
alien-store/src/main/java/shop/alien/store/controller/StoreInfoController.java

@@ -831,7 +831,7 @@ public class StoreInfoController {
             @ApiImplicitParam(name = "distance", value = "距离范围(单位:公里)", dataType = "Double", paramType = "query"),
             @ApiImplicitParam(name = "sortType", value = "排序模式(1:智能排序,2:好评优先,3:距离优先)", dataType = "int", paramType = "query"),
             @ApiImplicitParam(name = "businessType", value = "店铺类型(KTV=3、洗浴汗蒸=4、按摩足浴=5,丽人美发=6,运动健身=7,酒吧=11)", dataType = "int", paramType = "query"),
-            @ApiImplicitParam(name = "dictId", value = "字典表id,根据此id查询经营板块、经营种类、分类并匹配店铺", dataType = "Integer", paramType = "query"),
+            @ApiImplicitParam(name = "categoryId", value = "字典表id,根据此id查询经营板块、经营种类、分类并匹配店铺", dataType = "Integer", paramType = "query"),
             @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "int", paramType = "query", required = true),
             @ApiImplicitParam(name = "pageSize", value = "页容", dataType = "int", paramType = "query", required = true)
     })
@@ -842,11 +842,11 @@ public class StoreInfoController {
             @RequestParam(value = "distance", required = false) Double distance,
             @RequestParam(value = "sortType", required = false, defaultValue = "1") Integer sortType,
             @RequestParam(value = "businessType", required = false) Integer businessType,
-            @RequestParam(value = "dictId", required = false) Integer dictId,
+            @RequestParam(value = "categoryId", required = false) Integer categoryId,
             @RequestParam(defaultValue = "1") int pageNum,
             @RequestParam(defaultValue = "10") int pageSize) {
-        log.info("StoreInfoController.getSpecialTypeStoresByDistance?lon={},lat={},distance={},sortType={},businessType={},dictId={},pageNum={},pageSize={}",
-                lon, lat, distance, sortType, businessType, dictId, pageNum, pageSize);
+        log.info("StoreInfoController.getSpecialTypeStoresByDistance?lon={},lat={},distance={},sortType={},businessType={},categoryId={},pageNum={},pageSize={}",
+                lon, lat, distance, sortType, businessType, categoryId, pageNum, pageSize);
 
         try {
             // 参数校验:经度范围 [-180, 180],纬度范围 [-90, 90]
@@ -867,7 +867,7 @@ public class StoreInfoController {
             }
 
             // 调用服务层获取筛选结果
-            IPage<StoreInfoVo> result = storeInfoService.getSpecialTypeStoresByDistance(lon, lat, distance, sortType, businessType, dictId, pageNum, pageSize);
+            IPage<StoreInfoVo> result = storeInfoService.getSpecialTypeStoresByDistance(lon, lat, distance, sortType, businessType, categoryId, pageNum, pageSize);
 
             // 记录响应日志
             log.info("四种类型店铺距离筛选响应 - 总记录数: {}, 当前页: {}, 页大小: {}",

+ 2 - 2
alien-store/src/main/java/shop/alien/store/service/StoreInfoService.java

@@ -315,12 +315,12 @@ public interface StoreInfoService extends IService<StoreInfo> {
      * @param distance    距离范围(单位:公里)
      * @param sortType    排序模式(1:智能排序,2:好评优先,3:距离优先)
      * @param businessType 店铺类型(KTV=3、洗浴汗蒸=4、按摩足浴=5,酒吧需要查询字典表),可选
-     * @param dictId 字典表id,根据此id查询经营板块、经营种类、分类并匹配店铺,可选
+     * @param categoryId 字典表id,根据此id查询经营板块、经营种类、分类并匹配店铺,可选
      * @param pageNum     页码
      * @param pageSize    页容
      * @return IPage<StoreInfoVo> 分页的门店信息列表
      */
-    IPage<StoreInfoVo> getSpecialTypeStoresByDistance(Double lon, Double lat, Double distance, Integer sortType, Integer businessType, Integer dictId, int pageNum, int pageSize);
+    IPage<StoreInfoVo> getSpecialTypeStoresByDistance(Double lon, Double lat, Double distance, Integer sortType, Integer businessType, Integer categoryId, int pageNum, int pageSize);
 
     /**
      * web端查询门店明细

+ 9 - 9
alien-store/src/main/java/shop/alien/store/service/impl/StoreInfoServiceImpl.java

@@ -2543,7 +2543,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
     }
 
     @Override
-    public IPage<StoreInfoVo> getSpecialTypeStoresByDistance(Double lon, Double lat, Double distance, Integer sortType, Integer businessType, Integer dictId, int pageNum, int pageSize) {
+    public IPage<StoreInfoVo> getSpecialTypeStoresByDistance(Double lon, Double lat, Double distance, Integer sortType, Integer businessType, Integer categoryId, int pageNum, int pageSize) {
         // 参数校验
         if (lon == null || lat == null) {
             throw new IllegalArgumentException("经纬度参数不能为空");
@@ -2575,11 +2575,11 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
         QueryWrapper<StoreInfoVo> queryWrapper = new QueryWrapper<>();
         
         // 如果传入了dictId,根据字典id查询经营板块、经营种类、分类并匹配店铺
-        if (dictId != null) {
-            // 根据dictId查询字典表记录
-            StoreDictionary dict = storeDictionaryMapper.selectById(dictId);
+        if (categoryId != null) {
+            // 根据categoryId查询字典表记录
+            StoreDictionary dict = storeDictionaryMapper.selectById(categoryId);
             if (dict == null || dict.getDeleteFlag() == 1) {
-                throw new IllegalArgumentException("字典id不存在或已删除: " + dictId);
+                throw new IllegalArgumentException("字典id不存在或已删除: " + categoryId);
             }
 
             String typeName = dict.getTypeName();
@@ -2599,7 +2599,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
                 // 2. 匹配business_section和business_types
                 StoreDictionary parentDict = storeDictionaryMapper.selectById(dict.getParentId());
                 if (parentDict == null || !"business_section".equals(parentDict.getTypeName())) {
-                    throw new IllegalArgumentException("经营种类的父级不是经营板块,dictId: " + dictId);
+                    throw new IllegalArgumentException("经营种类的父级不是经营板块,categoryId: " + categoryId);
                 }
 
                 try {
@@ -2617,12 +2617,12 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
                 // 3. 匹配business_section、business_types和business_classify
                 StoreDictionary parentDict = storeDictionaryMapper.selectById(dict.getParentId());
                 if (parentDict == null || !"business_type".equals(parentDict.getTypeName())) {
-                    throw new IllegalArgumentException("分类的父级不是经营种类,dictId: " + dictId);
+                    throw new IllegalArgumentException("分类的父级不是经营种类,categoryId: " + categoryId);
                 }
 
                 StoreDictionary grandParentDict = storeDictionaryMapper.selectById(parentDict.getParentId());
                 if (grandParentDict == null || !"business_section".equals(grandParentDict.getTypeName())) {
-                    throw new IllegalArgumentException("经营种类的父级不是经营板块,dictId: " + dictId);
+                    throw new IllegalArgumentException("经营种类的父级不是经营板块,categoryId: " + categoryId);
                 }
 
                 try {
@@ -2636,7 +2636,7 @@ public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo
                     throw new IllegalArgumentException("经营板块、经营种类或分类dictId格式错误");
                 }
             } else {
-                throw new IllegalArgumentException("不支持的字典类型: " + typeName + ", dictId: " + dictId);
+                throw new IllegalArgumentException("不支持的字典类型: " + typeName + ", categoryId: " + categoryId);
             }
         } else if (businessType != null) {
             // 如果指定了businessType,则根据传入的数值进行筛选