puzhibing
2025-01-13 fc21ab0f288823a22a05b13d33f07362b5c6b91c
修改bug
4个文件已修改
47 ■■■■ 已修改文件
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/BalanceChangeRecordServiceImpl.java
@@ -62,34 +62,14 @@
        ShopBalanceStatement shopBalanceStatement = new ShopBalanceStatement();
        shopBalanceStatement.setType(1);
        List<BalanceChangeRecord> balanceChangeRecordList = this.baseMapper.selectBalanceChangeRecordList(balanceChangeRecord);
        List<WalletStatisticsDetail> walletStatisticsDetailList = new ArrayList<>();
        for (BalanceChangeRecord changeRecord : balanceChangeRecordList) {
        IPage<BalanceChangeRecord> balanceChangeRecordIPage = this.baseMapper.queryCommissionStatistics(page, balanceChangeRecord);
        IPage<WalletStatisticsDetail> walletStatisticsDetailIPage = balanceChangeRecordIPage.convert(changeRecord -> {
            WalletStatisticsDetail walletStatisticsDetail = new WalletStatisticsDetail();
            BeanUtils.copyBeanProp(walletStatisticsDetail, changeRecord);
            walletStatisticsDetailList.add(walletStatisticsDetail);
        }
            return walletStatisticsDetail;
        });
        // 按时间排序(倒序)
        walletStatisticsDetailList.sort(Comparator.comparing(WalletStatisticsDetail::getCreateTime).reversed());
        long current = page.getCurrent();
        long size = page.getSize();
        if (current < 1) {
            current = 1;
        }
        int fromIndex = (int) ((current - 1) * size);
        int toIndex = (int) Math.min(fromIndex + size, walletStatisticsDetailList.size());
        if (fromIndex >= walletStatisticsDetailList.size()) {
            throw new ServiceException("页面参数无效");
        }
        List<WalletStatisticsDetail> walletStatisticsDetailList2 = walletStatisticsDetailList.subList(fromIndex, toIndex);
        Map<Integer, BigDecimal> shopCommissionMap = walletStatisticsDetailList.stream()
        Map<Integer, BigDecimal> shopCommissionMap = walletStatisticsDetailIPage.getRecords().stream()
                .collect(Collectors.groupingBy(
                        WalletStatisticsDetail::getChangeType,
                        Collectors.reducing(
@@ -105,12 +85,7 @@
        WalletStatistics walletStatistics = new WalletStatistics();
        Page<WalletStatisticsDetail> page1 = new Page<>();
        page1.setRecords(walletStatisticsDetailList2);
        page1.setTotal(walletStatisticsDetailList.size());
        page1.setCurrent(current);
        page1.setSize(size);
        walletStatistics.setPage(page1);
        walletStatistics.setPage(walletStatisticsDetailIPage);
        walletStatistics.setTotalRecharge(totalRecharge);
        walletStatistics.setTotalWithdraw(totalWithdraw);
        walletStatistics.setTotalShopWithdraw(totalShopWithdraw);
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -393,7 +393,6 @@
        if(200 == r.getCode()){
            this.updateById(order);
        }
        refundPayMoney(order);
        return r;
    }
    
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/ShoppingCartServiceImpl.java
@@ -1141,8 +1141,7 @@
            //处理优惠券
            if(null != order.getUserCouponId()){
                UserCoupon userCoupon = userCouponClient.getUserCoupon(order.getUserCouponId()).getData();
                if(null != userCoupon && 1 == userCoupon.getStatus()){
                    userCoupon.setStatus(2);
                if(null != userCoupon && null == userCoupon.getUseTime()){
                    userCoupon.setUseTime(LocalDateTime.now());
                    userCouponClient.editUserCoupon(userCoupon);
                }
@@ -1354,7 +1353,7 @@
        //处理优惠券
        if(null != order.getUserCouponId()){
            UserCoupon userCoupon = userCouponClient.getUserCoupon(order.getUserCouponId()).getData();
            if(null != userCoupon && 1 == userCoupon.getStatus()){
            if(null != userCoupon && null == userCoupon.getUseTime()){
                userCoupon.setStatus(2);
                userCoupon.setUseTime(LocalDateTime.now());
                userCouponClient.editUserCoupon(userCoupon);
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/RedPackegeSetController.java
@@ -66,11 +66,11 @@
    @PostMapping("/addRedPackegeSet")
    @Transactional(rollbackFor = Exception.class)
    public R<Void> addRedPackegeSet(@RequestBody RedPackegeSetDto redPackegeSets){
        redPackegeSetService.remove(null);
        List<RedPackegeSet> redPackegeSetList = redPackegeSets.getRedPackegeSets();
        if (hasOverlap(redPackegeSetList)) {
            R.fail("时间段存在重叠,请重新配置");
            return R.fail("时间段存在重叠,请重新配置");
        }
        redPackegeSetService.remove(null);
        redPackegeSetService.saveBatch(redPackegeSetList);
        return R.ok();
    }