| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | // 获取预约时段有服务的分析师(不可预约) |
| | | List<MentalAppointment> sameTimeAppointmentList = mentalAppointmentService.list( |
| | | Wrappers.<MentalAppointment>lambdaQuery() |
| | | .isNull(MentalAppointment::getType) |
| | | .eq(MentalAppointment::getAppointmentDay, appointmentDayYmd) |
| | | .eq(MentalAppointment::getBeginTimePoint, beginTimePoint) |
| | | .eq(MentalAppointment::getEndTimePoint, endTimePoint) |
| | | .in(MentalAppointment::getStatusFlag, Arrays.asList( |
| | | MentalAppointmentStatusEnum.WAIT_PAY.getCode(), |
| | | MentalAppointmentStatusEnum.WAIT_SERVICE.getCode(), |
| | | MentalAppointmentStatusEnum.IN_SERVICE.getCode() |
| | | )) |
| | | .isNotNull(MentalAppointment::getWorkerId) |
| | | ); |
| | | List<Long> neWorkerIdList = sameTimeAppointmentList.stream().map(MentalAppointment::getWorkerId).collect(Collectors.toList()); |
| | | |
| | |
| | | // 获取当前星期 |
| | | Integer weekDay = DateUtil.dayOfWeekEnum(appointmentDay).getIso8601Value(); |
| | | // 预约时间段配置匹配的性格分析师 |
| | | List<MentalAnalysisTimeConfig> eqWorkerTimeConfigList = mentalAnalysisTimeConfigService.getWorkerListByAppointmentTime(CustomerMentalAnalysisStatusEnum.ON_WORK.getCode(), weekDay, appointmentDayYmd, beginTimePoint, endTimePoint); |
| | | List<MentalAnalysisTimeConfig> eqWorkerTimeConfigList = mentalAnalysisTimeConfigService.getWorkerListByAppointmentTime(CustomerWorkStatusEnum.ON_WORK.getCode(), CustomerMentalAnalysisStatusEnum.ON_WORK.getCode(), weekDay, appointmentDayYmd, beginTimePoint, endTimePoint); |
| | | // 分析师ID(预约时间段配置匹配) |
| | | List<Long> eqWorkerIdByTimeConfigList = eqWorkerTimeConfigList.isEmpty() ? Collections.singletonList(0L) : |
| | | eqWorkerTimeConfigList.stream() |