保誠-保戶業務員媒合平台
Mila
2021-12-29 c4f664ac6ff3060b82ae8d2108ed07bbc3cf9222
Merge branch 'master' of https://192.168.0.10:8443/r/pcalife/PAM
修改1個檔案
13 ■■■■ 已變更過的檔案
pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java 13 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java
@@ -9,6 +9,7 @@
import com.pollex.pam.config.ApplicationProperties;
import com.pollex.pam.service.dto.AppointmentUpdateDTO;
import com.pollex.pam.web.rest.errors.SendEmailFailException;
import com.pollex.pam.web.rest.errors.SendSMSFailException;
import io.jsonwebtoken.lang.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -188,8 +189,12 @@
        String consultantMobile = consultantService.findByAgentNo(appointment.getAgentNo()).getPhoneNumber();
        try {
            if(StringUtils.hasText(consultantMobile)) {
            sendMsgService.sendMsgBySMS(consultantMobile, msg);
        } catch (Exception e) {
            }
            throw new SendEmailFailException("the consultant does not have mobile!");
        } catch (SendSMSFailException e) {
            log.warn("send appointment notify by sms was fail, appointment Id = {}", appointment.getId(), e);
        }
    }
@@ -226,9 +231,13 @@
        String content = springTemplateEngine.process("mail/appointmentNotifyEmail", context);
        try {
            if(StringUtils.hasText(consultantEmail)) {
            sendMsgService.sendMsgByEmail(senderEmail, consultantEmail, NOTIFY_EMAIL_SUBJECT, content, true);
            }
            throw new SendEmailFailException("the consultant does not have email!");
        } catch (SendEmailFailException e) {
            log.warn("send email failed, appointment Id = {}", appointment.getId(), e);
            log.warn("send appointment notify by email was fail, appointment Id = {}", appointment.getId(), e);
        }
    }