puzhibing
4 天以前 15ca88685850cdc44f027a7925a063059582c9d0
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java
@@ -1359,6 +1359,17 @@
            remoteActivityService.addActivityRecord(activityRecord);
            //扣除redis库存
            redisService.setCacheObject(SecurityConstant.ACTIVITY_GOODS + "-" + activityId + "-" + goodsId, surpNum - buyNum);
            appPlaceOrderVo.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) {
                    appPlaceOrderVo.setLotteryDraw(true);
                    appPlaceOrderVo.setLotteryEventId(collect.get(0).getId());
                }
            }
        } catch (Exception e){
            log.error("活动订单购买失败:"+e.getMessage());
            throw new ServiceException(e.getMessage());