保誠-保戶業務員媒合平台
wayne
2021-12-03 83bd7808cda21e586841041b4db88d01c1340923
[update] 預約單更新時要補壓available tag

修改2個檔案
新增1個檔案
51 ■■■■ 已變更過的檔案
pamapi/src/doc/預約單/更新預約單明細API.txt 25 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java 23 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentCustomerViewMapper.java 3 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
pamapi/src/doc/¹w¬ù³æ/§ó·s¹w¬ù³æ©ú²ÓAPI.txt
¤ñ¹ï·sÀÉ®×
@@ -0,0 +1,25 @@
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
pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java
@@ -60,6 +60,18 @@
        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);
    }
@@ -94,17 +106,6 @@
        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) {
pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentCustomerViewMapper.java
@@ -9,11 +9,10 @@
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);