| | |
| | | } |
| | | } |
| | | |
| | | confirmOrderVo.setActivityName(activityInfo1.getActivityName()); |
| | | paymentMoney = paymentMoney.subtract(zyh); |
| | | activityAmount = activityAmount.add(zyh); |
| | | if(null != activityInfo1){ |
| | | confirmOrderVo.setActivityName(activityInfo1.getActivityName()); |
| | | paymentMoney = paymentMoney.subtract(zyh); |
| | | activityAmount = activityAmount.add(zyh); |
| | | } |
| | | } |
| | | confirmOrderVo.setDiscountAmount(activityAmount); |
| | | int earnPoint = goodsList.stream().mapToInt(MyShoppingCartVo::getEarnSpendingPoints).sum(); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(goods.getStatus() == 1){ |
| | | throw new RuntimeException(goods.getName() + "商品已被下架"); |
| | | } |
| | | if(!goods.getCommodityAuthority().contains("-1") && !goods.getCommodityAuthority().contains(appUser.getVipId().toString())){ |
| | | throw new RuntimeException("无权限购买" + goods.getName()); |
| | | } |
| | | |
| | | ids.add(id); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | discount = orderActivityInfo1.getDiscount(); |
| | | paymentMoney = paymentMoney.subtract(zyh); |
| | | activityAmount = activityAmount.add(zyh); |
| | | } |
| | |
| | | } |
| | | if(3 != shoppingCartPayment.getPaymentType() && (fullReductionAmount.compareTo(BigDecimal.ZERO) > 0 ||moneyAmount.compareTo(BigDecimal.ZERO) > 0 || discountAmount.compareTo(BigDecimal.ZERO) > 0)){ |
| | | order.setCouponJson(JSON.toJSONString(couponInfoVo)); |
| | | order.setUserCouponId(shoppingCartPayment.getUserCouponId()); |
| | | } |
| | | if(null != orderActivityInfo1){ |
| | | order.setActivityJson(JSON.toJSONString(orderActivityInfo1)); |
| | |
| | | orderService.updateById(order); |
| | | //删除购物车数据 |
| | | this.removeBatchByIds(ids); |
| | | //处理优惠券 |
| | | if(null != order.getUserCouponId()){ |
| | | UserCoupon userCoupon = userCouponClient.getUserCoupon(order.getUserCouponId()).getData(); |
| | | if(null != userCoupon && null == userCoupon.getUseTime()){ |
| | | userCoupon.setUseTime(LocalDateTime.now()); |
| | | userCouponClient.editUserCoupon(userCoupon); |
| | | } |
| | | } |
| | | //添加查询快递信息队列 |
| | | if(StringUtils.isNotEmpty(order.getExpressJson())){ |
| | | //一小时后定时查询快递信息 |
| | | redisTemplate.opsForZSet().add("order_express", order.getId(), LocalDateTime.now().plusHours(1).toEpochSecond(ZoneOffset.UTC)); |
| | | } |
| | | } |
| | | //积分支付 |
| | | if(3 == shoppingCartPayment.getPaymentType()){ |
| | |
| | | //删除购物车数据 |
| | | this.removeBatchByIds(ids); |
| | | } |
| | | //添加查询快递信息队列 |
| | | if(StringUtils.isNotEmpty(order.getExpressJson())){ |
| | | //一小时后定时查询快递信息 |
| | | SystemConfig systemConfig = systemConfigClient.getSystemConfig(3).getData(); |
| | | JSONObject jsonObject = JSON.parseObject(systemConfig.getContent()); |
| | | Integer waitTime = jsonObject.getInteger("waitTime"); |
| | | redisTemplate.opsForZSet().add("order_express", order.getId(), LocalDateTime.now().plusHours(waitTime).toEpochSecond(ZoneOffset.UTC)); |
| | | } |
| | | } |
| | | |
| | | //添加账户余额支付明细 |
| | |
| | | order.setOrderStatus(2); |
| | | } |
| | | orderService.updateById(order); |
| | | |
| | | //处理优惠券 |
| | | if(null != order.getUserCouponId()){ |
| | | UserCoupon userCoupon = userCouponClient.getUserCoupon(order.getUserCouponId()).getData(); |
| | | if(null != userCoupon && null == userCoupon.getUseTime()){ |
| | | userCoupon.setStatus(2); |
| | | userCoupon.setUseTime(LocalDateTime.now()); |
| | | userCouponClient.editUserCoupon(userCoupon); |
| | | } |
| | | } |
| | | //添加查询快递信息队列 |
| | | if(StringUtils.isNotEmpty(order.getExpressJson())){ |
| | | //一小时后定时查询快递信息 |
| | | redisTemplate.opsForZSet().add("order_express", order.getId(), LocalDateTime.now().plusHours(1).toEpochSecond(ZoneOffset.UTC)); |
| | | } |
| | | |
| | | //删除购物车数据 |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | List<OrderGood> list = orderGoodService.list(new LambdaQueryWrapper<OrderGood>().eq(OrderGood::getOrderId, order.getId())); |