From 3c94dc06c3b99e7fc430e68ee2ce4a6cf2cd422c Mon Sep 17 00:00:00 2001
From: wayne <wayne8692wayne8692@gmail.com>
Date: 星期三, 16 二月 2022 15:54:32 +0800
Subject: [PATCH] [update] 修正滿意度評分在沒有撈到任何評分紀錄時,不可直接set 0進顧問的分數中

---
 pamapi/src/main/java/com/pollex/pam/service/ScheduleTaskService.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/pamapi/src/main/java/com/pollex/pam/service/ScheduleTaskService.java b/pamapi/src/main/java/com/pollex/pam/service/ScheduleTaskService.java
index 57324b5..627aeb4 100644
--- a/pamapi/src/main/java/com/pollex/pam/service/ScheduleTaskService.java
+++ b/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())
         );
     }
 

--
Gitblit v1.8.0