From c90a8ac772937f8f084356ea1f04c5dba1d9e5d5 Mon Sep 17 00:00:00 2001
From: luodangjia <luodangjia>
Date: 星期五, 24 一月 2025 11:15:33 +0800
Subject: [PATCH] 12.18

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java |   32 +++++++++++++++++++++++++-------
 1 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
index 4aafb17..89451c0 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsController.java
@@ -56,6 +56,19 @@
     }
 
     /**
+     * 商品克隆
+     */
+    @GetMapping("/cloneGoods")
+    @ApiOperation(value = "商品克隆", tags = {"管理后台-商品管理"})
+    public R<Void> cloneGoods(@RequestParam Long goodsId,@RequestParam String goodsName) {
+        Goods goods = goodsService.getManageGoodsDetail(goodsId);
+        goods.setId(null);
+        goods.setName(goodsName);
+        goodsService.addGoods(goods);
+        return R.ok();
+    }
+
+    /**
      * 管理后台商品列表
      */
     @GetMapping("/manageGoodsList")
@@ -137,7 +150,9 @@
         if(0 < count){
             return R.fail("商品已被会员配置使用,不能删除");
         }
-        goodsService.removeById(goodsId);
+        Goods goods = goodsService.getById(goodsId);
+        goods.setDelFlag(1);
+        goodsService.updateById(goods);
         return R.ok();
     }
 
@@ -179,11 +194,14 @@
      */
     @GetMapping("/goodsDetail/{goodsId}")
     @ApiOperation(value = "商品详情", tags = {"小程序-商城-首页"})
-    public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId, String longitude, String latitude){
-        return R.ok(goodsService.goodsDetail(goodsId, longitude, latitude));
+    public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId,
+                                  Integer shopId,
+                                  String longitude,
+                                  String latitude) {
+        return R.ok(goodsService.goodsDetail(goodsId, shopId, longitude, latitude));
     }
-    
-    
+
+
     /**
      * 根据类型(1=服务商品,2=单品商品)获取商品数据
      * @param type
@@ -195,8 +213,8 @@
         List<Goods> list = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getType, type).eq(Goods::getDelFlag, 0).eq(Goods::getStatus, 2));
         return R.ok(list);
     }
-    
-    
+
+
     /**
      * 根据id获取商品信息
      * @param id

--
Gitblit v1.7.1