This commit is contained in:
zhuyy 2023-10-11 16:33:31 +08:00
parent d9cdc7293c
commit 01b59e1f66
1 changed files with 10 additions and 1 deletions

View File

@ -158,9 +158,18 @@ public class RecruitmentServiceImpl extends BaseService<RecruitmentMapper, Recru
to.mkdirs(); to.mkdirs();
} }
Organization organization = organizationMapper.selectById(id); Organization organization = organizationMapper.selectById(id);
if (ObjectUtil.isNull(organization)) {
throw new ResultException("数据不存在!");
}
CompanyName companyName = companyNameMapper.selectById(organization.getCompanyId()); CompanyName companyName = companyNameMapper.selectById(organization.getCompanyId());
if (ObjectUtil.isNull(companyName)) {
throw new ResultException("数据不存在!");
}
List<Recruitment> recruitments = recruitmentMapper.selectList(Wrappers.lambdaQuery(Recruitment.class).eq(Recruitment::getCompanyId, organization.getId())); List<Recruitment> recruitments = recruitmentMapper.selectList(Wrappers.lambdaQuery(Recruitment.class).eq(Recruitment::getCompanyId, organization.getId()));
long sum = recruitments.stream().mapToLong(Recruitment::getPlaces).sum(); long sum = 0;
if (CollUtil.isNotEmpty(recruitments)) {
sum = recruitments.stream().mapToLong(Recruitment::getPlaces).sum();
}
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("name", companyName.getCompanyName()); params.put("name", companyName.getCompanyName());
params.put("check", organization.getCheckNumber()); params.put("check", organization.getCheckNumber());