保誠-保戶業務員媒合平台
wayne
2022-02-17 34b08e1c461f5e08675fcff95525956d7c4bef11
pamapi/src/main/java/com/pollex/pam/service/ScheduleTaskService.java
@@ -6,6 +6,7 @@
import com.pollex.pam.enums.AppointmentStatusEnum;
import com.pollex.pam.enums.ContactStatusEnum;
import com.pollex.pam.enums.SatisfactionStatusEnum;
import com.pollex.pam.enums.SatisfactionTypeEnum;
import com.pollex.pam.repository.AppointmentCustomerViewRepository;
import com.pollex.pam.repository.AppointmentExpiringNotifyRecordRepository;
import org.slf4j.Logger;
@@ -127,13 +128,14 @@
    // todo 需確認該時間, otis todo=134497
    @Scheduled(cron = "0 30 8 * * *")
    public void sendNotFillSatisfactionToPersonalNotification() {
        Map<Long, List<Satisfaction>> customerNotFillSatisfactions = satisfactionService.getByStatus(SatisfactionStatusEnum.UNFILLED)
    public void sendNotFillAppointmentSatisfactionToPersonalNotification() {
        Map<Long, List<Satisfaction>> customerNotFillSatisfactions =
            satisfactionService.getByStatusAndType(SatisfactionStatusEnum.UNFILLED, SatisfactionTypeEnum.APPOINTMENT)
                .stream()
                .collect(Collectors.groupingBy(Satisfaction::getCustomerId));
        customerNotFillSatisfactions.forEach((customerId, notFillSatisfactions) ->
            personalNotificationService.createNotFillSatisfactionSumToCustomer(customerId, notFillSatisfactions.size())
            personalNotificationService.createNotFillAppointmentSatisfactionNumberToCustomer(customerId, notFillSatisfactions.size())
        );
    }