From f103ac7bc4f2fbb20a0f2dd3ed97b0ac7fc5f46d Mon Sep 17 00:00:00 2001
From: huliguo <2023611923@qq.com>
Date: 星期五, 11 四月 2025 17:40:24 +0800
Subject: [PATCH] 商家端

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java
index 82704d2..daea2a6 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopServiceImpl.java
@@ -158,7 +158,8 @@
         }
 
         // 计算距离
-        if (shopDetailVO.getLongitude() != null && shopDetailVO.getLatitude() != null){
+        if (shopDetailVO.getLongitude() != null && shopDetailVO.getLatitude() != null
+            && longitude != null && latitude != null) {
             String shopLocation = String.format("%s,%s", shopDetailVO.getLongitude(), shopDetailVO.getLatitude());
             String userLocation = String.format("%s,%s", longitude.toString(), latitude.toString());
             Map<String, Double> distanceMap = GeodesyUtil.getDistance(userLocation, shopLocation);
@@ -307,7 +308,7 @@
      * 发布商品 门店后台-商品管理
      */
     @Override
-    public void addGoodsByShop(AddGoodsDTO addGoodsDTO) {
+    public Integer addGoodsByShop(AddGoodsDTO addGoodsDTO) {
         if(addGoodsDTO.getPurchaseLimit()==null){
             addGoodsDTO.setPurchaseLimit(-1);
         }
@@ -330,7 +331,7 @@
         goodsShop.setAddress(shop.getAddress());
         goodsShopService.save(goodsShop);
         //判断是否参加秒杀活动
-        if (addGoodsDTO.isActivity()){
+        if (addGoodsDTO.getIsActivity()==1){
             //秒杀活动
             SeckillActivityInfo seckillActivityInfo = new SeckillActivityInfo();
             seckillActivityInfo.setDelFlag(0);
@@ -348,6 +349,7 @@
             goodsSeckill.setSeckillActivityInfoId(seckillActivityInfo.getId());
             goodsSeckillService.save(goodsSeckill);
         }
+        return goods.getId();
     }
 
     /**

--
Gitblit v1.7.1