From 296632415043a56e27da67f23e9d801e2afe5ec6 Mon Sep 17 00:00:00 2001
From: wayne <wayne8692wayne8692@gmail.com>
Date: 星期三, 29 十二月 2021 13:58:05 +0800
Subject: [PATCH] [fix] 微調訊息文案的換行處理

---
 pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java b/pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java
index b624ba0..f79a9c8 100644
--- a/pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java
+++ b/pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java
@@ -189,11 +189,11 @@
         String consultantMobile = consultantService.findByAgentNo(appointment.getAgentNo()).getPhoneNumber();
 
         try {
-            if(StringUtils.hasText(consultantMobile)) {
-                sendMsgService.sendMsgBySMS(consultantMobile, msg);
+            if(!StringUtils.hasText(consultantMobile)) {
+                throw new SendSMSFailException("the consultant does not have mobile!");
             }
 
-            throw new SendSMSFailException("the consultant does not have mobile!");
+            sendMsgService.sendMsgBySMS(consultantMobile, msg);
         } catch (SendSMSFailException e) {
             log.warn("send appointment notify by sms was fail, appointment Id = {}", appointment.getId(), e);
         }
@@ -202,13 +202,13 @@
     private String getAppointmentNotifyWording(Appointment appointment) {
         String normalContent;
         if(StringUtils.hasText(appointment.getPhone())) {
-            normalContent = "閬芣��“��憟踝����蝑�靽�犖憯賢��像��������恥�����Ⅳ�" + appointment.getPhone() + "\n\n";
+            normalContent = "閬芣��“��憟踝����蝑�靽�犖憯賢��像��������恥�����Ⅳ�" + appointment.getPhone();
         }
         else {
-            normalContent = "閬芣��“��憟踝����蝑�靽�犖憯賢��像�����n\n";
+            normalContent = "閬芣��“��憟踝����蝑�靽�犖憯賢��像������";
         }
 
-        String urlContent = "隢��雯��嚗�" + getAppointmentDetailUrl(appointment.getId()) + " ����蒂摰�蝯∟赤隢�����";
+        String urlContent = "嚗���雯��嚗�" + getAppointmentDetailUrl(appointment.getId()) + "����蒂摰�蝯∟赤隢�����";
         return normalContent + urlContent;
     }
 
@@ -219,10 +219,10 @@
         String normalContent;
 
         if(StringUtils.hasText(customerMobile)) {
-            normalContent = "閬芣��“��憟踝����蝑�靽�犖憯賢��像��������恥�����Ⅳ�" + customerMobile + "";
+            normalContent = "閬芣��“��憟踝����蝑�靽�犖憯賢��像��������恥�����Ⅳ�" + customerMobile + "嚗�";
         }
         else {
-            normalContent = "閬芣��“��憟踝����蝑�靽�犖憯賢��像������";
+            normalContent = "閬芣��“��憟踝����蝑�靽�犖憯賢��像�������";
         }
 
         Context context = new Context();
@@ -231,11 +231,11 @@
         String content = springTemplateEngine.process("mail/appointmentNotifyEmail", context);
 
         try {
-            if(StringUtils.hasText(consultantEmail)) {
-                sendMsgService.sendMsgByEmail(senderEmail, consultantEmail, NOTIFY_EMAIL_SUBJECT, content, true);
+            if(!StringUtils.hasText(consultantEmail)) {
+                throw new SendEmailFailException("the consultant does not have email!");
             }
 
-            throw new SendEmailFailException("the consultant does not have email!");
+            sendMsgService.sendMsgByEmail(senderEmail, consultantEmail, NOTIFY_EMAIL_SUBJECT, content, true);
         } catch (SendEmailFailException e) {
             log.warn("send appointment notify by email was fail, appointment Id = {}", appointment.getId(), e);
         }

--
Gitblit v1.8.0