Package com.expositds.ars.domain.user

Examples of com.expositds.ars.domain.user.Employee


      outgoingPaymentEntity.setCompleted(source.isCompleted());
      outgoingPaymentEntity.setCreationDate(source.getCreationDate());
      outgoingPaymentEntity.setId(source.getId());
      outgoingPaymentEntity.setPaymentDate(source.getPaymentDate());

      Employee employee = ((OutgoingPayment) source).getRecipient();
      EmployeeEntity employeeEntity = null;
      if (employee instanceof Mechanic) {
        employeeEntity = DozerHelper.map(employee, MechanicEntity.class);
      }
      if (employee instanceof Employee) {
View Full Code Here


      outgoingPayment.setId(tmp.getId());
      outgoingPayment.setPaymentDate(tmp.getPaymentDate());

      EmployeeEntity employeeEntity = ((OutgoingPaymentEntity) tmp)
          .getRecipient();
      Employee employee = null;
      if (employeeEntity instanceof MechanicEntity) {
        employee = DozerHelper.map(employee, Mechanic.class);
      }
      if (employeeEntity instanceof EmployeeEntity) {
        employee = DozerHelper.map(employee, Employee.class);
View Full Code Here

    return result;
  }

  @Override
  public Employee updateEmployee(Employee employee) {
    Employee result = null;

    EmployeeEntity employeeEntity = DozerHelper.map(employee,
        EmployeeEntity.class);
    employeeEntity = employeeRepository.merge(employeeEntity);
    result = DozerHelper.map(employeeEntity, Employee.class);
View Full Code Here

    employeeRepository.delete(id);
  }

  @Override
  public Employee getEmployeeById(Long id) {
    Employee result = null;

    EmployeeEntity employeeEntity = employeeRepository.findById(id);
    result = DozerHelper.map(employeeEntity, Employee.class);

    return result;
View Full Code Here

  }

  @SuppressWarnings("deprecation")
  @Override
  public Employee convertFrom(EmployeeEntity source, Employee destination) {
    Employee result = null;
    EmployeeEntity tmp = null;

    if (source != null) {
      tmp = HibernateHelper.initializeAndUnproxy(source);
    }

    if (tmp instanceof EmployeeEntity) {
      Employee employee = new Employee();

      employee.setId(tmp.getId());
      employee.setEmail(tmp.getEmail());
      employee.setName(tmp.getName());
      employee.setPassword(tmp.getPassword());
      employee.setPatronymic(tmp.getPatronymic());
      employee.setPhone(tmp.getPhone());
      employee.setPosition(tmp.getPosition());
      employee.setRole(tmp.getRole());
      employee.setSalary(tmp.getSalary());
      employee.setSurname(tmp.getSurname());

      result = employee;
    }

    if (tmp instanceof MechanicEntity) {
View Full Code Here

    log.info(payment);
  }

  @Test
  public void getPaymentForRecipientServiceTest() {
    Employee employee = employeeService.getEmployeeById((long) 1);
    List<OutgoingPayment> payment = paymentService.getPaymentsForRecipient(
        employee, true, 1);
    log.info(payment);
  }
View Full Code Here

  }

  @Test
  public void addPaymentServiceTest() {
    Subsidiary subsidiary = subsidiaryService.getSubsidiaryById(new Long(2));
    Employee recepient = employeeService.getEmployeeById(new Long(10));
   
    OutgoingPayment payment = null;
    try {
      payment = new OutgoingPayment(subsidiary, recepient, 200, EPaymentType.SALARY);
    } catch (InvalidPaymentTypeException e) {
View Full Code Here

  @Autowired
  private ISubsidiaryService subsidiaryService;

  @Test
  public void addEmployee() {
    Employee employee = new Employee();
    employee.setEmail("test@test.ru");
    employee.setName("Test");
    employee.setPassword("000000");
    employee.setPatronymic("Test");
    employee.setRole(EUserRole.DIRECTOR);
    employee.setSalary(20f);
    employee.setSurname("Test");
   
    Long id = employeeService.addEmployee(employee);
    employee = employeeService.getEmployeeById(id);
    log.info(employee);
  }
View Full Code Here

    log.info(employee);
  }

  @Test
  public void updateEmployeeTest() {
    Employee employee = employeeService.getEmployeeById(new Long(2));
    employee.setName("Admin");
   
    log.info(employee);
  }
View Full Code Here

    List<Detail> details = (List<Detail>) detailService.getDetailById((long) 1);
    subsidiary.setDetails(details);
    subsidiary.setEmail("2@2.r");

    Employee employee = employeeService.getEmployeeById((long) 1);
    subsidiary.setEmployees((List<Employee>) employee);

    subsidiary.setHouse((short) 3);
    subsidiary.setHousing((short) 1);
    subsidiary.setName("fd");
View Full Code Here

TOP

Related Classes of com.expositds.ars.domain.user.Employee

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.