Merge branch 'master' of http://101.126.146.73:3000/root/allLikeMall into khy-three
This commit is contained in:
commit
9e0cfba204
51
yudao-admin-vue3/src/api/promotion/activityinfo/index.ts
Normal file
51
yudao-admin-vue3/src/api/promotion/activityinfo/index.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 活动信息 VO
|
||||
export interface ActivityInfoVO {
|
||||
id: number // 活动唯一ID
|
||||
activityTitle: string // 活动标题
|
||||
activityLocation: string // 活动地点
|
||||
organizer: string // 活动主办方
|
||||
startTime: Date // 活动开始时间
|
||||
endTime: Date // 活动结束时间
|
||||
price: number // 活动票价
|
||||
status: string // 活动状态
|
||||
activityType: string // 活动类型
|
||||
capacity: number // 活动人数限制
|
||||
registeredCount: number // 已报名人数
|
||||
topicType: string // 专题类型
|
||||
}
|
||||
|
||||
// 活动信息 API
|
||||
export const ActivityInfoApi = {
|
||||
// 查询活动信息分页
|
||||
getActivityInfoPage: async (params: any) => {
|
||||
return await request.get({ url: `/promotion/activity-info/page`, params })
|
||||
},
|
||||
|
||||
// 查询活动信息详情
|
||||
getActivityInfo: async (id: number) => {
|
||||
return await request.get({ url: `/promotion/activity-info/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增活动信息
|
||||
createActivityInfo: async (data: ActivityInfoVO) => {
|
||||
return await request.post({ url: `/promotion/activity-info/create`, data })
|
||||
},
|
||||
|
||||
// 修改活动信息
|
||||
updateActivityInfo: async (data: ActivityInfoVO) => {
|
||||
return await request.put({ url: `/promotion/activity-info/update`, data })
|
||||
},
|
||||
|
||||
// 删除活动信息
|
||||
deleteActivityInfo: async (id: number) => {
|
||||
return await request.delete({ url: `/promotion/activity-info/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出活动信息 Excel
|
||||
exportActivityInfo: async (params) => {
|
||||
return await request.download({ url: `/promotion/activity-info/export-excel`, params })
|
||||
},
|
||||
|
||||
}
|
58
yudao-admin-vue3/src/api/promotion/registration/index.ts
Normal file
58
yudao-admin-vue3/src/api/promotion/registration/index.ts
Normal file
@ -0,0 +1,58 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 活动报名 VO
|
||||
export interface RegistrationVO {
|
||||
userName: string // 用户姓名
|
||||
phoneNumber: string // 手机号
|
||||
companyName: string // 公司名称
|
||||
position: string // 职位
|
||||
operationPlatform: string // 运营平台
|
||||
mainCategory: string // 主营品类
|
||||
agencyCity: string // 代理城市
|
||||
productIntent: string // 产品意向
|
||||
purpose: string // 参会目的
|
||||
attendeeIdentity: string // 参会身份
|
||||
registrationStatus: string // 报名状态
|
||||
verificationCode: string // 核销码
|
||||
verificationStatus: string // 核销状态
|
||||
isPaid: string // 是否付费
|
||||
reviewStatus: string // 审核状态
|
||||
}
|
||||
|
||||
// 活动报名 API
|
||||
export const RegistrationApi = {
|
||||
// 查询活动报名分页
|
||||
getRegistrationPage: async (params: any) => {
|
||||
return await request.get({ url: `/promotion/registration/page`, params })
|
||||
},
|
||||
|
||||
// 查询活动报名详情
|
||||
getRegistration: async (id: number) => {
|
||||
return await request.get({ url: `/promotion/registration/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增活动报名
|
||||
createRegistration: async (data: RegistrationVO) => {
|
||||
return await request.post({ url: `/promotion/registration/create`, data })
|
||||
},
|
||||
|
||||
// 修改活动报名
|
||||
updateRegistration: async (data: RegistrationVO) => {
|
||||
return await request.put({ url: `/promotion/registration/update`, data })
|
||||
},
|
||||
|
||||
// 删除活动报名
|
||||
deleteRegistration: async (id: number) => {
|
||||
return await request.delete({ url: `/promotion/registration/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出活动报名 Excel
|
||||
exportRegistration: async (params) => {
|
||||
return await request.download({ url: `/promotion/registration/export-excel`, params })
|
||||
},
|
||||
// 查询活动名称数据
|
||||
getActivityNames: async () => {
|
||||
return await request.get({ url: `/promotion/registration/getOrganization` })
|
||||
},
|
||||
|
||||
}
|
@ -123,19 +123,19 @@ export enum DICT_TYPE {
|
||||
TYPES = 'types',
|
||||
TECHNICIAN_STATUS = 'technician_status',
|
||||
SEX = 'sex',
|
||||
|
||||
|
||||
//客服配置类型
|
||||
KEFU_CONFIGURATION_TYPE = 'kefu_configuration_type',
|
||||
|
||||
|
||||
INFRA_FILE_TYPE = 'infra_file_type',
|
||||
|
||||
|
||||
PAY_WALLET_RECHARGE_PAY_STATUS = 'pay_wallet_recharge_pay_status',
|
||||
|
||||
|
||||
//预约:项目
|
||||
SUBSCRIBE_PROJECT_STATUS = 'subscribe_project_status',
|
||||
|
||||
|
||||
SUBSCRIBE_RESERVATION_STATUS = 'subscribe_reservation_status',
|
||||
|
||||
|
||||
//预约:配置
|
||||
SUBSCRIBE_CONFIGURATION_STATUS = 'subscribe_configuration_status',
|
||||
|
||||
@ -152,17 +152,17 @@ export enum DICT_TYPE {
|
||||
|
||||
//预约:机构管理
|
||||
ORGANIZATION_STATUS = 'organization_status',
|
||||
|
||||
|
||||
//客服:自动回复
|
||||
KEFU_AUTO_RESPONSE_TYPE = 'kefu_auto_response_type',
|
||||
KEFU_AUTO_RESPONSE_STATUS = 'kefu_auto_response_status',
|
||||
|
||||
|
||||
//客服:留言
|
||||
KEFU_LEAVE_WORD_STATUS = 'kefu_leave_word_status',
|
||||
|
||||
|
||||
//客服:话术
|
||||
KEFU_VERBAL_TRICK_TYPE = 'kefu_verbal_trick_type',
|
||||
|
||||
|
||||
//客服人员管理
|
||||
KEFU_SUPPORT_STAFF_STATUS = 'kefu_support_staff_status',
|
||||
KEFU_SUPPORT_STAFF_ORDER_MANAGE = 'kefu_support_staff_order_manage',
|
||||
@ -309,5 +309,20 @@ export enum DICT_TYPE {
|
||||
INVOICE_STATUS = 'invoice_status', //发票状态
|
||||
|
||||
INVOICE_HEADER_DEFAULT = 'invoice_header_default', //抬头默认
|
||||
// ========== 活动报名模块 ==========
|
||||
PROMOTION_REGISTRATION_OPERATION_PLATFORM = 'promotion_registration_operation_platform',
|
||||
PROMOTION_REGISTRATION_MAIN_CATEGORY = 'promotion_registration_main_category',
|
||||
PROMOTION_REGISTRATION_AGENCY_CITY = 'promotion_registration_agency_city',
|
||||
PROMOTION_REGISTRATION_PRODUCT_INTENT = 'promotion_registration_product_intent',
|
||||
PROMOTION_REGISTRATION_PURPOSE = 'promotion_registration_purpose',
|
||||
PROMOTION_REGISTRATION_ATTENDEE_IDENTITY = 'promotion_registration_attendee_identity',
|
||||
PROMOTION_REGISTRATION_REGISTRATION_STATUS = 'promotion_registration_registration_status',
|
||||
PROMOTION_REGISTRATION_VERIFICATION_STATUS = 'promotion_registration_verification_status',
|
||||
PROMOTION_REGISTRATION_IS_PAID = 'promotion_registration_is_paid',
|
||||
PROMOTION_REGISTRATION_REVIEW_STATUS = 'promotion_registration_review_status',
|
||||
|
||||
// ========== 活动信息模块 ==========
|
||||
PROMOTION_ACTIVITY_INFO_STATUS = 'promotion_activity_info_status',
|
||||
PROMOTION_ACTIVITY_INFO_ACTIVITY_TYPE = 'promotion_activity_info_activity_type',
|
||||
PROMOTION_ACTIVITY_INFO_TOPIC_TYPE = 'promotion_activity_info_topic_type',
|
||||
}
|
||||
|
@ -0,0 +1,180 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="150px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="活动标题" prop="activityTitle">
|
||||
<el-input v-model="formData.activityTitle" placeholder="请输入活动标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="活动地点" prop="activityLocation">
|
||||
<el-input v-model="formData.activityLocation" placeholder="请输入活动地点" />
|
||||
</el-form-item>
|
||||
<el-form-item label="活动主办方" prop="organizer">
|
||||
<el-input v-model="formData.organizer" placeholder="请输入活动主办方" />
|
||||
</el-form-item>
|
||||
<el-form-item label="活动开始时间" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="formData.startTime"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择活动开始时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动结束时间" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="formData.endTime"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择活动结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动票价" prop="price">
|
||||
<el-input v-model="formData.price" placeholder="请输入活动票价" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="活动状态" prop="status">-->
|
||||
<!-- <el-select v-model="formData.status" placeholder="请选择活动状态">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_ACTIVITY_INFO_STATUS)"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="活动类型" prop="activityType">
|
||||
<el-select v-model="formData.activityType" placeholder="请选择活动类型">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_ACTIVITY_INFO_ACTIVITY_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动人数限制" prop="capacity">
|
||||
<el-input v-model="formData.capacity" placeholder="请输入活动人数限制" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="已报名人数" prop="registeredCount">-->
|
||||
<!-- <el-input v-model="formData.registeredCount" placeholder="请输入已报名人数" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="专题类型" prop="topicType">
|
||||
<el-select v-model="formData.topicType" placeholder="请选择专题类型">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_ACTIVITY_INFO_TOPIC_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { ActivityInfoApi, ActivityInfoVO } from '@/api/promotion/activityinfo'
|
||||
|
||||
/** 活动信息 表单 */
|
||||
defineOptions({ name: 'ActivityInfoForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
activityTitle: undefined,
|
||||
activityLocation: undefined,
|
||||
organizer: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
price: undefined,
|
||||
status: undefined,
|
||||
activityType: undefined,
|
||||
capacity: undefined,
|
||||
registeredCount: undefined,
|
||||
topicType: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
activityTitle: [{ required: true, message: '活动标题不能为空', trigger: 'blur' }],
|
||||
activityLocation: [{ required: true, message: '活动地点不能为空', trigger: 'blur' }],
|
||||
organizer: [{ required: true, message: '活动主办方不能为空', trigger: 'blur' }],
|
||||
startTime: [{ required: true, message: '活动开始时间不能为空', trigger: 'blur' }],
|
||||
endTime: [{ required: true, message: '活动结束时间不能为空', trigger: 'blur' }],
|
||||
// status: [{ required: true, message: '活动状态不能为空', trigger: 'change' }],
|
||||
capacity: [{ required: true, message: '活动人数限制不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await ActivityInfoApi.getActivityInfo(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as ActivityInfoVO
|
||||
if (formType.value === 'create') {
|
||||
await ActivityInfoApi.createActivityInfo(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await ActivityInfoApi.updateActivityInfo(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
activityTitle: undefined,
|
||||
activityLocation: undefined,
|
||||
organizer: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
price: undefined,
|
||||
status: undefined,
|
||||
activityType: undefined,
|
||||
capacity: undefined,
|
||||
registeredCount: undefined,
|
||||
topicType: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
370
yudao-admin-vue3/src/views/promotion/activityinfo/index.vue
Normal file
370
yudao-admin-vue3/src/views/promotion/activityinfo/index.vue
Normal file
@ -0,0 +1,370 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<!-- <el-form-item label="活动标题" prop="activityTitle">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.activityTitle"-->
|
||||
<!-- placeholder="请输入活动标题"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter="handleQuery"-->
|
||||
<!-- class="!w-240px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="活动地点" prop="activityLocation">
|
||||
<el-input
|
||||
v-model="queryParams.activityLocation"
|
||||
placeholder="请输入活动地点"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="主办方" prop="organizer">
|
||||
<el-input
|
||||
v-model="queryParams.organizer"
|
||||
placeholder="请输入活动主办方"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.startTime"
|
||||
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')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.endTime"
|
||||
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')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动票价" prop="price">
|
||||
<el-input
|
||||
v-model="queryParams.price"
|
||||
placeholder="请输入活动票价"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="活动状态" prop="status">-->
|
||||
<!-- <el-select-->
|
||||
<!-- v-model="queryParams.status"-->
|
||||
<!-- placeholder="请选择活动状态"-->
|
||||
<!-- clearable-->
|
||||
<!-- class="!w-240px"-->
|
||||
<!-- >-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_ACTIVITY_INFO_STATUS)"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="活动类型" prop="activityType">
|
||||
<el-select
|
||||
v-model="queryParams.activityType"
|
||||
placeholder="请选择活动类型"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_ACTIVITY_INFO_ACTIVITY_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="活动人数限制" prop="capacity">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.capacity"-->
|
||||
<!-- placeholder="请输入活动人数限制"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter="handleQuery"-->
|
||||
<!-- class="!w-240px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="已报名人数" prop="registeredCount">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.registeredCount"-->
|
||||
<!-- placeholder="请输入已报名人数"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter="handleQuery"-->
|
||||
<!-- class="!w-240px"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="专题类型" prop="topicType">
|
||||
<el-select
|
||||
v-model="queryParams.topicType"
|
||||
placeholder="请选择专题类型"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_ACTIVITY_INFO_TOPIC_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</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('create')"
|
||||
v-hasPermi="['promotion:activity-info:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['promotion:activity-info:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="活动唯一ID" align="center" prop="id" />
|
||||
<el-table-column label="活动名称" align="center" prop="activityTitle" />
|
||||
<el-table-column label="活动地点" align="center" prop="activityLocation" />
|
||||
<el-table-column label="活动主办方" align="center" prop="organizer" />
|
||||
<el-table-column
|
||||
label="活动开始时间"
|
||||
align="center"
|
||||
prop="startTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
|
||||
/>
|
||||
<el-table-column
|
||||
label="活动结束时间"
|
||||
align="center"
|
||||
prop="endTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
|
||||
/>
|
||||
<el-table-column label="活动票价" align="center" prop="price" />
|
||||
<el-table-column label="活动人数限制" align="center" prop="capacity" />
|
||||
<!-- <el-table-column label="已报名人数" align="center" prop="registeredCount" />-->
|
||||
<el-table-column label="活动类型" align="center" prop="activityType" >
|
||||
<template #default="scope" >
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_ACTIVITY_INFO_ACTIVITY_TYPE" :value="scope.row.activityType" class="dict-style"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="专题类型" align="center" prop="topicType">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_ACTIVITY_INFO_TOPIC_TYPE" :value="scope.row.topicType" class="dict-style"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<!-- <dict-tag :type="DICT_TYPE.PROMOTION_ACTIVITY_INFO_STATUS" :value="scope.row.status" />-->
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.PROMOTION_ACTIVITY_INFO_STATUS"
|
||||
:value="calculateStatus(scope.row.startTime, scope.row.endTime)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="活动创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['promotion:activity-info:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['promotion:activity-info: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>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ActivityInfoForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { ActivityInfoApi, ActivityInfoVO } from '@/api/promotion/activityinfo'
|
||||
import ActivityInfoForm from './ActivityInfoForm.vue'
|
||||
|
||||
// 状态实时计算方法(无法与后端交互,有缺陷)
|
||||
const calculateStatus = (startTime: string, endTime: string) => {
|
||||
const now = new Date().getTime();
|
||||
const start = new Date(startTime).getTime();
|
||||
const end = new Date(endTime).getTime();
|
||||
|
||||
if (now < start) return '0'; // 未开始
|
||||
if (now > end) return '2';// 已结束
|
||||
return '1'; // 进行中
|
||||
};
|
||||
|
||||
|
||||
/** 活动信息 列表 */
|
||||
defineOptions({ name: 'ActivityInfo' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<ActivityInfoVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
activityTitle: undefined,
|
||||
activityLocation: undefined,
|
||||
organizer: undefined,
|
||||
startTime: [],
|
||||
endTime: [],
|
||||
price: undefined,
|
||||
status: undefined,
|
||||
activityType: undefined,
|
||||
capacity: undefined,
|
||||
registeredCount: undefined,
|
||||
topicType: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await ActivityInfoApi.getActivityInfoPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await ActivityInfoApi.deleteActivityInfo(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await ActivityInfoApi.exportActivityInfo(queryParams)
|
||||
download.excel(data, '活动信息.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
<!--<style scoped>-->
|
||||
<!--.dict-style {-->
|
||||
<!-- background: none !important;-->
|
||||
<!-- border-style: none !important;-->
|
||||
<!-- color: #504e4e !important;-->
|
||||
<!-- font-size: 14px;-->
|
||||
<!--}-->
|
||||
<!--</style>-->
|
@ -0,0 +1,321 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<!-- 第一行 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="用户姓名" prop="userName">
|
||||
<el-input v-model="formData.userName" placeholder="请输入用户姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="手机号" prop="phoneNumber">
|
||||
<el-input v-model="formData.phoneNumber" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="活动名称" prop="activityId">
|
||||
<el-select v-model="formData.activityId" placeholder="请选择活动名称">
|
||||
<el-option
|
||||
v-for="activity in activityNames"
|
||||
:key="activity.id"
|
||||
:label="activity.activityTitle"
|
||||
:value="activity.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 第二行 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司名称" prop="companyName">
|
||||
<el-input v-model="formData.companyName" placeholder="请输入公司名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="职位" prop="position">
|
||||
<el-input v-model="formData.position" placeholder="请输入职位" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <el-form-item label="活动场所" prop="operationPlatform">-->
|
||||
<!-- <el-select v-model="formData.operationPlatform" placeholder="请选择活动场所">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_OPERATION_PLATFORM)"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<!-- 第三行 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="主营品类" prop="mainCategory">
|
||||
<el-select v-model="formData.mainCategory" placeholder="请选择主营品类">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_MAIN_CATEGORY)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="代理城市" prop="agencyCity">
|
||||
<el-select v-model="formData.agencyCity" placeholder="请选择代理城市">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_AGENCY_CITY)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产品意向" prop="productIntent">
|
||||
<el-select v-model="formData.productIntent" placeholder="请选择产品意向">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_PRODUCT_INTENT)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 第四行 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="参会目的" prop="purpose">
|
||||
<el-select v-model="formData.purpose" placeholder="请选择参会目的">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_PURPOSE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="参会身份" prop="attendeeIdentity">
|
||||
<el-select v-model="formData.attendeeIdentity" placeholder="请选择参会身份">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_ATTENDEE_IDENTITY)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="报名状态" prop="registrationStatus">
|
||||
<el-select v-model="formData.registrationStatus" placeholder="请选择报名状态">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_REGISTRATION_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 第五行 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="核销码" prop="verificationCode">
|
||||
<el-input v-model="formData.verificationCode" placeholder="请输入核销码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="核销状态" prop="verificationStatus">
|
||||
<el-select v-model="formData.verificationStatus" placeholder="请选择核销状态">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_VERIFICATION_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否付费" prop="isPaid">
|
||||
<el-select v-model="formData.isPaid" placeholder="请选择是否付费">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_IS_PAID)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 第六行 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="审核状态" prop="reviewStatus">
|
||||
<el-select v-model="formData.reviewStatus" placeholder="请选择审核状态">
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_REVIEW_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { DICT_TYPE ,getStrDictOptions} from '@/utils/dict'
|
||||
import { RegistrationApi, RegistrationVO } from '@/api/promotion/registration'
|
||||
import { ActivityInfoVO} from "@/api/promotion/activityinfo"
|
||||
|
||||
/** 活动报名 表单 */
|
||||
defineOptions({ name: 'RegistrationForm' })
|
||||
|
||||
const activityNames = ref<ActivityInfoVO[]>([]);
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
userName: undefined,
|
||||
phoneNumber: undefined,
|
||||
companyName: undefined,
|
||||
position: undefined,
|
||||
operationPlatform: undefined,
|
||||
mainCategory: undefined,
|
||||
agencyCity: undefined,
|
||||
productIntent: undefined,
|
||||
purpose: undefined,
|
||||
attendeeIdentity: undefined,
|
||||
activityId: undefined,
|
||||
activityTitle: undefined,
|
||||
registrationStatus: undefined,
|
||||
verificationCode: undefined,
|
||||
verificationStatus: undefined,
|
||||
isPaid: undefined,
|
||||
reviewStatus: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
userName: [{ required: true, message: '用户姓名不能为空', trigger: 'blur' }],
|
||||
phoneNumber: [{ required: true, message: '手机号不能为空', trigger: 'blur' }],
|
||||
registrationStatus: [{ required: true, message: '报名状态不能为空', trigger: 'change' }],
|
||||
activityId: [{ required: true, message: '活动id不能为空', trigger: 'change' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
console.log('id', id)
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await RegistrationApi.getRegistration(id);
|
||||
const registration = await RegistrationApi.getRegistration(id); // 将返回值存储到 `registration` 变量中
|
||||
formData.value = { ...registration, activityId: registration.activityId }; // 正确引用 `registration`
|
||||
console.log('loaded registration:', formData.value);
|
||||
} finally {
|
||||
console.log('id查找失败', id)
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
console.log('submit form:', formData.value);
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as RegistrationVO
|
||||
if (formType.value === 'create') {
|
||||
await RegistrationApi.createRegistration(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await RegistrationApi.updateRegistration(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//初始化机构名称下拉框
|
||||
const getActivityNames = async () => {
|
||||
try {
|
||||
const result = await RegistrationApi.getActivityNames();
|
||||
activityNames.value = result;
|
||||
console.log('activityNames:', activityNames.value);
|
||||
} catch (error) {
|
||||
console.error('获取活动名称失败:', error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
userName: undefined,
|
||||
phoneNumber: undefined,
|
||||
companyName: undefined,
|
||||
position: undefined,
|
||||
operationPlatform: undefined,
|
||||
mainCategory: undefined,
|
||||
agencyCity: undefined,
|
||||
productIntent: undefined,
|
||||
purpose: undefined,
|
||||
attendeeIdentity: undefined,
|
||||
activityId: undefined,
|
||||
activityTitle: undefined,
|
||||
registrationStatus: undefined,
|
||||
verificationCode: undefined,
|
||||
verificationStatus: undefined,
|
||||
isPaid: undefined,
|
||||
reviewStatus: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getActivityNames()
|
||||
console.log("初始化成功!")
|
||||
})
|
||||
</script>
|
457
yudao-admin-vue3/src/views/promotion/registration/index.vue
Normal file
457
yudao-admin-vue3/src/views/promotion/registration/index.vue
Normal file
@ -0,0 +1,457 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="用户姓名" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入用户姓名"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="活动场所" prop="operationPlatform">
|
||||
<el-select
|
||||
v-model="queryParams.operationPlatform"
|
||||
placeholder="请选择活动场所"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_OPERATION_PLATFORM)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="代理城市" prop="agencyCity">
|
||||
<el-select
|
||||
v-model="queryParams.agencyCity"
|
||||
placeholder="请选择代理城市"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_AGENCY_CITY)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="身份" prop="attendeeIdentity">
|
||||
<el-select
|
||||
v-model="queryParams.attendeeIdentity"
|
||||
placeholder="请选择身份"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_ATTENDEE_IDENTITY)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="报名状态" prop="registrationStatus">
|
||||
<el-select
|
||||
v-model="queryParams.registrationStatus"
|
||||
placeholder="请选择报名状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_REGISTRATION_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="核销状态" prop="verificationStatus">
|
||||
<el-select
|
||||
v-model="queryParams.verificationStatus"
|
||||
placeholder="请选择核销状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_VERIFICATION_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否付费" prop="isPaid">
|
||||
<el-select
|
||||
v-model="queryParams.isPaid"
|
||||
placeholder="请选择是否付费"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_IS_PAID)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="报名状态" prop="reviewStatus">
|
||||
<el-select
|
||||
v-model="queryParams.reviewStatus"
|
||||
placeholder="请选择报名状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getStrDictOptions(DICT_TYPE.PROMOTION_REGISTRATION_REVIEW_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</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('create')"
|
||||
v-hasPermi="['promotion:registration:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['promotion:registration:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
|
||||
<el-table-column label="活动名称" align="center" prop="activityTitle" min-width="220" />
|
||||
<el-table-column label="报名信息" min-width="130" align="center">
|
||||
<template #default="scope">
|
||||
<div style="display: flex; flex-direction: column; gap: 8px;align:center;">
|
||||
<!-- 每个字段占一行 -->
|
||||
<div style="display: flex; align-items: center; white-space: nowrap; width: 100%;">
|
||||
<span class="field-label">姓名:</span>{{ scope.row.userName }}
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; white-space: nowrap; width: 100%;">
|
||||
<span class="field-label">公司名称:</span>{{ scope.row.companyName }}
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; white-space: nowrap; width: 100%;">
|
||||
<span class="field-label">手机号:</span>{{ scope.row.phoneNumber }}
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; white-space: nowrap; width: 100%;">
|
||||
<span class="field-label">身份:</span>
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.PROMOTION_REGISTRATION_ATTENDEE_IDENTITY"
|
||||
:value="scope.row.attendeeIdentity"
|
||||
class="dict-style"
|
||||
/>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; white-space: nowrap; width: 100%;">
|
||||
<span class="field-label">职位:</span>{{ scope.row.position }}
|
||||
</div>
|
||||
<!-- <div style="display: flex; align-items: center; white-space: nowrap; width: 100%;">
|
||||
<span class="field-label">主营品类:</span>
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.PROMOTION_REGISTRATION_MAIN_CATEGORY"
|
||||
:value="scope.row.mainCategory"
|
||||
class="dict-style"
|
||||
/>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; white-space: nowrap; width: 100%;">
|
||||
<span class="field-label">代理城市:</span>
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.PROMOTION_REGISTRATION_AGENCY_CITY"
|
||||
:value="scope.row.agencyCity"
|
||||
class="dict-style"
|
||||
/>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; white-space: nowrap; width: 100%;">
|
||||
<span class="field-label">产品意向:</span>
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.PROMOTION_REGISTRATION_PRODUCT_INTENT"
|
||||
:value="scope.row.productIntent"
|
||||
class="dict-style"
|
||||
/>
|
||||
</div>-->
|
||||
<div style="display: flex; align-items: center; white-space: nowrap; width: 100%;">
|
||||
<span class="field-label">目的:</span>
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.PROMOTION_REGISTRATION_PURPOSE"
|
||||
:value="scope.row.purpose"
|
||||
class="dict-style"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- 注释 -->
|
||||
<!-- <el-table-column label="用户姓名" align="center" prop="userName" />
|
||||
<el-table-column label="手机号" align="center" prop="phoneNumber" min-width="120" />
|
||||
<el-table-column label="参加活动" align="center" prop="activityId" />
|
||||
|
||||
<el-table-column label="公司名称" align="center" prop="companyName" min-width="220"/>
|
||||
<el-table-column label="职位" align="center" prop="position" min-width="120"/>
|
||||
<el-table-column label="活动场所" align="center" prop="operationPlatform" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_REGISTRATION_OPERATION_PLATFORM" :value="scope.row.operationPlatform" class="dict-style" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主营品类" align="center" prop="mainCategory" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_REGISTRATION_MAIN_CATEGORY" :value="scope.row.mainCategory" class="dict-style"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="代理城市" align="center" prop="agencyCity" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_REGISTRATION_AGENCY_CITY" :value="scope.row.agencyCity" class="dict-style"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品意向" align="center" prop="productIntent" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_REGISTRATION_PRODUCT_INTENT" :value="scope.row.productIntent" class="dict-style"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参会目的" align="center" prop="purpose" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_REGISTRATION_PURPOSE" :value="scope.row.purpose" class="dict-style"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参会身份" align="center" prop="attendeeIdentity" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_REGISTRATION_ATTENDEE_IDENTITY" :value="scope.row.attendeeIdentity" class="dict-style"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="报名状态" align="center" prop="registrationStatus" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_REGISTRATION_REGISTRATION_STATUS" :value="scope.row.registrationStatus" />
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
|
||||
<el-table-column label="是否付费" align="center" prop="isPaid" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_REGISTRATION_IS_PAID" :value="scope.row.isPaid" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报名状态" align="center" prop="reviewStatus" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_REGISTRATION_REVIEW_STATUS" :value="scope.row.reviewStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="核销状态" align="center" prop="verificationStatus" min-width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.PROMOTION_REGISTRATION_VERIFICATION_STATUS" :value="scope.row.verificationStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="核销码" align="center" prop="verificationCode" min-width="120" />
|
||||
<el-table-column
|
||||
label="报名时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column fixed="right" label="操作" align="center" min-width="120">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['promotion:registration:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['promotion:registration: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>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<RegistrationForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { RegistrationApi, RegistrationVO } from '@/api/promotion/registration'
|
||||
import RegistrationForm from './RegistrationForm.vue'
|
||||
|
||||
/** 活动报名 列表 */
|
||||
defineOptions({ name: 'Registration' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<RegistrationVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
userName: undefined,
|
||||
operationPlatform: undefined,
|
||||
agencyCity: undefined,
|
||||
attendeeIdentity: undefined,
|
||||
registrationStatus: undefined,
|
||||
activityId: undefined,
|
||||
activityTitle: undefined,
|
||||
verificationStatus: undefined,
|
||||
isPaid: undefined,
|
||||
reviewStatus: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await RegistrationApi.getRegistrationPage(queryParams)
|
||||
// 打印从后端获取到的数据
|
||||
console.log('打印从后端获取到的数据:', data);
|
||||
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await RegistrationApi.deleteRegistration(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await RegistrationApi.exportRegistration(queryParams)
|
||||
download.excel(data, '活动报名.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.dict-style {
|
||||
background: none !important;
|
||||
border-style: none !important;
|
||||
color: #504e4e !important;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.dict-style {
|
||||
background: none !important;
|
||||
border-style: none !important;
|
||||
color: #504e4e !important;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.el-table .cell {
|
||||
white-space: pre-line !important;
|
||||
}
|
||||
|
||||
.field-label {
|
||||
color: #4d4c4c; /* 深灰色 */
|
||||
font-weight: bold; /* 加粗字体,可选 */
|
||||
margin-right: 5px; /* 字段标签和值之间的间距 */
|
||||
}
|
||||
</style>
|
@ -170,4 +170,7 @@ public interface ErrorCodeConstants {
|
||||
// ========== 客服人员 TODO 补充编号 ==========
|
||||
ErrorCode SUPPORT_STAFF_NOT_EXISTS = new ErrorCode(1_023_000_000, "客服人员不存在");
|
||||
|
||||
ErrorCode REGISTRATION_NOT_EXISTS = new ErrorCode(1_024_000_000, "活动报名不存在");
|
||||
|
||||
ErrorCode ACTIVITY_INFO_NOT_EXISTS = new ErrorCode(1_025_000_000, "活动信息不存在");
|
||||
}
|
||||
|
@ -0,0 +1,103 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.activityinfo;
|
||||
|
||||
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.promotion.controller.admin.activityinfo.vo.*;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.activityinfo.ActivityInfoDO;
|
||||
import cn.iocoder.yudao.module.promotion.service.activityinfo.ActivityInfoService;
|
||||
|
||||
@Tag(name = "管理后台 - 活动信息")
|
||||
@RestController
|
||||
@RequestMapping("/promotion/activity-info")
|
||||
@Validated
|
||||
public class ActivityInfoController {
|
||||
|
||||
@Resource
|
||||
private ActivityInfoService activityInfoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建活动信息")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:activity-info:create')")
|
||||
public CommonResult<Long> createActivityInfo(@Valid @RequestBody ActivityInfoSaveReqVO createReqVO) {
|
||||
return success(activityInfoService.createActivityInfo(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新活动信息")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:activity-info:update')")
|
||||
public CommonResult<Boolean> updateActivityInfo(@Valid @RequestBody ActivityInfoSaveReqVO updateReqVO) {
|
||||
activityInfoService.updateActivityInfo(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除活动信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('promotion:activity-info:delete')")
|
||||
public CommonResult<Boolean> deleteActivityInfo(@RequestParam("id") Long id) {
|
||||
activityInfoService.deleteActivityInfo(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得活动信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:activity-info:query')")
|
||||
public CommonResult<ActivityInfoRespVO> getActivityInfo(@RequestParam("id") Long id) {
|
||||
ActivityInfoDO activityInfo = activityInfoService.getActivityInfo(id);
|
||||
return success(BeanUtils.toBean(activityInfo, ActivityInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得活动信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:activity-info:query')")
|
||||
public CommonResult<PageResult<ActivityInfoRespVO>> getActivityInfoPage(@Valid ActivityInfoPageReqVO pageReqVO) {
|
||||
PageResult<ActivityInfoDO> pageResult = activityInfoService.getActivityInfoPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ActivityInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出活动信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:activity-info:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportActivityInfoExcel(@Valid ActivityInfoPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ActivityInfoDO> list = activityInfoService.getActivityInfoPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "活动信息.xls", "数据", ActivityInfoRespVO.class,
|
||||
BeanUtils.toBean(list, ActivityInfoRespVO.class));
|
||||
}
|
||||
|
||||
// // 获得活动名称数据
|
||||
// @GetMapping("/getOrganization")
|
||||
// @Operation(summary = "获得活动名称数据")
|
||||
// public CommonResult<List<ActivityInfoDO>> getOrganization() {
|
||||
// List<ActivityInfoDO> list = ActivityInfoService.getOrganization();
|
||||
// return success(list);
|
||||
// }
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.activityinfo.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
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 ActivityInfoPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "活动标题")
|
||||
private String activityTitle;
|
||||
|
||||
@Schema(description = "活动地点")
|
||||
private String activityLocation;
|
||||
|
||||
@Schema(description = "活动主办方")
|
||||
private String organizer;
|
||||
|
||||
@Schema(description = "活动开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] startTime;
|
||||
|
||||
@Schema(description = "活动结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] endTime;
|
||||
|
||||
@Schema(description = "活动票价")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "活动状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "活动类型")
|
||||
private String activityType;
|
||||
|
||||
@Schema(description = "活动人数限制")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "已报名人数")
|
||||
private Integer registeredCount;
|
||||
|
||||
@Schema(description = "专题类型")
|
||||
private String topicType;
|
||||
|
||||
@Schema(description = "记录创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.activityinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 活动信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ActivityInfoRespVO {
|
||||
|
||||
@Schema(description = "活动唯一ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("活动唯一ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "活动标题", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("活动标题")
|
||||
private String activityTitle;
|
||||
|
||||
@Schema(description = "活动地点", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("活动地点")
|
||||
private String activityLocation;
|
||||
|
||||
@Schema(description = "活动主办方", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("活动主办方")
|
||||
private String organizer;
|
||||
|
||||
@Schema(description = "活动开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("活动开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "活动结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("活动结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "活动票价")
|
||||
@ExcelProperty("活动票价")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "活动状态")
|
||||
@ExcelProperty(value = "活动状态", converter = DictConvert.class)
|
||||
@DictFormat("promotion_activity_info_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String status;
|
||||
|
||||
@Schema(description = "活动类型")
|
||||
@ExcelProperty(value = "活动类型", converter = DictConvert.class)
|
||||
@DictFormat("promotion_activity_info_activity_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String activityType;
|
||||
|
||||
@Schema(description = "活动人数限制", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("活动人数限制")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "已报名人数")
|
||||
@ExcelProperty("已报名人数")
|
||||
private Integer registeredCount;
|
||||
|
||||
@Schema(description = "专题类型")
|
||||
@ExcelProperty(value = "专题类型", converter = DictConvert.class)
|
||||
@DictFormat("promotion_activity_info_topic_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String topicType;
|
||||
|
||||
@Schema(description = "记录创建时间")
|
||||
@ExcelProperty("记录创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.activityinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 活动信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class ActivityInfoSaveReqVO {
|
||||
|
||||
@Schema(description = "活动唯一ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "活动标题", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "活动标题不能为空")
|
||||
private String activityTitle;
|
||||
|
||||
@Schema(description = "活动地点", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "活动地点不能为空")
|
||||
private String activityLocation;
|
||||
|
||||
@Schema(description = "活动主办方", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "活动主办方不能为空")
|
||||
private String organizer;
|
||||
|
||||
@Schema(description = "活动开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "活动开始时间不能为空")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "活动结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "活动结束时间不能为空")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "活动票价")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "活动状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "活动类型")
|
||||
private String activityType;
|
||||
|
||||
@Schema(description = "活动人数限制", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "活动人数限制不能为空")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "已报名人数")
|
||||
private Integer registeredCount;
|
||||
|
||||
@Schema(description = "专题类型")
|
||||
private String topicType;
|
||||
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.registration;
|
||||
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.activityinfo.ActivityInfoDO;
|
||||
import cn.iocoder.yudao.module.promotion.service.activityinfo.ActivityInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.promotion.controller.admin.registration.vo.*;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.registration.RegistrationDO;
|
||||
import cn.iocoder.yudao.module.promotion.service.registration.RegistrationService;
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "管理后台 - 活动报名")
|
||||
@RestController
|
||||
@RequestMapping("/promotion/registration")
|
||||
@Validated
|
||||
public class RegistrationController {
|
||||
|
||||
@Resource
|
||||
private RegistrationService registrationService;
|
||||
|
||||
@Resource
|
||||
private ActivityInfoService ActivityInfoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建活动报名")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:registration:create')")
|
||||
public CommonResult<Long> createRegistration(@Valid @RequestBody RegistrationSaveReqVO createReqVO) {
|
||||
return success(registrationService.createRegistration(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新活动报名")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:registration:update')")
|
||||
public CommonResult<Boolean> updateRegistration(@Valid @RequestBody RegistrationSaveReqVO updateReqVO) {
|
||||
registrationService.updateRegistration(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除活动报名")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('promotion:registration:delete')")
|
||||
public CommonResult<Boolean> deleteRegistration(@RequestParam("id") Long id) {
|
||||
registrationService.deleteRegistration(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得活动报名")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:registration:query')")
|
||||
public CommonResult<RegistrationRespVO> getRegistration(@RequestParam("id") Long id) {
|
||||
RegistrationDO registration = registrationService.getRegistration(id);
|
||||
return success(BeanUtils.toBean(registration, RegistrationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得活动报名分页")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:registration:query')")
|
||||
// public CommonResult<PageResult<RegistrationRespVO>> getRegistrationPage(@Valid RegistrationPageReqVO pageReqVO) {
|
||||
// PageResult<RegistrationDO> pageResult = registrationService.getRegistrationPage(pageReqVO);
|
||||
// return success(BeanUtils.toBean(pageResult, RegistrationRespVO.class));
|
||||
// }
|
||||
public CommonResult<PageResult<RegistrationRespVO>> getRegistrationPage(@Valid RegistrationPageReqVO pageReqVO) {
|
||||
PageResult<RegistrationRespVO> pageResult = registrationService.getRegistrationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RegistrationRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出活动报名 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('promotion:registration:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
// public void exportRegistrationExcel(@Valid RegistrationPageReqVO pageReqVO,
|
||||
// HttpServletResponse response) throws IOException {
|
||||
// pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
// List<RegistrationDO> list = registrationService.getRegistrationPage(pageReqVO).getList();
|
||||
// // 导出 Excel
|
||||
// ExcelUtils.write(response, "活动报名.xls", "数据", RegistrationRespVO.class,
|
||||
// BeanUtils.toBean(list, RegistrationRespVO.class));
|
||||
// }
|
||||
public void exportRegistrationExcel(@Valid RegistrationPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<RegistrationRespVO> list = registrationService.getRegistrationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "活动报名.xls", "数据", RegistrationRespVO.class,
|
||||
BeanUtils.toBean(list, RegistrationRespVO.class));
|
||||
}
|
||||
|
||||
// 获得活动名称数据
|
||||
@GetMapping("/getOrganization")
|
||||
@Operation(summary = "获得活动名称数据")
|
||||
public CommonResult<List<ActivityInfoDO>> getOrganization() {
|
||||
List<ActivityInfoDO> list = ActivityInfoService.getOrganization();
|
||||
return success(list);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.registration.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 RegistrationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户姓名")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "运营平台")
|
||||
private String operationPlatform;
|
||||
|
||||
@Schema(description = "代理城市")
|
||||
private String agencyCity;
|
||||
|
||||
@Schema(description = "参会身份")
|
||||
private String attendeeIdentity;
|
||||
|
||||
@Schema(description = "报名状态")
|
||||
private String registrationStatus;
|
||||
|
||||
@Schema(description = "核销状态")
|
||||
private String verificationStatus;
|
||||
|
||||
@Schema(description = "是否付费")
|
||||
private String isPaid;
|
||||
|
||||
@Schema(description = "审核状态")
|
||||
private String reviewStatus;
|
||||
|
||||
@Schema(description = "记录创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.registration.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.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 活动报名 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class RegistrationRespVO {
|
||||
|
||||
@Schema(description = "报名唯一ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("报名唯一ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户姓名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("用户姓名")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("手机号")
|
||||
private String phoneNumber;
|
||||
|
||||
@Schema(description = "活动编号")
|
||||
@ExcelProperty("活动编号")
|
||||
private Long activityId;
|
||||
|
||||
// @Schema(description = "活动名称")
|
||||
// @ExcelProperty("活动名称")
|
||||
// private String activityName;
|
||||
@Schema(description = "活动名称")
|
||||
@ExcelProperty("活动名称")
|
||||
private String activityTitle;
|
||||
|
||||
|
||||
@Schema(description = "公司名称")
|
||||
@ExcelProperty("公司名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "职位")
|
||||
@ExcelProperty("职位")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "运营平台")
|
||||
// @ExcelProperty(value = "运营平台", converter = DictConvert.class)
|
||||
@DictFormat("promotion_registration_operation_platform") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String operationPlatform;
|
||||
|
||||
@Schema(description = "主营品类")
|
||||
// @ExcelProperty(value = "主营品类", converter = DictConvert.class)
|
||||
@DictFormat("promotion_registration_main_category") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String mainCategory;
|
||||
|
||||
@Schema(description = "代理城市")
|
||||
// @ExcelProperty(value = "代理城市", converter = DictConvert.class)
|
||||
@DictFormat("promotion_registration_agency_city") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String agencyCity;
|
||||
|
||||
@Schema(description = "产品意向")
|
||||
// @ExcelProperty(value = "产品意向", converter = DictConvert.class)
|
||||
@DictFormat("promotion_registration_product_intent") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String productIntent;
|
||||
|
||||
@Schema(description = "参会目的")
|
||||
@ExcelProperty(value = "参会目的", converter = DictConvert.class)
|
||||
@DictFormat("promotion_registration_purpose") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String purpose;
|
||||
|
||||
@Schema(description = "参会身份")
|
||||
@ExcelProperty(value = "参会身份", converter = DictConvert.class)
|
||||
@DictFormat("promotion_registration_attendee_identity") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String attendeeIdentity;
|
||||
|
||||
@Schema(description = "报名状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @ExcelProperty(value = "报名状态", converter = DictConvert.class)
|
||||
@DictFormat("promotion_registration_registration_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String registrationStatus;
|
||||
|
||||
@Schema(description = "核销码")
|
||||
@ExcelProperty("核销码")
|
||||
private String verificationCode;
|
||||
|
||||
@Schema(description = "核销状态")
|
||||
@ExcelProperty(value = "核销状态", converter = DictConvert.class)
|
||||
@DictFormat("promotion_registration_verification_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String verificationStatus;
|
||||
|
||||
@Schema(description = "是否付费")
|
||||
@ExcelProperty(value = "是否付费", converter = DictConvert.class)
|
||||
@DictFormat("promotion_registration_is_paid") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String isPaid;
|
||||
|
||||
@Schema(description = "审核状态")
|
||||
@ExcelProperty(value = "报名状态", converter = DictConvert.class)
|
||||
@DictFormat("promotion_registration_review_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String reviewStatus;
|
||||
|
||||
@Schema(description = "记录创建时间")
|
||||
@ExcelProperty("记录创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package cn.iocoder.yudao.module.promotion.controller.admin.registration.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 RegistrationSaveReqVO {
|
||||
|
||||
@Schema(description = "报名唯一ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户姓名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "用户姓名不能为空")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "手机号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "手机号不能为空")
|
||||
private String phoneNumber;
|
||||
|
||||
@Schema(description = "活动编号")
|
||||
private Long activityId;
|
||||
|
||||
@Schema(description = "公司名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "职位")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "运营平台")
|
||||
private String operationPlatform;
|
||||
|
||||
@Schema(description = "主营品类")
|
||||
private String mainCategory;
|
||||
|
||||
@Schema(description = "代理城市")
|
||||
private String agencyCity;
|
||||
|
||||
@Schema(description = "产品意向")
|
||||
private String productIntent;
|
||||
|
||||
@Schema(description = "参会目的")
|
||||
private String purpose;
|
||||
|
||||
@Schema(description = "参会身份")
|
||||
private String attendeeIdentity;
|
||||
|
||||
@Schema(description = "报名状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "报名状态不能为空")
|
||||
private String registrationStatus;
|
||||
|
||||
@Schema(description = "核销码")
|
||||
private String verificationCode;
|
||||
|
||||
@Schema(description = "核销状态")
|
||||
private String verificationStatus;
|
||||
|
||||
@Schema(description = "是否付费")
|
||||
private String isPaid;
|
||||
|
||||
@Schema(description = "审核状态")
|
||||
private String reviewStatus;
|
||||
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
package cn.iocoder.yudao.module.promotion.dal.dataobject.activityinfo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 活动信息 DO
|
||||
*
|
||||
* @author LCQ
|
||||
*/
|
||||
@TableName("promotion_activity_info")
|
||||
@KeySequence("promotion_activity_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityInfoDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 活动唯一ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 活动标题
|
||||
*/
|
||||
private String activityTitle;
|
||||
/**
|
||||
* 活动地点
|
||||
*/
|
||||
private String activityLocation;
|
||||
/**
|
||||
* 活动主办方
|
||||
*/
|
||||
private String organizer;
|
||||
/**
|
||||
* 活动开始时间
|
||||
*/
|
||||
private LocalDateTime startTime;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
/**
|
||||
* 活动票价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 活动状态
|
||||
*
|
||||
* 枚举 {@link TODO promotion_activity_info_status 对应的类}
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 活动类型
|
||||
*
|
||||
* 枚举 {@link TODO promotion_activity_info_activity_type 对应的类}
|
||||
*/
|
||||
private String activityType;
|
||||
/**
|
||||
* 活动人数限制
|
||||
*/
|
||||
private Integer capacity;
|
||||
/**
|
||||
* 已报名人数
|
||||
*/
|
||||
private Integer registeredCount;
|
||||
/**
|
||||
* 专题类型
|
||||
*
|
||||
* 枚举 {@link TODO promotion_activity_info_topic_type 对应的类}
|
||||
*/
|
||||
private String topicType;
|
||||
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package cn.iocoder.yudao.module.promotion.dal.dataobject.registration;
|
||||
|
||||
import com.sun.xml.bind.v2.TODO;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 活动报名 DO
|
||||
*
|
||||
* @author LCQ
|
||||
*/
|
||||
@TableName("promotion_registration")
|
||||
@KeySequence("promotion_registration_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RegistrationDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 报名唯一ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phoneNumber;
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String companyName;
|
||||
/**
|
||||
* 职位
|
||||
*/
|
||||
private String position;
|
||||
/**
|
||||
* 运营平台
|
||||
*
|
||||
* 枚举 {@link TODO promotion_registration_operation_platform 对应的类}
|
||||
*/
|
||||
private String operationPlatform;
|
||||
/**
|
||||
* 主营品类
|
||||
*
|
||||
* 枚举 {@link TODO promotion_registration_main_category 对应的类}
|
||||
*/
|
||||
private String mainCategory;
|
||||
/**
|
||||
* 代理城市
|
||||
*
|
||||
* 枚举 {@link TODO promotion_registration_agency_city 对应的类}
|
||||
*/
|
||||
private String agencyCity;
|
||||
/**
|
||||
* 产品意向
|
||||
*
|
||||
* 枚举 {@link TODO promotion_registration_product_intent 对应的类}
|
||||
*/
|
||||
private String productIntent;
|
||||
/**
|
||||
* 参会目的
|
||||
*
|
||||
* 枚举 {@link TODO promotion_registration_purpose 对应的类}
|
||||
*/
|
||||
private String purpose;
|
||||
/**
|
||||
* 参会身份
|
||||
*
|
||||
* 枚举 {@link TODO promotion_registration_attendee_identity 对应的类}
|
||||
*/
|
||||
private String attendeeIdentity;
|
||||
/**
|
||||
* 关联活动ID(外键关联活动表)
|
||||
*/
|
||||
private Long activityId;
|
||||
/**
|
||||
* 报名状态
|
||||
*
|
||||
* 枚举 {@link TODO promotion_registration_registration_status 对应的类}
|
||||
*/
|
||||
private String registrationStatus;
|
||||
/**
|
||||
* 核销码
|
||||
*/
|
||||
private String verificationCode;
|
||||
/**
|
||||
* 核销状态
|
||||
*
|
||||
* 枚举 {@link TODO promotion_registration_verification_status 对应的类}
|
||||
*/
|
||||
private String verificationStatus;
|
||||
/**
|
||||
* 是否付费
|
||||
*
|
||||
* 枚举 {@link TODO promotion_registration_is_paid 对应的类}
|
||||
*/
|
||||
private String isPaid;
|
||||
/**
|
||||
* 审核状态
|
||||
*
|
||||
* 枚举 {@link TODO promotion_registration_review_status 对应的类}
|
||||
*/
|
||||
private String reviewStatus;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.promotion.dal.mysql.activityinfo;
|
||||
|
||||
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.promotion.dal.dataobject.activityinfo.ActivityInfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.activityinfo.vo.*;
|
||||
|
||||
/**
|
||||
* 活动信息 Mapper
|
||||
*
|
||||
* @author LCQ
|
||||
*/
|
||||
@Mapper
|
||||
public interface ActivityInfoMapper extends BaseMapperX<ActivityInfoDO> {
|
||||
|
||||
default PageResult<ActivityInfoDO> selectPage(ActivityInfoPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ActivityInfoDO>()
|
||||
.eqIfPresent(ActivityInfoDO::getActivityTitle, reqVO.getActivityTitle())
|
||||
.eqIfPresent(ActivityInfoDO::getActivityLocation, reqVO.getActivityLocation())
|
||||
.eqIfPresent(ActivityInfoDO::getOrganizer, reqVO.getOrganizer())
|
||||
.betweenIfPresent(ActivityInfoDO::getStartTime, reqVO.getStartTime())
|
||||
.betweenIfPresent(ActivityInfoDO::getEndTime, reqVO.getEndTime())
|
||||
.eqIfPresent(ActivityInfoDO::getPrice, reqVO.getPrice())
|
||||
.eqIfPresent(ActivityInfoDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(ActivityInfoDO::getActivityType, reqVO.getActivityType())
|
||||
.eqIfPresent(ActivityInfoDO::getCapacity, reqVO.getCapacity())
|
||||
.eqIfPresent(ActivityInfoDO::getRegisteredCount, reqVO.getRegisteredCount())
|
||||
.eqIfPresent(ActivityInfoDO::getTopicType, reqVO.getTopicType())
|
||||
.betweenIfPresent(ActivityInfoDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ActivityInfoDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.promotion.dal.mysql.registration;
|
||||
|
||||
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.promotion.dal.dataobject.registration.RegistrationDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.registration.vo.*;
|
||||
|
||||
/**
|
||||
* 活动报名 Mapper
|
||||
*
|
||||
* @author LCQ
|
||||
*/
|
||||
@Mapper
|
||||
public interface RegistrationMapper extends BaseMapperX<RegistrationDO> {
|
||||
|
||||
default PageResult<RegistrationDO> selectPage(RegistrationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RegistrationDO>()
|
||||
.likeIfPresent(RegistrationDO::getUserName, reqVO.getUserName())
|
||||
.eqIfPresent(RegistrationDO::getOperationPlatform, reqVO.getOperationPlatform())
|
||||
.eqIfPresent(RegistrationDO::getAgencyCity, reqVO.getAgencyCity())
|
||||
.eqIfPresent(RegistrationDO::getAttendeeIdentity, reqVO.getAttendeeIdentity())
|
||||
.eqIfPresent(RegistrationDO::getRegistrationStatus, reqVO.getRegistrationStatus())
|
||||
// .eqIfPresent(RegistrationDO::getActivityId, reqVO.getActivityId())
|
||||
.eqIfPresent(RegistrationDO::getVerificationStatus, reqVO.getVerificationStatus())
|
||||
.eqIfPresent(RegistrationDO::getIsPaid, reqVO.getIsPaid())
|
||||
.eqIfPresent(RegistrationDO::getReviewStatus, reqVO.getReviewStatus())
|
||||
.betweenIfPresent(RegistrationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(RegistrationDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.promotion.service.activityinfo;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.activityinfo.vo.*;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.activityinfo.ActivityInfoDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 活动信息 Service 接口
|
||||
*
|
||||
* @author LCQ
|
||||
*/
|
||||
public interface ActivityInfoService {
|
||||
|
||||
|
||||
/**
|
||||
* 创建活动信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createActivityInfo(@Valid ActivityInfoSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新活动信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateActivityInfo(@Valid ActivityInfoSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除活动信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteActivityInfo(Long id);
|
||||
|
||||
/**
|
||||
* 获得活动信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 活动信息
|
||||
*/
|
||||
ActivityInfoDO getActivityInfo(Long id);
|
||||
|
||||
/**
|
||||
* 获得活动信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 活动信息分页
|
||||
*/
|
||||
PageResult<ActivityInfoDO> getActivityInfoPage(ActivityInfoPageReqVO pageReqVO);
|
||||
|
||||
|
||||
Map<Long, String> getActivityTitleMapByIds(Collection<Long> ids); // 新增方法声明
|
||||
|
||||
List<ActivityInfoDO> getOrganization();
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.promotion.service.activityinfo;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.activityinfo.vo.*;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.activityinfo.ActivityInfoDO;
|
||||
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.promotion.dal.mysql.activityinfo.ActivityInfoMapper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 活动信息 Service 实现类
|
||||
*
|
||||
* @author LCQ
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ActivityInfoServiceImpl implements ActivityInfoService {
|
||||
|
||||
@Resource
|
||||
private ActivityInfoMapper activityInfoMapper;
|
||||
|
||||
@Override
|
||||
public Long createActivityInfo(ActivityInfoSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ActivityInfoDO activityInfo = BeanUtils.toBean(createReqVO, ActivityInfoDO.class);
|
||||
activityInfoMapper.insert(activityInfo);
|
||||
// 返回
|
||||
return activityInfo.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateActivityInfo(ActivityInfoSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateActivityInfoExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ActivityInfoDO updateObj = BeanUtils.toBean(updateReqVO, ActivityInfoDO.class);
|
||||
activityInfoMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteActivityInfo(Long id) {
|
||||
// 校验存在
|
||||
validateActivityInfoExists(id);
|
||||
// 删除
|
||||
activityInfoMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateActivityInfoExists(Long id) {
|
||||
if (activityInfoMapper.selectById(id) == null) {
|
||||
throw exception(ACTIVITY_INFO_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivityInfoDO getActivityInfo(Long id) {
|
||||
return activityInfoMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ActivityInfoDO> getActivityInfoPage(ActivityInfoPageReqVO pageReqVO) {
|
||||
return activityInfoMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
|
||||
public Map<Long, String> getActivityTitleMapByIds(Collection<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return Collections.emptyMap(); // 返回空 Map,避免生成无效 SQL
|
||||
}
|
||||
List<ActivityInfoDO> activities = activityInfoMapper.selectBatchIds(ids);
|
||||
return activities.stream()
|
||||
.collect(Collectors.toMap(ActivityInfoDO::getId, ActivityInfoDO::getActivityTitle));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActivityInfoDO> getOrganization() {
|
||||
return activityInfoMapper.selectList();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.promotion.service.registration;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.registration.vo.*;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.registration.RegistrationDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 活动报名 Service 接口
|
||||
*
|
||||
* @author LCQ
|
||||
*/
|
||||
public interface RegistrationService {
|
||||
|
||||
/**
|
||||
* 创建活动报名
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createRegistration(@Valid RegistrationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新活动报名
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRegistration(@Valid RegistrationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除活动报名
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRegistration(Long id);
|
||||
|
||||
/**
|
||||
* 获得活动报名
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 活动报名
|
||||
*/
|
||||
RegistrationDO getRegistration(Long id);
|
||||
|
||||
/**
|
||||
* 获得活动报名分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 活动报名分页
|
||||
*/
|
||||
// PageResult<RegistrationDO> getRegistrationPage(RegistrationPageReqVO pageReqVO);
|
||||
|
||||
|
||||
// 原方法返回PageResult<RegistrationDO>,改为返回PageResult<RegistrationRespVO>
|
||||
PageResult<RegistrationRespVO> getRegistrationPage(RegistrationPageReqVO pageReqVO);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
package cn.iocoder.yudao.module.promotion.service.registration;
|
||||
|
||||
import cn.iocoder.yudao.module.promotion.service.activityinfo.ActivityInfoService;
|
||||
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 java.util.stream.Collectors;
|
||||
|
||||
import cn.iocoder.yudao.module.promotion.controller.admin.registration.vo.*;
|
||||
import cn.iocoder.yudao.module.promotion.dal.dataobject.registration.RegistrationDO;
|
||||
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.promotion.dal.mysql.registration.RegistrationMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.promotion.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 活动报名 Service 实现类
|
||||
*
|
||||
* @author LCQ
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RegistrationServiceImpl implements RegistrationService {
|
||||
|
||||
@Resource
|
||||
private RegistrationMapper registrationMapper;
|
||||
|
||||
@Resource
|
||||
private ActivityInfoService activityInfoService; // 新增注入
|
||||
|
||||
@Override
|
||||
public Long createRegistration(RegistrationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
RegistrationDO registration = BeanUtils.toBean(createReqVO, RegistrationDO.class);
|
||||
registrationMapper.insert(registration);
|
||||
// 返回
|
||||
return registration.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRegistration(RegistrationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRegistrationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
RegistrationDO updateObj = BeanUtils.toBean(updateReqVO, RegistrationDO.class);
|
||||
registrationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRegistration(Long id) {
|
||||
// 校验存在
|
||||
validateRegistrationExists(id);
|
||||
// 删除
|
||||
registrationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateRegistrationExists(Long id) {
|
||||
if (registrationMapper.selectById(id) == null) {
|
||||
throw exception(REGISTRATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegistrationDO getRegistration(Long id) {
|
||||
return registrationMapper.selectById(id);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public PageResult<RegistrationDO> getRegistrationPage(RegistrationPageReqVO pageReqVO) {
|
||||
// return registrationMapper.selectPage(pageReqVO);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public PageResult<RegistrationRespVO> getRegistrationPage(RegistrationPageReqVO pageReqVO) {
|
||||
// 1. 查询原始DO分页数据
|
||||
PageResult<RegistrationDO> pageResult = registrationMapper.selectPage(pageReqVO);
|
||||
|
||||
// 2. 提取所有活动ID并查询对应标题
|
||||
Set<Long> activityIds = pageResult.getList().stream()
|
||||
.map(RegistrationDO::getActivityId)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
Map<Long, String> activityTitleMap = activityInfoService.getActivityTitleMapByIds(activityIds); // 依赖注入ActivityInfoService
|
||||
|
||||
// 3. 转换DO到RespVO并填充活动名称
|
||||
List<RegistrationRespVO> respList = pageResult.getList().stream()
|
||||
.map(registrationDO -> {
|
||||
RegistrationRespVO respVO = BeanUtils.toBean(registrationDO, RegistrationRespVO.class);
|
||||
// 填充活动名称
|
||||
respVO.setActivityTitle(
|
||||
activityTitleMap.get(registrationDO.getActivityId())
|
||||
);
|
||||
return respVO;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 4. 返回新的RespVO分页结果
|
||||
return new PageResult<>(respList, pageResult.getTotal());
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.promotion.dal.mysql.registration.RegistrationMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user