[update] 預約單更新時要補壓available tag
¤ñ¹ï·sÀÉ®× |
| | |
| | | http put: |
| | | http://localhost:8080/api/appointment |
| | | |
| | | http request body: |
| | | { |
| | | "id": 170, |
| | | "phone": "0938520091", |
| | | "email": "", |
| | | "contactType": "phone", |
| | | "gender": "male", |
| | | "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 |
| | | } |
| | | |
| | | http response status: 204 |
| | |
| | | appointmentRepository.save(appointment); |
| | | } |
| | | |
| | | public void updateAppointment(AppointmentDTO appointmentDTO) { |
| | | Appointment appointment = appointmentDTOMapper.toAppointment(appointmentDTO); |
| | | appointment.setStatus(AVAILABLE); |
| | | appointmentRepository.save(appointment); |
| | | } |
| | | |
| | | public void markAppointmentDeleted(Long appointmentId) { |
| | | Appointment appointment = appointmentRepository.findById(appointmentId).get(); |
| | | appointment.setStatus(DELETED); |
| | | appointmentRepository.save(appointment); |
| | | } |
| | | |
| | | public List<Appointment> findByAgentNo(String agentNo) { |
| | | return appointmentRepository.findByAgentNo(agentNo); |
| | | } |
| | |
| | | else { |
| | | log.debug("this appointment was read, read time = {}", appointment.getConsultantReadTime()); |
| | | } |
| | | } |
| | | |
| | | public void updateAppointment(AppointmentDTO appointmentDTO) { |
| | | Appointment appointment = appointmentDTOMapper.toAppointment(appointmentDTO); |
| | | appointmentRepository.save(appointment); |
| | | } |
| | | |
| | | public void markAppointmentDeleted(Long appointmentId) { |
| | | Appointment appointment = appointmentRepository.findById(appointmentId).get(); |
| | | appointment.setStatus(DELETED); |
| | | appointmentRepository.save(appointment); |
| | | } |
| | | |
| | | public void recordAllAppointmentsView(String agentNo) { |
| | |
| | | |
| | | import com.pollex.pam.domain.AppointmentCustomerView; |
| | | import com.pollex.pam.service.dto.AppointmentCustomerViewDTO; |
| | | import com.pollex.pam.service.dto.AppointmentDTO; |
| | | |
| | | @Service |
| | | public class AppointmentCustomerViewMapper { |
| | | |
| | | |
| | | public AppointmentCustomerViewDTO toAppointmentCustomerViewDTO(AppointmentCustomerView source) { |
| | | AppointmentCustomerViewDTO target = new AppointmentCustomerViewDTO(); |
| | | BeanUtils.copyProperties(source, target); |