puzhibing
2 天以前 c7ac989e5a693bf29efb4fbaee16770442ea41a0
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java
@@ -35,6 +35,7 @@
import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.common.security.utils.CodeFactoryUtil;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.goods.api.domain.GetLotteryEventList;
import com.ruoyi.goods.api.domain.TLotteryEvent;
import com.ruoyi.goods.api.service.LotteryEventClient;
import com.ruoyi.order.config.WxPayConfiguration;
@@ -405,7 +406,10 @@
        appSureOrderVo.setAppSureOrderGoodsVoList(appSureOrderGoodsVoList);
        appSureOrderVo.setLotteryDraw(false);
        // 返回AppPlaceOrderVo对象
        List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(2).getData();
        GetLotteryEventList getLotteryEventList = new GetLotteryEventList();
        getLotteryEventList.setActivityType(2);
        getLotteryEventList.setUserId(SecurityUtils.getUserId());
        List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(getLotteryEventList).getData();
        if (data.size() > 0) {
            BigDecimal finalOrderPayMoney = orderPayMoney;
            List<TLotteryEvent> collect = data.stream().filter(s -> s.getPayMoney().compareTo(finalOrderPayMoney) <= 0).collect(Collectors.toList());
@@ -524,7 +528,10 @@
        appPanicBuyVo.setOrderPayMoney(orderPayMoney);
        appPanicBuyVo.setLotteryDraw(false);
        // 返回AppPlaceOrderVo对象
        List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(2).getData();
        GetLotteryEventList getLotteryEventList = new GetLotteryEventList();
        getLotteryEventList.setActivityType(2);
        getLotteryEventList.setUserId(SecurityUtils.getUserId());
        List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(getLotteryEventList).getData();
        if (data.size() > 0) {
            BigDecimal finalOrderPayMoney = orderPayMoney;
            List<TLotteryEvent> collect = data.stream().filter(s -> s.getPayMoney().compareTo(finalOrderPayMoney) <= 0).collect(Collectors.toList());
@@ -868,7 +875,10 @@
        appPlaceOrderVo.setLotteryDraw(false);
        // 返回AppPlaceOrderVo对象
        List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(2).getData();
        GetLotteryEventList getLotteryEventList = new GetLotteryEventList();
        getLotteryEventList.setActivityType(2);
        getLotteryEventList.setUserId(SecurityUtils.getUserId());
        List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(getLotteryEventList).getData();
        if (data.size() > 0) {
            BigDecimal finalOrderPayMoney = orderPayMoney;
            List<TLotteryEvent> collect = data.stream().filter(s -> s.getPayMoney().compareTo(finalOrderPayMoney) <= 0).collect(Collectors.toList());
@@ -1361,7 +1371,10 @@
            redisService.setCacheObject(SecurityConstant.ACTIVITY_GOODS + "-" + activityId + "-" + goodsId, surpNum - buyNum);
            appPlaceOrderVo.setLotteryDraw(false);
            // 返回AppPlaceOrderVo对象
            List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(2).getData();
            GetLotteryEventList getLotteryEventList = new GetLotteryEventList();
            getLotteryEventList.setActivityType(2);
            getLotteryEventList.setUserId(SecurityUtils.getUserId());
            List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(getLotteryEventList).getData();
            if (data.size() > 0) {
                BigDecimal finalOrderPayMoney = orderPayMoney;
                List<TLotteryEvent> collect = data.stream().filter(s -> s.getPayMoney().compareTo(finalOrderPayMoney) <= 0).collect(Collectors.toList());
@@ -1649,7 +1662,10 @@
        appPlaceOrderVo.setPrepayId(orderPayment.getPrepayId());
        appPlaceOrderVo.setLotteryDraw(false);
        // 返回AppPlaceOrderVo对象
        List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(2).getData();
        GetLotteryEventList getLotteryEventList = new GetLotteryEventList();
        getLotteryEventList.setActivityType(2);
        getLotteryEventList.setUserId(SecurityUtils.getUserId());
        List<TLotteryEvent> data = lotteryEventClient.getLotteryEventList(getLotteryEventList).getData();
        if (data.size() > 0) {
            List<TLotteryEvent> collect = data.stream().filter(s -> s.getPayMoney().compareTo(order.getPayMoney()) <= 0).collect(Collectors.toList());
            if (collect.size() > 0) {
@@ -2347,12 +2363,12 @@
            orderGoods.setBuyNum(1);
            ConsumerGoods consumerGoods = new ConsumerGoods();
            consumerGoods.setUsedNum(1);
            if(null != timeCard){
                //核销一次加一次
                orderGoods.setBuyNum(1);
                orderGoods.setServiceNum(1);
                consumerGoods.setServiceNum(timeCard.getTimesCount());
                consumerGoods.setUsedNum(1);
                consumerGoods.setUseTime(new Date());
            }
            orderGoods.setCycleNumFlag(1);
@@ -2365,7 +2381,7 @@
            consumerGoods.setServiceStatus(1);
            consumerGoods.setShopId(order.getShopId());
            consumerGoods.setUserId(order.getUserId());
            consumerGoods.setOrderId(orderId);
            consumerGoods.setOrderId(order.getOrderId());
            consumerGoods.setOrderGoodsId(orderGoods.getOrderGoodsId());
            consumerGoods.setGoodsName(sku.getTitle());
            consumerGoods.setCycleNumFlag(1);
@@ -2376,7 +2392,7 @@
            //生成返回
            MerVerifyOrderVo merVerifyOrderVo = new MerVerifyOrderVo();
            merVerifyOrderVo.setOrderId(orderId);
            merVerifyOrderVo.setOrderId(order.getOrderId());
            merVerifyOrderVo.setOrderNo(order.getOrderNo());
            merVerifyOrderVo.setOrderStatus(order.getOrderStatus());
            merVerifyOrderVo.setOrderFrom(order.getOrderFrom());
@@ -2445,7 +2461,7 @@
                if (integral > 0) {
                    memberTotalChangeDto.setChangeIntegral(integral);
                    memberTotalChangeDto.setTypeIntegral(1);
                    memberTotalChangeDto.setOrderId(orderId);
                    memberTotalChangeDto.setOrderId(order.getOrderId());
                    memberTotalChangeDto.setOrderNo(order.getOrderNo());
                }
            }
@@ -2471,7 +2487,7 @@
            consumerGoodsService.updateById(consumerGoods);
            //生成返回
            MerVerifyOrderVo merVerifyOrderVo = new MerVerifyOrderVo();
            merVerifyOrderVo.setOrderId(orderId);
            merVerifyOrderVo.setOrderId(order.getOrderId());
            merVerifyOrderVo.setOrderNo(order.getOrderNo());
            merVerifyOrderVo.setOrderStatus(order.getOrderStatus());
            merVerifyOrderVo.setOrderFrom(order.getOrderFrom());
@@ -2638,7 +2654,7 @@
            consumerGoods.setServiceStatus(1);
            consumerGoods.setShopId(order.getShopId());
            consumerGoods.setUserId(order.getUserId());
            consumerGoods.setOrderId(orderId);
            consumerGoods.setOrderId(order.getOrderId());
            consumerGoods.setGoodsId(sku.getSku_id());
            consumerGoods.setOrderGoodsId(orderGoods.getOrderGoodsId());
            consumerGoods.setGoodsName(sku.getTitle());
@@ -2652,7 +2668,7 @@
            consumerGoodsService.save(consumerGoods);
            //生成返回
            MerVerifyOrderVo merVerifyOrderVo = new MerVerifyOrderVo();
            merVerifyOrderVo.setOrderId(orderId);
            merVerifyOrderVo.setOrderId(order.getOrderId());
            merVerifyOrderVo.setOrderNo(order.getOrderNo());
            merVerifyOrderVo.setOrderStatus(order.getOrderStatus());
            merVerifyOrderVo.setOrderFrom(order.getOrderFrom());
@@ -2721,7 +2737,7 @@
                if (integral > 0) {
                    memberTotalChangeDto.setChangeIntegral(integral);
                    memberTotalChangeDto.setTypeIntegral(1);
                    memberTotalChangeDto.setOrderId(orderId);
                    memberTotalChangeDto.setOrderId(order.getOrderId());
                    memberTotalChangeDto.setOrderNo(order.getOrderNo());
                }
            }
@@ -2745,7 +2761,7 @@
            consumerGoodsService.updateById(consumerGoods);
            //生成返回
            MerVerifyOrderVo merVerifyOrderVo = new MerVerifyOrderVo();
            merVerifyOrderVo.setOrderId(orderId);
            merVerifyOrderVo.setOrderId(order.getOrderId());
            merVerifyOrderVo.setOrderNo(order.getOrderNo());
            merVerifyOrderVo.setOrderStatus(order.getOrderStatus());
            merVerifyOrderVo.setOrderFrom(order.getOrderFrom());
@@ -5668,7 +5684,8 @@
        if (memberGiftRecord.getGiftFrom() == 2 && !memberGiftRecord.getShopId().equals(shopId)) {
            throw new ServiceException(AppErrorConstant.VERIFY_SHOP_ERROR);
        }
        merVerifyAwardVo.setUserId(member.getUserId());
        merVerifyAwardVo.setUserName(member.getRealName());
        merVerifyAwardVo.setUserMobile(member.getMobile());
        if (1 == memberGiftRecord.getPrizeFrom()) {