From 77341e66cc97bb5ed30ea581d07d7fa22593f2c5 Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期四, 03 四月 2025 22:52:59 +0800 Subject: [PATCH] bug修改 --- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScreenService.java | 24 ++++++++++++++---------- ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTenantServiceImpl.java | 6 +++--- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScreenService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScreenService.java index 805e13c..5e45c2b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScreenService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ScreenService.java @@ -2,7 +2,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.common.core.domain.R; -import com.ruoyi.common.enums.BillTypeEnum; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.system.model.TBill; @@ -21,7 +20,12 @@ import java.math.BigDecimal; import java.math.RoundingMode; -import java.util.*; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Objects; /** * @author mitao @@ -61,13 +65,13 @@ .filter(item -> !item.getPayFeesStatus().equals("5")) .map(TBill::getPayableFeesMoney) .reduce(BigDecimal.ZERO, BigDecimal::add) - .divide(new BigDecimal("10000"),2, RoundingMode.HALF_UP); + .divide(new BigDecimal("10000"),2, RoundingMode.DOWN); vo.setTotalReceivableRent(totalReceivableRent); //总计已收租金 BigDecimal totalReceivedRent = billList.stream() .map(TBill::getPayFeesMoney) .reduce(BigDecimal.ZERO, BigDecimal::add) - .divide(new BigDecimal("10000"),2, RoundingMode.HALF_UP); + .divide(new BigDecimal("10000"),2, RoundingMode.DOWN); vo.setTotalReceivedRent(totalReceivedRent); //本月新增租户数 Integer newTenantCount = tContractService.getCurrentMonthRentCount(businessDeptId); @@ -88,26 +92,26 @@ BigDecimal totalRentPaid = currentQuarterBillList.stream() .map(TBill::getPayFeesMoney) .reduce(BigDecimal.ZERO, BigDecimal::add) - .divide(new BigDecimal("10000"),2, RoundingMode.HALF_UP); + .divide(new BigDecimal("10000"),2, RoundingMode.DOWN); vo.setTotalRentPaid(totalRentPaid); //本季度应交租金 BigDecimal totalRentShould = currentQuarterBillList.stream() .filter(item -> !item.getPayFeesStatus().equals("5")) .map(TBill::getPayableFeesMoney) .reduce(BigDecimal.ZERO, BigDecimal::add) - .divide(new BigDecimal("10000"),2, RoundingMode.HALF_UP); + .divide(new BigDecimal("10000"),2, RoundingMode.DOWN); vo.setTotalRentShould(totalRentShould); //本季度欠费 BigDecimal totalRentOwe = currentQuarterBillList.stream() .map(TBill::getOutstandingMoney) .reduce(BigDecimal.ZERO, BigDecimal::add) - .divide(BigDecimal.valueOf(10000L), 2, RoundingMode.HALF_UP); + .divide(BigDecimal.valueOf(10000L), 2, RoundingMode.DOWN); vo.setTotalRentOwe(totalRentOwe); //总计欠费 BigDecimal totalRentOweAll = billList.stream() .map(TBill::getOutstandingMoney) .reduce(BigDecimal.ZERO, BigDecimal::add) - .divide(BigDecimal.valueOf(10000L), 2, RoundingMode.HALF_UP); + .divide(BigDecimal.valueOf(10000L), 2, RoundingMode.DOWN); vo.setTotalRentOweAll(totalRentOweAll); return vo; } @@ -150,14 +154,14 @@ .map(TBill::getPayFeesMoney) .filter(Objects::nonNull) .reduce(BigDecimal.ZERO, BigDecimal::add) - .divide(BigDecimal.valueOf(10000L), 2, RoundingMode.HALF_UP); + .divide(BigDecimal.valueOf(10000L), 2, RoundingMode.DOWN); // 计算季度欠费总和 BigDecimal quarterOutstanding = quarterBills.stream() .map(TBill::getOutstandingMoney) .filter(Objects::nonNull) .reduce(BigDecimal.ZERO, BigDecimal::add) - .divide(BigDecimal.valueOf(10000L), 2, RoundingMode.HALF_UP); + .divide(BigDecimal.valueOf(10000L), 2, RoundingMode.DOWN); // 生成季度标签 (格式: YY-MM月) Calendar cal = Calendar.getInstance(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTenantServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTenantServiceImpl.java index aeeec8d..8f869f1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTenantServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TTenantServiceImpl.java @@ -6,7 +6,6 @@ import com.ruoyi.common.basic.PageInfo; import com.ruoyi.common.constant.DictConstants; import com.ruoyi.common.utils.DictUtils; -import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.dto.TTenantDTO; import com.ruoyi.system.mapper.TContractMapper; @@ -49,14 +48,15 @@ @Override public PageInfo<TenantVO> pageList(TTenantQuery query) { PageInfo<TenantVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); - String businessDeptId = SecurityUtils.getBusinessDeptId(); + /* String businessDeptId = SecurityUtils.getBusinessDeptId(); List<TenantVO> list = null; if (StringUtils.isBlank(businessDeptId) || "0".equals(businessDeptId)) { list = this.baseMapper.pageList(query, pageInfo); } else { query.setBusinessDeptId(businessDeptId); list = this.baseMapper.pageListByBusinessDeptId(query,pageInfo); - } + }*/ + List<TenantVO> list = this.baseMapper.pageList(query, pageInfo); for (TenantVO tenantVO : list) { tenantVO.setTenantAttributesName(StringUtils.isNotBlank(tenantVO.getTenantAttributes())?DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_ATTRIBUTE,tenantVO.getTenantAttributes()):""); tenantVO.setTenantTypeName(StringUtils.isNotBlank(tenantVO.getTenantType())?DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_TYPE,tenantVO.getTenantType()):""); -- Gitblit v1.7.1