From 9fbf413a72ac13c58f94b433857084946c2e0d9e Mon Sep 17 00:00:00 2001 From: Jack <jack.su@pollex.com.tw> Date: 星期二, 11 一月 2022 17:14:05 +0800 Subject: [PATCH] [ADD] 新增查看預約單通知歷程的API --- pamapi/src/main/java/com/pollex/pam/repository/AppointmentNoticeLogRepository.java | 4 ++ pamapi/src/main/java/com/pollex/pam/service/AppointmentNoticeLogService.java | 6 +++ pamapi/src/main/java/com/pollex/pam/service/dto/AppointmentCustomerViewDTO.java | 8 ++++ pamapi/src/main/java/com/pollex/pam/domain/AppointmentNoticeLog.java | 2 pamapi/src/main/java/com/pollex/pam/web/rest/NoticeResource.java | 1 pamapi/src/doc/預約單/取得預約單細節API.txt | 64 +++++++++++++++++++++----------- pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentCustomerViewMapper.java | 7 +++ 7 files changed, 69 insertions(+), 23 deletions(-) diff --git "a/pamapi/src/doc/\351\240\220\347\264\204\345\226\256/\345\217\226\345\276\227\351\240\220\347\264\204\345\226\256\347\264\260\347\257\200API.txt" "b/pamapi/src/doc/\351\240\220\347\264\204\345\226\256/\345\217\226\345\276\227\351\240\220\347\264\204\345\226\256\347\264\260\347\257\200API.txt" index 0520bc8..00a1f33 100644 --- "a/pamapi/src/doc/\351\240\220\347\264\204\345\226\256/\345\217\226\345\276\227\351\240\220\347\264\204\345\226\256\347\264\260\347\257\200API.txt" +++ "b/pamapi/src/doc/\351\240\220\347\264\204\345\226\256/\345\217\226\345\276\227\351\240\220\347\264\204\345\226\256\347\264\260\347\257\200API.txt" @@ -3,26 +3,46 @@ http://localhost:8080/api/appointment/getDetail/{appointmentId} +appointmentNoticeLogs: ��������風蝔� + + response body: -{ - "id": 110, - "phone": "09123456789", - "email": "", - "contactType": "mobile", - "gender": "male", - "age": "30", - "job": "��", - "requirement": "摮戊��,鞈閬��,��靽����", - "communicateStatus": "contacted", - "hopeContactTime": "'蝳格���,蝳格����12:00~14:00,14:00~18:00'", - "otherRequirement": null, - "appointmentDate": "2021-12-02T09:58:58.932Z", - "lastModifiedDate": "2021-12-02T09:58:58.932Z", - "agentNo": "AG0109051204", - "customerId": 70, - "name": null, - "consultantViewTime": "2021-12-02T09:58:12.066Z", - "consultantReadTime": "2021-12-02T09:58:58.930Z", - "contactTime": "2021-12-02T09:58:58.930Z", - "satisfactionScore":3 // null 隞�銵刻府蝑��撠憛怠神皛踵�漲 -} +[ { + "id" : 385, + "phone" : "0911223344", + "email" : "SDD", + "contactType" : "phone", + "gender" : "female", + "age" : "21-30", + "job" : "��", + "requirement" : "�摨瑁����", + "communicateStatus" : "contacted", + "hopeContactTime" : "'����,�����,�����,�����,�����,���,�����9:00~12:00,12:00~14:00,14:00~18:00,18:00~21:00'", + "otherRequirement" : null, + "appointmentDate" : "2021-12-16T07:11:05.400Z", + "lastModifiedDate" : "2021-12-28T07:16:37.004Z", + "agentNo" : "A568420", + "customerId" : 139, + "name" : "Angula-test", + "consultantViewTime" : "2021-12-27T02:02:18.711Z", + "consultantReadTime" : "2021-12-28T07:16:01.295Z", + "contactTime" : "2021-12-28T07:16:37.004Z", + "satisfactionScore" : null, + "appointmentMemoList" : [ ], + "interviewRecordDTOs" : [ ], + "appointmentNoticeLogs" : [ { + "id" : 1, + "phone" : "0912345678", + "email" : "pollex@gmail.com", + "appointmentId" : 385, + "content" : "notice customer invterview time", + "createdDate" : "2022-01-11T08:54:35.651Z" + }, { + "id" : 2, + "phone" : "0912345678", + "email" : "pollex@gmail.com", + "appointmentId" : 385, + "content" : "notice customer invterview time", + "createdDate" : "2022-01-11T08:57:23.133Z" + } ] +} ] \ No newline at end of file diff --git a/pamapi/src/main/java/com/pollex/pam/domain/AppointmentNoticeLog.java b/pamapi/src/main/java/com/pollex/pam/domain/AppointmentNoticeLog.java index 854dcee..89a15f0 100644 --- a/pamapi/src/main/java/com/pollex/pam/domain/AppointmentNoticeLog.java +++ b/pamapi/src/main/java/com/pollex/pam/domain/AppointmentNoticeLog.java @@ -50,7 +50,7 @@ @CreatedDate @Column(name = "created_date", updatable = false) - @JsonIgnore +// @JsonIgnore private Instant createdDate = Instant.now(); public Long getId() { diff --git a/pamapi/src/main/java/com/pollex/pam/repository/AppointmentNoticeLogRepository.java b/pamapi/src/main/java/com/pollex/pam/repository/AppointmentNoticeLogRepository.java index b3daada..e939258 100644 --- a/pamapi/src/main/java/com/pollex/pam/repository/AppointmentNoticeLogRepository.java +++ b/pamapi/src/main/java/com/pollex/pam/repository/AppointmentNoticeLogRepository.java @@ -1,5 +1,7 @@ package com.pollex.pam.repository; +import java.util.List; + import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @@ -8,4 +10,6 @@ @Repository public interface AppointmentNoticeLogRepository extends JpaRepository<AppointmentNoticeLog, Long>{ + List<AppointmentNoticeLog> findByAppointmentId(Long appointmentId); + } diff --git a/pamapi/src/main/java/com/pollex/pam/service/AppointmentNoticeLogService.java b/pamapi/src/main/java/com/pollex/pam/service/AppointmentNoticeLogService.java index 3f4c521..bfb0134 100644 --- a/pamapi/src/main/java/com/pollex/pam/service/AppointmentNoticeLogService.java +++ b/pamapi/src/main/java/com/pollex/pam/service/AppointmentNoticeLogService.java @@ -1,5 +1,7 @@ package com.pollex.pam.service; +import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -24,4 +26,8 @@ appointmentNoticeSendMapper.toAppointmentNoticeLog(noticeSendDTO); return appointmentNoticeLogRepository.save(appointmentNoticeLog); } + + public List<AppointmentNoticeLog> findByAppointmentId(Long appointmentId){ + return appointmentNoticeLogRepository.findByAppointmentId(appointmentId); + } } diff --git a/pamapi/src/main/java/com/pollex/pam/service/dto/AppointmentCustomerViewDTO.java b/pamapi/src/main/java/com/pollex/pam/service/dto/AppointmentCustomerViewDTO.java index 3028ea9..3c13edb 100644 --- a/pamapi/src/main/java/com/pollex/pam/service/dto/AppointmentCustomerViewDTO.java +++ b/pamapi/src/main/java/com/pollex/pam/service/dto/AppointmentCustomerViewDTO.java @@ -4,6 +4,7 @@ import java.util.List; import com.pollex.pam.domain.AppointmentMemo; +import com.pollex.pam.domain.AppointmentNoticeLog; import com.pollex.pam.domain.InterviewRecord; import com.pollex.pam.enums.ContactStatusEnum; @@ -31,6 +32,7 @@ private Float satisfactionScore; private List<AppointmentMemo> appointmentMemoList; private List<InterviewRecordDTO> interviewRecordDTOs; + private List<AppointmentNoticeLog> appointmentNoticeLogs; public Long getId() { return id; @@ -164,6 +166,12 @@ public void setInterviewRecordDTOs(List<InterviewRecordDTO> interviewRecordDTOs) { this.interviewRecordDTOs = interviewRecordDTOs; } + public List<AppointmentNoticeLog> getAppointmentNoticeLogs() { + return appointmentNoticeLogs; + } + public void setAppointmentNoticeLogs(List<AppointmentNoticeLog> appointmentNoticeLogs) { + this.appointmentNoticeLogs = appointmentNoticeLogs; + } } 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 823d73b..65dec36 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 @@ -10,6 +10,8 @@ import org.springframework.transaction.annotation.Transactional; import com.pollex.pam.domain.AppointmentCustomerView; +import com.pollex.pam.domain.AppointmentNoticeLog; +import com.pollex.pam.service.AppointmentNoticeLogService; import com.pollex.pam.service.AppointmentService; import com.pollex.pam.service.dto.AppointmentCustomerViewDTO; @@ -19,12 +21,17 @@ @Autowired AppointmentService appointmentService; + @Autowired + AppointmentNoticeLogService appointmentNoticeLogService; + @Transactional public AppointmentCustomerViewDTO toAppointmentCustomerViewDTO(AppointmentCustomerView source) { AppointmentCustomerViewDTO target = new AppointmentCustomerViewDTO(); BeanUtils.copyProperties(source, target); target.setAppointmentMemoList(source.getAppointmentMemoList()); appointmentService.setInterviewRecordDTO(target); + List<AppointmentNoticeLog> noticeLogs = appointmentNoticeLogService.findByAppointmentId(source.getId()); + target.setAppointmentNoticeLogs(noticeLogs); return target; } diff --git a/pamapi/src/main/java/com/pollex/pam/web/rest/NoticeResource.java b/pamapi/src/main/java/com/pollex/pam/web/rest/NoticeResource.java index 0a02874..f1bde12 100644 --- a/pamapi/src/main/java/com/pollex/pam/web/rest/NoticeResource.java +++ b/pamapi/src/main/java/com/pollex/pam/web/rest/NoticeResource.java @@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RestController; import com.pollex.pam.domain.Appointment; +import com.pollex.pam.domain.AppointmentNoticeLog; import com.pollex.pam.security.SecurityUtils; import com.pollex.pam.service.AppointmentService; import com.pollex.pam.service.NoticeService; -- Gitblit v1.8.0