Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
476be6fcc8
@ -341,23 +341,27 @@ public class StaffController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号信息禁用
|
* 账号信息禁用/启用
|
||||||
*
|
*
|
||||||
* @param staffId
|
* @param staffId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Transactional
|
@Transactional
|
||||||
@GetMapping("staffInfoDisable/{staffId}")
|
@GetMapping("staffInfoDisable/{staffId}/{state}")
|
||||||
public JsonResult<?> staffInfoDisable(@PathVariable("staffId") Long staffId) {
|
public JsonResult<?> staffInfoDisable(@PathVariable("staffId") Long staffId,
|
||||||
|
@PathVariable("state") String state) {
|
||||||
|
String msg = "禁用";
|
||||||
|
if ("1".equals(state)) {
|
||||||
|
msg = "启用";
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Staff staff = staffService.getById(staffId);
|
Staff staff = staffService.getById(staffId);
|
||||||
staff.setState("0");
|
staff.setState(state);
|
||||||
staffService.updateById(staff);
|
staffService.updateById(staff);
|
||||||
return JsonResult.success("禁用成功!");
|
return JsonResult.success(msg + "成功!");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return JsonResult.failed("禁用失败!");
|
return JsonResult.failed(msg + "失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user