diff --git a/frontend/app/web-gold/src/views/dh/Video.vue b/frontend/app/web-gold/src/views/dh/Video.vue deleted file mode 100644 index 51f0a73904..0000000000 --- a/frontend/app/web-gold/src/views/dh/Video.vue +++ /dev/null @@ -1,1550 +0,0 @@ - - - - - diff --git a/yudao-module-tik/src/main/java/cn/iocoder/yudao/module/tik/muye/aiusagestats/service/AiUsageStatsServiceImpl.java b/yudao-module-tik/src/main/java/cn/iocoder/yudao/module/tik/muye/aiusagestats/service/AiUsageStatsServiceImpl.java index 0db0364f77..8ace06c3ea 100644 --- a/yudao-module-tik/src/main/java/cn/iocoder/yudao/module/tik/muye/aiusagestats/service/AiUsageStatsServiceImpl.java +++ b/yudao-module-tik/src/main/java/cn/iocoder/yudao/module/tik/muye/aiusagestats/service/AiUsageStatsServiceImpl.java @@ -96,7 +96,7 @@ public class AiUsageStatsServiceImpl implements AiUsageStatsService { public PageResult getUserStatsPage(AiUsageStatsPageReqVO reqVO) { // 查询用户统计数据 List> userStatsList = pointRecordMapper.selectUserStats( - reqVO.getStartTime(), reqVO.getEndTime(), reqVO.getBizType(), reqVO.getUserId()); + reqVO.getStartTime(), reqVO.getEndTime(), reqVO.getBizType(), reqVO.getUserId(), reqVO.getMobile()); // 计算总数 long total = userStatsList.size(); diff --git a/yudao-module-tik/src/main/java/cn/iocoder/yudao/module/tik/muye/aiusagestats/vo/AiUsageStatsPageReqVO.java b/yudao-module-tik/src/main/java/cn/iocoder/yudao/module/tik/muye/aiusagestats/vo/AiUsageStatsPageReqVO.java index 34d37340ba..368a3406de 100644 --- a/yudao-module-tik/src/main/java/cn/iocoder/yudao/module/tik/muye/aiusagestats/vo/AiUsageStatsPageReqVO.java +++ b/yudao-module-tik/src/main/java/cn/iocoder/yudao/module/tik/muye/aiusagestats/vo/AiUsageStatsPageReqVO.java @@ -34,6 +34,9 @@ public class AiUsageStatsPageReqVO extends SortablePageParam { @Schema(description = "用户ID") private Long userId; + @Schema(description = "手机号") + private String mobile; + @Schema(description = "服务标识") private String serviceCode; diff --git a/yudao-module-tik/src/main/java/cn/iocoder/yudao/module/tik/muye/pointrecord/mapper/PointRecordMapper.java b/yudao-module-tik/src/main/java/cn/iocoder/yudao/module/tik/muye/pointrecord/mapper/PointRecordMapper.java index eb52f5f688..59663b7a1f 100644 --- a/yudao-module-tik/src/main/java/cn/iocoder/yudao/module/tik/muye/pointrecord/mapper/PointRecordMapper.java +++ b/yudao-module-tik/src/main/java/cn/iocoder/yudao/module/tik/muye/pointrecord/mapper/PointRecordMapper.java @@ -78,13 +78,15 @@ public interface PointRecordMapper extends BaseMapperX { " AND create_time <= #{endTime}" + " AND biz_type = #{bizType}" + " AND user_id = #{userId}" + + " AND mobile LIKE CONCAT('%', #{mobile}, '%')" + "GROUP BY user_id, mobile " + "ORDER BY consumePoints DESC" + "") List> selectUserStats(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("bizType") String bizType, - @Param("userId") Long userId); + @Param("userId") Long userId, + @Param("mobile") String mobile); /** * 按应用统计 diff --git a/yudao-ui-admin-vue3/src/api/muye/aiusagestats/index.ts b/yudao-ui-admin-vue3/src/api/muye/aiusagestats/index.ts index b5d278b429..dfb9228407 100644 --- a/yudao-ui-admin-vue3/src/api/muye/aiusagestats/index.ts +++ b/yudao-ui-admin-vue3/src/api/muye/aiusagestats/index.ts @@ -68,6 +68,7 @@ export const getAiUsageUserStatsPage = (params: { endTime?: string bizType?: string userId?: number + mobile?: string }) => { return request.get({ url: '/muye/ai-usage-stats/user-stats', params }) } diff --git a/yudao-ui-admin-vue3/src/views/muye/aiusage/components/AppStatsPanel.vue b/yudao-ui-admin-vue3/src/views/muye/aiusage/components/AppStatsPanel.vue new file mode 100644 index 0000000000..a3e59cd3a6 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/muye/aiusage/components/AppStatsPanel.vue @@ -0,0 +1,360 @@ + + + + + diff --git a/yudao-ui-admin-vue3/src/views/muye/aiusage/components/UserStatsPanel.vue b/yudao-ui-admin-vue3/src/views/muye/aiusage/components/UserStatsPanel.vue new file mode 100644 index 0000000000..2b855e7025 --- /dev/null +++ b/yudao-ui-admin-vue3/src/views/muye/aiusage/components/UserStatsPanel.vue @@ -0,0 +1,370 @@ + + + + + diff --git a/yudao-ui-admin-vue3/src/views/muye/aiusage/index.vue b/yudao-ui-admin-vue3/src/views/muye/aiusage/index.vue index 87c020025e..288b3e95b6 100644 --- a/yudao-ui-admin-vue3/src/views/muye/aiusage/index.vue +++ b/yudao-ui-admin-vue3/src/views/muye/aiusage/index.vue @@ -29,7 +29,7 @@ - + @@ -136,58 +136,12 @@ - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - + @@ -198,13 +152,11 @@ import { ref, reactive, onMounted, onUnmounted, nextTick } from 'vue' import * as echarts from 'echarts' import { getAiUsageOverview, - getAiUsageUserStatsPage, - getAiUsageAppStats, getAiUsageTrend, - type AiUsageOverview, - type AiUsageUserStats, - type AiUsageAppStats + type AiUsageOverview } from '@/api/muye/aiusagestats' +import UserStatsPanel from './components/UserStatsPanel.vue' +import AppStatsPanel from './components/AppStatsPanel.vue' defineOptions({ name: 'AiUsageStats' }) @@ -254,19 +206,6 @@ const activeTab = ref('overview') // 概览数据 const overviewData = ref({} as AiUsageOverview) -// 用户统计 -const userLoading = ref(false) -const userStatsList = ref([]) -const userPageParams = reactive({ - pageNo: 1, - pageSize: 10, - total: 0 -}) - -// 应用统计 -const appLoading = ref(false) -const appStatsList = ref([]) - // 图表 const trendChartRef = ref() const pieChartRef = ref() @@ -303,10 +242,8 @@ const getTrendData = async () => { type: 'day' }) - // 确保 DOM 已渲染 await nextTick() - // 初始化图表 if (!initTrendChart()) { console.warn('趋势图表容器未找到') return @@ -342,7 +279,6 @@ const initPieChart = () => { // 绘制饼图 const drawPieChart = () => { - // 初始化图表 if (!initPieChart()) { console.warn('饼图容器未找到') return @@ -367,61 +303,13 @@ const drawPieChart = () => { } } -// 获取用户统计列表 -const getUserStatsList = async () => { - userLoading.value = true - try { - const [startTime, endTime] = queryParams.timeRange || [] - const res = await getAiUsageUserStatsPage({ - pageNo: userPageParams.pageNo, - pageSize: userPageParams.pageSize, - startTime, - endTime, - bizType: queryParams.bizType - }) - userStatsList.value = res?.list || [] - userPageParams.total = res?.total || 0 - } finally { - userLoading.value = false - } -} - -// 获取应用统计列表 -const getAppStatsList = async () => { - appLoading.value = true - try { - const [startTime, endTime] = queryParams.timeRange || [] - const res = await getAiUsageAppStats({ - startTime, - endTime, - bizType: queryParams.bizType - }) - appStatsList.value = res || [] - } finally { - appLoading.value = false - } -} - // 查询 const handleQuery = async () => { + if (activeTab.value !== 'overview') return await getOverviewData() await getTrendData() await nextTick() drawPieChart() - if (activeTab.value === 'user') { - getUserStatsList() - } else if (activeTab.value === 'app') { - getAppStatsList() - } -} - -// Tab 切换 -const handleTabChange = (tab: string) => { - if (tab === 'user') { - getUserStatsList() - } else if (tab === 'app') { - getAppStatsList() - } } // 窗口大小变化时重绘图表