保誠-保戶業務員媒合平台
wayne
2022-01-24 ab6eb14b5081e2ca979f84bbb97cb68db57a6791
[ref] 調整命名以及修正未填寫滿意度的小鈴鐺批次時間

時間暫定8:30
修改1個檔案
12 ■■■■ 已變更過的檔案
pamapi/src/main/java/com/pollex/pam/service/ScheduleTaskService.java 12 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/java/com/pollex/pam/service/ScheduleTaskService.java
@@ -94,7 +94,7 @@
                .filter(appointment ->
                    appointmentService.isAppointmentDateNotInIntervalFromNow(appointment, Constants.APPOINTMENT_EXPIRING_PHONE_INTERVAL, Constants.APPOINTMENT_EXPIRING_EMAIL_INTERVAL)
                )
                .filter(this::isAppointmentNotifyNotOnLimit)
                .filter(this::isAppointmentExpiringNotifyNotOnLimit)
                .collect(Collectors.toList());
        allByCommunicateStatus.forEach(appointment -> {
@@ -104,10 +104,10 @@
            optionalPhone.ifPresent(phone ->
                sendMsgService.sendMsgBySMS(phone, String.format("很抱歉!您預約%s顧問正忙碌中,請您取消預約並改選其他顧問,請點擊網址:%s"
                    , consultant.getName(), getAppointmentUrl(appointment.getId())))
                    , consultant.getName(), getAppointmentExpiringNotifyUrl(appointment.getId())))
            );
            optionalEmail.ifPresent(email ->
                sendMsgService.sendMsgByEmail(email, NOT_CONTACTED_NOTIFY_SUBJECT, getAppointmentExpiringNotifyEmail(consultant.getName(), getAppointmentUrl(appointment.getId())), true)
                sendMsgService.sendMsgByEmail(email, NOT_CONTACTED_NOTIFY_SUBJECT, getAppointmentExpiringNotifyEmail(consultant.getName(), getAppointmentExpiringNotifyUrl(appointment.getId())), true)
            );
            AppointmentExpiringNotifyRecord record = new AppointmentExpiringNotifyRecord();
@@ -121,7 +121,7 @@
    }
    // todo 需確認該時間, otis todo=134497
    @Scheduled(cron = "0 0 9 * * *")
    @Scheduled(cron = "0 30 8 * * *")
    public void sendNotFillSatisfactionToPersonalNotification() {
        Map<Long, List<Satisfaction>> customerNotFillSatisfactions = satisfactionService.getByStatus(SatisfactionStatusEnum.UNFILLED)
                .stream()
@@ -132,14 +132,14 @@
        );
    }
    private boolean isAppointmentNotifyNotOnLimit(AppointmentCustomerView appointment) {
    private boolean isAppointmentExpiringNotifyNotOnLimit(AppointmentCustomerView appointment) {
        int sendNotifyToCustomerRecordSum =
            appointmentExpiringNotifyRecordRepository.findAllByAppointmentId(appointment.getId()).size();
        return sendNotifyToCustomerRecordSum < Constants.SEND_EXPIRING_NOTIFY_LIMIT;
    }
    private String getAppointmentUrl(Long appointmentId) {
    private String getAppointmentExpiringNotifyUrl(Long appointmentId) {
        return applicationProperties.getFrontEndDomain() + "?notContactAppointmentId=" + appointmentId;
    }