From b0487259ab4667cd3df5dd022d4fd547f9be24f8 Mon Sep 17 00:00:00 2001
From: Fdily <2949549024@qq.com>
Date: Mon, 27 Jul 2026 10:38:57 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4roll=E5=85=A8=E9=83=A8?=
=?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ruoyi-ui/src/api/skins/ttRoll/api.js | 7 +++
ruoyi-ui/src/views/skins/ttRoll/index.vue | 41 +++++++++++++---
.../admin/controller/TtRollController.java | 49 +++++++++++++++----
3 files changed, 81 insertions(+), 16 deletions(-)
diff --git a/ruoyi-ui/src/api/skins/ttRoll/api.js b/ruoyi-ui/src/api/skins/ttRoll/api.js
index 1d2926a..4362e65 100644
--- a/ruoyi-ui/src/api/skins/ttRoll/api.js
+++ b/ruoyi-ui/src/api/skins/ttRoll/api.js
@@ -95,6 +95,13 @@ export function delRoll(rollId) {
method: "delete",
});
}
+
+export function delAllRoll() {
+ return request({
+ url: `/admin/roll/removeAll`,
+ method: "delete",
+ });
+}
export function rollJackpotOrnamentDel(jackpotId, rollJackpotOrnamentsIds) {
return request({
url: `/admin/rollJackpotOrnaments/${jackpotId}/${rollJackpotOrnamentsIds}`,
diff --git a/ruoyi-ui/src/views/skins/ttRoll/index.vue b/ruoyi-ui/src/views/skins/ttRoll/index.vue
index 4718917..c4114dd 100644
--- a/ruoyi-ui/src/views/skins/ttRoll/index.vue
+++ b/ruoyi-ui/src/views/skins/ttRoll/index.vue
@@ -49,17 +49,27 @@
v-hasPermi="['admin:user:export']"
>导出
-
+
+
+ 一键删除所有
+
item.userId);
+ this.ids = selection.map(item => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
handleDelete(row) {
+ const ids = row ? [row] : this.ids;
+ if (!ids || ids.length === 0) {
+ this.$modal.msgWarning("请至少选择一条数据");
+ return;
+ }
this.$modal
- .confirm('是否确认删除ID为"' + row + '"的Roll房?')
+ .confirm('是否确认删除ID为"' + ids.join(", ") + '"的Roll房?')
.then(() => {
- delRoll(row).then(res => {
+ delRoll(ids.join(",")).then(res => {
this.getList();
this.$modal.msgSuccess("删除成功");
});
})
.catch(() => {});
},
+ handleDeleteAll() {
+ this.$modal
+ .confirm('此操作将删除所有Roll房,且不可恢复,是否继续?', "系统提示", {
+ type: "warning"
+ })
+ .then(() => {
+ delAllRoll().then(res => {
+ this.getList();
+ this.$modal.msgSuccess("一键删除成功");
+ });
+ })
+ .catch(() => {});
+ },
handleExport() {
this.download(
"admin/roll/export",
diff --git a/skins-service/service-admin/src/main/java/com/ruoyi/admin/controller/TtRollController.java b/skins-service/service-admin/src/main/java/com/ruoyi/admin/controller/TtRollController.java
index 955ce9f..fee1c61 100644
--- a/skins-service/service-admin/src/main/java/com/ruoyi/admin/controller/TtRollController.java
+++ b/skins-service/service-admin/src/main/java/com/ruoyi/admin/controller/TtRollController.java
@@ -113,16 +113,45 @@ public class TtRollController extends BaseController {
}
@ApiOperation("删除roll房")
- @DeleteMapping("/remove/{rollId}")
- public AjaxResult remove(@PathVariable Long rollId) {
- LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
- wrapper.eq(TtRollUser::getRollId, rollId);
- List list = rollUserService.list(wrapper);
- TtRoll ttRoll = rollService.getById(rollId);
- ttRoll.setUpdateBy(getUsername());
- ttRoll.setUpdateTime(DateUtils.getNowDate());
- rollService.updateById(ttRoll);
- return toAjax(rollService.removeById(rollId));
+ @DeleteMapping("/remove/{rollIds}")
+ public AjaxResult remove(@PathVariable Long[] rollIds) {
+ int count = 0;
+ for (Long rollId : rollIds) {
+ LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(TtRollUser::getRollId, rollId);
+ List list = rollUserService.list(wrapper);
+ TtRoll ttRoll = rollService.getById(rollId);
+ if (ttRoll == null) {
+ continue;
+ }
+ ttRoll.setUpdateBy(getUsername());
+ ttRoll.setUpdateTime(DateUtils.getNowDate());
+ rollService.updateById(ttRoll);
+ if (rollService.removeById(rollId)) {
+ count++;
+ }
+ }
+ return toAjax(count);
+ }
+
+ @ApiOperation("一键删除所有roll房")
+ @DeleteMapping("/removeAll")
+ public AjaxResult removeAll() {
+ List list = rollService.list();
+ int count = 0;
+ for (TtRoll roll : list) {
+ Long rollId = roll.getId();
+ LambdaQueryWrapper wrapper = Wrappers.lambdaQuery();
+ wrapper.eq(TtRollUser::getRollId, rollId);
+ List rollUserList = rollUserService.list(wrapper);
+ roll.setUpdateBy(getUsername());
+ roll.setUpdateTime(DateUtils.getNowDate());
+ rollService.updateById(roll);
+ if (rollService.removeById(rollId)) {
+ count++;
+ }
+ }
+ return toAjax(count);
}