From 7c94cd336bb31986d9744657f7a91cddfb34c21e Mon Sep 17 00:00:00 2001 From: wayne <wayne8692wayne8692@gmail.com> Date: 星期一, 29 十一月 2021 12:07:00 +0800 Subject: [PATCH] [update]【todo 131166】修正customer detail命名,ID -> DB_ID --- pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 deletions(-) diff --git a/pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java b/pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java index 5932aca..b23f88e 100644 --- a/pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java +++ b/pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java @@ -16,44 +16,41 @@ import com.pollex.pam.service.dto.AppointmentCustomerViewDTO; import com.pollex.pam.service.mapper.AppointmentCustomerViewMapper; import com.pollex.pam.service.mapper.AppointmentDTOMapper; -import com.pollex.pam.service.mapper.AppointmentMapper; import com.pollex.pam.web.rest.errors.AppointmentNotFoundException; @Service @Transactional public class AppointmentService { - + @Autowired AppointmentRepository appointmentRepository; - + @Autowired AppointmentDTOMapper appointmentDTOMapper; - + @Autowired ConsultantService consultantService; - + @Autowired AppointmentCustomerViewMapper appointmentCustomerViewMapper; - + @Autowired AppointmentCustomerViewRepository appointmentCustomerViewRepository; - - + public void customerCreateAppointment(AppointmentCreateDTO appointmentCreateDTO) { Appointment appointment = appointmentDTOMapper.toAppointment(appointmentCreateDTO); - appointment.setCustomerId(SecurityUtils.getCustomerId()); + appointment.setCustomerId(SecurityUtils.getCustomerDBId()); appointment.setCommunicateStatus(ContactStatusEnum.RESERVED); appointmentRepository.save(appointment); } - public List<Appointment> findByAgentNo(String agentNo) { return appointmentRepository.findByAgentNo(agentNo); } public void markAsContacted(Long appointmentId) { - - Appointment appointment = appointmentRepository.getById(appointmentId); + + Appointment appointment = appointmentRepository.findById(appointmentId).get(); appointment.setCommunicateStatus(ContactStatusEnum.CONTACTED); appointmentRepository.save(appointment); } @@ -64,5 +61,9 @@ .orElseThrow(AppointmentNotFoundException::new); return appointmentCustomerViewMapper.toAppointmentCustomerViewDTO(appointment); } - + + + public List<Appointment> findByAgentNoAndCustomerId(String agentNo, Long customerId) { + return appointmentRepository.findByAgentNoAndCustomerId(agentNo, customerId); + } } -- Gitblit v1.8.0