From 6058af744bdf4fe6a3856c46fe31cfb4dbd8e255 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期二, 29 七月 2025 11:54:01 +0800
Subject: [PATCH] 修改bug

---
 ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java |    2 ++
 ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/AppSureOrderVo.java                     |    6 ++++++
 ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/AppPanicBuyVo.java                      |    6 ++++++
 ruoyi-modules/ruoyi-member/src/main/resources/bootstrap.yml                                               |    1 -
 ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java          |   24 +++++++++++++++++++++++-
 5 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
index 8cfd09b..0baeaeb 100644
--- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
+++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/service/impl/lottery/LotteryEventServiceImpl.java
@@ -214,6 +214,7 @@
 						memberGiftRecord.setCouponNumber(userLotteryEvent.getNumber());
 						memberGiftRecord.setCouponName(userLotteryEvent.getObjectName());
 						memberGiftRecord.setVerifyStatus(2);
+						memberGiftRecord.setVerifyTime(new Date());
 						break;
 					case 2:
 						memberGiftRecord.setGiftType(2);
@@ -238,6 +239,7 @@
 						memberGiftRecord.setGiftType(5);
 						memberGiftRecord.setIntegralNumber(userLotteryEvent.getNumber());
 						memberGiftRecord.setVerifyStatus(2);
+						memberGiftRecord.setVerifyTime(new Date());
 						break;
 				}
 				memberGiftRecord.setPrizeFrom(2);
diff --git a/ruoyi-modules/ruoyi-member/src/main/resources/bootstrap.yml b/ruoyi-modules/ruoyi-member/src/main/resources/bootstrap.yml
index 0a117ad..6625bd9 100644
--- a/ruoyi-modules/ruoyi-member/src/main/resources/bootstrap.yml
+++ b/ruoyi-modules/ruoyi-member/src/main/resources/bootstrap.yml
@@ -16,7 +16,6 @@
         # 服务注册地址
         #        server-addr: 47.109.78.184:5000
         server-addr: 192.168.110.80:8848
-        ip: 192.168.110.21
         #pro
         #        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
         #        test
diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/AppPanicBuyVo.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/AppPanicBuyVo.java
index 23bf201..a97174c 100644
--- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/AppPanicBuyVo.java
+++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/AppPanicBuyVo.java
@@ -73,5 +73,11 @@
     @JsonSerialize(using = ToStringSerializer.class)
     private BigDecimal goodsRealPrice;
 
+    @ApiModelProperty(value = "是否可抽奖(0=否,1=是)")
+    private Boolean lotteryDraw;
+
+    @ApiModelProperty(value = "抽奖活动id")
+    private String lotteryEventId;
+
 
 }
diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/AppSureOrderVo.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/AppSureOrderVo.java
index 704bb75..10fab64 100644
--- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/AppSureOrderVo.java
+++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/AppSureOrderVo.java
@@ -38,4 +38,10 @@
     @ApiModelProperty(value = "订单商品列表")
     List<AppSureOrderGoodsVo> appSureOrderGoodsVoList;
 
+    @ApiModelProperty(value = "是否可抽奖(0=否,1=是)")
+    private Boolean lotteryDraw;
+
+    @ApiModelProperty(value = "抽奖活动id")
+    private String lotteryEventId;
+
 }
diff --git a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java
index 68504f4..d18f9d1 100644
--- a/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java
+++ b/ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java
@@ -402,6 +402,17 @@
         appSureOrderVo.setOrderPayMoney(orderPayMoney);
         // 设置订单商品列表
         appSureOrderVo.setAppSureOrderGoodsVoList(appSureOrderGoodsVoList);
+        appSureOrderVo.setLotteryDraw(false);
+        // 返回AppPlaceOrderVo对象
+        List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(2).getData();
+        if (data.size() > 0) {
+            BigDecimal finalOrderPayMoney = orderPayMoney;
+            List<TLotteryEvent> collect = data.stream().filter(s -> s.getPayMoney().compareTo(finalOrderPayMoney) <= 0).collect(Collectors.toList());
+            if (collect.size() > 0) {
+                appSureOrderVo.setLotteryDraw(true);
+                appSureOrderVo.setLotteryEventId(collect.get(0).getId());
+            }
+        }
         return appSureOrderVo;
     }
 
@@ -510,6 +521,17 @@
         appPanicBuyVo.setOrderGoodsMoney(orderGoodsMoney);
         appPanicBuyVo.setOrderPayDeposit(orderPayDeposit);
         appPanicBuyVo.setOrderPayMoney(orderPayMoney);
+        appPanicBuyVo.setLotteryDraw(false);
+        // 返回AppPlaceOrderVo对象
+        List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(2).getData();
+        if (data.size() > 0) {
+            BigDecimal finalOrderPayMoney = orderPayMoney;
+            List<TLotteryEvent> collect = data.stream().filter(s -> s.getPayMoney().compareTo(finalOrderPayMoney) <= 0).collect(Collectors.toList());
+            if (collect.size() > 0) {
+                appPanicBuyVo.setLotteryDraw(true);
+                appPanicBuyVo.setLotteryEventId(collect.get(0).getId());
+            }
+        }
         return appPanicBuyVo;
     }
 
@@ -1605,7 +1627,7 @@
         // 返回AppPlaceOrderVo对象
         List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(2).getData();
         if (data.size() > 0) {
-            List<TLotteryEvent> collect = data.stream().filter(s -> s.getPayMoney().compareTo(order.getPayMoney()) >= 0).collect(Collectors.toList());
+            List<TLotteryEvent> collect = data.stream().filter(s -> s.getPayMoney().compareTo(order.getPayMoney()) <= 0).collect(Collectors.toList());
             if (collect.size() > 0) {
                 appPlaceOrderVo.setLotteryDraw(true);
                 appPlaceOrderVo.setLotteryEventId(collect.get(0).getId());

--
Gitblit v1.7.1