Pu Zhibing
2024-12-20 49f2eff2cf52e0f1719dfad43cafff11b378252c
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -130,9 +130,6 @@
            orderGoodsVO.setOriginalPrice(goods.getOriginalPrice());
            goodsList.add(orderGoodsVO);
        }
        // 收货地址
        String addressJson = order.getAddressJson();
        UserAddress userAddress = new UserAddress();
@@ -140,7 +137,6 @@
            userAddress = JSONObject.parseObject(addressJson, UserAddress.class);
        }
        // 优惠券
        String couponJson = order.getCouponJson();
        CouponInfo couponInfo = new CouponInfo();
@@ -154,7 +150,6 @@
        if (StringUtils.isNotEmpty(activityJson)){
            orderActivityInfo = JSONObject.parseObject(activityJson, OrderActivityInfo.class);
        }
        OrderDetailVO orderDetailVO = new OrderDetailVO();
        if (CollectionUtil.isNotEmpty(orderGoods)){
@@ -314,7 +309,7 @@
     * @return
     */
    @Override
    public R confirmDelivery(String orderId, String code) {
    public R confirmDelivery(Long orderId, String code) {
        Order order = this.getById(orderId);
        if(1 == order.getPayStatus()){
            return R.fail("订单还未完成支付");
@@ -367,8 +362,10 @@
            //余额退款
            OrderBalancePayment orderBalancePayment = orderBalancePaymentService.getOne(new LambdaQueryWrapper<OrderBalancePayment>().eq(OrderBalancePayment::getOrderId, order.getId()));
            BigDecimal balance = appUser.getBalance();
            appUser.setTotalRedPacketAmount(appUser.getTotalRedPacketAmount().add(orderBalancePayment.getRedPacketAmount()).setScale(2, RoundingMode.HALF_EVEN));
            appUser.setTotalDistributionAmount(appUser.getTotalDistributionAmount().add(orderBalancePayment.getDistributionAmount()).setScale(2, RoundingMode.HALF_EVEN));
            if(null != orderBalancePayment){
                appUser.setTotalRedPacketAmount(appUser.getTotalRedPacketAmount().add(orderBalancePayment.getRedPacketAmount()).setScale(2, RoundingMode.HALF_EVEN));
                appUser.setTotalDistributionAmount(appUser.getTotalDistributionAmount().add(orderBalancePayment.getDistributionAmount()).setScale(2, RoundingMode.HALF_EVEN));
            }
            appUser.setBalance(balance.add(paymentAmount).setScale(2, RoundingMode.HALF_EVEN));
            appUser.setShopAmount(appUser.getShopAmount().subtract(paymentAmount).setScale(2, RoundingMode.HALF_EVEN));
        
@@ -457,10 +454,7 @@
        VipSetting vipSetting = vipSettingClient.getVipSetting(vipId).getData();
        Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole();
        Integer vipLevelUpShop = vipSetting.getVipLevelUpShop();
        if(1 == vipLevelUpShopRole && shopPoint < vipLevelUpShop){
            return true;
        }
        return false;
        return 1 == vipLevelUpShopRole && shopPoint < vipLevelUpShop;
    }