| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | 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); |
| | | 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()); |
| | | } |
| | | } 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); |
| | |
| | | MgtOrderTotal mgtOrderTotalFirst = orderMapper.totalOrderFirst(mgtShopOrderPageDto); |
| | | MgtOrderTotal mgtOrderTotalSecond = orderMapper.totalOrderSecond(mgtShopOrderPageDto); |
| | | MgtOrderTotal mgtOrderTotalThird = orderMapper.totalOrderThird(mgtShopOrderPageDto); |
| | | MgtOrderTotal mgtOrderTotalFour = orderMapper.totalOrderFour(mgtShopOrderPageDto); |
| | | |
| | | mgtOrderTotal.setOrderTotal(mgtOrderTotalFirst.getOrderTotal()); |
| | | mgtOrderTotal.setOrderMoneyTotal(mgtOrderTotalFirst.getOrderMoneyTotal()); |
| | | mgtOrderTotal.setShopOrderTotal(mgtOrderTotalSecond.getShopOrderTotal()); |
| | |
| | | */ |
| | | private List<MgtMapBigTotalVo> bigListRemoveNull(List<MgtMapBigTotalVo> MgtMapIntTotalVos) { |
| | | for (int i = 0; i < MgtMapIntTotalVos.size(); i++) { |
| | | if (StringUtils.isBlank(MgtMapIntTotalVos.get(i).getMapKey())) { |
| | | if(MgtMapIntTotalVos.get(i).getMapKey().isEmpty()){ |
| | | MgtMapIntTotalVos.remove(i); |
| | | } |
| | | } |
| | |
| | | orderFromList.add(kauishou); |
| | | orderFromList.add(meituan); |
| | | orderFromList = bigListRemoveNull(orderFromList); |
| | | |
| | | |
| | | //排行 |
| | | List<MgtMapBigTotalVo> sortedList = orderFromList.stream() |
| | | // 按 mapValue 降序排序,处理 null 值(若 mapValue 可能为 null) |