启用禁用员工账号
This commit is contained in:
@@ -101,4 +101,18 @@ public class EmployeeController {
|
||||
PageResult pageResult = employeeService.pageQuery(employeePageQueryDTO);
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,10 @@ public interface EmployeeMapper {
|
||||
* @return
|
||||
*/
|
||||
Page<Employee> pageQuery(EmployeePageQueryDTO employeePageQueryDTO);
|
||||
|
||||
/**
|
||||
* 根据主键动态修改属性
|
||||
* @param employee
|
||||
*/
|
||||
void update(Employee employee);
|
||||
}
|
||||
|
||||
@@ -27,4 +27,11 @@ public interface EmployeeService {
|
||||
* @return
|
||||
*/
|
||||
PageResult pageQuery(EmployeePageQueryDTO employeePageQueryDTO);
|
||||
|
||||
/**
|
||||
* 员工启用禁用
|
||||
* @param status
|
||||
* @param id
|
||||
*/
|
||||
void startOrStop(Integer status, Long id);
|
||||
}
|
||||
|
||||
@@ -109,4 +109,18 @@ public class EmployeeServiceImpl implements EmployeeService {
|
||||
return new PageResult(total,records);
|
||||
}
|
||||
|
||||
/**
|
||||
* 员工启用禁用
|
||||
* @param status
|
||||
* @param id
|
||||
*/
|
||||
@Override
|
||||
public void startOrStop(Integer status, Long id) {
|
||||
Employee employee = Employee.builder()
|
||||
.id(id)
|
||||
.status(status)
|
||||
.build();
|
||||
employeeMapper.update(employee);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user