diff --git a/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java b/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java index 791ec14..0873427 100644 --- a/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java +++ b/src/main/java/com/ydool/staff/service/impl/RecruitmentServiceImpl.java @@ -158,9 +158,18 @@ public class RecruitmentServiceImpl extends BaseService 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 params = new HashMap<>(); params.put("name", companyName.getCompanyName()); params.put("check", organization.getCheckNumber());