wujianwei
2025-12-22 021ef43a08e1b7b1e36a4c4b734a6105821b9613
新增客户判断
1个文件已修改
13 ■■■■■ 已修改文件
service/src/main/java/com/ruoyi/cwgl/service/impl/ReceivableFeeManagementServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/ReceivableFeeManagementServiceImpl.java
@@ -4,7 +4,9 @@
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import javax.annotation.Resource;
@@ -239,6 +241,17 @@
        // 查询应收费用主表记录
        List<ReceivableFeeManagement> receivableFeeList = receivableFeeManagementMapper.selectReceivableFeeManagementByIds(ids);
        
        // 检查所有记录是否属于同一个客户
        if (!receivableFeeList.isEmpty()) {
            Integer firstCustomerId = receivableFeeList.get(0).getCustomerId();
            boolean allSameCustomer = receivableFeeList.stream()
                    .allMatch(item -> Objects.equals(item.getCustomerId(), firstCustomerId));
            if (!allSameCustomer) {
                throw new ServiceException("所选记录包含不同客户的数据,无法进行统计");
            }
        }
        // 计算单据数量
        int documentCount = receivableFeeList.size();
        SysConfig sysConfig = sysConfigMapper.selectConfig(new SysConfig() {{