From f5831acafe510f9a79f8e2ecf6dee09026d67fc6 Mon Sep 17 00:00:00 2001 From: HelenHuang <LinHuang@pollex.com.tw> Date: 星期四, 20 一月 2022 16:09:09 +0800 Subject: [PATCH] Merge branch 'Phase3' of https://dev.pollex.com.tw:8443/r/pcalife/PAM into Phase3 --- pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentCustomerViewMapper.java | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentCustomerViewMapper.java b/pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentCustomerViewMapper.java index 65dec36..1821d25 100644 --- a/pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentCustomerViewMapper.java +++ b/pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentCustomerViewMapper.java @@ -3,14 +3,18 @@ import static java.util.stream.Collectors.toList; import java.util.List; +import java.util.Optional; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.pollex.pam.domain.AppointmentClosedInfo; import com.pollex.pam.domain.AppointmentCustomerView; import com.pollex.pam.domain.AppointmentNoticeLog; +import com.pollex.pam.repository.AppointmentClosedInfoRepository; +import com.pollex.pam.service.AppointmentClosedInfoService; import com.pollex.pam.service.AppointmentNoticeLogService; import com.pollex.pam.service.AppointmentService; import com.pollex.pam.service.dto.AppointmentCustomerViewDTO; @@ -24,6 +28,9 @@ @Autowired AppointmentNoticeLogService appointmentNoticeLogService; + @Autowired + AppointmentClosedInfoRepository appointmentClosedInfoRepository; + @Transactional public AppointmentCustomerViewDTO toAppointmentCustomerViewDTO(AppointmentCustomerView source) { AppointmentCustomerViewDTO target = new AppointmentCustomerViewDTO(); @@ -32,6 +39,12 @@ appointmentService.setInterviewRecordDTO(target); List<AppointmentNoticeLog> noticeLogs = appointmentNoticeLogService.findByAppointmentId(source.getId()); target.setAppointmentNoticeLogs(noticeLogs); + Optional<AppointmentClosedInfo> appointmentClosedInfoOP = appointmentClosedInfoRepository + .findByAppointmentId(source.getId()); + if(appointmentClosedInfoOP.isPresent()) { + target.setAppointmentClosedInfo(appointmentClosedInfoOP.get()); + } + return target; } -- Gitblit v1.8.0