Compare commits
11 Commits
67459fe554
...
ccbdf82114
Author | SHA1 | Date | |
---|---|---|---|
ccbdf82114 | |||
5235fae53c | |||
6c29031b3b | |||
b6b82502e0 | |||
0eabf4fc3c | |||
0621b9823b | |||
12dd84bb4c | |||
35cea73266 | |||
b24c6d3157 | |||
36b7469e1e | |||
a163a6490f |
@ -6,6 +6,7 @@ export interface FilePageReqVO extends PageParam {
|
||||
createTime?: Date[]
|
||||
}
|
||||
|
||||
|
||||
// 文件预签名地址 Response VO
|
||||
export interface FilePresignedUrlRespVO {
|
||||
// 文件配置编号
|
||||
@ -43,3 +44,5 @@ export const createFile = (data: any) => {
|
||||
export const updateFile = (data: any) => {
|
||||
return request.upload({ url: '/infra/file/upload', data })
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,7 +41,7 @@ export const VerbalTrickApi = {
|
||||
},
|
||||
|
||||
// 查询客服话术
|
||||
getVerbalTrickList: async () => {
|
||||
return await request.get({ url: `/promotion/verbal-trick/getVerbalTrickList` })
|
||||
getVerbalTrickList: async (id: string) => {
|
||||
return await request.get({ url: `/promotion/verbal-trick/getVerbalTrickList?id=` +id })
|
||||
}
|
||||
}
|
21
yudao-admin-vue3/src/api/member/memberagree/index.ts
Normal file
21
yudao-admin-vue3/src/api/member/memberagree/index.ts
Normal file
@ -0,0 +1,21 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 会员协议 VO
|
||||
export interface PaidMemberAgreeVO {
|
||||
id: number // 编号
|
||||
content: string // 内容
|
||||
}
|
||||
|
||||
// 会员协议 API
|
||||
export const PaidMemberAgreeApi = {
|
||||
// 查询会员协议
|
||||
getPaidMemberAgree: async () => {
|
||||
return await request.get({ url: `/member/paid-member-agree/get`})
|
||||
},
|
||||
|
||||
|
||||
// 保存会员协议
|
||||
savePaidMemberAgree: async (data: PaidMemberAgreeVO) => {
|
||||
return await request.put({ url: `/member/paid-member-agree/save`, data })
|
||||
}
|
||||
}
|
@ -47,3 +47,13 @@ export const deleteDictData = (id: number) => {
|
||||
export const exportDictData = (params) => {
|
||||
return request.download({ url: '/system/dict-data/export', params })
|
||||
}
|
||||
|
||||
// 图片素材管理分类
|
||||
export const getTypeList = () => {
|
||||
return request.get({ url: '/system/dict-data/getTypeList' })
|
||||
}
|
||||
|
||||
// 客服话术分类
|
||||
export const getHuaShuTypeList = () => {
|
||||
return request.get({ url: '/system/dict-data/getHuaShuTypeList' })
|
||||
}
|
||||
|
@ -1,126 +1,130 @@
|
||||
<template>
|
||||
<doc-alert title="上传下载" url="https://doc.iocoder.cn/file/" />
|
||||
<!-- 搜索 -->
|
||||
<ContentWrap>
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="文件路径" prop="path">
|
||||
<el-input
|
||||
v-model="queryParams.path"
|
||||
placeholder="请输入文件路径"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件类型" prop="type" width="80">
|
||||
<el-input
|
||||
v-model="queryParams.type"
|
||||
placeholder="请输入文件类型"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button type="primary" plain @click="openForm">
|
||||
<Icon icon="ep:upload" class="mr-5px" /> 上传文件
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<div class="flex-container">
|
||||
<!-- 菜单区域 -->
|
||||
<div class="menu-area">
|
||||
<el-menu :default-active="targetMenuId">
|
||||
<el-menu-item v-for="item in typeMenu" :index="item.value" :key="item.value" @click="clickMenu(item.value)">{{item.label}}</el-menu-item>
|
||||
|
||||
</el-menu>
|
||||
</div>
|
||||
|
||||
<!-- 内容区域 -->
|
||||
<div class="content-wrap">
|
||||
<ContentWrap>
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<!-- <el-form-item label="文件路径" prop="path">
|
||||
<el-input
|
||||
v-model="queryParams.path"
|
||||
placeholder="请输入文件路径"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="文件类型" prop="type" width="80">
|
||||
<el-input
|
||||
v-model="queryParams.type"
|
||||
placeholder="请输入文件类型"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button type="primary" plain @click="openForm">
|
||||
<Icon icon="ep:upload" class="mr-5px" /> 上传文件
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="文件名" align="center" prop="name" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="文件路径" align="center" prop="path" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="URL" align="center" prop="url" :show-overflow-tooltip="true" />
|
||||
<el-table-column
|
||||
label="文件大小"
|
||||
align="center"
|
||||
prop="size"
|
||||
width="120"
|
||||
:formatter="fileSizeFormatter"
|
||||
/>
|
||||
<el-table-column label="文件类型" align="center" prop="type" width="180px" />
|
||||
<el-table-column label="文件内容" align="center" prop="url" width="110px">
|
||||
<template #default="{ row }">
|
||||
<el-image
|
||||
v-if="row.type.includes('image')"
|
||||
class="h-80px w-80px"
|
||||
lazy
|
||||
:src="row.url"
|
||||
:preview-src-list="[row.url]"
|
||||
preview-teleported
|
||||
fit="cover"
|
||||
/>
|
||||
<el-link
|
||||
v-else-if="row.type.includes('pdf')"
|
||||
type="primary"
|
||||
:href="row.url"
|
||||
:underline="false"
|
||||
target="_blank"
|
||||
>预览</el-link
|
||||
>
|
||||
<el-link v-else type="primary" download :href="row.url" :underline="false" target="_blank"
|
||||
>下载</el-link
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="上传时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['infra:file:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="文件名" align="center" prop="name" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="文件路径" align="center" prop="path" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="URL" align="center" prop="url" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="文件大小" align="center" prop="size" width="120" :formatter="fileSizeFormatter" />
|
||||
<el-table-column label="文件类型" align="center" prop="type" width="180px" />
|
||||
<el-table-column label="文件内容" align="center" prop="url" width="110px">
|
||||
<template #default="{ row }">
|
||||
<el-image
|
||||
v-if="row.type.includes('image')"
|
||||
class="h-80px w-80px"
|
||||
lazy
|
||||
:src="row.url"
|
||||
:preview-src-list="[row.url]"
|
||||
preview-teleported
|
||||
fit="cover"
|
||||
/>
|
||||
<el-link
|
||||
v-else-if="row.type.includes('pdf')"
|
||||
type="primary"
|
||||
:href="row.url"
|
||||
:underline="false"
|
||||
target="_blank"
|
||||
>预览</el-link>
|
||||
<el-link v-else type="primary" download :href="row.url" :underline="false" target="_blank"
|
||||
>下载</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上传时间" align="center" prop="createTime" width="180" :formatter="dateFormatter" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['infra:file:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<FileForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
|
||||
import { fileSizeFormatter } from '@/utils'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import * as FileApi from '@/api/infra/file'
|
||||
import FileForm from './FileForm.vue'
|
||||
|
||||
import { string } from 'vue-types';
|
||||
import { number } from 'echarts';
|
||||
import * as DictDataApi from '@/api/system/dict/dict.data'
|
||||
const typeMenu = ref<DictDataApi.DictDataVO[]>([]) //
|
||||
const targetMenuId = ref('0')
|
||||
defineOptions({ name: 'InfraFile' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
@ -128,14 +132,16 @@ const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const total = ref(0) // 列表的总页数
|
||||
const list = ref([]) // 列表的数据
|
||||
const list = ref([]) // 列表的
|
||||
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
type: undefined,
|
||||
path: undefined,
|
||||
createTime: []
|
||||
createTime: [],
|
||||
menuType: '0',
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
|
||||
@ -151,6 +157,21 @@ const getList = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
//图片素材管理分类菜单
|
||||
const getTypeList = async () => {
|
||||
const data = await DictDataApi.getTypeList()
|
||||
typeMenu.value = data
|
||||
console.log('1111111111',typeMenu)
|
||||
}
|
||||
|
||||
|
||||
/** */
|
||||
const clickMenu = (id: string) => {
|
||||
queryParams.menuType = id
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
@ -184,6 +205,25 @@ const handleDelete = async (id: number) => {
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
// queryParams.value.menuType = targetMenuId
|
||||
getTypeList()
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
.flex-container {
|
||||
height: 100vh; /* 使容器填满视口高度 */
|
||||
display: flex;
|
||||
}
|
||||
.menu-area {
|
||||
|
||||
width: 200px;
|
||||
height: 100vh; /* 固定高度 */
|
||||
overflow-y: hidden; /* 禁止滚动 */
|
||||
border-right: 1px solid #e0e0e0; /* 可选:添加分隔线 */
|
||||
}
|
||||
.content-wrap {
|
||||
flex-grow: 1; /* 使内容区域占据剩余空间 */
|
||||
overflow-y: auto; /* 允许内容区域滚动 */
|
||||
}
|
||||
</style>
|
@ -118,8 +118,11 @@ v-show="showNewMessageTip" class="newMessageTip flex items-center cursor-pointer
|
||||
<div style="display: flex; width: 100%; height: 400px;">
|
||||
|
||||
<!-- 左边占 30% -->
|
||||
<div style="flex: 0 0 20%; background-color: #f0f0f0; padding: 10px;">
|
||||
左边的内容
|
||||
<div style="flex: 0 0 20%; padding: 10px;">
|
||||
<el-menu :default-active="targetMenuId">
|
||||
<el-menu-item v-for="item in huashuType" :index="item.value" :key="item.value" @click="clickMenu(item.value)">{{item.label}}</el-menu-item>
|
||||
|
||||
</el-menu>
|
||||
</div>
|
||||
<!-- 右边占 70% -->
|
||||
<div style="flex: 1; padding: 5px; overflow-y: auto; max-height: 400px;">
|
||||
@ -156,7 +159,11 @@ v-show="showNewMessageTip" class="newMessageTip flex items-center cursor-pointer
|
||||
import { getStaffToken, setStaffToken} from '@/utils/auth'
|
||||
import type { DropdownInstance } from 'element-plus'
|
||||
import { ref } from 'vue'
|
||||
|
||||
|
||||
|
||||
import * as DictDataApi from '@/api/system/dict/dict.data'
|
||||
const huashuType = ref<DictDataApi.DictDataVO[]>([]) //
|
||||
const targetMenuId = ref('0')
|
||||
dayjs.extend(relativeTime)
|
||||
|
||||
defineOptions({ name: 'KeFuMessageList' })
|
||||
@ -175,6 +182,7 @@ v-show="showNewMessageTip" class="newMessageTip flex items-center cursor-pointer
|
||||
import { KeFuConversationApi} from '@/api/mall/promotion/kefu/conversation'
|
||||
import { number } from 'vue-types'
|
||||
const onlineStaffList = ref<SupportStaffVO[]>([]) // 在线客服列表的数据
|
||||
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
@ -285,10 +293,17 @@ v-show="showNewMessageTip" class="newMessageTip flex items-center cursor-pointer
|
||||
/*点击话术库*/
|
||||
const huashu = async () => {
|
||||
dialogVisible.value = true;
|
||||
getVerbalTrickList(targetMenuId.value)
|
||||
}
|
||||
|
||||
const getVerbalTrickList = async () => {
|
||||
const response = await VerbalTrickApi.getVerbalTrickList();
|
||||
//话术分类菜单
|
||||
const getHuaShuTypeList = async () => {
|
||||
const data = await DictDataApi.getHuaShuTypeList()
|
||||
huashuType.value = data
|
||||
|
||||
}
|
||||
//话术内容
|
||||
const getVerbalTrickList = async (id: string) => {
|
||||
const response = await VerbalTrickApi.getVerbalTrickList(id);
|
||||
verbalTrickList.value = response; // 将数据部分赋值给 verbalTrickList
|
||||
}
|
||||
|
||||
@ -298,6 +313,11 @@ v-show="showNewMessageTip" class="newMessageTip flex items-center cursor-pointer
|
||||
message.value = content;
|
||||
dialogVisible.value = false;
|
||||
}
|
||||
const clickMenu = (id: string) => {
|
||||
console.log('1111111111',id)
|
||||
getVerbalTrickList(id)
|
||||
}
|
||||
|
||||
|
||||
/** 发送文本消息 */
|
||||
const handleSendMessage = async () => {
|
||||
@ -416,7 +436,8 @@ v-show="showNewMessageTip" class="newMessageTip flex items-center cursor-pointer
|
||||
}
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getVerbalTrickList()
|
||||
getHuaShuTypeList()
|
||||
getVerbalTrickList(targetMenuId.value)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
96
yudao-admin-vue3/src/views/member/memberagree/index.vue
Normal file
96
yudao-admin-vue3/src/views/member/memberagree/index.vue
Normal file
@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="120px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
|
||||
<el-tabs>
|
||||
<el-tab-pane label="付费会员协议">
|
||||
<el-form-item prop="content">
|
||||
<Editor v-model="formData.content" />
|
||||
</el-form-item>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<div class="center-container">
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { PaidMemberAgreeApi, PaidMemberAgreeVO } from '@/api/member/memberagree'
|
||||
|
||||
/** 会员协议 列表 */
|
||||
defineOptions({ name: 'PaidMemberAgree' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
content: undefined
|
||||
})
|
||||
const formRef = ref() //表单 Ref
|
||||
|
||||
const formRules = reactive({})
|
||||
/** 查询付费会员协议 */
|
||||
const getPaidMemberAgree = async () => {
|
||||
try {
|
||||
const data = await PaidMemberAgreeApi.getPaidMemberAgree()
|
||||
if(data == null){
|
||||
return
|
||||
}
|
||||
formData.value = data
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
const onSubmit = async () => {
|
||||
// 校验表单
|
||||
if (!formRef) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as PaidMemberAgreeVO
|
||||
await PaidMemberAgreeApi.savePaidMemberAgree(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
dialogVisible.value = false
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getPaidMemberAgree()
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.center-container {
|
||||
display: flex;
|
||||
justify-content: center; /* 水平居中 */
|
||||
/* 如果需要垂直居中,并且父容器允许,可以尝试添加以下行(但通常不是必需的)*/
|
||||
/* align-items: center; */
|
||||
width: 100%; /* 或设置一个具体的宽度 */
|
||||
/* 可能需要添加其他样式来确保容器没有其他默认的 padding 或 margin */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
@ -102,7 +102,6 @@ watch(
|
||||
if (!newVal) {
|
||||
formData.value.paidMemberPrice = false; // 当 openPaidMember 变为 false 时,重置 paidMemberPriceStatus
|
||||
}
|
||||
// 注意:这里不需要处理 newVal 为 true 的情况,因为表单项会根据 v-if 指令的条件渲染
|
||||
},
|
||||
{ immediate: true } // 立即执行一次观察者回调,以确保初始状态正确
|
||||
);
|
||||
|
@ -9,6 +9,8 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.*;
|
||||
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
|
||||
import cn.iocoder.yudao.module.infra.service.file.FileService;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -25,6 +27,9 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.module.infra.framework.file.core.utils.FileTypeUtils.writeAttachment;
|
||||
|
||||
@ -38,6 +43,7 @@ public class FileController {
|
||||
@Resource
|
||||
private FileService fileService;
|
||||
|
||||
|
||||
@PostMapping("/upload")
|
||||
@Operation(summary = "上传文件", description = "模式一:后端上传文件")
|
||||
public CommonResult<String> uploadFile(FileUploadReqVO uploadReqVO) throws Exception {
|
||||
@ -100,4 +106,7 @@ public class FileController {
|
||||
return success(BeanUtils.toBean(pageResult, FileRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -101,9 +101,8 @@ public class VerbalTrickController {
|
||||
|
||||
@GetMapping("/getVerbalTrickList")
|
||||
@Operation(summary = "获得客服话术数据")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:verbal-trick:query')")
|
||||
public CommonResult<List<VerbalTrickDO>> getVerbalTrickList() {
|
||||
List<VerbalTrickDO> result = verbalTrickService.getVerbalTrickList();
|
||||
public CommonResult<List<VerbalTrickDO>> getVerbalTrickList(String id) {
|
||||
List<VerbalTrickDO> result = verbalTrickService.getVerbalTrickList(id);
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,6 @@ public interface VerbalTrickService {
|
||||
* 获取话术数据
|
||||
* @return
|
||||
*/
|
||||
List<VerbalTrickDO> getVerbalTrickList();
|
||||
List<VerbalTrickDO> getVerbalTrickList(String id);
|
||||
|
||||
}
|
@ -72,8 +72,9 @@ public class VerbalTrickServiceImpl implements VerbalTrickService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VerbalTrickDO> getVerbalTrickList() {
|
||||
return verbalTrickMapper.selectList();
|
||||
public List<VerbalTrickDO> getVerbalTrickList(String id) {
|
||||
|
||||
return verbalTrickMapper.selectList("type",id);
|
||||
}
|
||||
|
||||
}
|
@ -21,6 +21,6 @@ public interface TradeMemberUserService {
|
||||
|
||||
void updateUserDo(TradeMemberUserDO user);
|
||||
|
||||
void updateActivate(String cardName);
|
||||
void updateActivate(String cardName,Long userId);
|
||||
|
||||
}
|
||||
|
@ -93,8 +93,8 @@ public class TradeMemberUserServiceImpl implements TradeMemberUserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateActivate(String cardName) {
|
||||
TradeMemberUserDO tradeMemberUserDO = getUser(getLoginUserId());
|
||||
public void updateActivate(String cardName,Long userId) {
|
||||
TradeMemberUserDO tradeMemberUserDO = getUser(userId);
|
||||
//设置个人信息的会员状态,0:未开通,1试用,2有效期,3永久
|
||||
if(cardName.equals("永久")){
|
||||
tradeMemberUserDO.setActivate(3);
|
||||
|
@ -78,7 +78,6 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
|
||||
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.minusTime;
|
||||
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getTerminal;
|
||||
import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.*;
|
||||
import static cn.iocoder.yudao.module.trade.enums.ErrorCodeConstants.ORDER_NOT_FOUND;
|
||||
@ -338,7 +337,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
||||
PayOrderRespDTO payOrder = orderResult.getValue();
|
||||
System.out.println("交易订单成功id:"+id+"和payOrderId:"+payOrderId);
|
||||
//会员用户信息,支付状态修改
|
||||
TradeMemberUserDO tradeMemberUserDO = tradeMemberUserService.getUser(getLoginUserId());
|
||||
TradeMemberUserDO tradeMemberUserDO = tradeMemberUserService.getUser(order.getUserId());
|
||||
TradePaidMemberUserDO tradePaidMemberUserDO = tradePaidMemberUserService.getByPayOrderId(payOrderId);
|
||||
if(tradePaidMemberUserDO != null ){
|
||||
System.out.println("进入会员支付修改操作paid:"+tradePaidMemberUserDO+"和member:"+tradeMemberUserDO);
|
||||
@ -355,7 +354,7 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
|
||||
tradePaidMemberUserService.update(tradePaidMemberUserDO);
|
||||
System.out.println("成功更新会员订单paid:"+tradePaidMemberUserDO);
|
||||
//更新用户会员状态
|
||||
tradeMemberUserService.updateActivate(tradePaidMemberUserDO.getPayMemberType());
|
||||
tradeMemberUserService.updateActivate(tradePaidMemberUserDO.getPayMemberType(),order.getUserId());
|
||||
System.out.println("成功更新用户的会员状态member:"+tradeMemberUserDO);
|
||||
}
|
||||
System.out.println("会员修改操作结束!!!");
|
||||
|
@ -72,6 +72,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode PAID_MEMBER_USER_NOT_OPEN = new ErrorCode(1_004_024_000, "会员未开通");
|
||||
ErrorCode PAID_MEMBER_USER_PASSED = new ErrorCode(1_004_025_000, "会员已过期");
|
||||
ErrorCode PAID_MEMBER_CONFIG_NOT_EXISTS = new ErrorCode(1_004_026_000, "付费会员配置不存在");
|
||||
ErrorCode PAID_MEMBER_AGREE_NOT_EXISTS = new ErrorCode(1_004_027_000, "会员协议不存在");
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.memberagree;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.memberagree.vo.*;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.memberagree.PaidMemberAgreeDO;
|
||||
import cn.iocoder.yudao.module.member.service.memberagree.PaidMemberAgreeService;
|
||||
|
||||
@Tag(name = "管理后台 - 会员协议")
|
||||
@RestController
|
||||
@RequestMapping("/member/paid-member-agree")
|
||||
@Validated
|
||||
public class PaidMemberAgreeController {
|
||||
|
||||
@Resource
|
||||
private PaidMemberAgreeService paidMemberAgreeService;
|
||||
|
||||
|
||||
@PutMapping("/save")
|
||||
@Operation(summary = "更新会员协议")
|
||||
@PreAuthorize("@ss.hasPermission('member:paid-member-agree:update')")
|
||||
public CommonResult<Boolean> savePaidMemberAgree(@Valid @RequestBody PaidMemberAgreeSaveReqVO updateReqVO) {
|
||||
paidMemberAgreeService.saveAgree(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员协议")
|
||||
@PreAuthorize("@ss.hasPermission('member:paid-member-agree:query')")
|
||||
public CommonResult<PaidMemberAgreeRespVO> getPaidMemberAgree() {
|
||||
PaidMemberAgreeDO paidMemberAgree = paidMemberAgreeService.getAgree();
|
||||
return success(BeanUtils.toBean(paidMemberAgree, PaidMemberAgreeRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.memberagree.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 会员协议分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PaidMemberAgreePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.memberagree.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员协议 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PaidMemberAgreeRespVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22863")
|
||||
@ExcelProperty("编号")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "内容")
|
||||
@ExcelProperty("内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.member.controller.admin.memberagree.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 会员协议新增/修改 Request VO")
|
||||
@Data
|
||||
public class PaidMemberAgreeSaveReqVO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "22863")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "内容")
|
||||
private String content;
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.member.controller.app.memberagree;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.memberagree.vo.PaidMemberAgreeRespVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.memberagree.PaidMemberAgreeDO;
|
||||
import cn.iocoder.yudao.module.member.service.memberagree.PaidMemberAgreeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "用户 APP - 用户付费会员协议")
|
||||
@RestController
|
||||
@RequestMapping("/member/paid-member-agree")
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class AppPaidMemberAgreeController {
|
||||
|
||||
@Resource
|
||||
private PaidMemberAgreeService paidMemberAgreeService;
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员协议")
|
||||
@PreAuthenticated
|
||||
public CommonResult<PaidMemberAgreeRespVO> getPaidMemberAgree() {
|
||||
PaidMemberAgreeDO paidMemberAgree = paidMemberAgreeService.getAgree();
|
||||
return success(BeanUtils.toBean(paidMemberAgree, PaidMemberAgreeRespVO.class));
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,8 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "用户 APP - 用户个人信息 Response VO")
|
||||
@ -47,9 +49,9 @@ public class AppMemberUserInfoRespVO {
|
||||
@Schema(description = "会员名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "季卡")
|
||||
private String cardName;
|
||||
|
||||
@Schema(description = "会员名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String cardExpirationTime;
|
||||
private LocalDateTime cardExpirationTime;
|
||||
|
||||
@Schema(description = "用户 App - 会员等级")
|
||||
@Data
|
||||
|
@ -0,0 +1,19 @@
|
||||
package cn.iocoder.yudao.module.member.convert.memberagree;
|
||||
|
||||
import cn.iocoder.yudao.module.member.controller.admin.memberagree.vo.PaidMemberAgreeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.memberagree.PaidMemberAgreeDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 付费会员协议 Convert
|
||||
*
|
||||
*/
|
||||
@Mapper
|
||||
public interface PaidMemberAgreeConvert {
|
||||
|
||||
PaidMemberAgreeConvert INSTANCE = Mappers.getMapper(PaidMemberAgreeConvert.class);
|
||||
|
||||
PaidMemberAgreeDO convert(PaidMemberAgreeSaveReqVO bean);
|
||||
}
|
||||
|
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.member.dal.dataobject.memberagree;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 会员协议 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("paid_member_agree")
|
||||
@KeySequence("paid_member_agree_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PaidMemberAgreeDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.member.dal.mysql.memberagree;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.memberagree.PaidMemberAgreeDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.memberagree.vo.*;
|
||||
|
||||
/**
|
||||
* 会员协议 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface PaidMemberAgreeMapper extends BaseMapperX<PaidMemberAgreeDO> {
|
||||
|
||||
default PageResult<PaidMemberAgreeDO> selectPage(PaidMemberAgreePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PaidMemberAgreeDO>()
|
||||
.eqIfPresent(PaidMemberAgreeDO::getContent, reqVO.getContent())
|
||||
.betweenIfPresent(PaidMemberAgreeDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PaidMemberAgreeDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package cn.iocoder.yudao.module.member.service.memberagree;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.memberagree.vo.*;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.memberagree.PaidMemberAgreeDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 会员协议 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface PaidMemberAgreeService {
|
||||
|
||||
/**
|
||||
* 创建会员协议
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createPaidMemberAgree(@Valid PaidMemberAgreeSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新会员协议
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePaidMemberAgree(@Valid PaidMemberAgreeSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除会员协议
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePaidMemberAgree(Integer id);
|
||||
|
||||
/**
|
||||
* 获得会员协议
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 会员协议
|
||||
*/
|
||||
PaidMemberAgreeDO getPaidMemberAgree(Integer id);
|
||||
|
||||
/**
|
||||
* 获得会员协议分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 会员协议分页
|
||||
*/
|
||||
PageResult<PaidMemberAgreeDO> getPaidMemberAgreePage(PaidMemberAgreePageReqVO pageReqVO);
|
||||
|
||||
PaidMemberAgreeDO getAgree();
|
||||
|
||||
void saveAgree(@Valid PaidMemberAgreeSaveReqVO saveReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package cn.iocoder.yudao.module.member.service.memberagree;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.module.member.convert.memberagree.PaidMemberAgreeConvert;
|
||||
import cn.iocoder.yudao.module.member.convert.memberconfig.PaidMemberConfigConvert;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.memberconfig.PaidMemberConfigDO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.memberagree.vo.*;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.memberagree.PaidMemberAgreeDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.memberagree.PaidMemberAgreeMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 会员协议 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PaidMemberAgreeServiceImpl implements PaidMemberAgreeService {
|
||||
|
||||
@Resource
|
||||
private PaidMemberAgreeMapper paidMemberAgreeMapper;
|
||||
|
||||
@Override
|
||||
public Integer createPaidMemberAgree(PaidMemberAgreeSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PaidMemberAgreeDO paidMemberAgree = BeanUtils.toBean(createReqVO, PaidMemberAgreeDO.class);
|
||||
paidMemberAgreeMapper.insert(paidMemberAgree);
|
||||
// 返回
|
||||
return paidMemberAgree.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePaidMemberAgree(PaidMemberAgreeSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePaidMemberAgreeExists(updateReqVO.getId());
|
||||
// 更新
|
||||
PaidMemberAgreeDO updateObj = BeanUtils.toBean(updateReqVO, PaidMemberAgreeDO.class);
|
||||
paidMemberAgreeMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePaidMemberAgree(Integer id) {
|
||||
// 校验存在
|
||||
validatePaidMemberAgreeExists(id);
|
||||
// 删除
|
||||
paidMemberAgreeMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validatePaidMemberAgreeExists(Integer id) {
|
||||
if (paidMemberAgreeMapper.selectById(id) == null) {
|
||||
throw exception(PAID_MEMBER_AGREE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PaidMemberAgreeDO getPaidMemberAgree(Integer id) {
|
||||
return paidMemberAgreeMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PaidMemberAgreeDO> getPaidMemberAgreePage(PaidMemberAgreePageReqVO pageReqVO) {
|
||||
return paidMemberAgreeMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PaidMemberAgreeDO getAgree() {
|
||||
List<PaidMemberAgreeDO> list = paidMemberAgreeMapper.selectList();
|
||||
return CollectionUtils.getFirst(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveAgree(PaidMemberAgreeSaveReqVO saveReqVO) {
|
||||
//存在,则更新
|
||||
PaidMemberAgreeDO paidMemberAgreeDO = getAgree();
|
||||
if(paidMemberAgreeDO != null){
|
||||
paidMemberAgreeMapper.updateById(PaidMemberAgreeConvert.INSTANCE.convert(saveReqVO).setId(paidMemberAgreeDO.getId()));
|
||||
return;
|
||||
}
|
||||
//不存在,则进行插入
|
||||
paidMemberAgreeMapper.insert(PaidMemberAgreeConvert.INSTANCE.convert(saveReqVO));
|
||||
}
|
||||
|
||||
}
|
@ -189,6 +189,6 @@ public interface MemberUserService {
|
||||
|
||||
void updateUserDo(MemberUserDO user);
|
||||
|
||||
void updateActivate(String cardName);
|
||||
void updateActivate(String cardName,Long userId);
|
||||
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
@ -330,8 +329,8 @@ public class MemberUserServiceImpl implements MemberUserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateActivate(String cardName) {
|
||||
MemberUserDO memberUserDO = getUser(getLoginUserId());
|
||||
public void updateActivate(String cardName,Long userId) {
|
||||
MemberUserDO memberUserDO = getUser(userId);
|
||||
//设置个人信息的会员状态,0:未开通,1试用,2有效期,3永久
|
||||
if(cardName.equals("永久")){
|
||||
memberUserDO.setActivate(3);
|
||||
|
@ -36,7 +36,6 @@ import cn.iocoder.yudao.module.member.dal.mysql.user.PaidMemberUserMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getTerminal;
|
||||
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
|
||||
|
||||
@ -227,6 +226,7 @@ public class PaidMemberUserServiceImpl implements PaidMemberUserService {
|
||||
orderDO.setProductCount(1);
|
||||
orderDO.setUserIp(getClientIP()).setTerminal(getTerminal());
|
||||
orderDO.setDeliveryType(DeliveryTypeEnum.EXPRESS.getType());
|
||||
orderDO.setPayPrice(updateReqVO.getPrice());
|
||||
//获取用户地址
|
||||
// MemberAddressRespDTO address = addressApi.getDefaultAddress(updateReqVO.getUid());
|
||||
// orderDO.setReceiverName(address.getName()).setReceiverMobile(address.getMobile())
|
||||
|
@ -186,7 +186,7 @@ public class AppPaidMembeController {
|
||||
//更新会员订单
|
||||
paidMemberUserService.update(paidMemberUserDO);
|
||||
//更新用户会员状态
|
||||
memberUserService.updateActivate(paidMemberUserDO.getPayMemberType());
|
||||
memberUserService.updateActivate(paidMemberUserDO.getPayMemberType(),getLoginUserId());
|
||||
// return success(PayMemberOrderConvert.INSTANCE.convert(paidMemberUserDO.getId(),payOrderId
|
||||
// ,paidMemberUserDO.getCardExpirationTime(),memberUserDO.getActivate()));
|
||||
return success(true);
|
||||
|
@ -7,6 +7,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataSaveReqVO;
|
||||
@ -38,6 +40,10 @@ public class DictDataController {
|
||||
@Resource
|
||||
private DictDataService dictDataService;
|
||||
|
||||
@Resource
|
||||
public DictDataApi dictDataApi;
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "新增字典数据")
|
||||
@PreAuthorize("@ss.hasPermission('system:dict:create')")
|
||||
@ -101,4 +107,23 @@ public class DictDataController {
|
||||
BeanUtils.toBean(list, DictDataRespVO.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型查询字典数据信息:图片素材管理分类
|
||||
*/
|
||||
@GetMapping(value = "/getTypeList")
|
||||
public CommonResult<List<DictDataRespDTO>> getTypeList() {
|
||||
List<DictDataRespDTO> dictDataList = dictDataApi.getDictDataList("infra_file_type");
|
||||
return success(dictDataList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据字典类型查询字典数据信息:客服素材分类
|
||||
*/
|
||||
@GetMapping(value = "/getHuaShuTypeList")
|
||||
public CommonResult<List<DictDataRespDTO>> getHuaShuTypeList() {
|
||||
List<DictDataRespDTO> dictDataList = dictDataApi.getDictDataList("kefu_verbal_trick_type");
|
||||
return success(dictDataList);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user