|
@@ -126,4 +126,31 @@ public class EmployeeServiceImpl implements EmployeeService {
|
|
|
employeeMapper.update(employee);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据id查询员工
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Employee getById(Integer id) {
|
|
|
+ Employee employee = employeeMapper.getById(id);
|
|
|
+ employee.setPassword("******");
|
|
|
+ return employee;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 编辑员工信息
|
|
|
+ * @param employeeDTO
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void update(EmployeeDTO employeeDTO) {
|
|
|
+ Employee employee = new Employee();
|
|
|
+ BeanUtils.copyProperties(employeeDTO, employee);
|
|
|
+
|
|
|
+ employee.setUpdateTime(LocalDateTime.now());
|
|
|
+ employee.setUpdateUser(BaseContext.getCurrentId());
|
|
|
+
|
|
|
+ employeeMapper.update(employee);
|
|
|
+ }
|
|
|
+
|
|
|
}
|