puzhibing
2024-12-04 2c249b86e922aef7397dc496fe5bbd84730b0772
修改启动异常
6个文件已修改
36 ■■■■■ 已修改文件
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopDetailVO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/domain/Shop.java
@@ -38,9 +38,9 @@
    @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")
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/ShopController.java
@@ -22,6 +22,7 @@
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
/**
@@ -76,8 +77,8 @@
    @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));
    }
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/ShopService.java
@@ -5,6 +5,7 @@
import com.ruoyi.other.vo.NearbyShopVO;
import com.ruoyi.other.vo.ShopDetailVO;
import java.math.BigDecimal;
import java.util.List;
/**
@@ -19,5 +20,5 @@
    List<NearbyShopVO> nearbyShopList(String longitude, String latitude);
    ShopDetailVO getShopDetail(Integer shopId,String longitude, String latitude);
    ShopDetailVO getShopDetail(Integer shopId, BigDecimal longitude, BigDecimal latitude);
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java
@@ -11,6 +11,7 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@@ -29,11 +30,11 @@
    @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) {
@@ -43,9 +44,9 @@
        // 计算距离
        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;
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/vo/ShopDetailVO.java
@@ -1,5 +1,6 @@
package com.ruoyi.other.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -29,8 +30,8 @@
    @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;
@@ -63,8 +64,8 @@
    private Double distance;
    @ApiModelProperty(value = "经度")
    private String longitude;
    private BigDecimal longitude;
    @ApiModelProperty(value = "纬度")
    private String latitude;
    private BigDecimal latitude;
}
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/ShopMapper.xml
@@ -31,6 +31,8 @@
            ts.business_date,
            ts.start_time,
            ts.end_time,
            ts.longitude,
            ts.latitude,
            AVG( tss.score ) score
        FROM
            t_shop ts
@@ -47,6 +49,8 @@
            ts.address,
            ts.business_date,
            ts.start_time,
            ts.end_time
            ts.end_time,
            ts.longitude,
            ts.latitude
    </select>
</mapper>