工作台预约面试待审核的增加对应时段预约情况信息
This commit is contained in:
@@ -152,6 +152,17 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
|
||||
Map<Long, HyPartnerLineInfoDO> hyPartnerLineInfoDOMap = hyPartnerLineInfoDOS.stream().collect(Collectors.toMap(HyPartnerLineInfoDO::getId, data -> data));
|
||||
List<String> userPortraitList = list.stream().filter(x -> StringUtils.isNotEmpty(x.getUserPortrait() )).map(PartnerInterviewInfoDTO::getUserPortrait).collect(Collectors.toList());
|
||||
Map<Long, String> userPortraitMap = labelService.getUserPortraitMap(userPortraitList);
|
||||
//获取对应时间段的预约情况
|
||||
Map<String, HyPartnerInterviewBookSituation> orderSituationMap;
|
||||
if (CommonConstants.PENDING.equals(type)) {
|
||||
Optional<PartnerInterviewInfoDTO> minInterviewStartTime = list.stream().min((info1, info2) -> info1.getStartTime().compareTo(info2.getStartTime()));
|
||||
Optional<PartnerInterviewInfoDTO> maxInterviewEndTime = list.stream().max((info1, info2) -> info1.getEndTime().compareTo(info2.getEndTime()));
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
List<HyPartnerInterviewBookSituation> interviewBookSituation = hyPartnerInterviewPlanMapper.getInterviewBookSituation(userId, dateFormat.format(minInterviewStartTime.get().getStartTime()), dateFormat.format(maxInterviewEndTime.get().getEndTime()));
|
||||
orderSituationMap = interviewBookSituation.stream().collect(Collectors.toMap(HyPartnerInterviewBookSituation::getStartTime, situation -> situation));
|
||||
} else {
|
||||
orderSituationMap = new HashMap<>();
|
||||
}
|
||||
list.stream().forEach(x->{
|
||||
PartnerInterviewInfoVO partnerInterviewInfoVO = convertPartnerInterviewInfoDTOToVo(x,userPortraitMap,userNameMap.get(x.getPartnerId()),channelMap);
|
||||
partnerInterviewInfoVO.setPartnerName(userNameMap.getOrDefault(x.getPartnerId(),new HyPartnerUserInfoDO()).getUsername());
|
||||
@@ -160,6 +171,16 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
|
||||
partnerInterviewInfoVO.setInterviewerPhone(interviewerUserMap.getOrDefault(x.getInterviewer(),new EnterpriseUserDO()).getMobile());
|
||||
partnerInterviewInfoVO.setLineStatus(hyPartnerLineInfoDOMap.getOrDefault(x.getPartnerLineId(),new HyPartnerLineInfoDO()).getLineStatus());
|
||||
partnerInterviewInfoVO.setLineId(hyPartnerLineInfoDOMap.getOrDefault(x.getPartnerLineId(),new HyPartnerLineInfoDO()).getId());
|
||||
if (CommonConstants.PENDING.equals(type)) {
|
||||
//设置对应时间段的被预约情况
|
||||
HyPartnerInterviewBookSituation bookSituation = orderSituationMap.getOrDefault(partnerInterviewInfoVO.getStartTime().replace("/", "-"), new HyPartnerInterviewBookSituation(0, Boolean.FALSE));
|
||||
Integer appointmentCount = bookSituation.getBookingCount();
|
||||
//预约人数需要减去自己
|
||||
appointmentCount = appointmentCount == 0 ? appointmentCount : appointmentCount - 1;
|
||||
partnerInterviewInfoVO.setAppointmentCount(appointmentCount);
|
||||
//是否被预约
|
||||
partnerInterviewInfoVO.setBooked(bookSituation.getBooked());
|
||||
}
|
||||
result.add(partnerInterviewInfoVO);
|
||||
});
|
||||
partnerInterviewInfoList.setList(result);
|
||||
|
||||
Reference in New Issue
Block a user