Merge branch 'master' of ssh://192.168.0.10:29418/pcalife/PAM
¤ñ¹ï·sÀÉ®× |
| | |
| | | UPDATE omo.appointment SET contact_time = appointment_date where communicate_status = 'CONTACTED'; |
| | |
| | | "age": "under_20", |
| | | "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-12-01T04:27:20.154Z", |
| | | "lastModifiedDate": "2021-12-01T04:27:20.154Z", |
| | | "agentNo": "J149388015", |
| | | "customerId": 76, |
| | | "consultantViewTime": null, |
| | | "consultantReadTime": null |
| | | "otherRequirement": null |
| | | } |
| | | |
| | | http response status: 204 |
¤ñ¹ï·sÀÉ®× |
| | |
| | | http get : |
| | | |
| | | http://localhost:8080/api/consultant/getMyAppointment |
| | | |
| | | |
| | | |
| | | [ |
| | | { |
| | | "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": 109, |
| | | "phone": "09123456789", |
| | | "email": "", |
| | | "contactType": "mobile", |
| | | "gender": "male", |
| | | "age": "20", |
| | | "job": "å
§å¤", |
| | | "requirement": "å¥åº·èä¿é,å女æè²,ä¿å®å¥æª¢/è¦å,é²ç«ä¿å®ç¸é", |
| | | "communicateStatus": "contacted", |
| | | "hopeContactTime": "'禮æä¸,禮æäº,禮æä¸,禮æå,禮æäº,禮æå
,ç¦®ææ¥ã12:00~14:00,14:00~18:00'", |
| | | "otherRequirement": null, |
| | | "appointmentDate": "2021-12-02T10:12:24.613Z", |
| | | "lastModifiedDate": "2021-12-02T10:12:24.613Z", |
| | | "agentNo": "AG0109051204", |
| | | "customerId": 67, |
| | | "name": null, |
| | | "consultantViewTime": "2021-12-02T09:58:12.066Z", |
| | | "consultantReadTime": "2021-12-02T10:12:24.612Z", |
| | | "contactTime": null, |
| | | "satisfactionScore":3 // null 代表該çé ç´å®å°æªå¡«å¯«æ»¿æåº¦ |
| | | }, |
| | | { |
| | | "id": 114, |
| | | "phone": "09123456789", |
| | | "email": "", |
| | | "contactType": "mobile", |
| | | "gender": "male", |
| | | "age": "70", |
| | | "job": "å
§å¤", |
| | | "requirement": "å¥åº·èä¿é,å女æè²,è³ç¢è¦å,æ¨æ´»éä¼,é²ç«ä¿å®ç¸é", |
| | | "communicateStatus": "contacted", |
| | | "hopeContactTime": "'禮æä¸,禮æäº,禮æä¸,禮æå,禮æäº,禮æå
,ç¦®ææ¥ã12:00~14:00,14:00~18:00'", |
| | | "otherRequirement": null, |
| | | "appointmentDate": "2021-12-02T09:58:12.248Z", |
| | | "lastModifiedDate": "2021-12-02T09:58:12.248Z", |
| | | "agentNo": "AG0109051204", |
| | | "customerId": 71, |
| | | "name": null, |
| | | "consultantViewTime": "2021-12-02T09:58:12.066Z", |
| | | "consultantReadTime": null, |
| | | "contactTime": null, |
| | | "satisfactionScore":3 // null 代表該çé ç´å®å°æªå¡«å¯«æ»¿æåº¦ |
| | | }, |
| | | { |
| | | "id": 121, |
| | | "phone": "09123456789", |
| | | "email": "", |
| | | "contactType": "mobile", |
| | | "gender": "male", |
| | | "age": "20", |
| | | "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-02T09:58:12.248Z", |
| | | "lastModifiedDate": "2021-12-02T09:58:12.248Z", |
| | | "agentNo": "AG0109051204", |
| | | "customerId": 76, |
| | | "name": "æå²ç¶", |
| | | "consultantViewTime": "2021-12-02T09:58:12.066Z", |
| | | "consultantReadTime": "2021-12-02T09:54:20.872Z", |
| | | "contactTime": null, |
| | | "satisfactionScore":3 // null 代表該çé ç´å®å°æªå¡«å¯«æ»¿æåº¦ |
| | | }, |
| | | { |
| | | "id": 118, |
| | | "phone": "09123456789", |
| | | "email": "", |
| | | "contactType": "mobile", |
| | | "gender": "male", |
| | | "age": "20", |
| | | "job": "å
§å¤", |
| | | "requirement": "å¥åº·èä¿é", |
| | | "communicateStatus": "contacted", |
| | | "hopeContactTime": "'禮æä¸,禮æäº,禮æä¸,禮æå,禮æäº,禮æå
,ç¦®ææ¥ã12:00~14:00,14:00~18:00'", |
| | | "otherRequirement": null, |
| | | "appointmentDate": "2021-12-02T10:02:52.797Z", |
| | | "lastModifiedDate": "2021-12-02T10:02:52.797Z", |
| | | "agentNo": "AG0109051204", |
| | | "customerId": 72, |
| | | "name": null, |
| | | "consultantViewTime": "2021-12-02T09:58:12.066Z", |
| | | "consultantReadTime": "2021-12-02T10:02:52.796Z", |
| | | "contactTime": null, |
| | | "satisfactionScore":3 // null 代表該çé ç´å®å°æªå¡«å¯«æ»¿æåº¦ |
| | | }, |
| | | { |
| | | "id": 180, |
| | | "phone": "0911111111", |
| | | "email": "", |
| | | "contactType": "phone", |
| | | "gender": "female", |
| | | "age": "31-40", |
| | | "job": "å
§å¤", |
| | | "requirement": "å女æè²,å¥åº·èä¿é", |
| | | "communicateStatus": "contacted", |
| | | "hopeContactTime": "'禮æäº,禮æä¸,禮æå,禮æäº,禮æå
ã9:00~12:00,12:00~14:00,14:00~18:00,18:00~21:00','禮æä¸,禮æäº,禮æä¸,禮æå,禮æäº,ç¦®ææ¥ã12:00~14:00,14:00~18:00,18:00~21:00','禮æä¸,禮æå,禮æå
,ç¦®ææ¥ã14:00~18:00,18:00~21:00'", |
| | | "otherRequirement": null, |
| | | "appointmentDate": "2021-12-02T10:10:53.341Z", |
| | | "lastModifiedDate": "2021-12-03T03:40:16.344Z", |
| | | "agentNo": "AG0109051204", |
| | | "customerId": 77, |
| | | "name": "111", |
| | | "consultantViewTime": "2021-12-02T10:10:46.358Z", |
| | | "consultantReadTime": "2021-12-02T10:10:53.340Z", |
| | | "contactTime": "2021-12-03T03:40:16.215Z", |
| | | "satisfactionScore":3 // null 代表該çé ç´å®å°æªå¡«å¯«æ»¿æåº¦ |
| | | } |
| | | ] |
| | |
| | | "updateTime": "2021-12-02T10:56:32.741Z", // æè¿æ´æ°æé |
| | | "role": "å¨çä¿éªç¶ç´äºº", |
| | | "seniority": "22 å¹´ 8 æ", |
| | | "latestAppointmentId": 130, // æå¾ä¸çé ç´å®ID |
| | | "latestAppointmentDate": "2021-12-02T10:56:32.741Z", // æå¾ä¸çé ç´å®é ç´æé |
| | | "latestAppointmentScore": null, // æå¾ä¸çé ç´å®ç忏 (nullçºå°æªè©å) |
| | | "appointments": [ // 客æ¶å·²é ç´ç顧忏
å® |
| | | { |
| | | "id": 130, |
| | |
| | | "customerId": 76, |
| | | "name": "æå²ç¶", |
| | | "consultantViewTime": null, |
| | | "consultantReadTime": null |
| | | "consultantReadTime": null, |
| | | "satisfactionScore":3 // null 代表該çé ç´å®å°æªå¡«å¯«æ»¿æåº¦ |
| | | } |
| | | ], |
| | | "new": true |
| | |
| | | "updateTime": "2021-12-02T10:56:56.946Z", |
| | | "role": "é åµä¿éªç¶ç´äºº", |
| | | "seniority": "30 å¹´ 8 æ", |
| | | "latestAppointmentId": 131, |
| | | "latestAppointmentDate": "2021-12-02T10:56:56.946Z", |
| | | "latestAppointmentScore": null, |
| | | "appointments": [ |
| | | { |
| | | "id": 131, |
| | |
| | | "customerId": 76, |
| | | "name": "æå²ç¶", |
| | | "consultantViewTime": null, |
| | | "consultantReadTime": null |
| | | "consultantReadTime": null, |
| | | "satisfactionScore":3 // null 代表該çé ç´å®å°æªå¡«å¯«æ»¿æåº¦ |
| | | } |
| | | ], |
| | | "new": true |
| | |
| | | "updateTime": null, |
| | | "role": "å°åä¿éªç¶ç´äºº", |
| | | "seniority": "38 å¹´ ", |
| | | "latestAppointmentId": null, |
| | | "latestAppointmentDate": null, |
| | | "latestAppointmentScore": null, |
| | | "appointments": [], |
| | | "new": true |
| | | }, |
| | |
| | | "createTime": "2021-12-02T10:56:04.620Z", |
| | | "updateTime": null, |
| | | "role": "åæ³°ä¿éªç¶ç´äºº", |
| | | "seniority": "17 å¹´ 1 æ", |
| | | "latestAppointmentId": null, |
| | | "latestAppointmentDate": null, |
| | | "latestAppointmentScore": null, // æå¾ä¸çé ç´å®ç忏 (nullçºå°æªè©å) |
| | | "appointments": [], |
| | | "new": true |
| | | } |
| | |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.pollex.pam.enums.AppointmentStatusEnum; |
| | | import com.pollex.pam.service.dto.AppointmentDTO; |
| | | import com.pollex.pam.domain.Satisfaction; |
| | | import com.pollex.pam.service.dto.AppointmentUpdateDTO; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | appointmentRepository.save(appointment); |
| | | } |
| | | |
| | | public void updateAppointment(AppointmentDTO appointmentDTO) { |
| | | Appointment appointment = appointmentDTOMapper.toAppointment(appointmentDTO); |
| | | appointment.setStatus(AVAILABLE); |
| | | public void updateAppointment(AppointmentUpdateDTO updateAppointmentDTO) { |
| | | Appointment appointment = appointmentRepository.findById(updateAppointmentDTO.getId()).get(); |
| | | |
| | | appointment.setPhone(updateAppointmentDTO.getPhone()); |
| | | appointment.setEmail(updateAppointmentDTO.getEmail()); |
| | | appointment.setContactType(updateAppointmentDTO.getContactType()); |
| | | appointment.setGender(updateAppointmentDTO.getGender()); |
| | | appointment.setAge(updateAppointmentDTO.getAge()); |
| | | appointment.setJob(updateAppointmentDTO.getJob()); |
| | | appointment.setRequirement(updateAppointmentDTO.getRequirement()); |
| | | appointment.setHopeContactTime(updateAppointmentDTO.getHopeContactTime()); |
| | | appointment.setOtherRequirement(updateAppointmentDTO.getOtherRequirement()); |
| | | |
| | | appointmentRepository.save(appointment); |
| | | } |
| | | |
| | |
| | | public AppointmentCustomerViewDTO getAppointmentDetail(Long appointmentId) { |
| | | AppointmentCustomerView appointment = appointmentCustomerViewRepository.findById(appointmentId) |
| | | .orElseThrow(AppointmentNotFoundException::new); |
| | | return appointmentCustomerViewMapper.toAppointmentCustomerViewDTO(appointment); |
| | | |
| | | AppointmentCustomerViewDTO dto = appointmentCustomerViewMapper.toAppointmentCustomerViewDTO(appointment); |
| | | setSatisfactionScore(dto, appointmentId); |
| | | return dto; |
| | | } |
| | | |
| | | public List<AppointmentCustomerViewDTO> getConsultantAvailableAppointments(String agentNo) { |
| | | return appointmentCustomerViewRepository.findByAgentNo(agentNo).stream() |
| | | .filter(appointment -> appointment.getStatus() == AVAILABLE) |
| | | .map(appointmentCustomerView -> { |
| | | AppointmentCustomerViewDTO dto = appointmentCustomerViewMapper.toAppointmentCustomerViewDTO(appointmentCustomerView); |
| | | setSatisfactionScore(dto, appointmentCustomerView.getId()); |
| | | return dto; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | public void setSatisfactionScore(AppointmentCustomerViewDTO dto, Long appointmentId) { |
| | | satisfactionService.getByAppointmentId(appointmentId).ifPresent(satisfaction -> { |
| | | dto.setSatisfactionScore(satisfaction.getScore()); |
| | | }); |
| | | } |
| | | |
| | | public List<AppointmentCustomerView> findAvailableByAgentNoAndCustomerId(String agentNo, Long customerId) { |
| | | return appointmentCustomerViewRepository.findByAgentNoAndCustomerId(agentNo, customerId) |
| | |
| | | |
| | | consultantNotViewAppointments.forEach(appointment -> appointment.setConsultantViewTime(Instant.now())); |
| | | appointmentRepository.saveAll(consultantNotViewAppointments); |
| | | } |
| | | |
| | | public List<AppointmentCustomerViewDTO> getConsultantAppointments(String agentNo) { |
| | | return appointmentCustomerViewRepository.findByAgentNo(agentNo).stream() |
| | | .filter(appointment -> appointment.getStatus() != DELETED) |
| | | .map(appointmentCustomerViewMapper::toAppointmentCustomerViewDTO) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | |
| | | import com.pollex.pam.domain.AppointmentCustomerView; |
| | | import com.pollex.pam.domain.Consultant; |
| | | import com.pollex.pam.domain.CustomerFavoriteConsultant; |
| | | import com.pollex.pam.domain.Satisfaction; |
| | | import com.pollex.pam.enums.ContactStatusEnum; |
| | | import com.pollex.pam.enums.LoginResult; |
| | | import com.pollex.pam.repository.ConsultantRepository; |
| | |
| | | |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | |
| | | CustomerFavoriteConsultantDTO dto = consultantMapper.toCustomerFavoriteConsultantDto(consultant); |
| | | |
| | | dto.setContactStatus(ContactStatusEnum.PICKED); |
| | | dto.setLatestAppointmentId(null); |
| | | dto.setLatestAppointmentDate(null); |
| | | dto.setLatestAppointmentScore(null); |
| | | dto.setCreateTime(customerFavoriteConsultantRelation.getLastModifiedDate()); |
| | | dto.setCreateTime(customerFavoriteConsultantRelation.getCreatedDate()); |
| | | |
| | | setAppointmentInfo( |
| | | dto, |
| | |
| | | }).collect(Collectors.toList()); |
| | | } |
| | | |
| | | private void setAppointmentInfo(CustomerFavoriteConsultantDTO dto, List<AppointmentCustomerView> appointmentList) { |
| | | private void setAppointmentInfo(CustomerFavoriteConsultantDTO customerFavoriteConsultantDTO, List<AppointmentCustomerView> appointmentList) { |
| | | List<AppointmentCustomerView> appointments = appointmentList.stream() |
| | | .sorted(Comparator.comparing(AppointmentCustomerView::getAppointmentDate).reversed()) |
| | | .collect(Collectors.toList()); |
| | | |
| | | dto.setAppointments(appointmentCustomerViewMapper.toAppointmentCustomerViewDTO(appointments)); |
| | | List<AppointmentCustomerViewDTO> appointmentCustomerViewDTOS = appointmentCustomerViewMapper.toAppointmentCustomerViewDTO(appointments); |
| | | appointmentCustomerViewDTOS.forEach(appointmentCustomerViewDTO -> { |
| | | appointmentService.setSatisfactionScore(appointmentCustomerViewDTO, appointmentCustomerViewDTO.getId()); |
| | | }); |
| | | customerFavoriteConsultantDTO.setAppointments(appointmentCustomerViewDTOS); |
| | | |
| | | if (!appointments.isEmpty()) { |
| | | AppointmentCustomerView latestAppointment = appointments.get(0); |
| | | dto.setContactStatus(latestAppointment.getCommunicateStatus()); |
| | | dto.setLatestAppointmentId(latestAppointment.getId()); |
| | | dto.setLatestAppointmentDate(latestAppointment.getAppointmentDate()); |
| | | dto.setUpdateTime(latestAppointment.getLastModifiedDate()); |
| | | |
| | | setLatestAppointmentScore(dto, latestAppointment); |
| | | } |
| | | } |
| | | |
| | | private void setLatestAppointmentScore(CustomerFavoriteConsultantDTO dto, AppointmentCustomerView latestAppointment) { |
| | | Optional<Satisfaction> satisfactionOptional = satisfactionService.getByAppointmentId(latestAppointment.getId()); |
| | | if(satisfactionOptional.isPresent()) { |
| | | Satisfaction satisfaction = satisfactionOptional.get(); |
| | | dto.setLatestAppointmentScore(satisfaction.getScore()); |
| | | } |
| | | else { |
| | | dto.setLatestAppointmentScore(null); |
| | | customerFavoriteConsultantDTO.setContactStatus(latestAppointment.getCommunicateStatus()); |
| | | customerFavoriteConsultantDTO.setUpdateTime(latestAppointment.getLastModifiedDate()); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | public List<AppointmentCustomerViewDTO> getMyAppointment() { |
| | | String agentNo = SecurityUtils.getAgentNo(); |
| | | return appointmentService.getConsultantAppointments(agentNo); |
| | | return appointmentService.getConsultantAvailableAppointments(agentNo); |
| | | } |
| | | |
| | | public void removeConsultantFromCustomList(String agentNo) { |
| | |
| | | private Instant consultantViewTime; |
| | | private Instant consultantReadTime; |
| | | private Instant contactTime; |
| | | private Float satisfactionScore; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | |
| | | public void setContactTime(Instant contactTime) { |
| | | this.contactTime = contactTime; |
| | | } |
| | | public Float getSatisfactionScore() { |
| | | return satisfactionScore; |
| | | } |
| | | public void setSatisfactionScore(Float satisfactionScore) { |
| | | this.satisfactionScore = satisfactionScore; |
| | | } |
| | | } |
¤ñ¹ï·sÀÉ®× |
| | |
| | | package com.pollex.pam.service.dto; |
| | | |
| | | public class AppointmentUpdateDTO { |
| | | private Long id; |
| | | private String phone; |
| | | private String email; |
| | | private String contactType; |
| | | private String gender; |
| | | private String age; |
| | | private String job; |
| | | private String requirement; |
| | | private String hopeContactTime; |
| | | private String otherRequirement; |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getPhone() { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getContactType() { |
| | | return contactType; |
| | | } |
| | | |
| | | public void setContactType(String contactType) { |
| | | this.contactType = contactType; |
| | | } |
| | | |
| | | public String getGender() { |
| | | return gender; |
| | | } |
| | | |
| | | public void setGender(String gender) { |
| | | this.gender = gender; |
| | | } |
| | | |
| | | public String getAge() { |
| | | return age; |
| | | } |
| | | |
| | | public void setAge(String age) { |
| | | this.age = age; |
| | | } |
| | | |
| | | public String getJob() { |
| | | return job; |
| | | } |
| | | |
| | | public void setJob(String job) { |
| | | this.job = job; |
| | | } |
| | | |
| | | public String getRequirement() { |
| | | return requirement; |
| | | } |
| | | |
| | | public void setRequirement(String requirement) { |
| | | this.requirement = requirement; |
| | | } |
| | | |
| | | public String getHopeContactTime() { |
| | | return hopeContactTime; |
| | | } |
| | | |
| | | public void setHopeContactTime(String hopeContactTime) { |
| | | this.hopeContactTime = hopeContactTime; |
| | | } |
| | | |
| | | public String getOtherRequirement() { |
| | | return otherRequirement; |
| | | } |
| | | |
| | | public void setOtherRequirement(String otherRequirement) { |
| | | this.otherRequirement = otherRequirement; |
| | | } |
| | | } |
| | |
| | | private Instant updateTime; |
| | | private String role; |
| | | private String seniority; |
| | | private Long latestAppointmentId; |
| | | private Instant latestAppointmentDate; |
| | | private Float latestAppointmentScore; |
| | | private List<AppointmentCustomerViewDTO> appointments; |
| | | |
| | | public boolean isNewConsultant() { |
| | |
| | | this.expertise = expertise; |
| | | } |
| | | |
| | | public Float getLatestAppointmentScore() { |
| | | return latestAppointmentScore; |
| | | } |
| | | |
| | | public void setLatestAppointmentScore(Float latestAppointmentScore) { |
| | | this.latestAppointmentScore = latestAppointmentScore; |
| | | } |
| | | |
| | | public Float getAvgScore() { |
| | | return avgScore; |
| | | } |
| | |
| | | |
| | | public void setContactStatus(ContactStatusEnum contactStatus) { |
| | | this.contactStatus = contactStatus; |
| | | } |
| | | |
| | | public Instant getLatestAppointmentDate() { |
| | | return latestAppointmentDate; |
| | | } |
| | | |
| | | public void setLatestAppointmentDate(Instant latestAppointmentDate) { |
| | | this.latestAppointmentDate = latestAppointmentDate; |
| | | } |
| | | |
| | | public Instant getCreateTime() { |
| | |
| | | |
| | | public void setNewConsultant(boolean newConsultant) { |
| | | this.newConsultant = newConsultant; |
| | | } |
| | | |
| | | public Long getLatestAppointmentId() { |
| | | return latestAppointmentId; |
| | | } |
| | | |
| | | public void setLatestAppointmentId(Long latestAppointmentId) { |
| | | this.latestAppointmentId = latestAppointmentId; |
| | | } |
| | | |
| | | public List<AppointmentCustomerViewDTO> getAppointments() { |
| | |
| | | package com.pollex.pam.service.mapper; |
| | | |
| | | import com.pollex.pam.domain.Appointment; |
| | | import com.pollex.pam.domain.Consultant; |
| | | import com.pollex.pam.domain.CustomerFavoriteConsultant; |
| | | import com.pollex.pam.enums.ContactStatusEnum; |
| | | import com.pollex.pam.service.AppointmentService; |
| | | import com.pollex.pam.service.dto.ConsultantDTO; |
| | | import com.pollex.pam.service.dto.ConsultantDetailDTO; |
| | | import com.pollex.pam.service.dto.CustomerFavoriteConsultantDTO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | |
| | | |
| | | consultantDTO.setContactStatus(null); |
| | | consultantDTO.setUpdateTime(null); |
| | | consultantDTO.setLatestAppointmentId(null); |
| | | |
| | | return consultantDTO; |
| | | } |
| | |
| | | package com.pollex.pam.web.rest; |
| | | |
| | | import com.pollex.pam.service.dto.AppointmentDTO; |
| | | import com.pollex.pam.service.dto.AppointmentUpdateDTO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | SatisfactionService satisfactionService; |
| | | |
| | | @PutMapping("") |
| | | public ResponseEntity<Void> updateAppointment(@RequestBody AppointmentDTO appointment) { |
| | | public ResponseEntity<Void> updateAppointment(@RequestBody AppointmentUpdateDTO appointment) { |
| | | appointmentService.updateAppointment(appointment); |
| | | return ResponseEntity.noContent().build(); |
| | | } |
| | |
| | | package com.pollex.pam.web.rest; |
| | | |
| | | import com.pollex.pam.service.AppointmentService; |
| | | import com.pollex.pam.service.ConsultantService; |
| | | import com.pollex.pam.service.dto.*; |
| | | import org.apache.commons.compress.utils.IOUtils; |
| | |
| | | datasource: |
| | | type: com.zaxxer.hikari.HikariDataSource |
| | | url: jdbc:postgresql://dev.pollex.com.tw:5433/pam |
| | | #url: jdbc:postgresql://localhost:5432/omo?currentSchema=omo |
| | | username: pamadmin |
| | | password: pamadmin |
| | | hikari: |