保誠-保戶業務員媒合平台
wayne
2022-02-17 a3716f72066d25d745f4d5103ff23a553c3e102b
pamapi/src/main/java/com/pollex/pam/service/mapper/AppointmentMapper.java
@@ -4,6 +4,7 @@
import java.util.List;
import com.pollex.pam.enums.SatisfactionTypeEnum;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -13,7 +14,6 @@
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;
@Service
public class AppointmentMapper {
@@ -32,17 +32,19 @@
            .map(s -> toAppointmentDTO(s)).collect(toList());
   }
   public Satisfaction toSatisfaction(Appointment appointment) {
   public Satisfaction toAppointmentSatisfaction(Appointment appointment) {
      Satisfaction target = new Satisfaction();
        target.setAppointmentId(appointment.getId());
      target.setAgentNo(appointment.getAgentNo());
      target.setCustomerId(appointment.getCustomerId());
        target.setType(SatisfactionTypeEnum.APPOINTMENT);
      target.setStatus(SatisfactionStatusEnum.UNFILLED);
      return target;
   }
   public Satisfaction toSatisfaction(Long appointmentId) {
   public Satisfaction toAppointmentSatisfaction(Long appointmentId) {
      Appointment appointment = appointmentRepository.findById(appointmentId).get();
      return toSatisfaction(appointment);
      return toAppointmentSatisfaction(appointment);
   }