feat: 支持系统账号批量操作

- 新增账号批量删除和批量重置密码接口及结果返回

- 用户列表增加批量操作工具栏与结果提示

- 账号删除切换为逻辑删除语义
This commit is contained in:
2026-03-24 18:37:32 +08:00
parent d510034abb
commit 6e1bd73cd8
12 changed files with 513 additions and 14 deletions

View File

@@ -22,6 +22,7 @@ import tech.easyflow.common.web.controller.BaseCurdController;
import tech.easyflow.common.web.jsonbody.JsonBody;
import tech.easyflow.log.annotation.LogRecord;
import tech.easyflow.system.entity.SysAccount;
import tech.easyflow.system.entity.vo.SysAccountBatchActionResultVo;
import tech.easyflow.system.entity.vo.SysAccountImportResultVo;
import tech.easyflow.system.service.SysAccountService;
import tech.easyflow.system.util.SysPasswordPolicy;
@@ -180,6 +181,28 @@ public class SysAccountController extends BaseCurdController<SysAccountService,
return Result.ok();
}
@PostMapping("/removeBatchWithResult")
@SaCheckPermission("/api/v1/sysAccount/remove")
@LogRecord("批量删除用户")
public Result<SysAccountBatchActionResultVo> removeBatchWithResult(
@JsonBody(value = "ids", required = true) List<BigInteger> ids) {
if (ids == null || ids.isEmpty()) {
return Result.fail("ids不能为空", null);
}
return Result.ok(service.removeBatchWithResult(ids));
}
@PostMapping("/resetPasswordBatch")
@SaCheckPermission("/api/v1/sysAccount/save")
@LogRecord("批量重置用户密码")
public Result<SysAccountBatchActionResultVo> resetPasswordBatch(
@JsonBody(value = "ids", required = true) List<BigInteger> ids) {
if (ids == null || ids.isEmpty()) {
return Result.fail("ids不能为空", null);
}
return Result.ok(service.resetPasswordBatch(ids, SaTokenUtil.getLoginAccount().getId()));
}
@PostMapping("/importExcel")
@SaCheckPermission("/api/v1/sysAccount/save")
public Result<SysAccountImportResultVo> importExcel(MultipartFile file) {