fix:新功能提交
This commit is contained in:
parent
bfa30bb543
commit
6600f4f1f9
|
|
@ -0,0 +1,64 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true" label-width="88px">
|
||||||
|
<el-form-item label="类型" prop="orderType">
|
||||||
|
<el-select v-model="queryParams.orderType" clearable placeholder="全部">
|
||||||
|
<el-option label="充值" :value="0" /><el-option label="退款" :value="1" /><el-option label="手动修改" :value="2" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订单编号" prop="orderNum">
|
||||||
|
<el-input v-model="queryParams.orderNum" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-row class="mb8"><right-toolbar :show-search.sync="showSearch" @queryTable="getList" /></el-row>
|
||||||
|
<el-table v-loading="loading" :data="list">
|
||||||
|
<el-table-column label="ID" prop="id" width="70" />
|
||||||
|
<el-table-column label="团队" prop="deptName" min-width="100" show-overflow-tooltip />
|
||||||
|
<el-table-column label="类型" width="90">
|
||||||
|
<template slot-scope="s">{{ typeLabel(s.row.orderType) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="金额" prop="money" width="90" />
|
||||||
|
<el-table-column label="积分" prop="amount" width="90" />
|
||||||
|
<el-table-column label="时间" width="160"><template slot-scope="s">{{ parseTime(s.row.createTime) }}</template></el-table-column>
|
||||||
|
<el-table-column label="备注" prop="remark" min-width="120" show-overflow-tooltip />
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listSubteamChargeOrder } from '@/api/subteam'
|
||||||
|
export default {
|
||||||
|
name: 'SubteamChargeOrder',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true,
|
||||||
|
showSearch: true,
|
||||||
|
list: [],
|
||||||
|
total: 0,
|
||||||
|
queryParams: { pageNum: 1, pageSize: 10, orderType: undefined, orderNum: undefined }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() { this.getList() },
|
||||||
|
methods: {
|
||||||
|
typeLabel(t) {
|
||||||
|
const m = { 0: '充值', 1: '退款', 2: '手动修改' }
|
||||||
|
return m[t] != null ? m[t] : '—'
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listSubteamChargeOrder(this.queryParams).then(res => {
|
||||||
|
this.list = res.rows
|
||||||
|
this.total = res.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleQuery() { this.queryParams.pageNum = 1; this.getList() },
|
||||||
|
resetQuery() { this.resetForm('queryForm'); this.handleQuery() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,66 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form ref="queryForm" :model="queryParams" size="small" :inline="true" label-width="96px">
|
||||||
|
<el-form-item label="统计日期" prop="statDate">
|
||||||
|
<el-date-picker v-model="queryParams.statDate" type="date" value-format="yyyyMMdd" placeholder="请选择日期" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<p class="tip">仅展示当前团队数据;请选择日期后查询。</p>
|
||||||
|
<el-table v-loading="loading" :data="list">
|
||||||
|
<el-table-column label="日期" prop="dateKey" />
|
||||||
|
<el-table-column label="团队" prop="deptName" />
|
||||||
|
<el-table-column label="充值积分" prop="rechargeScore" />
|
||||||
|
<el-table-column label="消耗积分" prop="score" />
|
||||||
|
<el-table-column label="成功订单" prop="orderCount" />
|
||||||
|
<el-table-column label="Tokens" prop="useTokens" />
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listSubteamConsumeStat } from '@/api/subteam'
|
||||||
|
export default {
|
||||||
|
name: 'SubteamConsumeStat',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: false,
|
||||||
|
list: [],
|
||||||
|
total: 0,
|
||||||
|
queryParams: { pageNum: 1, pageSize: 10, statDate: null }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
if (!this.queryParams.statDate) {
|
||||||
|
this.list = []
|
||||||
|
this.total = 0
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.loading = true
|
||||||
|
listSubteamConsumeStat(this.queryParams).then(res => {
|
||||||
|
this.list = res.rows
|
||||||
|
this.total = res.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.list = []
|
||||||
|
this.total = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.tip { color: #909399; font-size: 13px; margin-bottom: 12px; }
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,55 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true">
|
||||||
|
<el-form-item label="类型" prop="type">
|
||||||
|
<el-input v-model="queryParams.type" clearable placeholder="0-4" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="关联单号" prop="relationOrderNo">
|
||||||
|
<el-input v-model="queryParams.relationOrderNo" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-row class="mb8"><right-toolbar :show-search.sync="showSearch" @queryTable="getList" /></el-row>
|
||||||
|
<el-table v-loading="loading" :data="list">
|
||||||
|
<el-table-column label="ID" prop="id" width="80" />
|
||||||
|
<el-table-column label="关联单号" prop="relationOrderNo" min-width="120" show-overflow-tooltip />
|
||||||
|
<el-table-column label="类型" prop="type" width="80" />
|
||||||
|
<el-table-column label="变更金额" prop="changeAmount" width="100" />
|
||||||
|
<el-table-column label="变更后" prop="resultAmount" width="100" />
|
||||||
|
<el-table-column label="时间" width="160"><template slot-scope="s">{{ parseTime(s.row.createTime) }}</template></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listSubteamGroupBalance } from '@/api/subteam'
|
||||||
|
export default {
|
||||||
|
name: 'SubteamGroupBalance',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true,
|
||||||
|
showSearch: true,
|
||||||
|
list: [],
|
||||||
|
total: 0,
|
||||||
|
queryParams: { pageNum: 1, pageSize: 10, type: undefined, relationOrderNo: undefined }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() { this.getList() },
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listSubteamGroupBalance(this.queryParams).then(res => {
|
||||||
|
this.list = res.rows
|
||||||
|
this.total = res.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleQuery() { this.queryParams.pageNum = 1; this.getList() },
|
||||||
|
resetQuery() { this.resetForm('queryForm'); this.handleQuery() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="16" v-loading="loading">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-card shadow="hover"><div class="metric-title">团队 ID</div><div class="metric-val">{{ info.deptId }}</div></el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-card shadow="hover"><div class="metric-title">团队名称</div><div class="metric-val">{{ info.deptName }}</div></el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-card shadow="hover"><div class="metric-title">积分余额(部门)</div><div class="metric-val">{{ info.balance }}</div></el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="16" style="margin-top:16px">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-card shadow="hover"><div class="metric-title">AI用户数(实时)</div><div class="metric-val">{{ info.aiUserCount }}</div></el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-card shadow="hover"><div class="metric-title">近 7 日消耗积分 <span class="hint">(5 分钟缓存)</span></div><div class="metric-val">{{ info.last7DaysConsumeScore }}</div></el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-card shadow="hover"><div class="metric-title">近 7 日成功订单数 <span class="hint">(5 分钟缓存)</span></div><div class="metric-val">{{ info.last7DaysOrderCount }}</div></el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getSubteamOverview } from '@/api/subteam'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'SubteamOverview',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true,
|
||||||
|
info: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.load()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
load() {
|
||||||
|
this.loading = true
|
||||||
|
getSubteamOverview().then(res => {
|
||||||
|
this.info = res.data || {}
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.metric-title { color: #909399; font-size: 13px; }
|
||||||
|
.metric-val { font-size: 22px; margin-top: 8px; font-weight: 600; }
|
||||||
|
.hint { font-size: 12px; color: #909399; }
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,179 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true">
|
||||||
|
<el-form-item label="账号" prop="username">
|
||||||
|
<el-input v-model="queryParams.username" placeholder="账号" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="手机号" prop="phone">
|
||||||
|
<el-input v-model="queryParams.phone" placeholder="手机号" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="状态" clearable>
|
||||||
|
<el-option label="正常" :value="0" />
|
||||||
|
<el-option label="停用" :value="1" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['subteam:user:add']" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['subteam:user:edit']" type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button v-hasPermi="['subteam:user:remove']" type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="50" />
|
||||||
|
<el-table-column label="主键ID" prop="id" width="80" />
|
||||||
|
<el-table-column label="账号" prop="username" />
|
||||||
|
<el-table-column label="昵称" prop="nickname" />
|
||||||
|
<el-table-column label="部门" prop="deptName" />
|
||||||
|
<el-table-column label="手机" prop="phone" width="120" />
|
||||||
|
<el-table-column label="状态" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.sys_normal_disable" :value="String(scope.row.status)" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="200">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button v-hasPermi="['subteam:user:edit']" size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||||
|
<el-button v-hasPermi="['subteam:user:resetPwd']" size="mini" type="text" icon="el-icon-key" @click="handleResetPwd(scope.row)">密码</el-button>
|
||||||
|
<el-button v-hasPermi="['subteam:user:remove']" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
|
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="640px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="88px">
|
||||||
|
<el-form-item label="昵称" prop="nickname"><el-input v-model="form.nickname" /></el-form-item>
|
||||||
|
<el-row v-if="!form.id">
|
||||||
|
<el-col :span="12"><el-form-item label="账号" prop="username"><el-input v-model="form.username" /></el-form-item></el-col>
|
||||||
|
<el-col :span="12"><el-form-item label="密码" prop="password"><el-input v-model="form.password" type="password" show-password /></el-form-item></el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item label="手机" prop="phone"><el-input v-model="form.phone" /></el-form-item>
|
||||||
|
<el-form-item label="邮箱" prop="email"><el-input v-model="form.email" /></el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-radio-group v-model="form.status">
|
||||||
|
<el-radio :label="0">正常</el-radio>
|
||||||
|
<el-radio :label="1">停用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注"><el-input v-model="form.remark" type="textarea" /></el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
listSubteamUser, getSubteamUser, addSubteamUser, updateSubteamUser, delSubteamUser,
|
||||||
|
resetSubteamUserPwd
|
||||||
|
} from '@/api/subteam'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'SubteamUser',
|
||||||
|
dicts: ['sys_normal_disable'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true,
|
||||||
|
showSearch: true,
|
||||||
|
userList: [],
|
||||||
|
total: 0,
|
||||||
|
ids: [],
|
||||||
|
single: true,
|
||||||
|
multiple: true,
|
||||||
|
title: '',
|
||||||
|
open: false,
|
||||||
|
queryParams: { pageNum: 1, pageSize: 10, username: undefined, phone: undefined, status: undefined },
|
||||||
|
form: {},
|
||||||
|
rules: {
|
||||||
|
nickname: [{ required: true, message: '必填', trigger: 'blur' }],
|
||||||
|
username: [{ required: true, message: '必填', trigger: 'blur' }],
|
||||||
|
password: [{ required: true, message: '必填', trigger: 'blur' }],
|
||||||
|
email: [{ type: 'email', message: '邮箱格式', trigger: ['blur', 'change'] }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listSubteamUser(this.queryParams).then(res => {
|
||||||
|
this.userList = res.rows
|
||||||
|
this.total = res.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm('queryForm')
|
||||||
|
this.handleQuery()
|
||||||
|
},
|
||||||
|
handleSelectionChange(rows) {
|
||||||
|
this.ids = rows.map(r => r.id)
|
||||||
|
this.single = rows.length !== 1
|
||||||
|
this.multiple = !rows.length
|
||||||
|
},
|
||||||
|
reset() {
|
||||||
|
this.form = { id: undefined, username: undefined, nickname: undefined, password: undefined,
|
||||||
|
phone: undefined, email: undefined, status: 0, remark: undefined }
|
||||||
|
this.resetForm('form')
|
||||||
|
},
|
||||||
|
handleAdd() {
|
||||||
|
this.reset()
|
||||||
|
this.open = true
|
||||||
|
this.title = '新增AI用户'
|
||||||
|
},
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset()
|
||||||
|
const id = row.id || this.ids[0]
|
||||||
|
getSubteamUser(id).then(r => {
|
||||||
|
this.form = r.data || {}
|
||||||
|
this.form.status = Number(this.form.status || 0)
|
||||||
|
this.open = true
|
||||||
|
this.title = '修改AI用户'
|
||||||
|
})
|
||||||
|
},
|
||||||
|
submitForm() {
|
||||||
|
this.$refs.form.validate(valid => {
|
||||||
|
if (!valid) return
|
||||||
|
if (this.form.id) {
|
||||||
|
updateSubteamUser(this.form).then(() => { this.$modal.msgSuccess('成功'); this.open = false; this.getList() })
|
||||||
|
} else {
|
||||||
|
addSubteamUser(this.form).then(() => { this.$modal.msgSuccess('成功'); this.open = false; this.getList() })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cancel() { this.open = false },
|
||||||
|
handleDelete(row) {
|
||||||
|
const userIds = row.id || this.ids
|
||||||
|
this.$modal.confirm('确认删除?').then(() => delSubteamUser(userIds)).then(() => { this.getList(); this.$modal.msgSuccess('已删除') }).catch(() => {})
|
||||||
|
},
|
||||||
|
handleResetPwd(row) {
|
||||||
|
this.$prompt('新密码', '重置', { inputType: 'password' }).then(({ value }) => {
|
||||||
|
resetSubteamUserPwd({ id: row.id, password: value }).then(() => this.$modal.msgSuccess('已重置'))
|
||||||
|
}).catch(() => {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true">
|
||||||
|
<el-form-item label="用户ID" prop="userId">
|
||||||
|
<el-input v-model="queryParams.userId" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型" prop="type">
|
||||||
|
<el-input v-model="queryParams.type" clearable placeholder="类型码" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-row class="mb8"><right-toolbar :show-search.sync="showSearch" @queryTable="getList" /></el-row>
|
||||||
|
<el-table v-loading="loading" :data="list">
|
||||||
|
<el-table-column label="ID" prop="id" width="80" />
|
||||||
|
<el-table-column label="用户ID" prop="userId" width="90" />
|
||||||
|
<el-table-column label="账号" prop="nickname" min-width="100" />
|
||||||
|
<el-table-column label="类型" prop="type" width="80" />
|
||||||
|
<el-table-column label="变更" prop="changeAmount" width="100" />
|
||||||
|
<el-table-column label="余额" prop="resultAmount" width="100" />
|
||||||
|
<el-table-column label="时间" width="160"><template slot-scope="s">{{ parseTime(s.row.createTime) }}</template></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listSubteamUserBalance } from '@/api/subteam'
|
||||||
|
export default {
|
||||||
|
name: 'SubteamUserBalance',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true,
|
||||||
|
showSearch: true,
|
||||||
|
list: [],
|
||||||
|
total: 0,
|
||||||
|
queryParams: { pageNum: 1, pageSize: 10, userId: undefined, type: undefined }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() { this.getList() },
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listSubteamUserBalance(this.queryParams).then(res => {
|
||||||
|
this.list = res.rows
|
||||||
|
this.total = res.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleQuery() { this.queryParams.pageNum = 1; this.getList() },
|
||||||
|
resetQuery() { this.resetForm('queryForm'); this.handleQuery() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,138 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true">
|
||||||
|
<el-form-item label="订单号" prop="orderNum">
|
||||||
|
<el-input v-model="queryParams.orderNum" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户ID" prop="userId">
|
||||||
|
<el-input v-model="queryParams.userId" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" clearable placeholder="状态">
|
||||||
|
<el-option label="进行中" :value="0" /><el-option label="已完成" :value="1" /><el-option label="失败" :value="2" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-row class="mb8"><right-toolbar :show-search.sync="showSearch" @queryTable="getList" /></el-row>
|
||||||
|
<el-table v-loading="loading" :data="list">
|
||||||
|
<el-table-column label="ID" prop="id" width="70" />
|
||||||
|
<el-table-column label="订单号" prop="orderNum" min-width="120" show-overflow-tooltip />
|
||||||
|
<el-table-column label="用户ID" prop="userId" width="90" />
|
||||||
|
<el-table-column label="金额" prop="amount" width="90" />
|
||||||
|
<el-table-column label="状态" prop="status" width="80" />
|
||||||
|
<el-table-column label="结果预览" min-width="220">
|
||||||
|
<template slot-scope="s">
|
||||||
|
<div v-if="extractVideoUrl(s.row.result)">
|
||||||
|
<video
|
||||||
|
:src="extractVideoUrl(s.row.result)"
|
||||||
|
controls
|
||||||
|
preload="metadata"
|
||||||
|
style="width: 180px; max-height: 100px; border-radius: 4px;"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" prop="createTime" width="160"><template slot-scope="s">{{ parseTime(s.row.createTime) }}</template></el-table-column>
|
||||||
|
<el-table-column label="操作" width="90" fixed="right">
|
||||||
|
<template slot-scope="s">
|
||||||
|
<el-button type="text" size="mini" @click="handleDetail(s.row)">详情</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
|
|
||||||
|
<el-dialog title="订单详情" :visible.sync="detailVisible" width="720px" append-to-body>
|
||||||
|
<el-descriptions :column="1" border size="small">
|
||||||
|
<el-descriptions-item v-for="(value, key) in detailData" :key="key" :label="key">
|
||||||
|
<pre v-if="isObjectValue(value)" style="margin: 0; white-space: pre-wrap;">{{ formatJson(value) }}</pre>
|
||||||
|
<span v-else>{{ value === null || value === undefined || value === '' ? '-' : value }}</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<span slot="footer">
|
||||||
|
<el-button size="mini" @click="detailVisible = false">关闭</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listSubteamVideoOrder } from '@/api/subteam'
|
||||||
|
export default {
|
||||||
|
name: 'SubteamVideoOrder',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: true,
|
||||||
|
showSearch: true,
|
||||||
|
list: [],
|
||||||
|
total: 0,
|
||||||
|
detailVisible: false,
|
||||||
|
detailData: {},
|
||||||
|
queryParams: { pageNum: 1, pageSize: 10, orderNum: undefined, userId: undefined, status: undefined }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() { this.getList() },
|
||||||
|
methods: {
|
||||||
|
getList() {
|
||||||
|
this.loading = true
|
||||||
|
listSubteamVideoOrder(this.queryParams).then(res => {
|
||||||
|
this.list = res.rows
|
||||||
|
this.total = res.total
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
extractVideoUrl(result) {
|
||||||
|
if (!result) return ''
|
||||||
|
if (typeof result === 'string') {
|
||||||
|
const value = result.trim()
|
||||||
|
if (!value) return ''
|
||||||
|
if (/^https?:\/\/|^\/\//.test(value)) return value
|
||||||
|
try {
|
||||||
|
const parsed = JSON.parse(value)
|
||||||
|
return this.extractVideoUrl(parsed)
|
||||||
|
} catch (e) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Array.isArray(result)) {
|
||||||
|
for (let i = 0; i < result.length; i += 1) {
|
||||||
|
const url = this.extractVideoUrl(result[i])
|
||||||
|
if (url) return url
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
if (typeof result === 'object') {
|
||||||
|
const directKeys = ['videoUrl', 'url', 'resultUrl', 'playUrl', 'output', 'fileUrl']
|
||||||
|
for (let i = 0; i < directKeys.length; i += 1) {
|
||||||
|
const key = directKeys[i]
|
||||||
|
if (result[key]) {
|
||||||
|
const url = this.extractVideoUrl(result[key])
|
||||||
|
if (url) return url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
},
|
||||||
|
handleDetail(row) {
|
||||||
|
this.detailData = row || {}
|
||||||
|
this.detailVisible = true
|
||||||
|
},
|
||||||
|
isObjectValue(value) {
|
||||||
|
return value !== null && typeof value === 'object'
|
||||||
|
},
|
||||||
|
formatJson(value) {
|
||||||
|
try {
|
||||||
|
return JSON.stringify(value, null, 2)
|
||||||
|
} catch (e) {
|
||||||
|
return String(value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleQuery() { this.queryParams.pageNum = 1; this.getList() },
|
||||||
|
resetQuery() { this.resetForm('queryForm'); this.handleQuery() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -27,6 +27,9 @@ public class AiVideoReportData implements Serializable {
|
||||||
/** 统计日期键(varchar) */
|
/** 统计日期键(varchar) */
|
||||||
private String dateKey;
|
private String dateKey;
|
||||||
|
|
||||||
|
/** 查询参数:统计日期(yyyyMMdd) */
|
||||||
|
private String statDate;
|
||||||
|
|
||||||
/** 部门ID */
|
/** 部门ID */
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
|
|
@ -42,6 +45,12 @@ public class AiVideoReportData implements Serializable {
|
||||||
/** 消耗 tokens */
|
/** 消耗 tokens */
|
||||||
private Long useTokens;
|
private Long useTokens;
|
||||||
|
|
||||||
|
/** 充值积分 */
|
||||||
|
private BigDecimal rechargeScore;
|
||||||
|
|
||||||
|
/** 部门名称(联表字段) */
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.ruoyi.ai.domain.AiBalanceChangeRecord;
|
import com.ruoyi.ai.domain.AiBalanceChangeRecord;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 余额使用记录Mapper接口
|
* 余额使用记录Mapper接口
|
||||||
|
|
@ -17,4 +18,15 @@ public interface AiBalanceChangeRecordMapper extends BaseMapper<AiBalanceChangeR
|
||||||
int deleteAiBalanceChangeRecordById(Long id);
|
int deleteAiBalanceChangeRecordById(Long id);
|
||||||
|
|
||||||
List<AiBalanceChangeRecord> selectAiBalanceChangeRecordList(AiBalanceChangeRecord aiBalanceChangeRecord);
|
List<AiBalanceChangeRecord> selectAiBalanceChangeRecordList(AiBalanceChangeRecord aiBalanceChangeRecord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按 AI 用户所属部门查询余额流水
|
||||||
|
*
|
||||||
|
* @param aiBalanceChangeRecord 查询条件
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @return 余额流水列表
|
||||||
|
*/
|
||||||
|
List<AiBalanceChangeRecord> selectAiBalanceChangeRecordListByAiUserDept(
|
||||||
|
@Param("query") AiBalanceChangeRecord aiBalanceChangeRecord,
|
||||||
|
@Param("deptId") Long deptId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,17 @@ package com.ruoyi.ai.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.ruoyi.ai.domain.AiChargeRefundOrder;
|
import com.ruoyi.ai.domain.AiChargeRefundOrder;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值/退款订单 Mapper
|
* 充值/退款订单 Mapper
|
||||||
*/
|
*/
|
||||||
public interface AiChargeRefundOrderMapper extends BaseMapper<AiChargeRefundOrder> {
|
public interface AiChargeRefundOrderMapper extends BaseMapper<AiChargeRefundOrder> {
|
||||||
|
/**
|
||||||
|
* 查询充值/退款订单列表
|
||||||
|
*
|
||||||
|
* @param aiChargeRefundOrder 查询条件
|
||||||
|
* @return 订单列表
|
||||||
|
*/
|
||||||
|
List<AiChargeRefundOrder> selectAiChargeRefundOrderList(AiChargeRefundOrder aiChargeRefundOrder);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,19 @@ package com.ruoyi.ai.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.ruoyi.ai.domain.AiDeptArkConfig;
|
import com.ruoyi.ai.domain.AiDeptArkConfig;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门方舟配置 Mapper
|
* 部门方舟配置 Mapper
|
||||||
*/
|
*/
|
||||||
public interface AiDeptArkConfigMapper extends BaseMapper<AiDeptArkConfig> {
|
public interface AiDeptArkConfigMapper extends BaseMapper<AiDeptArkConfig> {
|
||||||
|
List<AiDeptArkConfig> selectAiDeptArkConfigList(AiDeptArkConfig aiDeptArkConfig);
|
||||||
|
|
||||||
|
AiDeptArkConfig selectAiDeptArkConfigById(String id);
|
||||||
|
|
||||||
|
int insertAiDeptArkConfig(AiDeptArkConfig aiDeptArkConfig);
|
||||||
|
|
||||||
|
int updateAiDeptArkConfig(AiDeptArkConfig aiDeptArkConfig);
|
||||||
|
|
||||||
|
int deleteAiDeptArkConfigByIds(String[] ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,20 @@ package com.ruoyi.ai.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.ruoyi.ai.domain.AiGroupBalanceChangeRecord;
|
import com.ruoyi.ai.domain.AiGroupBalanceChangeRecord;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 集团余额变动记录 Mapper
|
* 集团余额变动记录 Mapper
|
||||||
*/
|
*/
|
||||||
public interface AiGroupBalanceChangeRecordMapper extends BaseMapper<AiGroupBalanceChangeRecord> {
|
public interface AiGroupBalanceChangeRecordMapper extends BaseMapper<AiGroupBalanceChangeRecord> {
|
||||||
|
List<AiGroupBalanceChangeRecord> selectAiGroupBalanceChangeRecordList(
|
||||||
|
AiGroupBalanceChangeRecord aiGroupBalanceChangeRecord);
|
||||||
|
|
||||||
|
AiGroupBalanceChangeRecord selectAiGroupBalanceChangeRecordById(String id);
|
||||||
|
|
||||||
|
int insertAiGroupBalanceChangeRecord(AiGroupBalanceChangeRecord aiGroupBalanceChangeRecord);
|
||||||
|
|
||||||
|
int updateAiGroupBalanceChangeRecord(AiGroupBalanceChangeRecord aiGroupBalanceChangeRecord);
|
||||||
|
|
||||||
|
int deleteAiGroupBalanceChangeRecordByIds(String[] ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@ package com.ruoyi.ai.mapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.ruoyi.ai.domain.AiVideoReportData;
|
import com.ruoyi.ai.domain.AiVideoReportData;
|
||||||
import com.ruoyi.common.core.dto.DeptSummaryDTO;
|
import com.ruoyi.common.core.dto.DeptSummaryDTO;
|
||||||
|
import com.ruoyi.system.domain.subteam.SubteamVideoMetrics;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -12,4 +16,33 @@ public interface AiVideoReportDataMapper extends BaseMapper<AiVideoReportData> {
|
||||||
@Select("SELECT SUM(order_count) as order_count,SUM(score) as score FROM ai_video_report_data " +
|
@Select("SELECT SUM(order_count) as order_count,SUM(score) as score FROM ai_video_report_data " +
|
||||||
" where dept_id=#{deptId} and date_key>=#{startHour} and date_key<=#{endHour}")
|
" where dept_id=#{deptId} and date_key>=#{startHour} and date_key<=#{endHour}")
|
||||||
DeptSummaryDTO selectOneDeptSummaryData(Long deptId, String startHour, String endHour);
|
DeptSummaryDTO selectOneDeptSummaryData(Long deptId, String startHour, String endHour);
|
||||||
|
|
||||||
|
List<AiVideoReportData> selectTeamDailyConsumeByDeptId(@Param("statDate") String statDate, @Param("deptId") Long deptId);
|
||||||
|
|
||||||
|
SubteamVideoMetrics selectDeptVideoMetricsBetween(
|
||||||
|
@Param("deptId") Long deptId,
|
||||||
|
@Param("startDay") String startDay,
|
||||||
|
@Param("endDay") String endDay);
|
||||||
|
|
||||||
|
int upsertVideoConsumeIncrement(
|
||||||
|
@Param("dateKey") String dateKey,
|
||||||
|
@Param("deptId") Long deptId,
|
||||||
|
@Param("userId") Long userId,
|
||||||
|
@Param("score") BigDecimal score,
|
||||||
|
@Param("orderCount") Long orderCount,
|
||||||
|
@Param("useTokens") Long useTokens);
|
||||||
|
|
||||||
|
List<AiVideoReportData> selectTeamDailyConsumeList(
|
||||||
|
@Param("statDate") String statDate,
|
||||||
|
@Param("deptName") String deptName);
|
||||||
|
|
||||||
|
List<AiVideoReportData> selectAiVideoReportDataList(AiVideoReportData aiVideoReportData);
|
||||||
|
|
||||||
|
AiVideoReportData selectAiVideoReportDataById(String id);
|
||||||
|
|
||||||
|
int insertAiVideoReportData(AiVideoReportData aiVideoReportData);
|
||||||
|
|
||||||
|
int updateAiVideoReportData(AiVideoReportData aiVideoReportData);
|
||||||
|
|
||||||
|
int deleteAiVideoReportDataByIds(String[] ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ruoyi.ai.service;
|
package com.ruoyi.ai.service;
|
||||||
|
|
||||||
import com.ruoyi.ai.domain.AiChargeRefundOrder;
|
import com.ruoyi.ai.domain.AiChargeRefundOrder;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值/退款订单 Service
|
* 充值/退款订单 Service
|
||||||
|
|
@ -14,4 +15,14 @@ public interface IAiChargeRefundOrderService {
|
||||||
int updateById(AiChargeRefundOrder entity);
|
int updateById(AiChargeRefundOrder entity);
|
||||||
|
|
||||||
int deleteById(Long id);
|
int deleteById(Long id);
|
||||||
|
|
||||||
|
List<AiChargeRefundOrder> selectAiChargeRefundOrderList(AiChargeRefundOrder aiChargeRefundOrder);
|
||||||
|
|
||||||
|
AiChargeRefundOrder selectAiChargeRefundOrderById(Long id);
|
||||||
|
|
||||||
|
int insertAiChargeRefundOrder(AiChargeRefundOrder aiChargeRefundOrder);
|
||||||
|
|
||||||
|
int updateAiChargeRefundOrder(AiChargeRefundOrder aiChargeRefundOrder);
|
||||||
|
|
||||||
|
int deleteAiChargeRefundOrderByIds(Long[] ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ruoyi.ai.service;
|
package com.ruoyi.ai.service;
|
||||||
|
|
||||||
import com.ruoyi.ai.domain.AiDeptArkConfig;
|
import com.ruoyi.ai.domain.AiDeptArkConfig;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门方舟配置 Service
|
* 部门方舟配置 Service
|
||||||
|
|
@ -14,4 +15,14 @@ public interface IAiDeptArkConfigService {
|
||||||
int updateById(AiDeptArkConfig entity);
|
int updateById(AiDeptArkConfig entity);
|
||||||
|
|
||||||
int deleteById(Long id);
|
int deleteById(Long id);
|
||||||
|
|
||||||
|
List<AiDeptArkConfig> selectAiDeptArkConfigList(AiDeptArkConfig aiDeptArkConfig);
|
||||||
|
|
||||||
|
AiDeptArkConfig selectAiDeptArkConfigById(String id);
|
||||||
|
|
||||||
|
int insertAiDeptArkConfig(AiDeptArkConfig aiDeptArkConfig);
|
||||||
|
|
||||||
|
int updateAiDeptArkConfig(AiDeptArkConfig aiDeptArkConfig);
|
||||||
|
|
||||||
|
int deleteAiDeptArkConfigByIds(String[] ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ruoyi.ai.service;
|
package com.ruoyi.ai.service;
|
||||||
|
|
||||||
import com.ruoyi.ai.domain.AiGroupBalanceChangeRecord;
|
import com.ruoyi.ai.domain.AiGroupBalanceChangeRecord;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 集团余额变动记录 Service
|
* 集团余额变动记录 Service
|
||||||
|
|
@ -14,4 +15,15 @@ public interface IAiGroupBalanceChangeRecordService {
|
||||||
int updateById(AiGroupBalanceChangeRecord entity);
|
int updateById(AiGroupBalanceChangeRecord entity);
|
||||||
|
|
||||||
int deleteById(Long id);
|
int deleteById(Long id);
|
||||||
|
|
||||||
|
List<AiGroupBalanceChangeRecord> selectAiGroupBalanceChangeRecordList(
|
||||||
|
AiGroupBalanceChangeRecord aiGroupBalanceChangeRecord);
|
||||||
|
|
||||||
|
AiGroupBalanceChangeRecord selectAiGroupBalanceChangeRecordById(String id);
|
||||||
|
|
||||||
|
int insertAiGroupBalanceChangeRecord(AiGroupBalanceChangeRecord aiGroupBalanceChangeRecord);
|
||||||
|
|
||||||
|
int updateAiGroupBalanceChangeRecord(AiGroupBalanceChangeRecord aiGroupBalanceChangeRecord);
|
||||||
|
|
||||||
|
int deleteAiGroupBalanceChangeRecordByIds(String[] ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.ruoyi.ai.service;
|
||||||
|
|
||||||
import com.ruoyi.ai.domain.AiVideoReportData;
|
import com.ruoyi.ai.domain.AiVideoReportData;
|
||||||
import com.ruoyi.common.core.dto.DeptSummaryDTO;
|
import com.ruoyi.common.core.dto.DeptSummaryDTO;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
@ -14,4 +16,36 @@ public interface IAiVideoReportDataService {
|
||||||
int insert(AiVideoReportData entity);
|
int insert(AiVideoReportData entity);
|
||||||
|
|
||||||
DeptSummaryDTO getSevenDayDeptSummaryData(Long deptId);
|
DeptSummaryDTO getSevenDayDeptSummaryData(Long deptId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按部门查询团队每日消耗
|
||||||
|
*
|
||||||
|
* @param statDate 统计日期(yyyyMMdd)
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @return 每日消耗列表
|
||||||
|
*/
|
||||||
|
List<AiVideoReportData> selectTeamDailyConsumeByDeptId(String statDate, Long deptId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步视频消耗增量
|
||||||
|
*
|
||||||
|
* @param createTime 订单创建时间
|
||||||
|
* @param deptId 部门ID
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @param score 消耗积分
|
||||||
|
* @param useTokens 消耗token
|
||||||
|
*/
|
||||||
|
void syncVideoConsumeIncrement(Date createTime, Long deptId, Long userId, BigDecimal score, Long useTokens);
|
||||||
|
|
||||||
|
List<AiVideoReportData> selectTeamDailyConsumeList(String statDate, String deptName);
|
||||||
|
|
||||||
|
List<AiVideoReportData> selectAiVideoReportDataList(AiVideoReportData aiVideoReportData);
|
||||||
|
|
||||||
|
AiVideoReportData selectAiVideoReportDataById(String id);
|
||||||
|
|
||||||
|
int insertAiVideoReportData(AiVideoReportData aiVideoReportData);
|
||||||
|
|
||||||
|
int updateAiVideoReportData(AiVideoReportData aiVideoReportData);
|
||||||
|
|
||||||
|
int deleteAiVideoReportDataByIds(String[] ids);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.ai.domain.AiChargeRefundOrder;
|
import com.ruoyi.ai.domain.AiChargeRefundOrder;
|
||||||
import com.ruoyi.ai.mapper.AiChargeRefundOrderMapper;
|
import com.ruoyi.ai.mapper.AiChargeRefundOrderMapper;
|
||||||
import com.ruoyi.ai.service.IAiChargeRefundOrderService;
|
import com.ruoyi.ai.service.IAiChargeRefundOrderService;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值/退款订单 Service 实现
|
* 充值/退款订单 Service 实现
|
||||||
|
|
@ -35,4 +36,36 @@ public class AiChargeRefundOrderServiceImpl implements IAiChargeRefundOrderServi
|
||||||
public int deleteById(Long id) {
|
public int deleteById(Long id) {
|
||||||
return aiChargeRefundOrderMapper.deleteById(id);
|
return aiChargeRefundOrderMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AiChargeRefundOrder> selectAiChargeRefundOrderList(AiChargeRefundOrder aiChargeRefundOrder) {
|
||||||
|
return aiChargeRefundOrderMapper.selectAiChargeRefundOrderList(aiChargeRefundOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AiChargeRefundOrder selectAiChargeRefundOrderById(Long id) {
|
||||||
|
return aiChargeRefundOrderMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertAiChargeRefundOrder(AiChargeRefundOrder aiChargeRefundOrder) {
|
||||||
|
return aiChargeRefundOrderMapper.insert(aiChargeRefundOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateAiChargeRefundOrder(AiChargeRefundOrder aiChargeRefundOrder) {
|
||||||
|
return aiChargeRefundOrderMapper.updateById(aiChargeRefundOrder);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteAiChargeRefundOrderByIds(Long[] ids) {
|
||||||
|
int rows = 0;
|
||||||
|
if (ids == null) {
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
for (Long id : ids) {
|
||||||
|
rows += aiChargeRefundOrderMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.ai.domain.AiDeptArkConfig;
|
import com.ruoyi.ai.domain.AiDeptArkConfig;
|
||||||
import com.ruoyi.ai.mapper.AiDeptArkConfigMapper;
|
import com.ruoyi.ai.mapper.AiDeptArkConfigMapper;
|
||||||
import com.ruoyi.ai.service.IAiDeptArkConfigService;
|
import com.ruoyi.ai.service.IAiDeptArkConfigService;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门方舟配置 Service 实现
|
* 部门方舟配置 Service 实现
|
||||||
|
|
@ -35,4 +36,29 @@ public class AiDeptArkConfigServiceImpl implements IAiDeptArkConfigService {
|
||||||
public int deleteById(Long id) {
|
public int deleteById(Long id) {
|
||||||
return aiDeptArkConfigMapper.deleteById(id);
|
return aiDeptArkConfigMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AiDeptArkConfig> selectAiDeptArkConfigList(AiDeptArkConfig aiDeptArkConfig) {
|
||||||
|
return aiDeptArkConfigMapper.selectAiDeptArkConfigList(aiDeptArkConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AiDeptArkConfig selectAiDeptArkConfigById(String id) {
|
||||||
|
return aiDeptArkConfigMapper.selectAiDeptArkConfigById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertAiDeptArkConfig(AiDeptArkConfig aiDeptArkConfig) {
|
||||||
|
return aiDeptArkConfigMapper.insertAiDeptArkConfig(aiDeptArkConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateAiDeptArkConfig(AiDeptArkConfig aiDeptArkConfig) {
|
||||||
|
return aiDeptArkConfigMapper.updateAiDeptArkConfig(aiDeptArkConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteAiDeptArkConfigByIds(String[] ids) {
|
||||||
|
return aiDeptArkConfigMapper.deleteAiDeptArkConfigByIds(ids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.ai.domain.AiGroupBalanceChangeRecord;
|
import com.ruoyi.ai.domain.AiGroupBalanceChangeRecord;
|
||||||
import com.ruoyi.ai.mapper.AiGroupBalanceChangeRecordMapper;
|
import com.ruoyi.ai.mapper.AiGroupBalanceChangeRecordMapper;
|
||||||
import com.ruoyi.ai.service.IAiGroupBalanceChangeRecordService;
|
import com.ruoyi.ai.service.IAiGroupBalanceChangeRecordService;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 集团余额变动记录 Service 实现
|
* 集团余额变动记录 Service 实现
|
||||||
|
|
@ -35,4 +36,30 @@ public class AiGroupBalanceChangeRecordServiceImpl implements IAiGroupBalanceCha
|
||||||
public int deleteById(Long id) {
|
public int deleteById(Long id) {
|
||||||
return aiGroupBalanceChangeRecordMapper.deleteById(id);
|
return aiGroupBalanceChangeRecordMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AiGroupBalanceChangeRecord> selectAiGroupBalanceChangeRecordList(
|
||||||
|
AiGroupBalanceChangeRecord aiGroupBalanceChangeRecord) {
|
||||||
|
return aiGroupBalanceChangeRecordMapper.selectAiGroupBalanceChangeRecordList(aiGroupBalanceChangeRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AiGroupBalanceChangeRecord selectAiGroupBalanceChangeRecordById(String id) {
|
||||||
|
return aiGroupBalanceChangeRecordMapper.selectAiGroupBalanceChangeRecordById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertAiGroupBalanceChangeRecord(AiGroupBalanceChangeRecord aiGroupBalanceChangeRecord) {
|
||||||
|
return aiGroupBalanceChangeRecordMapper.insertAiGroupBalanceChangeRecord(aiGroupBalanceChangeRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateAiGroupBalanceChangeRecord(AiGroupBalanceChangeRecord aiGroupBalanceChangeRecord) {
|
||||||
|
return aiGroupBalanceChangeRecordMapper.updateAiGroupBalanceChangeRecord(aiGroupBalanceChangeRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteAiGroupBalanceChangeRecordByIds(String[] ids) {
|
||||||
|
return aiGroupBalanceChangeRecordMapper.deleteAiGroupBalanceChangeRecordByIds(ids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.ruoyi.ai.service.IAiVideoReportDataService;
|
||||||
import com.ruoyi.common.constant.RedisKey;
|
import com.ruoyi.common.constant.RedisKey;
|
||||||
import com.ruoyi.common.core.dto.DeptSummaryDTO;
|
import com.ruoyi.common.core.dto.DeptSummaryDTO;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -15,6 +16,7 @@ import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 视频报表数据 Service 实现
|
* 视频报表数据 Service 实现
|
||||||
|
|
@ -54,6 +56,57 @@ public class AiVideoReportDataServiceImpl implements IAiVideoReportDataService {
|
||||||
return videoReportDataMapper.selectOneDeptSummaryData(deptId, startHour, endHour);
|
return videoReportDataMapper.selectOneDeptSummaryData(deptId, startHour, endHour);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AiVideoReportData> selectTeamDailyConsumeByDeptId(String statDate, Long deptId) {
|
||||||
|
return videoReportDataMapper.selectTeamDailyConsumeByDeptId(statDate, deptId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void syncVideoConsumeIncrement(Date createTime, Long deptId, Long userId, BigDecimal score, Long useTokens) {
|
||||||
|
if (createTime == null || deptId == null || userId == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
BigDecimal scoreSafe = score != null ? score : BigDecimal.ZERO;
|
||||||
|
Long useTokensSafe = useTokens != null ? useTokens : 0L;
|
||||||
|
videoReportDataMapper.upsertVideoConsumeIncrement(
|
||||||
|
formatDateKey(createTime),
|
||||||
|
deptId,
|
||||||
|
userId,
|
||||||
|
scoreSafe,
|
||||||
|
1L,
|
||||||
|
useTokensSafe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AiVideoReportData> selectTeamDailyConsumeList(String statDate, String deptName) {
|
||||||
|
return videoReportDataMapper.selectTeamDailyConsumeList(statDate, deptName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AiVideoReportData> selectAiVideoReportDataList(AiVideoReportData aiVideoReportData) {
|
||||||
|
return videoReportDataMapper.selectAiVideoReportDataList(aiVideoReportData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AiVideoReportData selectAiVideoReportDataById(String id) {
|
||||||
|
return videoReportDataMapper.selectAiVideoReportDataById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int insertAiVideoReportData(AiVideoReportData aiVideoReportData) {
|
||||||
|
return videoReportDataMapper.insertAiVideoReportData(aiVideoReportData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateAiVideoReportData(AiVideoReportData aiVideoReportData) {
|
||||||
|
return videoReportDataMapper.updateAiVideoReportData(aiVideoReportData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int deleteAiVideoReportDataByIds(String[] ids) {
|
||||||
|
return videoReportDataMapper.deleteAiVideoReportDataByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
private static String formatDateKey(Date date) {
|
private static String formatDateKey(Date date) {
|
||||||
LocalDateTime ldt = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
|
LocalDateTime ldt = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
|
||||||
return DATE_KEY_FORMAT.format(ldt);
|
return DATE_KEY_FORMAT.format(ldt);
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
order by r.id desc
|
order by r.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAiBalanceChangeRecordListByAiUserDept" resultMap="AiBalanceChangeRecordResult">
|
||||||
|
<include refid="selectAiBalanceChangeRecordVo"/>
|
||||||
|
<where>
|
||||||
|
and u.dept_id = #{deptId}
|
||||||
|
<if test="query.nickname != null and query.nickname != '' "> and u.nickname like concat('%', #{query.nickname}, '%') </if>
|
||||||
|
<if test="query.userId != null "> and r.user_id = #{query.userId}</if>
|
||||||
|
<if test="query.uuid != null "> and u.user_id = #{query.uuid}</if>
|
||||||
|
<if test="query.type != null "> and r.type = #{query.type}</if>
|
||||||
|
<if test="query.changeAmount != null "> and r.change_amount = #{query.changeAmount}</if>
|
||||||
|
<if test="query.resultAmount != null "> and r.result_amount = #{query.resultAmount}</if>
|
||||||
|
<if test="query.params.beginTime != null and query.params.beginTime != ''">
|
||||||
|
AND date_format(r.create_time,'%Y%m%d') >= date_format(#{query.params.beginTime},'%Y%m%d')
|
||||||
|
</if>
|
||||||
|
<if test="query.params.endTime != null and query.params.endTime != ''">
|
||||||
|
AND date_format(r.create_time,'%Y%m%d') <= date_format(#{query.params.endTime},'%Y%m%d')
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
order by r.id desc
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectAiBalanceChangeRecordById" parameterType="Long" resultMap="AiBalanceChangeRecordResult">
|
<select id="selectAiBalanceChangeRecordById" parameterType="Long" resultMap="AiBalanceChangeRecordResult">
|
||||||
<include refid="selectAiBalanceChangeRecordVo"/>
|
<include refid="selectAiBalanceChangeRecordVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue