From 270a3c0208001e2db9577cb6d7d4fd7ec646dfd8 Mon Sep 17 00:00:00 2001
From: mitao <2763622819@qq.com>
Date: 星期二, 04 十一月 2025 21:27:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0' into 2.0

---
 cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java |   34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
index edef607..73fd2a4 100644
--- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
+++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
@@ -754,8 +754,19 @@
                         coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints()));
                         break;
                     case 2:
-                        coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints()));
-                        coupon.setCash(dataVo.getRequiredCash());
+                        if (dataVo.getRequiredCash() != null){
+                            coupon.setCash(dataVo.getRequiredCash());
+                        }else{
+                            coupon.setCash(BigDecimal.ZERO);
+
+                        }
+                        if (dataVo.getRequiredPoints() != null){
+                            coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints()));
+
+                        }else{
+                            coupon.setIntegral(BigDecimal.ZERO);
+
+                        }
                         break;
                     case 3:
                         coupon.setCash(dataVo.getRequiredCash());
@@ -955,6 +966,25 @@
             VipDetail vipDetailServiceById = vipDetailService.getById(userCoupon.getVipDetailId());
             vipDetailServiceById.setUseTime(new Date());
             vipDetailServiceById.setStatus(2);
+            vipDetailServiceById.setOperatorId(0);
+            vipDetailService.updateById(vipDetailServiceById);
+        }
+
+    }
+    @GetMapping("/base/coupon/updateTypeOther/{id}/{operatorId}/{storeId}/{siteId}")
+    void updateTypeOther(@PathVariable("id")Long id,@PathVariable("operatorId")Integer operatorId,
+                         @PathVariable("storeId")Integer storeId,@PathVariable("siteId")Integer siteId){
+        couponService.updateType(id);
+        UserCoupon userCoupon = userCouponService.getById(id);
+        if (userCoupon.getIsVipGrant()!=null&& userCoupon.getIsVipGrant()==1){
+            VipDetail vipDetailServiceById = vipDetailService.getById(userCoupon.getVipDetailId());
+            vipDetailServiceById.setUseTime(new Date());
+            vipDetailServiceById.setStatus(2);
+            vipDetailServiceById.setOperatorId(operatorId);
+            vipDetailServiceById.setUseStoreId(storeId);
+            if (siteId!=0){
+                vipDetailServiceById.setUseSiteId(siteId);
+            }
             vipDetailService.updateById(vipDetailServiceById);
         }
 

--
Gitblit v1.7.1