| | |
| | | List<CapitalAccountCompany> capitalAccountCompanyList = capitalAccountCompanyRepository.findByProjectDistinguishAndAccountTypeAndAccountYear(resources.getProjectDistinguish(), resources.getAccountType(), resources.getAccountYear()); |
| | | // 判断结果集长度 |
| | | if (capitalAccountCompanyList.size() > 1) { |
| | | throw new BadRequestException("每个年度同类型公司流账户只能有一个!"); |
| | | throw new BadRequestException("每个年度项目区分+账户类型组合公司流账户只能有一个!"); |
| | | } else if (capitalAccountCompanyList.size() == 1) { |
| | | if (resources.getId() == null || capitalAccountCompanyList.get(0).getId().longValue() != resources.getId().longValue()) { |
| | | throw new BadRequestException("每个年度同类型公司流账户只能有一个!"); |
| | | throw new BadRequestException("每个年度项目区分+账户类型组合公司流账户只能有一个!"); |
| | | } |
| | | } |
| | | } |