From 1d8e72674b2d14270fe5c2ba6fe3be4efa28a924 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期五, 24 十二月 2021 13:19:37 +0800 Subject: [PATCH] Merge branch 'master' of https://dev.pollex.com.tw:8443/r/pcalife/PAM --- pamapi/src/main/resources/config/application-pollex.yml | 1 + pamapi/src/main/resources/config/application-dev.yml | 1 + pamapi/src/main/resources/config/application-sit.yml | 5 +++-- pamapi/src/main/java/com/pollex/pam/web/rest/TestSendMsgResource.java | 5 ----- pamapi/src/main/java/com/pollex/pam/service/SendMsgService.java | 4 ++-- pamapi/src/main/resources/config/application-uat.yml | 3 ++- pamapi/src/main/java/com/pollex/pam/config/ApplicationProperties.java | 9 +++++++++ 7 files changed, 18 insertions(+), 10 deletions(-) diff --git a/pamapi/src/main/java/com/pollex/pam/config/ApplicationProperties.java b/pamapi/src/main/java/com/pollex/pam/config/ApplicationProperties.java index fc204ce..332ead8 100644 --- a/pamapi/src/main/java/com/pollex/pam/config/ApplicationProperties.java +++ b/pamapi/src/main/java/com/pollex/pam/config/ApplicationProperties.java @@ -116,6 +116,7 @@ private String sourceCode; private String sender; private String smsType; + private String subject; public String getUrl() { return url; @@ -148,6 +149,14 @@ public void setSmsType(String smsType) { this.smsType = smsType; } + + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } } public static class Email { diff --git a/pamapi/src/main/java/com/pollex/pam/service/SendMsgService.java b/pamapi/src/main/java/com/pollex/pam/service/SendMsgService.java index eb758f6..d630ba6 100644 --- a/pamapi/src/main/java/com/pollex/pam/service/SendMsgService.java +++ b/pamapi/src/main/java/com/pollex/pam/service/SendMsgService.java @@ -131,7 +131,7 @@ sendSMSRequest.setSender(smsProperties.getSender()); sendSMSRequest.setMsgTypeSet(smsProperties.getSmsType()); sendSMSRequest.setSendTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:00"))); - sendSMSRequest.setSubject(""); + sendSMSRequest.setSubject(encoder.encodeToString(smsProperties.getSubject().getBytes(StandardCharsets.UTF_8))); sendSMSRequest.setActivityId(""); SMSDetail smsDetail = new SMSDetail(); @@ -194,7 +194,7 @@ SendMailResponse sendMailResponse = new ObjectMapper().readValue(responseEntity.getBody(), SendMailResponse.class); log.debug("sendMailResponse = {}", sendMailResponse); -// if(sendMailResponse == null || sendMailResponse.getData() == null || "ADDED".equalsIgnoreCase(sendMailResponse.getData().getMessageStatus())) { +// if(sendMailResponse == null || sendMailResponse.getData() == null || !"ADDED".equalsIgnoreCase(sendMailResponse.getData().getMessageStatus())) { // throw new SendEmailFailException(); // } diff --git a/pamapi/src/main/java/com/pollex/pam/web/rest/TestSendMsgResource.java b/pamapi/src/main/java/com/pollex/pam/web/rest/TestSendMsgResource.java index 461ea06..e1835e5 100644 --- a/pamapi/src/main/java/com/pollex/pam/web/rest/TestSendMsgResource.java +++ b/pamapi/src/main/java/com/pollex/pam/web/rest/TestSendMsgResource.java @@ -41,9 +41,4 @@ ) { return ResponseEntity.ok(sendMsgService.sendMsgByHtmlTestTemplateEmail(from, to)); } - - @GetMapping("/appointment/{appointmentId}") - public void sendAppointmentNotify(@PathVariable Long appointmentId) { - sendMsgService.sendAppointmentNotify(appointmentRepository.findById(appointmentId).get()); - } } diff --git a/pamapi/src/main/resources/config/application-dev.yml b/pamapi/src/main/resources/config/application-dev.yml index 66b939b..42031d8 100644 --- a/pamapi/src/main/resources/config/application-dev.yml +++ b/pamapi/src/main/resources/config/application-dev.yml @@ -126,6 +126,7 @@ source-code: ePos sender: POS sms-type: '0017' + subject: '慦�像��' email: url: https://localhost:8081/testEmail function-id: epos diff --git a/pamapi/src/main/resources/config/application-pollex.yml b/pamapi/src/main/resources/config/application-pollex.yml index 800d738..013dd6e 100644 --- a/pamapi/src/main/resources/config/application-pollex.yml +++ b/pamapi/src/main/resources/config/application-pollex.yml @@ -124,6 +124,7 @@ source-code: ePos sender: POS sms-type: '0017' + subject: '慦�像��' email: url: https://localhost:8081/testEmail function-id: epos diff --git a/pamapi/src/main/resources/config/application-sit.yml b/pamapi/src/main/resources/config/application-sit.yml index 908d753..16ddc37 100644 --- a/pamapi/src/main/resources/config/application-sit.yml +++ b/pamapi/src/main/resources/config/application-sit.yml @@ -118,12 +118,13 @@ e-service-login-func: ValidateUsrLogin e-service-login-sys: epos front-end-domain: https://vtwlifeopensyssit.pru.intranet.asia/pam - send-notify-msg: true + send-notify-msg: false sms: - url: https://vtwlifewinbo66.pru.intranet.asia/MesgQueueMgmnt/rest/smsSendMsgResource + url: https://vtwlifeopensysuat.pru.intranet.asia/MesgQueueMgmnt/rest/smsSendMsgResource source-code: ePos sender: POS sms-type: '0017' + subject: '慦�像��' email: url: https://vtwlifeopensysuat.pru.intranet.asia/tsgw/mq/mqSendMail function-id: epos diff --git a/pamapi/src/main/resources/config/application-uat.yml b/pamapi/src/main/resources/config/application-uat.yml index a6b85d7..f907809 100644 --- a/pamapi/src/main/resources/config/application-uat.yml +++ b/pamapi/src/main/resources/config/application-uat.yml @@ -120,10 +120,11 @@ front-end-domain: https://vtwlifeopensysuat.pru.intranet.asia/pam send-notify-msg: true sms: - url: https://vtwlifewinbo66.pru.intranet.asia/MesgQueueMgmnt/rest/smsSendMsgResource + url: https://vtwlifeopensysuat.pru.intranet.asia/MesgQueueMgmnt/rest/smsSendMsgResource source-code: ePos sender: POS sms-type: '0017' + subject: '慦�像��' email: url: https://vtwlifeopensysuat.pru.intranet.asia/tsgw/mq/mqSendMail function-id: epos -- Gitblit v1.8.0