| | |
| | | import com.pollex.pam.domain.AppointmentClosedInfo; |
| | | import com.pollex.pam.enums.ContactStatusEnum; |
| | | import com.pollex.pam.repository.AppointmentClosedInfoRepository; |
| | | import com.pollex.pam.service.AppointmentClosedInfoService; |
| | | import com.pollex.pam.service.dto.AbstractAppointmentProcessDTO; |
| | | import com.pollex.pam.service.dto.ClosedProcessDTO; |
| | | import com.pollex.pam.service.dto.DoneProcessDTO; |
| | | import com.pollex.pam.web.rest.errors.AppointmentClosedInfoNotFoundException; |
| | | |
| | | @Service |
| | | public class DoneProcess implements AppointmentProcessInterface{ |
| | |
| | | @Autowired |
| | | AppointmentClosedInfoRepository appointmentClosedInfoRepository; |
| | | |
| | | @Autowired |
| | | AppointmentClosedInfoService appointmentClosedInfoService; |
| | | |
| | | @Override |
| | | public void doProcess(AbstractAppointmentProcessDTO processDTO) { |
| | | public void createProcess(AbstractAppointmentProcessDTO processDTO) { |
| | | checkClosedInfo(processDTO.getAppointmentId()); |
| | | DoneProcessDTO doneProcess = (DoneProcessDTO)processDTO; |
| | | BeanUtils.copyProperties(processDTO, doneProcess); |
| | | DoneProcessDTO doneProcess = toDoneProcessDTO(processDTO); |
| | | AppointmentClosedInfo closedInfo = new AppointmentClosedInfo(); |
| | | BeanUtils.copyProperties(doneProcess, closedInfo); |
| | | appointmentClosedInfoRepository.save(closedInfo); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public AppointmentClosedInfo editClosedInfo(AbstractAppointmentProcessDTO abstractDTO) { |
| | | DoneProcessDTO doneProcess = toDoneProcessDTO(abstractDTO); |
| | | AppointmentClosedInfo closedInfo = appointmentClosedInfoService.findByAppointmentId(abstractDTO.getAppointmentId()); |
| | | BeanUtils.copyProperties(doneProcess, closedInfo); |
| | | return appointmentClosedInfoRepository.save(closedInfo); |
| | | } |
| | | |
| | | private DoneProcessDTO toDoneProcessDTO(AbstractAppointmentProcessDTO abstractDTO) { |
| | | |
| | | DoneProcessDTO doneProcess = (DoneProcessDTO)abstractDTO; |
| | | BeanUtils.copyProperties(abstractDTO, doneProcess); |
| | | return doneProcess; |
| | | } |
| | | |
| | | } |