保誠-保戶業務員媒合平台
wayne
2021-12-02 bb9e8aad46c1667625b451b8df458a441bfc792f
pamapi/src/main/java/com/pollex/pam/service/AppointmentService.java
@@ -3,6 +3,8 @@
import java.time.Instant;
import java.util.List;
import com.pollex.pam.enums.AppointmentStatusEnum;
import com.pollex.pam.service.dto.AppointmentDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -20,6 +22,8 @@
import com.pollex.pam.service.mapper.AppointmentCustomerViewMapper;
import com.pollex.pam.service.mapper.AppointmentDTOMapper;
import com.pollex.pam.web.rest.errors.AppointmentNotFoundException;
import static com.pollex.pam.enums.AppointmentStatusEnum.DELETED;
@Service
@Transactional
@@ -87,4 +91,16 @@
            log.debug("this appointment was read, read time = {}", appointment.getConsultantReadTime());
        }
    }
    public void updateAppointment(AppointmentDTO appointmentDTO) {
        Appointment appointment = appointmentDTOMapper.toAppointment(appointmentDTO);
        appointmentRepository.save(appointment);
    }
    public void markAppointmentDeleted(Long appointmentId) {
        Appointment appointment = appointmentRepository.findById(appointmentId).get();
        appointment.setStatus(DELETED);
        appointmentRepository.save(appointment);
    }
}