保誠-保戶業務員媒合平台
jack
2023-07-27 b3572f326520545ba2d1a4a69b29520a055cb649
[ADD] 預約單相關API新增欄位諮詢方式(consultationMethod), todo: 169489
修改8個檔案
新增1個檔案
修改2個檔案名稱
421 ■■■■ 已變更過的檔案
pamapi/src/doc/sql/20230727_j.sql 26 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/doc/sql/executed/20230710_j.sql 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/doc/sql/executed/20230718_j.sql 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/doc/預約單/取得客戶所有預約單資料group by consultant.txt 348 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/doc/預約單/取得預約單細節API.txt 2 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/doc/預約單/客戶取得最新預約的未處理預約單.txt 3 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/doc/預約單/更新預約單明細API.txt 7 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/doc/預約單/標記為已聯絡API.txt 3 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/doc/預約單/預約前詢問.txt 7 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/doc/預約單/顧問取得所有自己的預約單API.txt 3 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/java/com/pollex/pam/web/rest/AppointmentResource.java 22 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/doc/sql/20230727_j.sql
¤ñ¹ï·sÀÉ®×
@@ -0,0 +1,26 @@
-- æ–°å¢žconsultation_method欄位
CREATE OR REPLACE VIEW omo.appointment_customer_view
AS SELECT a.id AS appointment_id,
    a.phone,
    a.email,
    a.contact_type,
    a.gender,
    a.age,
    a.job,
    a.requirement,
    a.communicate_status,
    a.hope_contact_time,
    a.other_requirement,
    a.agent_no,
    a.appointment_date,
    a.customer_id,
    a.consultant_view_time,
    a.consultant_read_time,
    a.contact_time,
    a.status,
    a.last_modified_date,
    c.name,
    a.consultation_method
   FROM appointment a
     LEFT JOIN customer c ON a.customer_id = c.id;
pamapi/src/doc/sql/executed/20230710_j.sql
pamapi/src/doc/sql/executed/20230718_j.sql
pamapi/src/doc/¹w¬ù³æ/¨ú±o«È¤á©Ò¦³¹w¬ù³æ¸ê®Ægroup by consultant.txt
@@ -4,277 +4,79 @@
response body :
[
    {
        "agentNo": "A568420",
        "name": "謝霆風",
        "img": "C://pam_file/consultant_A568420.jpg",
        "expertise": [
            "健康與保障",
            "子女教育"
        ],
        "avgScore": 1.0,
        "contactStatus": "closed",
        "createTime": "2021-12-29T09:33:16.526Z",
        "updateTime": "2022-03-22T03:49:05.602Z",
        "customerViewTime": "2021-12-29T09:33:18.727Z",
        "role": "66666",
        "seniority": "40 å¹´ 10 æœˆ",
        "appointments": [
            {
                "id": 435,
                "phone": "0973057067",
                "email": "",
                "contactType": "phone",
                "gender": "male",
                "age": "under_20",
                "job": "外勤",
                "requirement": "健康與保障",
                "communicateStatus": "closed",
                "hopeContactTime": "'星期一,星期二,星期三,星期四,星期五,星期六,星期日、9:00~12:00,12:00~14:00,14:00~18:00,18:00~21:00'",
                "otherRequirement": null,
                "appointmentDate": "2021-12-29T09:33:16.643Z",
                "lastModifiedDate": "2022-03-22T03:49:05.602Z",
                "agentNo": "A568420",
                "customerId": 90,
                "name": "Jack",
                "consultantViewTime": "2021-12-29T09:33:49.547Z",
                "consultantReadTime": "2021-12-29T09:37:21.710Z",
                "contactTime": "2022-01-04T03:34:09.399Z",
                "satisfactionScore": null,
                "appointmentMemoList": [],
                "interviewRecordDTOs": [],
                "appointmentNoticeLogs": [],
                "appointmentClosedInfo": {
                    "id": 70,
                    "policyholderIdentityId": null,
                    "planCode": null,
                    "policyEntryDate": null,
                    "remark": "ddddde",
                    "closedReason": "economy",
                    "closedOtherReason": null,
                    "appointmentId": 435
                }
            }
        ]
[ {
  "agentNo" : "A568420",
  "name" : "謝霆風",
  "img" : "C://pam_file/consultant_A568420.jpg",
  "expertise" : [ "健康與保障", "子女教育" ],
  "avgScore" : 1.0,
  "contactStatus" : "reserved",
  "createTime" : "2021-12-29T09:33:16.526Z",
  "updateTime" : "2023-07-27T07:50:58.167Z",
  "customerViewTime" : "2021-12-29T09:33:18.727Z",
  "role" : "66666",
  "seniority" : "39 å¹´ 4 æœˆ",
  "entryDate" : "1984-03-29T00:00:00.000+00:00",
  "appointments" : [ {
    "id" : 435,
    "phone" : "0973057067",
    "email" : "",
    "contactType" : "phone",
    "gender" : "male",
    "age" : "under_20",
    "job" : "外勤",
    "requirement" : "健康與保障",
    "communicateStatus" : "closed",
    "hopeContactTime" : "'星期一,星期二,星期三,星期四,星期五,星期六,星期日、9:00~12:00,12:00~14:00,14:00~18:00,18:00~21:00'",
    "otherRequirement" : null,
    "appointmentDate" : "2021-12-29T09:33:16.643Z",
    "lastModifiedDate" : "2022-03-22T03:49:05.602Z",
    "agentNo" : "A568420",
    "customerId" : 90,
    "name" : "Jack",
    "consultantViewTime" : "2021-12-29T09:33:49.547Z",
    "consultantReadTime" : "2021-12-29T09:37:21.710Z",
    "contactTime" : "2022-01-04T03:34:09.399Z",
    "satisfactionScore" : null,
    "appointmentMemoList" : [ ],
    "interviewRecordDTOs" : [ ],
    "appointmentNoticeLogs" : [ ],
    "appointmentClosedInfo" : {
      "id" : 70,
      "policyholderIdentityId" : null,
      "planCode" : null,
      "policyEntryDate" : null,
      "remark" : "ddddde",
      "closedReason" : "economy",
      "closedOtherReason" : null,
      "appointmentId" : 435
    },
    {
        "agentNo": "B282677963",
        "name": "喬妹",
        "img": "C://pam_file/consultant_B282677963.jpg",
        "expertise": [
            "健康與保障",
            "資產規劃",
            "樂活退休",
            "保單健檢/規劃"
        ],
        "avgScore": 3.5,
        "contactStatus": "reserved",
        "createTime": "2021-11-30T12:31:57.310Z",
        "updateTime": "2021-12-06T05:36:58.867Z",
        "customerViewTime": "2021-12-14T07:09:13.150Z",
        "role": "",
        "seniority": "30 å¹´ 8 æœˆ",
        "appointments": [
            {
                "id": 136,
                "phone": "0973057067",
                "email": "",
                "contactType": "phone",
                "gender": "",
                "age": "31-40",
                "job": "",
                "requirement": "子女教育",
                "communicateStatus": "reserved",
                "hopeContactTime": "'禮拜一,禮拜二,禮拜三,禮拜四,禮拜五,禮拜六,禮拜日、9:00~12:00,12:00~14:00,14:00~18:00,18:00~21:00'",
                "otherRequirement": null,
                "appointmentDate": "2021-11-30T12:39:38.702Z",
                "lastModifiedDate": "2021-12-06T05:36:58.867Z",
                "agentNo": "B282677963",
                "customerId": 90,
                "name": "Jack",
                "consultantViewTime": "2021-12-06T05:36:33.180Z",
                "consultantReadTime": "2021-12-06T05:36:58.866Z",
                "contactTime": null,
                "satisfactionScore": 2.0,
                "appointmentMemoList": [],
                "interviewRecordDTOs": [],
                "appointmentNoticeLogs": [],
                "appointmentClosedInfo": null
            },
            {
                "id": 134,
                "phone": "0973057067",
                "email": "",
                "contactType": "phone",
                "gender": "",
                "age": "",
                "job": "",
                "requirement": "子女教育",
                "communicateStatus": "reserved",
                "hopeContactTime": "'禮拜一,禮拜二,禮拜三,禮拜四,禮拜五,禮拜六,禮拜日、9:00~12:00,12:00~14:00,14:00~18:00,18:00~21:00'",
                "otherRequirement": null,
                "appointmentDate": "2021-11-30T12:33:48.006Z",
                "lastModifiedDate": "2021-12-06T05:37:00.385Z",
                "agentNo": "B282677963",
                "customerId": 90,
                "name": "Jack",
                "consultantViewTime": "2021-12-06T05:36:33.180Z",
                "consultantReadTime": "2021-12-06T05:37:00.384Z",
                "contactTime": null,
                "satisfactionScore": 4.0,
                "appointmentMemoList": [],
                "interviewRecordDTOs": [],
                "appointmentNoticeLogs": [],
                "appointmentClosedInfo": null
            },
            {
                "id": 135,
                "phone": "0973057067",
                "email": "",
                "contactType": "phone",
                "gender": "",
                "age": "31-40",
                "job": "",
                "requirement": "子女教育",
                "communicateStatus": "reserved",
                "hopeContactTime": "'禮拜一,禮拜二,禮拜三,禮拜四,禮拜五,禮拜六,禮拜日、9:00~12:00,12:00~14:00,14:00~18:00,18:00~21:00'",
                "otherRequirement": null,
                "appointmentDate": "2021-11-30T12:38:28.930Z",
                "lastModifiedDate": "2021-12-06T05:37:02.646Z",
                "agentNo": "B282677963",
                "customerId": 90,
                "name": "Jack",
                "consultantViewTime": "2021-12-06T05:36:33.180Z",
                "consultantReadTime": "2021-12-06T05:37:02.645Z",
                "contactTime": null,
                "satisfactionScore": 4.0,
                "appointmentMemoList": [],
                "interviewRecordDTOs": [],
                "appointmentNoticeLogs": [],
                "appointmentClosedInfo": null
            },
            {
                "id": 133,
                "phone": "0973057067",
                "email": "",
                "contactType": "phone",
                "gender": "",
                "age": "",
                "job": "",
                "requirement": "子女教育",
                "communicateStatus": "reserved",
                "hopeContactTime": "'禮拜一,禮拜二,禮拜三,禮拜四,禮拜五,禮拜六,禮拜日、9:00~12:00,12:00~14:00,14:00~18:00,18:00~21:00'",
                "otherRequirement": null,
                "appointmentDate": "2021-11-30T12:31:57.419Z",
                "lastModifiedDate": "2021-12-06T05:37:05.639Z",
                "agentNo": "B282677963",
                "customerId": 90,
                "name": "Jack",
                "consultantViewTime": "2021-12-06T05:36:33.180Z",
                "consultantReadTime": "2021-12-06T05:37:05.639Z",
                "contactTime": null,
                "satisfactionScore": null,
                "appointmentMemoList": [],
                "interviewRecordDTOs": [],
                "appointmentNoticeLogs": [],
                "appointmentClosedInfo": null
            }
        ]
    },
    {
        "agentNo": "AGAM11249699",
        "name": "莫拉邀",
        "img": "C://pam_file/consultant_AGAM11249699.jpg",
        "expertise": [
            "健康與保障",
            "資產規劃",
            "子女教育",
            "保單健檢/規劃"
        ],
        "avgScore": 4.4,
        "contactStatus": "contacted",
        "createTime": "2021-11-29T04:02:01.176Z",
        "updateTime": "2021-12-02T09:51:22.571Z",
        "customerViewTime": "2021-12-14T07:09:13.150Z",
        "role": "和泰保險經紀人",
        "seniority": "10 å¹´ 6 æœˆ",
        "appointments": [
            {
                "id": 123,
                "phone": "0973057067",
                "email": "",
                "contactType": "phone",
                "gender": "",
                "age": "",
                "job": "",
                "requirement": "",
                "communicateStatus": "contacted",
                "hopeContactTime": "'禮拜一、9:00~12:00'",
                "otherRequirement": null,
                "appointmentDate": "2021-12-03T03:25:17.075Z",
                "lastModifiedDate": "2021-12-02T09:51:22.571Z",
                "agentNo": "AGAM11249699",
                "customerId": 90,
                "name": "Jack",
                "consultantViewTime": "2021-12-03T03:25:16.996Z",
                "consultantReadTime": "2021-12-02T09:51:22.571Z",
                "contactTime": "2021-12-03T03:25:17.075Z",
                "satisfactionScore": 4.0,
                "appointmentMemoList": [],
                "interviewRecordDTOs": [],
                "appointmentNoticeLogs": [],
                "appointmentClosedInfo": null
            }
        ]
    },
    {
        "agentNo": "R221444250",
        "name": "崔寨",
        "img": "C://pam_file/consultant_R221444250.jpg",
        "expertise": [
            "健康與保障",
            "子女教育",
            "資產規劃",
            "樂活退休",
            "保單健檢/規劃",
            "分紅保單"
        ],
        "avgScore": 3.1,
        "contactStatus": "reserved",
        "createTime": "2021-12-14T07:10:02.068Z",
        "updateTime": "2021-12-14T07:10:02.144Z",
        "customerViewTime": "2021-12-14T07:10:03.859Z",
        "role": "",
        "seniority": "38 å¹´ ",
        "appointments": [
            {
                "id": 354,
                "phone": "0973057067",
                "email": "",
                "contactType": "phone",
                "gender": "male",
                "age": "21-30",
                "job": "內勤",
                "requirement": "保單健檢/規劃",
                "communicateStatus": "reserved",
                "hopeContactTime": "'禮拜一,禮拜二,禮拜三,禮拜四,禮拜五,禮拜六,禮拜日、18:00~21:00'",
                "otherRequirement": null,
                "appointmentDate": "2021-12-14T07:10:02.149Z",
                "lastModifiedDate": "2021-12-14T07:10:02.144Z",
                "agentNo": "R221444250",
                "customerId": 90,
                "name": "Jack",
                "consultantViewTime": "2021-12-24T08:48:22.013Z",
                "consultantReadTime": "2021-12-15T04:58:28.736Z",
                "contactTime": null,
                "satisfactionScore": null,
                "appointmentMemoList": [],
                "interviewRecordDTOs": [],
                "appointmentNoticeLogs": [],
                "appointmentClosedInfo": null
            }
        ]
    }
]
    "consultationMethod" : null
  }, {
    "id" : 618,
    "phone" : "0973057067",
    "email" : "jack568420@gmail.com",
    "contactType" : "phone",
    "gender" : "male",
    "age" : "21-30",
    "job" : "內勤",
    "requirement" : "分紅保單",
    "communicateStatus" : "reserved",
    "hopeContactTime" : "'星期一,星期二,星期三,星期四,星期五,星期六,星期日、9:00~12:00,12:00~14:00,14:00~18:00,18:00~21:00'",
    "otherRequirement" : null,
    "appointmentDate" : "2023-07-20T07:49:03.361Z",
    "lastModifiedDate" : "2023-07-27T07:50:58.167Z",
    "agentNo" : "A568420",
    "customerId" : 90,
    "name" : "Jack",
    "consultantViewTime" : null,
    "consultantReadTime" : null,
    "contactTime" : null,
    "satisfactionScore" : null,
    "appointmentMemoList" : [ ],
    "interviewRecordDTOs" : [ ],
    "appointmentNoticeLogs" : [ ],
    "appointmentClosedInfo" : null,
    "consultationMethod" : "offline"
  } ]
} ]
pamapi/src/doc/¹w¬ù³æ/¨ú±o¹w¬ù³æ²Ó¸`API.txt
@@ -5,12 +5,14 @@
appointmentNoticeLogs: é ç´„單發送通知的歷程
appointmentClosedInfo: é ç´„單結案資料
consultationMethod: è«®è©¢æ–¹å¼
response body:
{
    "id": 385,
    "phone": "0911223344",
    "consultationMethod" : "offline",
    "email": "SDD",
    "contactType": "phone",
    "gender": "female",
pamapi/src/doc/¹w¬ù³æ/«È¤á¨ú±o³Ì·s¹w¬ùªº¥¼³B²z¹w¬ù³æ.txt
@@ -57,5 +57,6 @@
        "closedReason": "other2",
        "closedOtherReason": "心情不好不想買2",
        "appointmentId": 385
    }
    },
    "consultationMethod" : "offline"
}
pamapi/src/doc/¹w¬ù³æ/§ó·s¹w¬ù³æ©ú²ÓAPI.txt
@@ -1,6 +1,10 @@
http put:
http://localhost:8080/api/appointment
consultationMethod: è«®è©¢æ–¹å¼(online,offline)
http request body:
{
    "id": 170,
@@ -12,7 +16,8 @@
    "job": "內勤",
    "requirement": "健康與保障,子女教育,資產規劃",
    "hopeContactTime": "'禮拜一,禮拜二,禮拜三,禮拜四,禮拜五,禮拜六,禮拜日、9:00~12:00,12:00~14:00,14:00~18:00,18:00~21:00'",
    "otherRequirement": null
    "otherRequirement": null,
    "consultationMethod": "offline"
}
http response status: 204
pamapi/src/doc/¹w¬ù³æ/¼Ð°O¬°¤wÁpµ¸API.txt
@@ -54,5 +54,6 @@
        "closedReason": "other2",
        "closedOtherReason": "心情不好不想買2",
        "appointmentId": 385
    }
    },
    "consultationMethod": "offline"
}
pamapi/src/doc/¹w¬ù³æ/¹w¬ù«e¸ß°Ý.txt
@@ -5,6 +5,7 @@
contactType: email,phone
gender: male, female
consultationMethod: è«®è©¢æ–¹å¼(online,offline)
request body:
@@ -18,7 +19,8 @@
    "requirement":"財務規劃,資產移轉",
    "hopeContactTime":"'星期一~星期五, 12:00~14:00, 18:00~21:00'",
    "otherRequirement":"外幣投資",
    "agentNo":"admin"
    "agentNo":"admin",
    "consultationMethod": "offline"
}
回傳預約單資訊
@@ -41,5 +43,6 @@
  "customerId" : 167,
  "consultantViewTime" : null,
  "consultantReadTime" : null,
  "contactTime" : null
  "contactTime" : null,
  "consultationMethod": "offline"
}
pamapi/src/doc/¹w¬ù³æ/ÅU°Ý¨ú±o©Ò¦³¦Û¤vªº¹w¬ù³æAPI.txt
@@ -58,6 +58,7 @@
            "closedReason": "other2",
            "closedOtherReason": "心情不好不想買2",
            "appointmentId": 385
        }
        },
        "consultationMethod" : "offline",
    }
]
pamapi/src/main/java/com/pollex/pam/web/rest/AppointmentResource.java
@@ -68,14 +68,13 @@
    public AppointmentDTO clientCreateAppointment(@RequestBody AppointmentCreateDTO appointmentCreateDTO) {
        List<Appointment> processing = appointmentService.findProcessingAppointmentByCustomer(SecurityUtils.getCustomerDBId());
        List<Appointment> cancelAppointmentment = appointmentService.findCustomer3DayCancelAppointment();
        if(processing.size()>0) {
        if(!processing.isEmpty()) {
            throw new CreateFailHaveProcessingAppointmentException();
        }else if(cancelAppointmentment.size()>0) {
        }else if(!cancelAppointmentment.isEmpty()) {
            throw new CreateFailBecauseOfCancelAppointmentRecentException();
        }
        
        Appointment appointment = appointmentService.customerCreateAppointment(appointmentCreateDTO);
//        appointmentService.sendAppointmentNotify(appointment);
        satisfactionService.createUnfilledSystemSatisfaction(appointment);
        return appointmentMapper.toAppointmentDTO(appointment);
@@ -126,21 +125,4 @@
        return appointmentService.getCustomerAllAppointmentGroupByConsultant();
    }
//    @PostMapping("/close/info/edit")
//    public ResponseEntity<Void> editAppointmentClosedInfo(@RequestBody AppointmentCloseDTO closeDTO) {
//
//        if(closeDTO.getContactStatus() == ContactStatusEnum.DONE) {
//            DoneProcessDTO dto = new DoneProcessDTO();
//            BeanUtils.copyProperties(closeDTO, dto);
//            abstractAppointmentProcess.editClosedInfo(dto);
//        }else if(closeDTO.getContactStatus() == ContactStatusEnum.CLOSED){
//            ClosedProcessDTO dto = new ClosedProcessDTO();
//            BeanUtils.copyProperties(closeDTO, dto);
//            abstractAppointmentProcess.editClosedInfo(dto);
//        }else {
//            return ResponseEntity.notFound().build();
//        }
//
//        return ResponseEntity.noContent().build();
//    }
}