保誠-保戶業務員媒合平台
HelenHuang
2022-01-20 f5831acafe510f9a79f8e2ecf6dee09026d67fc6
pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentMapper.java
@@ -13,11 +13,11 @@
import com.pollex.pam.enums.SatisfactionStatusEnum;
import com.pollex.pam.repository.AppointmentRepository;
import com.pollex.pam.service.dto.AppointmentDTO;
import com.pollex.pam.service.dto.SatisfactionCustomerCreateDTO;
import com.pollex.pam.service.dto.SatisfactionCustomerScoreDTO;
@Service
public class AppointmentMapper {
   @Autowired
   AppointmentRepository appointmentRepository;
@@ -34,16 +34,18 @@
   public Satisfaction toSatisfaction(Appointment appointment) {
      Satisfaction target = new Satisfaction();
        target.setAppointmentId(appointment.getId());
      target.setAgentNo(appointment.getAgentNo());
      target.setCustomerId(appointment.getCustomerId());
      target.setStatus(SatisfactionStatusEnum.UNFILLED);
      return target;
   }
   public Satisfaction toSatisfaction(Long appointmentId) {
      Appointment appointment = appointmentRepository.findById(appointmentId).get();
      return toSatisfaction(appointment);
   }
}