| | |
| | | @TableField("pid") |
| | | private Integer pid; |
| | | |
| | | @ApiModelProperty(value = "营业星期(1,2,3,4,5,6,7)") |
| | | @ApiModelProperty(value = "营业星期:1-周一到周日 2-周一周五 3-仅周末") |
| | | @TableField("business_date") |
| | | private String businessDate; |
| | | private Integer businessDate; |
| | | |
| | | @ApiModelProperty(value = "开始时间(HH:mm)") |
| | | @TableField("start_time") |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @GetMapping("/shopDetail") |
| | | @ApiOperation(value = "门店详情", tags = {"小程序-首页-门店详情"}) |
| | | public R<ShopDetailVO> shopDetail(@ApiParam("门店id") @RequestParam Integer shopId, |
| | | @ApiParam("经度") @RequestParam String longitude, |
| | | @ApiParam("纬度") @RequestParam String latitude) { |
| | | @ApiParam("经度") @RequestParam BigDecimal longitude, |
| | | @ApiParam("纬度") @RequestParam BigDecimal latitude) { |
| | | return R.ok(shopService.getShopDetail(shopId, longitude, latitude)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.other.vo.NearbyShopVO; |
| | | import com.ruoyi.other.vo.ShopDetailVO; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | List<NearbyShopVO> nearbyShopList(String longitude, String latitude); |
| | | |
| | | ShopDetailVO getShopDetail(Integer shopId,String longitude, String latitude); |
| | | ShopDetailVO getShopDetail(Integer shopId, BigDecimal longitude, BigDecimal latitude); |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<NearbyShopVO> nearbyShopList(String longitude, String latitude) { |
| | | return shopMapper.selectNearbyShopList(longitude,latitude); |
| | | return shopMapper.selectNearbyShopList(longitude,latitude); |
| | | } |
| | | |
| | | @Override |
| | | public ShopDetailVO getShopDetail(Integer shopId, String longitude, String latitude) { |
| | | public ShopDetailVO getShopDetail(Integer shopId, BigDecimal longitude, BigDecimal latitude) { |
| | | // 查询店铺详情 |
| | | ShopDetailVO shopDetailVO = shopMapper.selectShopDetail(shopId); |
| | | if (shopDetailVO == null) { |
| | |
| | | // 计算距离 |
| | | if (shopDetailVO.getLongitude() != null && shopDetailVO.getLatitude() != null){ |
| | | String shopLocation = String.format("%s,%s", shopDetailVO.getLongitude(), shopDetailVO.getLatitude()); |
| | | String userLocation = String.format("%s,%s", longitude, latitude); |
| | | String userLocation = String.format("%s,%s", longitude.toString(), latitude.toString()); |
| | | Map<String, Double> distanceMap = GeodesyUtil.getDistance(userLocation, shopLocation); |
| | | Double wGs84 = distanceMap.get("WGs84"); |
| | | Double wGs84 = distanceMap.get("WGS84"); |
| | | shopDetailVO.setDistance(wGs84); |
| | | } |
| | | return shopDetailVO; |
| | |
| | | package com.ruoyi.other.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "资质证书图片") |
| | | private String certification; |
| | | |
| | | @ApiModelProperty(value = "营业星期(1,2,3,4,5,6,7)") |
| | | private String businessDate; |
| | | @ApiModelProperty(value = "营业星期:1-周一到周日 2-周一周五 3-仅周末") |
| | | private Integer businessDate; |
| | | |
| | | @ApiModelProperty(value = "开始时间(HH:mm)") |
| | | private String startTime; |
| | |
| | | private Double distance; |
| | | |
| | | @ApiModelProperty(value = "经度") |
| | | private String longitude; |
| | | private BigDecimal longitude; |
| | | |
| | | @ApiModelProperty(value = "纬度") |
| | | private String latitude; |
| | | private BigDecimal latitude; |
| | | } |
| | |
| | | ts.business_date, |
| | | ts.start_time, |
| | | ts.end_time, |
| | | ts.longitude, |
| | | ts.latitude, |
| | | AVG( tss.score ) score |
| | | FROM |
| | | t_shop ts |
| | |
| | | ts.address, |
| | | ts.business_date, |
| | | ts.start_time, |
| | | ts.end_time |
| | | ts.end_time, |
| | | ts.longitude, |
| | | ts.latitude |
| | | </select> |
| | | </mapper> |