From 0a714b1322803be821890cee7c40c1706eb24c79 Mon Sep 17 00:00:00 2001 From: yys <47@gamerwa.com> Date: Wed, 22 Apr 2026 17:40:59 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=9B=A2=E9=98=9F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-ui/src/views/ai/data/index.vue | 126 +++++++++++++++++- .../src/views/ai/groupchargeorder/index.vue | 11 +- admin-ui/src/views/ai/user/index.vue | 69 ++++------ .../src/views/subteam/chargeOrder/index.vue | 3 +- admin-ui/src/views/subteam/overview/index.vue | 2 +- admin-ui/src/views/subteam/user/index.vue | 7 +- .../AiVideoReportDataController.java | 26 +++- .../subteam/SubteamOverviewController.java | 5 +- .../com/ruoyi/common/constant/RedisKey.java | 2 + .../common/core/domain/entity/AiUser.java | 4 +- .../ruoyi/ai/domain/AiVideoReportData.java | 17 ++- .../request/GroupReportDataRequest.java | 6 + .../vo/TeamDailyConsumeAggregateVO.java | 25 ++++ .../ai/mapper/AiVideoReportDataMapper.java | 17 ++- .../ai/service/IAiVideoReportDataService.java | 7 + .../impl/AiVideoReportDataServiceImpl.java | 47 +++++-- .../impl/SubteamOverviewServiceImpl.java | 12 +- .../mapper/ai/AiVideoReportDataMapper.xml | 101 +++++++++----- 18 files changed, 369 insertions(+), 118 deletions(-) create mode 100644 web-api/ruoyi-system/src/main/java/com/ruoyi/ai/domain/vo/TeamDailyConsumeAggregateVO.java diff --git a/admin-ui/src/views/ai/data/index.vue b/admin-ui/src/views/ai/data/index.vue index 6b8b6be..8695bb9 100644 --- a/admin-ui/src/views/ai/data/index.vue +++ b/admin-ui/src/views/ai/data/index.vue @@ -32,12 +32,46 @@ 搜索 重置 + 导出 + - - - +

+ + + +

@@ -90,6 +124,7 @@ export default { showSearch: true, total: 0, dataList: [], + aggregate: null, deptOptions: [], dateRange: [], queryParams: { @@ -107,9 +142,30 @@ export default { this.syncDateRangeToQuery() this.getList() }, + computed: { + summaryState() { + if (this.loading) { + return { mode: "loading" } + } + const a = this.aggregate + if (!a) { + return { mode: "empty" } + } + const fmt = (v) => this.formatWesternNumberValue(v) + const n = a.totalRows != null ? Number(a.totalRows) : 0 + const totalStr = Number.isNaN(n) ? "0" : n.toLocaleString("en-US") + return { + mode: "ok", + totalStr, + recharge: fmt(a.sumRechargeScore), + score: fmt(a.sumScore), + orders: fmt(a.sumOrderCount), + tokens: fmt(a.sumUseTokens) + } + } + }, methods: { - /** null/空 显示 0;数字按 en-US 千分位(如 99,999,999) */ - formatWesternNumber(row, column, cellValue) { + formatWesternNumberValue(cellValue) { if (cellValue === null || cellValue === undefined || cellValue === "") { return (0).toLocaleString("en-US") } @@ -119,6 +175,10 @@ export default { } return n.toLocaleString("en-US") }, + /** null/空 显示 0;数字按 en-US 千分位(如 99,999,999) */ + formatWesternNumber(row, column, cellValue) { + return this.formatWesternNumberValue(cellValue) + }, buildLastMonthDateRange() { const end = new Date() const start = new Date(end.getTime()) @@ -160,8 +220,10 @@ export default { this.loading = true listData(this.queryParams) .then(response => { - this.dataList = response.rows - this.total = response.total + this.dataList = response.rows || [] + this.total = response.total != null ? response.total : 0 + this.aggregate = + response.param && response.param.aggregate != null ? response.param.aggregate : null }) .finally(() => { this.loading = false @@ -177,7 +239,57 @@ export default { this.queryParams.pageNum = 1 this.syncDateRangeToQuery() this.getList() + }, + handleExport() { + this.syncDateRangeToQuery() + this.download( + "ai/data/export", + { + startDate: this.queryParams.startDate, + endDate: this.queryParams.endDate, + deptId: this.queryParams.deptId + }, + `team_consume_${new Date().getTime()}.xlsx` + ) } } } + + diff --git a/admin-ui/src/views/ai/groupchargeorder/index.vue b/admin-ui/src/views/ai/groupchargeorder/index.vue index fed8f2a..4113c31 100644 --- a/admin-ui/src/views/ai/groupchargeorder/index.vue +++ b/admin-ui/src/views/ai/groupchargeorder/index.vue @@ -19,7 +19,12 @@ - + @@ -151,6 +156,10 @@ export default { amount: [{ required: true, message: "请填写积分", trigger: "blur" }], status: [{ required: true, message: "请选择状态", trigger: "change" }] }, + orderTypeQueryOptions: [ + { label: "充值", value: 0 }, + { label: "退款", value: 1 } + ], orderTypeOptions: [ { label: "充值", value: 0 }, { label: "退款", value: 1 }, diff --git a/admin-ui/src/views/ai/user/index.vue b/admin-ui/src/views/ai/user/index.vue index e0d1755..d5d61fd 100644 --- a/admin-ui/src/views/ai/user/index.vue +++ b/admin-ui/src/views/ai/user/index.vue @@ -8,19 +8,12 @@ v-show="showSearch" label-width="68px" > - - - @@ -29,19 +22,12 @@ v-model="queryParams.username" placeholder="请输入用户账号" clearable + style="width: 150px" @keyup.enter.native="handleQuery" /> - - - - - + + - + 搜索 重置 - - - - - 新增 - - 删除 - - 导出 - - - + + + - - + + - + - +