From e24ed6e7f6ced9f331e88048df37537d8f1da165 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 11 九月 2025 16:51:19 +0800
Subject: [PATCH] 虚拟商品优惠劵

---
 seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java         |    1 +
 framework/src/main/java/cn/lili/modules/lmk/enums/general/VirtualGoodsTypeEnum.java |   13 +++++++++++++
 framework/src/main/java/cn/lili/modules/goods/entity/dos/GoodsSku.java              |    7 +++++++
 framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java  |    2 +-
 framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java                 |    6 ++++++
 framework/src/main/java/cn/lili/modules/goods/sku/GoodsSkuBuilder.java              |    2 ++
 framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsOperationDTO.java     |    8 ++++++++
 7 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java b/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java
index 43d2e79..5acdfae 100644
--- a/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java
+++ b/framework/src/main/java/cn/lili/modules/goods/entity/dos/Goods.java
@@ -177,6 +177,10 @@
 
     @ApiModelProperty(value = "鍟嗗搧鎺掑簭")
     private Integer goodsSort;
+
+    @ApiModelProperty(value ="琛ㄧず铏氭嫙鍟嗗搧绫诲瀷 鐜版湁绫诲瀷锛欳OUPON浼樻儬鍔�")
+    private String virtualGoodsType;
+
     public Goods() {
     }
 
@@ -194,6 +198,8 @@
         this.mobileIntro = goodsOperationDTO.getMobileIntro();
         this.goodsVideo = goodsOperationDTO.getGoodsVideo();
         this.price = goodsOperationDTO.getPrice();
+        this.virtualGoodsType = goodsOperationDTO.getVirtualGoodsType();
+
         //涓嶆槸棰勫敭鍟嗗搧棰勫敭鏃堕棿缃┖
         if (!GoodsSalesModeEnum.PRESALE.name().equals(goodsOperationDTO.getSalesModel())) {
             goodsOperationDTO.setPreSaleBeginDate(null);
diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/dos/GoodsSku.java b/framework/src/main/java/cn/lili/modules/goods/entity/dos/GoodsSku.java
index 1b77b11..6f968a3 100644
--- a/framework/src/main/java/cn/lili/modules/goods/entity/dos/GoodsSku.java
+++ b/framework/src/main/java/cn/lili/modules/goods/entity/dos/GoodsSku.java
@@ -170,6 +170,12 @@
     @ApiModelProperty(value = "棰勮鏁伴噺")
     private Integer alertQuantity;
 
+    @ApiModelProperty(value ="浼樻儬鍔礽d")
+    private String couponId;
+
+    @ApiModelProperty(value ="浼樻儬鍔靛悕")
+    private String couponName;
+
     public Double getWeight() {
         if (weight == null) {
             return 0d;
@@ -223,6 +229,7 @@
         this.storeCategoryPath = goods.getStoreCategoryPath();
         this.freightTemplateId = goods.getTemplateId();
         this.recommend = goods.getRecommend();
+
     }
 
 }
\ No newline at end of file
diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsOperationDTO.java b/framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsOperationDTO.java
index b47e599..89323d9 100644
--- a/framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsOperationDTO.java
+++ b/framework/src/main/java/cn/lili/modules/goods/entity/dto/GoodsOperationDTO.java
@@ -158,6 +158,14 @@
     private BigDecimal commission;
     @ApiModelProperty(value = "鍟嗗搧鎺掑簭")
     private Integer goodsSort;
+    @ApiModelProperty(value = "浼樻儬鍔礽d")
+    private String couponId;
+    @ApiModelProperty(value = "浼樻儬鍔靛悕")
+    private String couponName;
+
+    @ApiModelProperty(value ="琛ㄧず铏氭嫙鍟嗗搧绫诲瀷 鐜版湁绫诲瀷锛欳OUPON浼樻儬鍔�")
+    private String virtualGoodsType;
+
 
     public String getGoodsName() {
         //瀵瑰晢鍝佸鍚嶇О鍋氫竴涓瀬闄愬鐞嗐�傝繖閲屾病鏈夌敤xss杩囨护鏄洜涓簒ss杩囨护涓哄叏灞�杩囨护锛屽奖鍝嶅緢澶с��
diff --git a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java
index 63f3d6c..6cebe32 100644
--- a/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/goods/serviceimpl/GoodsSkuServiceImpl.java
@@ -159,7 +159,7 @@
         // 妫�鏌ユ槸鍚﹂渶瑕佺敓鎴愮储寮�
         List<GoodsSku> goodsSkus = GoodsSkuBuilder.buildBatch(goods, goodsOperationDTO.getSkuList());
         renderGoodsSkuList(goodsSkus, goodsOperationDTO);
-
+        System.out.println(goodsSkus);
         if (!goodsSkus.isEmpty()) {
             this.saveOrUpdateBatch(goodsSkus);
             this.updateGoodsStock(goodsSkus);
diff --git a/framework/src/main/java/cn/lili/modules/goods/sku/GoodsSkuBuilder.java b/framework/src/main/java/cn/lili/modules/goods/sku/GoodsSkuBuilder.java
index 0df1a26..ae0dd7e 100644
--- a/framework/src/main/java/cn/lili/modules/goods/sku/GoodsSkuBuilder.java
+++ b/framework/src/main/java/cn/lili/modules/goods/sku/GoodsSkuBuilder.java
@@ -83,6 +83,8 @@
 
 
         //瑙勬牸淇℃伅
+        goodsSku.setCouponId(Convert.toStr(skuInfo.get("couponId"),""));
+        goodsSku.setCouponName(Convert.toStr(skuInfo.get("couponName"),""));
         goodsSku.setId(Convert.toStr(skuInfo.get("id"), ""));
         goodsSku.setSn(Convert.toStr(skuInfo.get("sn")));
         goodsSku.setWeight(Convert.toDouble(skuInfo.get("weight"), 0D));
diff --git a/framework/src/main/java/cn/lili/modules/lmk/enums/general/VirtualGoodsTypeEnum.java b/framework/src/main/java/cn/lili/modules/lmk/enums/general/VirtualGoodsTypeEnum.java
new file mode 100644
index 0000000..69d08a8
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/enums/general/VirtualGoodsTypeEnum.java
@@ -0,0 +1,13 @@
+package cn.lili.modules.lmk.enums.general;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
+@Getter
+public enum VirtualGoodsTypeEnum {
+
+    COUPON("铏氭嫙浼樻儬鍔�");
+    private String description;
+
+}
diff --git a/seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java b/seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java
index f4f46c0..ef46981 100644
--- a/seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java
+++ b/seller-api/src/main/java/cn/lili/controller/goods/GoodsStoreController.java
@@ -155,6 +155,7 @@
     @ApiOperation(value = "鏂板鍟嗗搧")
     @PostMapping(value = "/create", consumes = "application/json", produces = "application/json")
     public ResultMessage<GoodsOperationDTO> save(@Valid @RequestBody GoodsOperationDTO goodsOperationDTO) {
+
         System.err.println(JSONObject.toJSONString(goodsOperationDTO));
         goodsService.addGoods(goodsOperationDTO);
         return ResultUtil.success();

--
Gitblit v1.8.0