| | |
| | | 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; |
| | | |
| | |
| | | // 查询应收费用主表记录 |
| | | 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() {{ |