保誠-保戶業務員媒合平台
Jack
2022-01-11 9fbf413a72ac13c58f94b433857084946c2e0d9e
[ADD] 新增查看預約單通知歷程的API
修改7個檔案
86 ■■■■ 已變更過的檔案
pamapi/src/doc/預約單/取得預約單細節API.txt 58 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/java/com/pollex/pam/domain/AppointmentNoticeLog.java 2 ●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
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/service/mapper/AppointmentCustomerViewMapper.java 7 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/java/com/pollex/pam/web/rest/NoticeResource.java 1 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/doc/¹w¬ù³æ/¨ú±o¹w¬ù³æ²Ó¸`API.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",
[ {
      "id" : 385,
      "phone" : "0911223344",
      "email" : "SDD",
      "contactType" : "phone",
      "gender" : "female",
      "age" : "21-30",
    "job": "內勤",
    "requirement": "子女教育,資產規劃,防疫保單相關",
      "requirement" : "健康與保障",
    "communicateStatus": "contacted",
    "hopeContactTime": "'禮拜三,禮拜五、12:00~14:00,14:00~18:00'",
      "hopeContactTime" : "'星期一,星期二,星期三,星期四,星期五,星期六,星期日、9:00~12:00,12:00~14:00,14:00~18:00,18:00~21: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 ä»£è¡¨è©²ç­†é ç´„單尚未填寫滿意度
}
      "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"
      } ]
} ]
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() {
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);
}
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);
    }
}
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;
    }
    
    
}
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;
    }
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;