| | |
| | | appPlaceOrderVo.setSignType(payArr[4]); |
| | | appPlaceOrderVo.setPaySign(payArr[5]); |
| | | appPlaceOrderVo.setPrepayId(orderPayment.getPrepayId()); |
| | | appPlaceOrderVo.setLotteryDraw(false); |
| | | // 返回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()); |
| | | appPlaceOrderVo.setLotteryDraw(collect.size() > 0); |
| | | if (collect.size() > 0) { |
| | | appPlaceOrderVo.setLotteryDraw(true); |
| | | appPlaceOrderVo.setLotteryEventId(collect.get(0).getId()); |
| | | } |
| | | } else { |
| | | appPlaceOrderVo.setLotteryDraw(false); |
| | | } |
| | | return appPlaceOrderVo; |
| | | } |
| | |
| | | consumerGoodsService.sendGoodsGift(giftSendDtoList); |
| | | //抽奖奖品中的平台商品需要生成订单数据 |
| | | if (memberGiftRecord.getPrizeFrom() == 2) { |
| | | addOrder(memberGiftRecord.getShopId(), memberGiftRecord.getUserId(), goods, memberGiftRecord.getGoodsNumber(), memberGiftRecord.getGiftId()); |
| | | Order one = this.getOne(new QueryWrapper<Order>().eq("activity_id", memberGiftRecord.getGiftId()).eq("order_from", 4)); |
| | | if(null == one){ |
| | | addOrder(memberGiftRecord.getShopId(), memberGiftRecord.getUserId(), goods, memberGiftRecord.getGoodsNumber(), memberGiftRecord.getGiftId(), 3); |
| | | }else{ |
| | | one.setOrderStatus(3); |
| | | this.updateById(one); |
| | | } |
| | | } |
| | | break; |
| | | case 3: |
| | |
| | | |
| | | |
| | | /** |
| | | * 核销抽奖的平台商品生成订单 |
| | | * 抽奖的平台商品生成订单--待审核 |
| | | * |
| | | * @param shopId |
| | | * @param userId |
| | | * @param goods |
| | | * @param goodsNum |
| | | */ |
| | | public void addOrder(Long shopId, Long userId, Goods goods, Integer goodsNum, String giftId) { |
| | | public void addOrder(Long shopId, Long userId, Goods goods, Integer goodsNum, String giftId, Integer status) { |
| | | Order order = new Order(); |
| | | order.setOrderId(IdUtils.simpleUUID()); |
| | | order.setDelFlag(0); |
| | | order.setOrderStatus(3); |
| | | order.setOrderStatus(status); |
| | | order.setOrderNo(CodeFactoryUtil.getShopOrderNo()); |
| | | order.setOrderFrom(4); |
| | | order.setShopId(shopId); |