保誠-保戶業務員媒合平台
pamapi/src/main/java/com/pollex/pam/appointment/process/DoneProcess.java
@@ -1,5 +1,7 @@
package com.pollex.pam.appointment.process;
import java.util.Optional;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -18,6 +20,7 @@
   @Override
   public void doProcess(AbstractAppointmentProcessDTO processDTO) {
      checkClosedInfo(processDTO.getAppointmentId());
      DoneProcessDTO doneProcess = (DoneProcessDTO)processDTO;
      BeanUtils.copyProperties(processDTO, doneProcess);
      AppointmentClosedInfo closedInfo = new AppointmentClosedInfo();
@@ -30,5 +33,11 @@
      return ContactStatusEnum.DONE;
   }
   
   private void checkClosedInfo(Long appointmentId) {
      Optional<AppointmentClosedInfo> closedInfo = appointmentClosedInfoRepository.findByAppointmentId(appointmentId);
      if(closedInfo.isPresent()) {
         throw new IllegalArgumentException("appointment closed info exist");
      }
   }
   
}