[ADD] 預約單相關API新增欄位諮詢方式(consultationMethod), todo: 169489
¤ñ¹ï·sÀÉ®× |
| | |
| | | -- æ°å¢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; |
| | |
| | | |
| | | |
| | | 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" |
| | | } ] |
| | | } ] |
| | |
| | | |
| | | appointmentNoticeLogs: é ç´å®ç¼ééç¥çæ·ç¨ |
| | | appointmentClosedInfo: é ç´å®çµæ¡è³æ |
| | | consultationMethod: 諮詢æ¹å¼ |
| | | |
| | | |
| | | response body: |
| | | { |
| | | "id": 385, |
| | | "phone": "0911223344", |
| | | "consultationMethod" : "offline", |
| | | "email": "SDD", |
| | | "contactType": "phone", |
| | | "gender": "female", |
| | |
| | | "closedReason": "other2", |
| | | "closedOtherReason": "å¿æ
ä¸å¥½ä¸æ³è²·2", |
| | | "appointmentId": 385 |
| | | } |
| | | }, |
| | | "consultationMethod" : "offline" |
| | | } |
| | |
| | | http put: |
| | | http://localhost:8080/api/appointment |
| | | |
| | | consultationMethod: 諮詢æ¹å¼(online,offline) |
| | | |
| | | |
| | | |
| | | http request body: |
| | | { |
| | | "id": 170, |
| | |
| | | "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 |
| | |
| | | "closedReason": "other2", |
| | | "closedOtherReason": "å¿æ
ä¸å¥½ä¸æ³è²·2", |
| | | "appointmentId": 385 |
| | | } |
| | | }, |
| | | "consultationMethod": "offline" |
| | | } |
| | |
| | | |
| | | contactType: email,phone |
| | | gender: male, female |
| | | consultationMethod: 諮詢æ¹å¼(online,offline) |
| | | |
| | | request body: |
| | | |
| | |
| | | "requirement":"財åè¦å,è³ç¢ç§»è½", |
| | | "hopeContactTime":"'ææä¸~ææäº, 12:00~14:00, 18:00~21:00'", |
| | | "otherRequirement":"å¤å¹£æè³", |
| | | "agentNo":"admin" |
| | | "agentNo":"admin", |
| | | "consultationMethod": "offline" |
| | | } |
| | | |
| | | åå³é ç´å®è³è¨ |
| | |
| | | "customerId" : 167, |
| | | "consultantViewTime" : null, |
| | | "consultantReadTime" : null, |
| | | "contactTime" : null |
| | | "contactTime" : null, |
| | | "consultationMethod": "offline" |
| | | } |
| | |
| | | "closedReason": "other2", |
| | | "closedOtherReason": "å¿æ
ä¸å¥½ä¸æ³è²·2", |
| | | "appointmentId": 385 |
| | | } |
| | | }, |
| | | "consultationMethod" : "offline", |
| | | } |
| | | ] |
| | |
| | | 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); |
| | |
| | | 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(); |
| | | // } |
| | | } |