|
|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import io.swagger.annotations.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartRequest;
|
|
|
@@ -15,17 +16,13 @@ import shop.alien.entity.store.*;
|
|
|
import shop.alien.entity.store.dto.StoreInfoDto;
|
|
|
import shop.alien.entity.store.vo.*;
|
|
|
import shop.alien.entity.storePlatform.StoreLicenseHistory;
|
|
|
-import shop.alien.mapper.StoreCommentSummaryInterestMapper;
|
|
|
-import shop.alien.mapper.TagsMainMapper;
|
|
|
-import shop.alien.mapper.WebAuditMapper;
|
|
|
+import shop.alien.mapper.*;
|
|
|
import shop.alien.mapper.storePlantform.StoreLicenseHistoryMapper;
|
|
|
import shop.alien.store.config.BaseRedisService;
|
|
|
import shop.alien.store.service.StoreInfoService;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 二期-门店信息Controller
|
|
|
@@ -55,6 +52,10 @@ public class StoreInfoController {
|
|
|
/** 商户证照历史记录数据访问对象 */
|
|
|
private final StoreLicenseHistoryMapper licenseHistoryMapper;
|
|
|
|
|
|
+ private final StoreImgMapper storeImgMapper;
|
|
|
+
|
|
|
+ private final StoreCommentMapper storeCommentMapper;
|
|
|
+
|
|
|
@ApiOperation("获取所有门店")
|
|
|
@ApiOperationSupport(order = 1)
|
|
|
@GetMapping("/getAll")
|
|
|
@@ -100,6 +101,7 @@ public class StoreInfoController {
|
|
|
return R.fail("失败");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@ApiOperation("新增门店草稿")
|
|
|
@ApiOperationSupport(order = 3)
|
|
|
@PostMapping("/saveStoreInfoDraft")
|
|
|
@@ -392,6 +394,24 @@ public class StoreInfoController {
|
|
|
return R.data(storeDetail);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "获取门店代金券明细")
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
+ @GetMapping("/getStoreCouponList")
|
|
|
+ @ResponseBody
|
|
|
+ public R getStoreCouponList(@RequestParam("storeId") String storeId) {
|
|
|
+ log.info("StoreInfoController.getStoreCouponList?storeId={}", storeId);
|
|
|
+ CouponAndEventVo couponAndEventVo = new CouponAndEventVo();
|
|
|
+ List<LifeCouponVo> lifeCouponVos = storeInfoService.getStoreCouponList(storeId);
|
|
|
+
|
|
|
+ List<StoreImg> storeImgs = storeInfoService.getBannerUrl(storeId);
|
|
|
+ couponAndEventVo.setCouponList(lifeCouponVos);
|
|
|
+ if (CollectionUtils.isNotEmpty(storeImgs)) {
|
|
|
+ couponAndEventVo.setMarketingList(storeImgs);
|
|
|
+ }
|
|
|
+ couponAndEventVo.setMarketingList(storeImgs);
|
|
|
+ return R.data(couponAndEventVo);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "web端审批店铺")
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
@GetMapping("/approveStoreInfo")
|
|
|
@@ -402,6 +422,28 @@ public class StoreInfoController {
|
|
|
return R.success("审批完成");
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "中台web端获取店铺明细详情")
|
|
|
+ @ApiOperationSupport(order = 21)
|
|
|
+ @GetMapping("/getNewStoreDetail")
|
|
|
+ @ResponseBody
|
|
|
+ public R getNewStoreDetail(@RequestParam("id") String id) {
|
|
|
+ log.info("StoreInfoController.getStoreDetail?id={}", id);
|
|
|
+ StoreInfoVo storeDetail = storeInfoService.getNewStoreDetail(id);
|
|
|
+ return R.data(storeDetail);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("新中台web端修改门店")
|
|
|
+ @ApiOperationSupport(order = 22)
|
|
|
+ @PostMapping("/editNewStoreInfo")
|
|
|
+ public R editNewStoreInfo(@RequestBody StoreInfoDto storeInfoDto) {
|
|
|
+ log.info("StoreInfoController.editStoreInfo?storeInfoDto={}", storeInfoDto);
|
|
|
+ StoreInfoVo storeInfoVo = storeInfoService.editNewStoreInfo(storeInfoDto);
|
|
|
+ if (storeInfoVo != null) {
|
|
|
+ return R.data(storeInfoVo);
|
|
|
+ }
|
|
|
+ return R.fail("失败");
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "web端导出店铺信息")
|
|
|
@ApiOperationSupport(order = 6)
|
|
|
@GetMapping("/exportExcel")
|
|
|
@@ -728,13 +770,53 @@ public class StoreInfoController {
|
|
|
|
|
|
@ApiOperation(value = "AI服务-门店评价标签")
|
|
|
@GetMapping("/getStoreEvaluateTags")
|
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "storeId", value = "门店id", dataType = "int", paramType = "query")})
|
|
|
- public R<List<TagsMainVo>> getStoreEvaluateTags(int storeId) {
|
|
|
- log.info("StoreInfoController.getStoreEvaluateTags?storeId={}", storeId);
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "storeId", value = "门店id", dataType = "int", paramType = "query", required = true)
|
|
|
+ })
|
|
|
+ public R<Map<String,Object>> getStoreEvaluateTags(@RequestParam("storeId") int storeId) {
|
|
|
+ log.info("StoreInfoController.getStoreEvaluateTags?storeId={}, tagType={}", storeId);
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
List<TagsMainVo> voList = tagsMainMapper.getStoreEvaluateTags(storeId);
|
|
|
- return R.data(voList);
|
|
|
+ if(voList !=null && voList.size()>0){
|
|
|
+ StoreCommentVo storeComment = storeCommentMapper.getCommentOneInfo(storeId);
|
|
|
+ if(storeComment!=null){
|
|
|
+ if(storeComment.getImgId()!=null){
|
|
|
+ List<String> imgIds = Arrays.asList(storeComment.getImgId().split(","));
|
|
|
+ List<StoreImg> storeImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().in(StoreImg::getId, imgIds));
|
|
|
+ storeComment.setImgList(storeImgs);
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<StoreComment> lambdaQueryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper1.eq(StoreComment :: getStoreId, storeId);
|
|
|
+ lambdaQueryWrapper1.eq(StoreComment :: getBusinessType, 5);
|
|
|
+ lambdaQueryWrapper1.eq(StoreComment :: getDeleteFlag, 0);
|
|
|
+ Integer commitCount = storeCommentMapper.selectCount(lambdaQueryWrapper1);
|
|
|
+ map.put("commitCount",commitCount);
|
|
|
+ }
|
|
|
+ map.put("tag",voList);
|
|
|
+ map.put("evaluate",storeComment);
|
|
|
+ }
|
|
|
+ return R.data(map);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "AI服务-门店评价标签下评价")
|
|
|
+ @GetMapping("/getStoreEvaluateTagsList")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "mainId", value = "标签id", dataType = "int", paramType = "query", required = true)
|
|
|
+ })
|
|
|
+ public R<List<StoreCommentVo>> getStoreEvaluateTagsList(@RequestParam("mainId") int mainId) {
|
|
|
+ log.info("StoreInfoController.getStoreEvaluateTagsList?mainId={}", mainId);
|
|
|
+ List<StoreCommentVo> list = tagsMainMapper.getstoreCommentList(mainId);
|
|
|
+ if(list!=null && list.size()>0){
|
|
|
+ for(int i = 0; i<list.size(); i++){
|
|
|
+ if(list.get(i).getImgId()!=null){
|
|
|
+ List<String> imgIds = Arrays.asList(list.get(i).getImgId().split(","));
|
|
|
+ List<StoreImg> storeImgs = storeImgMapper.selectList(new LambdaQueryWrapper<StoreImg>().in(StoreImg::getId, imgIds));
|
|
|
+ list.get(i).setImgList(storeImgs);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.data(list);
|
|
|
+ }
|
|
|
@ApiOperation(value = "AI服务-门店趣味信息")
|
|
|
@GetMapping("/getStoreInterestInfo")
|
|
|
@ApiImplicitParams({
|
|
|
@@ -760,25 +842,337 @@ public class StoreInfoController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "更多推荐(用户端)")
|
|
|
+ @GetMapping("/getMoreRecommendedStores")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "lon", value = "经度", dataType = "double", paramType = "query", required = true),
|
|
|
+ @ApiImplicitParam(name = "lat", value = "纬度", dataType = "double", paramType = "query", required = true),
|
|
|
+ @ApiImplicitParam(name = "businessSection", value = "经营板块", dataType = "String", paramType = "query", required = true),
|
|
|
+ @ApiImplicitParam(name = "businessTypes", value = "经营分类", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "businessClassify", value = "分类", dataType = "String", paramType = "query")
|
|
|
+ })
|
|
|
+ public R<List<StoreInfoVo>> getMoreRecommendedStores(Double lon , Double lat, String businessSection, String businessTypes, String businessClassify) {
|
|
|
+ log.info("StoreInfoController.getMoreRecommendedStores?lon={},lat={},businessSection={},businessTypes={},businessClassify={}", lon,lat, businessSection, businessTypes, businessClassify);
|
|
|
+ return R.data(storeInfoService.getMoreRecommendedStores(lon,lat, businessSection, businessTypes, businessClassify));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "AI服务-门头识别")
|
|
|
@ApiOperationSupport(order = 16)
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "storeUserId", value = "门店用户id", dataType = "String", paramType = "query", required = true),
|
|
|
- @ApiImplicitParam(name = "imageUrl", value = "图片URL", dataType = "String", paramType = "query", required = true)
|
|
|
+ @ApiImplicitParam(name = "imageUrl", value = "图片URL", dataType = "String", paramType = "query", required = true),
|
|
|
+ @ApiImplicitParam(name = "merchantName", value = "门店名称", dataType = "String", paramType = "query", required = true)
|
|
|
})
|
|
|
@GetMapping("/getStoreOcrData")
|
|
|
- public R<Map<String, Object>> getStoreOcrData(@RequestParam("storeUserId") String storeUserId,
|
|
|
- @RequestParam("imageUrl") String imageUrl) {
|
|
|
- log.info("StoreInfoController.getStoreOcrData?storeId={},imageUrl={}", storeUserId, imageUrl);
|
|
|
- if (storeUserId == null || storeUserId.trim().isEmpty() || imageUrl == null || imageUrl.trim().isEmpty()) {
|
|
|
- return R.fail("门店ID与图片URL不能为空");
|
|
|
+ public R<Map<String, Object>> getStoreOcrData(@RequestParam("imageUrl") String imageUrl,
|
|
|
+ @RequestParam("merchantName") String merchantName) {
|
|
|
+ log.info("StoreInfoController.getStoreOcrData?imageUrl={},merchantName{}", imageUrl, merchantName);
|
|
|
+ if (merchantName == null || merchantName.trim().isEmpty() || imageUrl == null || imageUrl.trim().isEmpty()) {
|
|
|
+ return R.fail("门店名称与图片URL不能为空");
|
|
|
}
|
|
|
Map<String, Object> ocrData = null;
|
|
|
try {
|
|
|
- ocrData = storeInfoService.getStoreOcrData(storeUserId, imageUrl);
|
|
|
+ ocrData = storeInfoService.getStoreOcrData(imageUrl, merchantName);
|
|
|
} catch (Exception e) {
|
|
|
return R.fail("未查询到OCR识别数据");
|
|
|
}
|
|
|
return R.data(ocrData);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取店铺详情(用户端)")
|
|
|
+ @ApiOperationSupport(order = 17)
|
|
|
+ @GetMapping("/getClientStoreDetail")
|
|
|
+ @ResponseBody
|
|
|
+ public R getClientStoreDetail(@RequestParam("id") String id,
|
|
|
+ @RequestParam(value = "userId", required = false) String userId,
|
|
|
+ @RequestParam(value = "jingdu", required = false) String jingdu,
|
|
|
+ @RequestParam(value = "weidu", required = false) String weidu) {
|
|
|
+ log.info("StoreInfoController.getClientStoreDetail?id={},userId={},jingdu={},weidu={}", id, jingdu, weidu);
|
|
|
+ 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 = "storeName", value = "店铺名称(模糊查询)", dataType = "String", paramType = "query"),
|
|
|
+ @ApiImplicitParam(name = "storeType", value = "美食3 休闲娱乐1 健身2 ", dataType = "int", 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(value = "storeName", required = false) String storeName,
|
|
|
+ @RequestParam(value = "storeType", required = false) Integer storeType,
|
|
|
+ @RequestParam(defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(defaultValue = "10") int pageSize) {
|
|
|
+ log.info("StoreInfoController.getSpecialTypeStoresByDistance?lon={},lat={},distance={},sortType={},businessType={},categoryId={},storeName={},storeType{},pageNum={},pageSize={}",
|
|
|
+ lon, lat, distance, sortType, businessType, categoryId, storeName,storeType, 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, storeName,storeType, 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("获取推荐店铺失败,请稍后重试");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 根据business_classify字段获取字典表数据实现UI图中的功能
|
|
|
+ * RESTful风格:GET /store/info/business-classifies
|
|
|
+ * 返回扁平化的分类列表,用于多选分类功能
|
|
|
+ *
|
|
|
+ * @param parentId 父分类ID(可选),如果提供则只返回该父分类下的子分类
|
|
|
+ * @return R<List<StoreDictionaryVo>> 分类列表(扁平化,仅子分类)
|
|
|
+ */
|
|
|
+ @ApiOperation("获取店铺分类信息)")
|
|
|
+ @ApiOperationSupport(order = 19)
|
|
|
+ @GetMapping("/business-classifies")
|
|
|
+ public R<List<StoreDictionaryVo>> getBusinessClassifyData(
|
|
|
+ @RequestParam(value = "parentId", required = false) Integer parentId) {
|
|
|
+ log.info("StoreInfoController.getBusinessClassifyData?parentId={}", parentId);
|
|
|
+ try {
|
|
|
+ List<StoreDictionaryVo> result = storeInfoService.getBusinessClassifyData(parentId);
|
|
|
+ return R.data(result);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("获取business_classify分类数据异常", 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 = "storeName", value = "商家名称(模糊查询)", dataType = "String", 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(value = "storeName", required = false) String storeName,
|
|
|
+ @RequestParam(defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(defaultValue = "10") int pageSize) {
|
|
|
+ log.info("StoreInfoController.getLifeServicesByDistance?lon={},lat={},distance={},sortType={},businessType={},categoryId={},storeName={},pageNum={},pageSize={}",
|
|
|
+ lon, lat, distance, sortType, businessType, categoryId, storeName, 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, storeName, 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("筛选失败,请稍后重试");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|