fix front
This commit is contained in:
parent
4b69a4ff4b
commit
c96cf40dee
BIN
data.mv.db
BIN
data.mv.db
Binary file not shown.
@ -4,9 +4,7 @@ import com.example.demo.speaker.controller.EmployeeDTO;
|
|||||||
import com.example.demo.speaker.model.Appointment;
|
import com.example.demo.speaker.model.Appointment;
|
||||||
import com.example.demo.speaker.model.Employee;
|
import com.example.demo.speaker.model.Employee;
|
||||||
import com.example.demo.speaker.model.RequestForCooperation;
|
import com.example.demo.speaker.model.RequestForCooperation;
|
||||||
import com.example.demo.speaker.repository.IAppointmentRepository;
|
|
||||||
import com.example.demo.speaker.repository.IEmployeeRepository;
|
import com.example.demo.speaker.repository.IEmployeeRepository;
|
||||||
import com.example.demo.speaker.repository.IRequestForCooperationRepository;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -16,16 +14,16 @@ import java.util.Optional;
|
|||||||
@Service
|
@Service
|
||||||
public class EmployeeService {
|
public class EmployeeService {
|
||||||
private final IEmployeeRepository employeeRepository;
|
private final IEmployeeRepository employeeRepository;
|
||||||
private final AppointmentService appointmentRepository;
|
private final AppointmentService appointmentService;
|
||||||
|
|
||||||
public EmployeeService(IEmployeeRepository employeeRepository, AppointmentService appointmentRepository) {
|
public EmployeeService(IEmployeeRepository employeeRepository, AppointmentService appointmentService) {
|
||||||
this.employeeRepository = employeeRepository;
|
this.employeeRepository = employeeRepository;
|
||||||
this.appointmentRepository = appointmentRepository;
|
this.appointmentService = appointmentService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public Employee addWorker(EmployeeDTO employee) {
|
public Employee addWorker(EmployeeDTO employee) {
|
||||||
var appontment = appointmentRepository.findAppointment(employee.getAppointment().getId());
|
var appontment = appointmentService.findAppointment(employee.getAppointment().getId());
|
||||||
Employee employeeNew = new Employee(employee.getFio(), appontment);
|
Employee employeeNew = new Employee(employee.getFio(), appontment);
|
||||||
employeeRepository.save(employeeNew);
|
employeeRepository.save(employeeNew);
|
||||||
return employeeNew;
|
return employeeNew;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user