|
|
@@ -810,4 +810,268 @@ public class StoreInfoController {
|
|
|
StoreInfoVo storeDetail = storeInfoService.getClientStoreDetail(id, userId, jingdu, weidu);
|
|
|
return R.data(storeDetail);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询四种类型店铺(酒吧、ktv、洗浴汗蒸、按摩足浴)并按距离筛选
|
|
|
+ *
|
|
|
+ * @param lon 经度
|
|
|
+ * @param lat 纬度
|
|
|
+ * @param distance 距离范围(单位:公里)
|
|
|
+ * @param sortType 排序模式(1:智能排序,2:好评优先,3:距离优先)
|
|
|
+ * @param businessType 店铺类型(KTV=3、洗浴汗蒸=4、按摩足浴=5,酒吧需要查询字典表),可选,如果指定则只查询该类型
|
|
|
+ * @param pageNum 页码
|
|
|
+ * @param pageSize 页容
|
|
|
+ * @return R<IPage<StoreInfoVo>> 分页的门店信息列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询四种类型店铺(酒吧、ktv、洗浴汗蒸、按摩足浴)并按距离筛选")
|
|
|
+ @ApiOperationSupport(order = 16)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "lon", value = "经度", dataType = "Double", paramType = "query", required = true),
|
|
|
+ @ApiImplicitParam(name = "lat", value = "纬度", dataType = "Double", paramType = "query", required = true),
|
|
|
+ @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 = "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)
|
|
|
+ })
|
|
|
+ @GetMapping("/getSpecialTypeStoresByDistance")
|
|
|
+ public R<IPage<StoreInfoVo>> getSpecialTypeStoresByDistance(
|
|
|
+ @RequestParam("lon") Double lon,
|
|
|
+ @RequestParam("lat") Double lat,
|
|
|
+ @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 = "categoryId", required = false) Integer categoryId,
|
|
|
+ @RequestParam(defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(defaultValue = "10") int 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]
|
|
|
+ if (lon == null || lat == null) {
|
|
|
+ return R.fail("经纬度参数不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 智能检测:如果参数可能传反了(lat超出范围但lon在范围内),给出提示
|
|
|
+ if (Math.abs(lat) > 90 && Math.abs(lon) <= 90) {
|
|
|
+ return R.fail(String.format("参数可能传反了!当前值: lon=%s, lat=%s。经度范围: [-180, 180],纬度范围: [-90, 90]。请检查参数顺序。", lon, lat));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (lon < -180 || lon > 180) {
|
|
|
+ return R.fail("经度参数超出有效范围 [-180, 180],当前值: " + lon);
|
|
|
+ }
|
|
|
+ if (lat < -90 || lat > 90) {
|
|
|
+ return R.fail("纬度参数超出有效范围 [-90, 90],当前值: " + lat);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 调用服务层获取筛选结果
|
|
|
+ IPage<StoreInfoVo> result = storeInfoService.getSpecialTypeStoresByDistance(lon, lat, distance, sortType, businessType, categoryId, pageNum, pageSize);
|
|
|
+
|
|
|
+ // 记录响应日志
|
|
|
+ log.info("四种类型店铺距离筛选响应 - 总记录数: {}, 当前页: {}, 页大小: {}",
|
|
|
+ result.getTotal(), result.getCurrent(), result.getSize());
|
|
|
+
|
|
|
+ return R.data(result);
|
|
|
+ } catch (IllegalArgumentException e) {
|
|
|
+ log.warn("四种类型店铺距离筛选参数错误: {}", e.getMessage());
|
|
|
+ return R.fail(e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("四种类型店铺距离筛选异常", e);
|
|
|
+ return R.fail("筛选失败,请稍后重试");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取休闲娱乐分类数据(主分类和子分类)
|
|
|
+ * 根据图片需求,返回层级结构的分类数据
|
|
|
+ *
|
|
|
+ * @return R<List<StoreDictionaryVo>> 分类列表,包含主分类和子分类
|
|
|
+ */
|
|
|
+ @ApiOperation("获取休闲娱乐分类数据(主分类和子分类)")
|
|
|
+ @ApiOperationSupport(order = 18)
|
|
|
+ @GetMapping("/getLeisureEntertainmentCategories")
|
|
|
+ public R<List<StoreDictionaryVo>> getLeisureEntertainmentCategories() {
|
|
|
+ log.info("StoreInfoController.getLeisureEntertainmentCategories");
|
|
|
+ try {
|
|
|
+ List<StoreDictionaryVo> result = storeInfoService.getLeisureEntertainmentCategories();
|
|
|
+ return R.data(result);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("获取休闲娱乐分类数据异常", e);
|
|
|
+ return R.fail("获取分类数据失败,请稍后重试");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取休闲娱乐分类数据(主分类和子分类)
|
|
|
+ * 根据图片需求,返回层级结构的分类数据
|
|
|
+ *getAllBusinessSection
|
|
|
+ * @return R<List<StoreDictionary>> 分类列表,包含主分类和子分类
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("获取所有经营板块以及子类")
|
|
|
+ @ApiOperationSupport(order = 18)
|
|
|
+ @GetMapping("/getAllBusinessSection")
|
|
|
+ public R<List<StoreDictionary>> queryBusinessSectionTree(
|
|
|
+ @ApiParam(value = "一级分类dictId,可选,如果传入则只返回该一级分类下的二级和三级分类", required = false)
|
|
|
+ @RequestParam(required = false) String businessSection) {
|
|
|
+ log.info("platformBusinessSection.queryBusinessSectionTree, businessSection={}", businessSection);
|
|
|
+
|
|
|
+ try {
|
|
|
+ List<StoreDictionary> result = storeInfoService.getAllBusinessSection(businessSection);
|
|
|
+ return R.data(result);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("获取休闲娱乐分类数据异常", e);
|
|
|
+ return R.fail("获取分类数据失败,请稍后重试");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 你可能还喜欢(推荐店铺)
|
|
|
+ * 根据一级分类、二级分类、三级分类进行店铺筛选
|
|
|
+ * 筛选顺序:先三级,然后二级,最后一级
|
|
|
+ *
|
|
|
+ * @param businessSection 一级分类(经营板块)
|
|
|
+ * @param businessTypes 二级分类(经营种类)
|
|
|
+ * @param businessClassify 三级分类(分类)
|
|
|
+ * @param lon 经度
|
|
|
+ * @param lat 纬度
|
|
|
+ * @return R<List<StoreInfoVo>> 店铺信息列表
|
|
|
+ */
|
|
|
+ @ApiOperation("你可能还喜欢(推荐店铺)")
|
|
|
+ @ApiOperationSupport(order = 19)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "businessSection", value = "一级分类(经营板块)", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "businessTypes", value = "二级分类(经营种类)", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "businessClassify", value = "三级分类(分类)", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "lon", value = "经度", dataType = "Double", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "lat", value = "纬度", dataType = "Double", paramType = "query")
|
|
|
+ })
|
|
|
+ @GetMapping("/getRecommendedStores")
|
|
|
+ public R<List<StoreInfoVo>> getRecommendedStores(
|
|
|
+ @RequestParam(value = "businessSection", required = true) String businessSection,
|
|
|
+ @RequestParam(value = "businessTypes", required = false) String businessTypes,
|
|
|
+ @RequestParam(value = "businessClassify", required = false) String businessClassify,
|
|
|
+ @RequestParam(value = "lon", required = false) Double lon,
|
|
|
+ @RequestParam(value = "lat", required = false) Double lat) {
|
|
|
+ log.info("StoreInfoController.getRecommendedStores?businessSection={},businessTypes={},businessClassify={},lon={},lat={}",
|
|
|
+ businessSection, businessTypes, businessClassify, lon, lat);
|
|
|
+ try {
|
|
|
+ List<StoreInfoVo> result = storeInfoService.getRecommendedStores(businessSection, businessTypes, businessClassify, lon, lat);
|
|
|
+ return R.data(result);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("获取推荐店铺异常", e);
|
|
|
+ return R.fail("获取推荐店铺失败,请稍后重试");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取banner图详情")
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
+ @GetMapping("/getBannerUrlInfo")
|
|
|
+ @ResponseBody
|
|
|
+ public R getBannerUrlInfo(@RequestParam("storeId") String storeId, @RequestParam("businessId") Integer businessId) {
|
|
|
+ log.info("StoreInfoController.getBannerUrlInfo?storeId={},businessId{}", storeId, businessId);
|
|
|
+
|
|
|
+ try {
|
|
|
+
|
|
|
+ return R.data(storeInfoService.getBannerUrlInfo(storeId, businessId));
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ log.error("StoreInfoController.getBannerUrlInfo ERROR Msg={}", e.getMessage(), e);
|
|
|
+
|
|
|
+ return R.fail("查询失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询两种类型店铺(丽人美发、运动健身)并按距离筛选
|
|
|
+ *
|
|
|
+ * @param lon 经度
|
|
|
+ * @param lat 纬度
|
|
|
+ * @param distance 距离范围(单位:公里)
|
|
|
+ * @param sortType 排序模式(1:智能排序,2:好评优先,3:距离优先)
|
|
|
+ * @param businessType 店铺类型(KTV=3、洗浴汗蒸=4、按摩足浴=5,丽人美发=6,运动健身=7),可选,如果指定则只查询该类型
|
|
|
+ * @param pageNum 页码
|
|
|
+ * @param pageSize 页容
|
|
|
+ * @return R<IPage<StoreInfoVo>> 分页的门店信息列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询四种类型店铺(丽人美发、运动健身)并按距离筛选")
|
|
|
+ @ApiOperationSupport(order = 16)
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "lon", value = "经度", dataType = "Double", paramType = "query", required = true),
|
|
|
+ @ApiImplicitParam(name = "lat", value = "纬度", dataType = "Double", paramType = "query", required = true),
|
|
|
+ @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 = "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)
|
|
|
+ })
|
|
|
+ @GetMapping("/getLifeServicesByDistance")
|
|
|
+ public R<IPage<StoreInfoVo>> getLifeServicesByDistance(
|
|
|
+ @RequestParam("lon") Double lon,
|
|
|
+ @RequestParam("lat") Double lat,
|
|
|
+ @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 = "categoryId", required = false) Integer categoryId,
|
|
|
+ @RequestParam(defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(defaultValue = "10") int pageSize) {
|
|
|
+ log.info("StoreInfoController.getLifeServicesByDistance?lon={},lat={},distance={},sortType={},businessType={},categoryId={},pageNum={},pageSize={}",
|
|
|
+ lon, lat, distance, sortType, businessType, categoryId, pageNum, pageSize);
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 参数校验:经度范围 [-180, 180],纬度范围 [-90, 90]
|
|
|
+ if (lon == null || lat == null) {
|
|
|
+ return R.fail("经纬度参数不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 智能检测:如果参数可能传反了(lat超出范围但lon在范围内),给出提示
|
|
|
+ if (Math.abs(lat) > 90 && Math.abs(lon) <= 90) {
|
|
|
+ return R.fail(String.format("参数可能传反了!当前值: lon=%s, lat=%s。经度范围: [-180, 180],纬度范围: [-90, 90]。请检查参数顺序。", lon, lat));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (lon < -180 || lon > 180) {
|
|
|
+ return R.fail("经度参数超出有效范围 [-180, 180],当前值: " + lon);
|
|
|
+ }
|
|
|
+ if (lat < -90 || lat > 90) {
|
|
|
+ return R.fail("纬度参数超出有效范围 [-90, 90],当前值: " + lat);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 调用服务层获取筛选结果
|
|
|
+ IPage<StoreInfoVo> result = storeInfoService.getLifeServicesByDistance(lon, lat, distance, sortType, businessType, categoryId, pageNum, pageSize);
|
|
|
+
|
|
|
+ // 记录响应日志
|
|
|
+ log.info("四种类型店铺距离筛选响应 - 总记录数: {}, 当前页: {}, 页大小: {}",
|
|
|
+ result.getTotal(), result.getCurrent(), result.getSize());
|
|
|
+
|
|
|
+ return R.data(result);
|
|
|
+ } catch (IllegalArgumentException e) {
|
|
|
+ log.warn("四种类型店铺距离筛选参数错误: {}", e.getMessage());
|
|
|
+ return R.fail(e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("四种类型店铺距离筛选异常", e);
|
|
|
+ return R.fail("筛选失败,请稍后重试");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|