启用禁用员工账号业务代码开发
This commit is contained in:
@@ -104,4 +104,20 @@ public class EmployeeController {
|
||||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 启用禁用员工账号
|
||||
* @param status
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/status/{status}")
|
||||
@ApiOperation("启用禁用员工账号")
|
||||
public Result startOrStop(@PathVariable Integer status, Long id){
|
||||
|
||||
log.info("启用禁用员工账号:{},{}", status, id);
|
||||
employeeService.startOrStop(status, id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,4 +36,11 @@ public interface EmployeeMapper {
|
||||
*/
|
||||
|
||||
Page<Employee> pageQuery(EmployeePageQueryDTO employeePageQueryDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 启用禁用员工
|
||||
* @param employee
|
||||
*/
|
||||
void update(Employee employee);
|
||||
}
|
||||
|
||||
@@ -29,4 +29,12 @@ public interface EmployeeService {
|
||||
* @return
|
||||
*/
|
||||
PageResult pageQuery(EmployeePageQueryDTO employeePageQueryDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 启用禁用员工账号
|
||||
* @param status
|
||||
* @param id
|
||||
*/
|
||||
void startOrStop(Integer status, Long id);
|
||||
}
|
||||
|
||||
@@ -109,4 +109,24 @@ public class EmployeeServiceImpl implements EmployeeService {
|
||||
return new PageResult(total, records);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 启用禁用员工账号
|
||||
* @param status
|
||||
* @param id
|
||||
*/
|
||||
public void startOrStop(Integer status, Long id) {
|
||||
|
||||
/* Employee employee = new Employee();
|
||||
employee.setStatus(status);
|
||||
employee.setId(id);*/
|
||||
|
||||
//builder构造器
|
||||
Employee employee = Employee.builder()
|
||||
.status(status)
|
||||
.id(id)
|
||||
.build();
|
||||
employeeMapper.update(employee);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user