buhuazhen
2026-04-20 2aebdcfb7fc35a6c7aed4273f3a39cf7166f0564
fix(home): 提高金额显示的精度至三位小数

- 将月销售金额和已售金额的小数位精度从2位调整为3位
- 将月采购金额和已付款金额的小数位精度从2位调整为3位
- 将库存数量的小数位精度从2位调整为3位
- 将当天入库数量的小数位精度从2位调整为3位
已修改1个文件
12 ■■■■ 文件已修改
src/main/java/com/ruoyi/home/service/impl/HomeServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/home/service/impl/HomeServiceImpl.java
@@ -178,8 +178,8 @@
            BigDecimal noInvoiceAmountTotal = salesLedgerProducts.stream().map(SalesLedgerProduct::getNoInvoiceAmount)
                    .filter(Objects::nonNull)
                    .reduce(BigDecimal.ZERO, BigDecimal::add);
            homeBusinessDto.setMonthSaleMoney(contractAmount.setScale(2, RoundingMode.HALF_UP).toString());
            homeBusinessDto.setMonthSaleHaveMoney(noInvoiceAmountTotal.setScale(2, RoundingMode.HALF_UP).toString());
            homeBusinessDto.setMonthSaleMoney(contractAmount.setScale(3, RoundingMode.HALF_UP).toString());
            homeBusinessDto.setMonthSaleHaveMoney(noInvoiceAmountTotal.setScale(3, RoundingMode.HALF_UP).toString());
        }
        // 创建LambdaQueryWrapper
        LambdaQueryWrapper<PurchaseLedger> queryWrapper = new LambdaQueryWrapper<>();
@@ -208,16 +208,16 @@
                    .filter(Objects::nonNull)
                    .reduce(BigDecimal.ZERO, BigDecimal::add);
            homeBusinessDto.setMonthPurchaseMoney(receiveAmount.setScale(2, RoundingMode.HALF_UP).toString());
            homeBusinessDto.setMonthPurchaseHaveMoney(unReceiptPaymentAmount.setScale(2, RoundingMode.HALF_UP).toString());
            homeBusinessDto.setMonthPurchaseMoney(receiveAmount.setScale(3, RoundingMode.HALF_UP).toString());
            homeBusinessDto.setMonthPurchaseHaveMoney(unReceiptPaymentAmount.setScale(3, RoundingMode.HALF_UP).toString());
        }
        // 统计库存
        BigDecimal stockQuantityTotal = stockInventoryMapper.selectTotal();
        homeBusinessDto.setInventoryNum(stockQuantityTotal.setScale(2, RoundingMode.HALF_UP).toString());
        homeBusinessDto.setInventoryNum(stockQuantityTotal.setScale(3, RoundingMode.HALF_UP).toString());
        // 获取当天入库数量
        BigDecimal bigDecimal = stockInventoryMapper.selectTotalByDate(LocalDate.now());
        homeBusinessDto.setTodayInventoryNum(bigDecimal.setScale(2, RoundingMode.HALF_UP).toString());
        homeBusinessDto.setTodayInventoryNum(bigDecimal.setScale(3, RoundingMode.HALF_UP).toString());
        return homeBusinessDto;
    }