保誠-保戶業務員媒合平台
Mila
2022-01-13 75d1209791a26cc27d9ba489792788513bd70446
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.pollex.pam.appointment.process;
 
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import com.pollex.pam.domain.AppointmentClosedInfo;
import com.pollex.pam.enums.ContactStatusEnum;
import com.pollex.pam.repository.AppointmentClosedInfoRepository;
import com.pollex.pam.service.dto.AbstractAppointmentProcessDTO;
import com.pollex.pam.service.dto.ClosedProcessDTO;
import com.pollex.pam.service.dto.DoneProcessDTO;
 
@Service
public class ClosedProcess implements AppointmentProcessInterface{
    
    @Autowired
    AppointmentClosedInfoRepository appointmentClosedInfoRepository;
 
    @Override
    public void doProcess(AbstractAppointmentProcessDTO processDTO) {
        ClosedProcessDTO doneProcess = (ClosedProcessDTO)processDTO;
        BeanUtils.copyProperties(processDTO, doneProcess);
        AppointmentClosedInfo closedInfo = new AppointmentClosedInfo();
        BeanUtils.copyProperties(doneProcess, closedInfo);
        appointmentClosedInfoRepository.save(closedInfo);
    }
 
    @Override
    public ContactStatusEnum getProcessType() {
        return ContactStatusEnum.CLOSED;
    }
    
    
}