From e5065dea306c4a3185fbee8c12525cf8c5ef85ee Mon Sep 17 00:00:00 2001
From: Jack <jack.su@pollex.com.tw>
Date: 星期五, 21 一月 2022 17:02:55 +0800
Subject: [PATCH] [ADD] 新增小鈴鐺通知的查詢API [UPDATE] 調整取得最愛顧問清單的狀態判斷 [BUG] 修復結案的進件時間只有日期的問題

---
 pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentMapper.java |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentMapper.java b/pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentMapper.java
index 7b9e398..f92aac5 100644
--- a/pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentMapper.java
+++ b/pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentMapper.java
@@ -5,13 +5,21 @@
 import java.util.List;
 
 import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.pollex.pam.domain.Appointment;
+import com.pollex.pam.domain.Satisfaction;
+import com.pollex.pam.enums.SatisfactionStatusEnum;
+import com.pollex.pam.repository.AppointmentRepository;
 import com.pollex.pam.service.dto.AppointmentDTO;
+import com.pollex.pam.service.dto.SatisfactionCustomerScoreDTO;
 
 @Service
 public class AppointmentMapper {
+
+	@Autowired
+	AppointmentRepository appointmentRepository;
 
 	public AppointmentDTO toAppointmentDTO(Appointment source) {
 		AppointmentDTO target = new AppointmentDTO();
@@ -24,4 +32,20 @@
 				.map(s -> toAppointmentDTO(s)).collect(toList());
 	}
 
+	public Satisfaction toSatisfaction(Appointment appointment) {
+		Satisfaction target = new Satisfaction();
+        target.setAppointmentId(appointment.getId());
+		target.setAgentNo(appointment.getAgentNo());
+		target.setCustomerId(appointment.getCustomerId());
+		target.setStatus(SatisfactionStatusEnum.UNFILLED);
+		return target;
+	}
+
+	public Satisfaction toSatisfaction(Long appointmentId) {
+		Appointment appointment = appointmentRepository.findById(appointmentId).get();
+		return toSatisfaction(appointment);
+	}
+
+
+
 }

--
Gitblit v1.8.0