This commit is contained in:
XinWei 2024-10-22 22:56:13 +08:00
commit 1d50394776
38 changed files with 1340 additions and 545 deletions

View File

@ -0,0 +1,51 @@
import request from '@/config/axios'
// 预约项目 VO
export interface ProjectVO {
id: number // ID
brandId: number // 所属门店
name: string // 项目名称
pictrue: string // 项目图片
content: string // 项目简介
status: number // 状态
timeInterval: string // 可预约日期
brandName: string
}
// 预约项目 API
export const ProjectApi = {
// 查询预约项目分页
getProjectPage: async (params: any) => {
return await request.get({ url: `/subscribe/project/page`, params })
},
// 查询预约项目详情
getProject: async (id: number) => {
return await request.get({ url: `/subscribe/project/get?id=` + id })
},
// 新增预约项目
createProject: async (data: ProjectVO) => {
return await request.post({ url: `/subscribe/project/create`, data })
},
// 修改预约项目
updateProject: async (data: ProjectVO) => {
return await request.put({ url: `/subscribe/project/update`, data })
},
// 删除预约项目
deleteProject: async (id: number) => {
return await request.delete({ url: `/subscribe/project/delete?id=` + id })
},
// 导出预约项目 Excel
exportProject: async (params) => {
return await request.download({ url: `/subscribe/project/export-excel`, params })
},
getProjectName: async () => {
return await request.get({ url: `/subscribe/project/getProjectName` })
},
}

View File

@ -3,16 +3,11 @@ import request from '@/config/axios'
// 人员管理 VO
export interface LitemallTechnicianVO {
id: number // id
techSn: string // 人员编号
type: number // 人员类型
technicianName: string // 人员名称
brandId: number // 门店id
brandName: string
sex: number // 性别
projectId: number // 项目id
brandName: string //项目名称
photo: string // 照片
serviceTime: string // 服务时间段
serviceScope: string // 服务范围
phone: string // 手机号
ym: number // 约满标记
status: number // 状态
content: string // 介绍

View File

@ -124,6 +124,8 @@ export enum DICT_TYPE {
TECHNICIAN_STATUS = 'technician_status',
SEX = 'sex',
//预约:项目
SUBSCRIBE_PROJECT_STATUS = 'subscribe_project_status',
//预约:人员管理
STALL_SEX = 'stall_sex',

View File

@ -96,6 +96,8 @@ const open = async (type: string, id?: number) => {
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {

View File

@ -0,0 +1,161 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="50%">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="门店" prop="brandId">
<!-- <el-input v-model="formData.brandId" placeholder="请输入门店id" />-->
<el-select v-model="formData.brandId" placeholder="请选择门店" clearable class="!w-240px">
<el-option v-for="organizationNameOptions in option" :key="organizationNameOptions.id"
:label="organizationNameOptions.name" :value="organizationNameOptions.id" />
</el-select>
</el-form-item>
<el-form-item label="项目名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入项目名称" />
</el-form-item>
<el-form-item label="项目图片" prop="pictrue">
<UploadImg v-model="formData.pictrue" />
</el-form-item>
<el-form-item label="项目简介" prop="content">
<Editor v-model="formData.content" height="150px" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="formData.status" placeholder="请选择状态">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.SUBSCRIBE_PROJECT_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="可预约日期" prop="timeInterval">
<!-- <el-input v-model="formData.timeInterval" placeholder="请输入可预约日期" /> -->
<el-date-picker
v-model="formData.timeInterval"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</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 { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import { ProjectApi, ProjectVO } from '@/api/subscribe/project'
import { LitemallBrandApi, LitemallBrandVO } from '@/api/subscribe/brand'
/** 预约项目 表单 */
defineOptions({ name: 'ProjectForm' })
const { t } = useI18n() //
const message = useMessage() //
const option = ref<LitemallBrandVO[]>([]);
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
brandId: undefined,
name: undefined,
pictrue: undefined,
content: undefined,
status: undefined,
timeInterval: '',
})
const formRules = reactive({
brandId: [{ required: true, message: '所属门店不能为空', trigger: 'blur' }],
name: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }],
pictrue: [{ required: true, message: '项目图片不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'change' }],
timeInterval: [{ 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 ProjectApi.getProject(id)
formData.value.timeInterval = JSON.parse(formData.value.timeInterval)
console.log('11111111111',formData.value)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
formData.value.timeInterval = JSON.stringify(formData.value.timeInterval);
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as ProjectVO
if (formType.value === 'create') {
await ProjectApi.createProject(data)
message.success(t('common.createSuccess'))
} else {
await ProjectApi.updateProject(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
//
const getOrganizations = async () => {
try {
option.value = await LitemallBrandApi.getOrganizations()
} finally {
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
brandId: undefined,
name: undefined,
pictrue: undefined,
content: undefined,
status: undefined,
timeInterval: '',
}
formRef.value?.resetFields()
}
/** 初始化 **/
onMounted(() => {
getOrganizations()
})
</script>

View File

@ -0,0 +1,209 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
<el-form-item label="所属门店" prop="brandId">
<el-select v-model="queryParams.brandId" placeholder="请选择门店" clearable class="!w-240px">
<el-option v-for="organizationNameOptions in option" :key="organizationNameOptions.id"
:label="organizationNameOptions.name" :value="organizationNameOptions.id" />
</el-select>
</el-form-item>
<el-form-item label="项目名称" prop="name">
<el-input v-model="queryParams.name" 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 getIntDictOptions(DICT_TYPE.SUBSCRIBE_PROJECT_STATUS)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="可预约日期" prop="timeInterval">
<el-input v-model="queryParams.timeInterval" placeholder="请输入可预约日期" clearable @keyup.enter="handleQuery"
class="!w-240px" />
</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="['subscribe:project:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button type="success" plain @click="handleExport" :loading="exportLoading"
v-hasPermi="['subscribe:project: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="brandName" />
<el-table-column label="项目名称" align="center" prop="name" />
<!-- <el-table-column label="项目图片" align="center" prop="pictrue" /> -->
<el-table-column label="照片" align="center" prop="pictrue">
<template #default="{ row }">
<div class="flex" style="display: flex; align-items: center;">
<el-image fit="cover" :src="row.pictrue" class="flex-none w-50px h-50px"
@click="imagePreview(row.pictrue)" />
</div>
</template>
</el-table-column>
<!-- <el-table-column label="项目简介" align="center" prop="content" /> -->
<el-table-column label="介绍" align="center" prop="content">
<template #default="scope">
<div v-html="scope.row.content"></div>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<dict-tag :type="DICT_TYPE.SUBSCRIBE_PROJECT_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="可预约日期" align="center" prop="timeInterval" />
<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="['subscribe:project:update']">
编辑
</el-button>
<el-button link type="danger" @click="handleDelete(scope.row.id)"
v-hasPermi="['subscribe:project: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>
<!-- 表单弹窗添加/修改 -->
<ProjectForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { ProjectApi, ProjectVO } from '@/api/subscribe/project'
import ProjectForm from './ProjectForm.vue'
import { LitemallBrandApi, LitemallBrandVO } from '@/api/subscribe/brand'
/** 预约项目 列表 */
defineOptions({ name: 'Project' })
const message = useMessage() //
const { t } = useI18n() //
const option = ref<LitemallBrandVO[]>([]);
const loading = ref(true) //
const list = ref<ProjectVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
brandId: undefined,
name: undefined,
pictrue: undefined,
content: undefined,
status: undefined,
timeInterval: undefined,
createTime: [],
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await ProjectApi.getProjectPage(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 getOrganization = async () => {
loading.value = true
try {
option.value = await LitemallBrandApi.getOrganizations()
} finally {
loading.value = false
}
}
const imagePreview = (imgUrl : string) => {
createImageViewer({
urlList: [imgUrl]
})
}
/** 删除按钮操作 */
const handleDelete = async (id : number) => {
try {
//
await message.delConfirm()
//
await ProjectApi.deleteProject(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await ProjectApi.exportProject(queryParams)
download.excel(data, '预约项目.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
getOrganization()
})
</script>

View File

@ -1,31 +1,14 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading">
<!-- <el-form-item label="人员编号" prop="techSn">-->
<!-- <el-input v-model="formData.techSn" placeholder="请输入人员编号" />-->
<!-- </el-form-item>-->
<el-form-item label="人员类型" prop="type">
<el-select v-model="formData.type" placeholder="请选择人员类型">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.TYPES)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="人员名称" prop="technicianName">
<el-input v-model="formData.technicianName" placeholder="请输入人员名称" />
</el-form-item>
<el-form-item label="门店" prop="brandId">
<!-- <el-input v-model="formData.brandId" placeholder="请输入门店id" />-->
<el-select v-model="formData.brandId" placeholder="请选择门店" clearable class="!w-240px">
<el-form-item label="项目" prop="projectId">
<el-select v-model="formData.projectId" placeholder="请选择项目" clearable class="!w-240px">
<el-option v-for="organizationNameOptions in option" :key="organizationNameOptions.id"
:label="organizationNameOptions.name" :value="organizationNameOptions.id" />
</el-select>
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-select v-model="formData.sex" placeholder="请选择性别">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.SEX)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="照片" prop="photo">
<UploadImg v-model="formData.photo" />
</el-form-item>
@ -52,12 +35,7 @@
<el-form-item label="服务范围" prop="serviceScope">
<el-input v-model="formData.serviceScope" placeholder="请输入服务范围" />
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input v-model="formData.phone" placeholder="请输入手机号" />
</el-form-item>
<!-- <el-form-item label="约满标记" prop="ym">-->
<!-- <el-input v-model="formData.ym" placeholder="请输入约满标记" />-->
<!-- </el-form-item>-->
<el-form-item label="状态" prop="status">
<el-select v-model="formData.status" placeholder="请选择状态">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.TECHNICIAN_STATUS)" :key="dict.value"
@ -80,30 +58,24 @@
<script setup lang="ts">
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import { LitemallTechnicianApi, LitemallTechnicianVO } from '@/api/subscribe/technician'
import { LitemallBrandApi, LitemallBrandVO } from '@/api/subscribe/brand'
import { ProjectApi, ProjectVO } from '@/api/subscribe/project'
/** 人员管理 表单 */
defineOptions({ name: 'LitemallTechnicianForm' })
const { t } = useI18n() //
const message = useMessage() //
const option = ref<LitemallBrandVO[]>([]);
const option = ref<ProjectVO[]>([]);
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
// techSn: undefined,
type: undefined,
technicianName: undefined,
brandId: undefined,
sex: undefined,
projectId: undefined,
photo: undefined,
serviceTime: '',
serviceTimeArray: [{}],
serviceScope: undefined,
phone: undefined,
// ym: undefined,
status: undefined,
content: undefined,
remark: undefined,
@ -130,9 +102,9 @@
};
//
const getOrganizations = async () => {
const getProjectName = async () => {
try {
option.value = await LitemallBrandApi.getOrganizations()
option.value = await ProjectApi.getProjectName()
} finally {
}
@ -195,16 +167,10 @@
const resetForm = () => {
formData.value = {
id: undefined,
// techSn: undefined,
type: undefined,
technicianName: undefined,
brandId: undefined,
sex: undefined,
projectId: undefined,
photo: undefined,
serviceTime: '',
serviceScope: undefined,
phone: undefined,
// ym: undefined,
status: undefined,
content: undefined,
remark: undefined,
@ -215,7 +181,7 @@
/** 初始化 **/
onMounted(() => {
getOrganizations()
getProjectName()
})
</script>
<style>

View File

@ -1,166 +1,57 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="人员编号" prop="techSn">
<el-input
v-model="queryParams.techSn"
placeholder="请输入人员编号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
<!-- <el-form-item label="人员编号" prop="techSn">
<el-input v-model="queryParams.techSn" placeholder="请输入人员编号" clearable @keyup.enter="handleQuery"
class="!w-240px" />
</el-form-item>
<el-form-item label="人员类型" prop="type">
<el-select
v-model="queryParams.type"
placeholder="请选择人员类型"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TYPES)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<el-select v-model="queryParams.type" placeholder="请选择人员类型" clearable class="!w-240px">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.TYPES)" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="人员名称" prop="technicianName">
<el-input
v-model="queryParams.technicianName"
placeholder="请输入人员名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-input v-model="queryParams.technicianName" placeholder="请输入人员名称" clearable
@keyup.enter="handleQuery" class="!w-240px" />
</el-form-item> -->
<el-form-item label="所属门店" prop="brandId">
<!-- <el-input-->
<!-- v-model="queryParams.brandId"-->
<!-- placeholder="请输入门店id"-->
<!-- clearable-->
<!-- @keyup.enter="handleQuery"-->
<!-- class="!w-240px"-->
<!-- />-->
<el-select
v-model="queryParams.brandId"
placeholder="请选择门店"
clearable
class="!w-240px"
>
<el-option
v-for="organizationNameOptions in option"
:key="organizationNameOptions.id"
:label="organizationNameOptions.name"
:value="organizationNameOptions.id"
/>
<el-select v-model="queryParams.brandId" placeholder="请选择门店" clearable class="!w-240px">
<el-option v-for="organizationNameOptions in option" :key="organizationNameOptions.id"
:label="organizationNameOptions.name" :value="organizationNameOptions.id" />
</el-select>
</el-form-item>
<!-- <el-form-item label="性别" prop="sex">-->
<!-- <el-select-->
<!-- v-model="queryParams.sex"-->
<!-- placeholder="请选择性别"-->
<!-- clearable-->
<!-- class="!w-240px"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="dict in getIntDictOptions(DICT_TYPE.SEX)"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="服务时间段" prop="serviceTime">-->
<!-- <el-date-picker-->
<!-- v-model="queryParams.serviceTime"-->
<!-- 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="serviceScope">-->
<!-- <el-input-->
<!-- v-model="queryParams.serviceScope"-->
<!-- placeholder="请输入服务范围"-->
<!-- clearable-->
<!-- @keyup.enter="handleQuery"-->
<!-- class="!w-240px"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="手机号" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入手机号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<!-- <el-form-item label="约满标记" prop="ym">-->
<!-- <el-input-->
<!-- v-model="queryParams.ym"-->
<!-- placeholder="请输入约满标记"-->
<!-- clearable-->
<!-- @keyup.enter="handleQuery"-->
<!-- class="!w-240px"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="手机号" prop="phone">
<el-input v-model="queryParams.phone" 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 getIntDictOptions(DICT_TYPE.TECHNICIAN_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.TECHNICIAN_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-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="['subscribe:litemall-technician:create']"
>
<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="['subscribe:litemall-technician:create']">
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['subscribe:litemall-technician:export']"
>
<el-button type="success" plain @click="handleExport" :loading="exportLoading"
v-hasPermi="['subscribe:litemall-technician:export']">
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
@ -171,34 +62,29 @@
<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="techSn" />
<!-- <el-table-column label="人员编号" align="center" prop="techSn" />
<el-table-column label="人员类型" align="center" prop="type">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TYPES" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column label="人员名称" align="center" prop="technicianName" />
<el-table-column label="门店" align="center" prop="brandName" />
<el-table-column label="性别" align="center" prop="sex">
<el-table-column label="人员名称" align="center" prop="technicianName" /> -->
<el-table-column label="归属项目" align="center" prop="brandName" />
<!-- <el-table-column label="性别" align="center" prop="sex">
<template #default="scope">
<dict-tag :type="DICT_TYPE.SEX" :value="scope.row.sex" />
</template>
</el-table-column>
<el-table-column label="照片" align="center" prop="photo" >
</el-table-column> -->
<el-table-column label="图片" align="center" prop="photo">
<template #default="{ row }">
<div class="flex">
<el-image
fit="cover"
:src="row.photo"
class="flex-none w-50px h-50px"
@click="imagePreview(row.photo)"
/>
<el-image fit="cover" :src="row.photo" class="flex-none w-50px h-50px"
@click="imagePreview(row.photo)" />
</div>
</template>
</el-table-column>
<el-table-column label="服务时间段" align="center" prop="serviceTimeArray" width="200" />
<el-table-column label="服务范围" align="center" prop="serviceScope" />
<el-table-column label="手机号" align="center" prop="phone" />
<el-table-column label="约满标记" align="center" prop="ym" />
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
@ -211,41 +97,23 @@
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="dateFormatter" width="180px" />
<el-table-column label="操作" align="center" fixed="right" width="110">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['subscribe:litemall-technician:update']"
>
<el-button link type="primary" @click="openForm('update', scope.row.id)"
v-hasPermi="['subscribe:litemall-technician:update']">
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['subscribe:litemall-technician:delete']"
>
<el-button link type="danger" @click="handleDelete(scope.row.id)"
v-hasPermi="['subscribe:litemall-technician:delete']">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize"
@pagination="getList" />
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
@ -259,13 +127,13 @@ import download from '@/utils/download'
import { LitemallTechnicianApi, LitemallTechnicianVO } from '@/api/subscribe/technician'
import LitemallTechnicianForm from './LitemallTechnicianForm.vue'
import { createImageViewer } from "@/components/ImageViewer";
import { LitemallBrandApi, LitemallBrandVO } from '@/api/subscribe/brand'
import { ProjectApi, ProjectVO } from '@/api/subscribe/project'
/** 人员管理 列表 */
defineOptions({ name: 'LitemallTechnician' })
const message = useMessage() //
const { t } = useI18n() //
const option = ref<LitemallBrandVO[]>([]);
const option = ref<ProjectVO[]>([]);
const loading = ref(true) //
const list = ref<LitemallTechnicianVO[]>([]) //
const total = ref(0) //
@ -304,11 +172,11 @@ const getList = async () => {
}
//
const getOrganization = async () => {
//
const getProjectName = async () => {
loading.value = true
try {
option.value = await LitemallBrandApi.getOrganizations()
option.value = await ProjectApi.getProjectName()
} finally {
loading.value = false
}
@ -367,6 +235,6 @@ const handleExport = async () => {
/** 初始化 **/
onMounted(() => {
getList()
getOrganization()
getProjectName()
})
</script>

View File

@ -41,7 +41,7 @@ public class PaidMemberOrderController {
@PostMapping("/create")
@Operation(summary = "创建付费会员订单")
@PreAuthorize("@ss.hasPermission('member:paid-member-order:create')")
public CommonResult<Integer> createPaidMemberOrder(@Valid @RequestBody PaidMemberOrderSaveReqVO createReqVO) {
public CommonResult<Long> createPaidMemberOrder(@Valid @RequestBody PaidMemberOrderSaveReqVO createReqVO) {
return success(paidMemberOrderService.createPaidMemberOrder(createReqVO));
}

View File

@ -34,11 +34,15 @@ public class AppMemberCardTypeController {
@GetMapping("/list")
@Operation(summary = "获得会员卡类型列表")
public CommonResult<List<AppMemberCardTypeRespVO>> list() {
public CommonResult<List<AppMemberCardTypeRespVO>> list(@RequestParam(value = "name", required = false) String name) {
/** 查询状态为启用的会员卡类型列表 */
MemberUserDO memberUserDO = userService.getUser(getLoginUserId());
/** 根据用户查询是否有试用会员的类型列表 */
List<PaidMemberCardTypeDO> list = cardService.getCardTypeList(memberUserDO.getActivate());
if(!name.isEmpty()){
//根据用户查询是否有有效期会员的类型列表
list = cardService.getCardTypeList2(memberUserDO.getActivate(),name);
}
return success(MemberCardTypeConvert.INSTANCE.convertList(list));
}

View File

@ -12,8 +12,7 @@ public interface PaidMemberOrderConvert {
PaidMemberOrderConvert INSTANCE = Mappers.getMapper(PaidMemberOrderConvert.class);
PaidMemberOrderDO convert(Long uid, String cardName, Integer type,
String payChannel, BigDecimal price, LocalDateTime payTime,
PaidMemberOrderDO convert(Long uid, String cardName, Integer type, BigDecimal price, LocalDateTime payTime,
String deadlineDay,LocalDateTime cardExpirationTime,BigDecimal originalPrice);
}

View File

@ -32,7 +32,7 @@ public class PaidMemberOrderDO extends TenantBaseDO {
* 编号
*/
@TableId
private Integer id;
private Long id;
/**
* 用户UID
*/

View File

@ -38,4 +38,7 @@ public interface PaidMemberCardTypeMapper extends BaseMapperX<PaidMemberCardType
.neIfPresent(PaidMemberCardTypeDO::getName,"试用")
.orderByAsc(PaidMemberCardTypeDO::getId));
}
}

View File

@ -63,11 +63,13 @@ public interface PaidMemberCardTypeService {
List<PaidMemberCardTypeDO> getCardTypeList (Integer activate);
/**
* 根据发起的订单type确定试用有效期永久的会员卡
* @param type
* 根据用户是否使用有效期会员
* 查询会员类型列表
* @param activate
* @return
*/
PaidMemberCardTypeDO selectMemberCardType(Integer type, BigDecimal price);
List<PaidMemberCardTypeDO> getCardTypeList2 (Integer activate,String name);
/**

View File

@ -93,25 +93,20 @@ public class PaidMemberCardTypeServiceImpl implements PaidMemberCardTypeService
}
@Override
public PaidMemberCardTypeDO selectMemberCardType(Integer type, BigDecimal price) {
PaidMemberCardTypeDO paidMemberCardTypeDO = new PaidMemberCardTypeDO();
PaidMemberUserDO paidMemberUserDO = paidMemberUserService01.getMemberUser(getLoginUserId());
if(type == 0){
paidMemberCardTypeDO =cardMapper.selectOne(new LambdaQueryWrapperX<PaidMemberCardTypeDO>()
.eqIfPresent(PaidMemberCardTypeDO::getName,"试用"));
} else if (type == 1 && paidMemberUserDO == null) {
paidMemberCardTypeDO =cardMapper.selectOne(new LambdaQueryWrapperX<PaidMemberCardTypeDO>()
.eqIfPresent(PaidMemberCardTypeDO::getOriginalPrice,price));
} else if (type == 1 && paidMemberUserDO != null) {
paidMemberCardTypeDO =cardMapper.selectOne(new LambdaQueryWrapperX<PaidMemberCardTypeDO>()
.eqIfPresent(PaidMemberCardTypeDO::getSpecialPrice,price));
} else if (type == 2) {
paidMemberCardTypeDO =cardMapper.selectOne(new LambdaQueryWrapperX<PaidMemberCardTypeDO>()
.eqIfPresent(PaidMemberCardTypeDO::getName,"永久"));
public List<PaidMemberCardTypeDO> getCardTypeList2(Integer activate,String name) {
List<PaidMemberCardTypeDO> list = new ArrayList<>();
Integer status = 1;
if (activate == 2){
list = cardMapper.selectList(new LambdaQueryWrapperX<PaidMemberCardTypeDO>()
.eqIfPresent(PaidMemberCardTypeDO::getStatus,status)
.neIfPresent(PaidMemberCardTypeDO::getName,name)
.neIfPresent(PaidMemberCardTypeDO::getName,"试用")
.orderByAsc(PaidMemberCardTypeDO::getId));
}
return paidMemberCardTypeDO;
return list;
}
@Override
public PaidMemberCardTypeDO selectByName(String cardName) {
PaidMemberCardTypeDO paidMemberCardTypeDO = cardMapper.selectOne(new LambdaQueryWrapperX<PaidMemberCardTypeDO>()

View File

@ -23,7 +23,7 @@ public interface PaidMemberOrderService {
* @param createReqVO 创建信息
* @return 编号
*/
Integer createPaidMemberOrder(@Valid PaidMemberOrderSaveReqVO createReqVO);
Long createPaidMemberOrder(@Valid PaidMemberOrderSaveReqVO createReqVO);
/**
* 更新付费会员订单
@ -61,7 +61,7 @@ public interface PaidMemberOrderService {
* @return 编号
*/
BigDecimal createMemberRecord(Long userId, Integer userType, String userIp,
BigDecimal price, Integer type);
Integer type,String cardName);
/**
* 创建付费会员订单
@ -84,4 +84,10 @@ public interface PaidMemberOrderService {
*/
LocalDateTime getDeadLineDay(String cardName);
/**
* 根据id获取对应的会员订单
*/
PaidMemberOrderDO getPaidMemeberOrder(Long id);
}

View File

@ -4,6 +4,7 @@ import cn.iocoder.yudao.module.member.dal.dataobject.membercardtype.PaidMemberCa
import cn.iocoder.yudao.module.member.dal.dataobject.user.PaidMemberUserDO;
import cn.iocoder.yudao.module.member.service.membercardtype.PaidMemberCardTypeService;
import cn.iocoder.yudao.module.member.service.user.PaidMemberUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@ -32,6 +33,7 @@ import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
*/
@Service
@Validated
@Slf4j
public class PaidMemberOrderServiceImpl implements PaidMemberOrderService {
@Resource
@ -44,7 +46,7 @@ public class PaidMemberOrderServiceImpl implements PaidMemberOrderService {
private PaidMemberUserService paidMemberUserService;
@Override
public Integer createPaidMemberOrder(PaidMemberOrderSaveReqVO createReqVO) {
public Long createPaidMemberOrder(PaidMemberOrderSaveReqVO createReqVO) {
// 插入
PaidMemberOrderDO paidMemberOrder = BeanUtils.toBean(createReqVO, PaidMemberOrderDO.class);
paidMemberOrderMapper.insert(paidMemberOrder);
@ -87,14 +89,14 @@ public class PaidMemberOrderServiceImpl implements PaidMemberOrderService {
@Override
public BigDecimal createMemberRecord(Long userId, Integer userType, String userIp,
BigDecimal price, Integer type) {
Integer type, String cardName) {
//定义一个支付金额
BigDecimal payPrice = null;
BigDecimal gitBalance = BigDecimal.valueOf(0);//赠送余额权益规则还未定
if(Objects.nonNull(type)){
PaidMemberUserDO paidMemberUserDO = paidMemberUserService.getMemberUser(getLoginUserId());
PaidMemberCardTypeDO paidMemberCardTypeDO =typeService.selectMemberCardType(type,price);
PaidMemberCardTypeDO paidMemberCardTypeDO =typeService.selectByName(cardName);
if(paidMemberCardTypeDO.getName().equals("试用")){
payPrice = paidMemberCardTypeDO.getOriginalPrice();
}else if (paidMemberUserDO != null){
@ -135,4 +137,14 @@ public class PaidMemberOrderServiceImpl implements PaidMemberOrderService {
return deadlineDay;
}
@Override
public PaidMemberOrderDO getPaidMemeberOrder(Long id) {
PaidMemberOrderDO paidMemberOrderDO = paidMemberOrderMapper.selectById(id);
if (paidMemberOrderDO == null){
log.error("[getPaidMemeberOrder][会员支付订单记录不存在,会员支付订单记录 id({})]",id);
throw exception(PAID_MEMBER_ORDER_NOT_EXISTS);
}
return paidMemberOrderDO;
}
}

View File

@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
//import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
import cn.iocoder.yudao.module.member.controller.admin.user.vo.PaidMemberUserSaveReqVO;
import cn.iocoder.yudao.module.member.convert.order.PaidMemberOrderConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.order.PaidMemberOrderDO;
@ -14,10 +15,13 @@ import cn.iocoder.yudao.module.member.service.membercardtype.PaidMemberCardTypeS
import cn.iocoder.yudao.module.member.service.order.PaidMemberOrderService;
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
import cn.iocoder.yudao.module.member.service.user.PaidMemberUserService;
import cn.iocoder.yudao.module.pay.api.notify.dto.PayOrderNotifyReqDTO;
import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderCreateReqDTO;
import cn.iocoder.yudao.module.pay.controller.app.member.vo.AppPaidMemberOrderReqVO;
import cn.iocoder.yudao.module.pay.controller.app.member.vo.AppPaidMemberOrderRespVO;
import cn.iocoder.yudao.module.pay.controller.app.member.vo.AppPaidMemeberOrderReqDto;
import cn.iocoder.yudao.module.pay.convert.member.PayMemberOrderConvert;
import cn.iocoder.yudao.module.pay.dal.dataobject.order.PayOrderDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletTransactionDO;
import cn.iocoder.yudao.module.pay.service.order.PayOrderService;
@ -30,17 +34,23 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.time.Duration;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.addTime;
import static cn.iocoder.yudao.framework.common.util.servlet.ServletUtils.getClientIP;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.getLoginUserType;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.PAID_MEMBER_ORDER_NOT_EXISTS;
import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.WALLET_BALANCE_NOT_ENOUGH;
import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.WALLET_NOT_FOUND;
import static cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum.PAYMENT;
@Tag(name = "用户 APP - 会员支出")
@RestController
@ -67,6 +77,8 @@ public class AppPaidMembeOrderController {
@Resource
private PaidMemberCardTypeService cardService;
@Resource
private PayWalletService payWalletService;
@PostMapping("/create")
@ -75,8 +87,15 @@ public class AppPaidMembeOrderController {
MemberUserDO memberUserDO = userService1.getUser(getLoginUserId());
PaidMemberUserSaveReqVO paidMemberUserSaveReqVO = new PaidMemberUserSaveReqVO();
// 判断当前用户是否选择过试用会员
if(memberUserDO.getActivate() == 0 && memberUserDO != null){
if(memberUserDO.getActivate() == 0 && memberUserDO != null && reqVO.getCardName().equals("试用")){
//试用会员
memberUserDO.setActivate(CommonStatusEnum.DISABLE.getStatus());
}else if(reqVO.getCardName().equals("永久")){
//永久会员
memberUserDO.setActivate(3);
}else {
//有效期会员
memberUserDO.setActivate(2);
}
// 若不是会员则往会员表插入数据
if(memberUserService1.getMemberUser(memberUserDO.getId()) == null){
@ -99,14 +118,14 @@ public class AppPaidMembeOrderController {
//获得支付金额
BigDecimal payPrice = paidMemberOrderService1.createMemberRecord(getLoginUserId(),
getLoginUserType(),getClientIP(),reqVO.getPrice(),reqVO.getType());
getLoginUserType(),getClientIP(),reqVO.getType(),reqVO.getCardName());
BigDecimal p = payPrice.multiply(new BigDecimal("100"));
Integer payPriceInt = p.intValue();
BigDecimal originalPrice = cardService.selectByName(reqVO.getCardName()).getOriginalPrice();
// PayWalletDO walletDO = memberWalletService.getOrCreateWallet(getLoginUserId(),getLoginUserType());
//订单对象赋值
PaidMemberOrderDO paidMemberOrderDO = PaidMemberOrderConvert.INSTANCE.convert(getLoginUserId(),
reqVO.getCardName(),reqVO.getType(),reqVO.getPayChannel(),reqVO.getPrice(),payTime,deadlineDay,cardExpirationTime,originalPrice);
reqVO.getCardName(),reqVO.getType(),payPrice,payTime,deadlineDay,cardExpirationTime,originalPrice);
paidMemberOrderService1.createOrder(paidMemberOrderDO);
Long payOrderId = payOrderService01.createOrder(new PayOrderCreateReqDTO()
.setAppId(1L).setUserIp(getClientIP())
@ -117,6 +136,41 @@ public class AppPaidMembeOrderController {
paidMemberOrderDO.setPayOrderId(payOrderId);
userService1.updateUserDo(memberUserDO);
paidMemberOrderService1.updateOrder(paidMemberOrderDO);
return success(PayMemberOrderConvert.INSTANCE.convert(paidMemberOrderDO));
return success(PayMemberOrderConvert.INSTANCE.convert(paidMemberOrderDO.getId(),paidMemberOrderDO.getPayOrderId()
,paidMemberOrderDO.getCardExpirationTime(),memberUserDO.getActivate()));
}
@PostMapping("/update")
@Operation(summary = "更新会员订单未支付为已支付") // pay-module 支付服务进行回调可见 PayNotifyJob
public CommonResult<Boolean> updatePaidMemberOrder(@Valid @RequestBody AppPaidMemeberOrderReqDto notifyReqDTO){
//获取订单记录
PaidMemberOrderDO paidMemberOrderDO = paidMemberOrderService1.getPaidMemeberOrder(Long.valueOf(notifyReqDTO.getMerchantOrderId()));
if(paidMemberOrderDO == null){
log.error("[updatePaidMemberOrder]updateReqVO({}) 付费会员订单不存在.");
throw exception(PAID_MEMBER_ORDER_NOT_EXISTS);
}
BigDecimal decimalprice = paidMemberOrderDO.getPrice();
Integer price = decimalprice.multiply(new BigDecimal("100")).intValue();
// 校验钱包充值是否可以支付
PayWalletDO walletDO = payWalletService.getOrCreateWallet(WebFrameworkUtils.getLoginUserId(),getLoginUserType());
if(walletDO == null){
log.error("[updatePaidMemberOrder]updateReqVO({}) 用户钱包不存在.");
throw exception(WALLET_NOT_FOUND);
}
if(walletDO.getBalance()<price){
log.error("[updatePaidMemberOrder]updateReqVO({}) 钱包余额不足.");
throw exception(WALLET_BALANCE_NOT_ENOUGH);
}
PayOrderDO payOrderDO = payOrderService01.getOrder(notifyReqDTO.getPayOrderId());
//更新订单支付状态为已支付
paidMemberOrderDO.setPaid(true);
paidMemberOrderDO.setPayChannel(payOrderDO.getChannelCode());
paidMemberOrderService1.updateOrder(paidMemberOrderDO);
//扣减钱包余额
PayWalletTransactionDO payWalletTransactionDO = payWalletService.reduceWalletBalance
(walletDO.getId(),notifyReqDTO.getPayOrderId(),PAYMENT,price);
return success(true);
}
}

View File

@ -2,6 +2,11 @@ package cn.iocoder.yudao.module.pay.controller.app.member.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "用户 APP - 会员支付 Resp VO")
@Data
@ -12,4 +17,12 @@ public class AppPaidMemberOrderRespVO {
@Schema(description = "支付订单编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "o100")
private Long payOrderId;
@Schema(description = "到期时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-11-22 09:30:05")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime cardExpirationTime;
@Schema(description = "会员类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "0:未开通,1:试用,2:有效,3:永久")
private Integer activate;
}

View File

@ -0,0 +1,34 @@
package cn.iocoder.yudao.module.pay.controller.app.member.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
* 付费会员支付单的通知 Request DTO
*
* @author 芋道源码
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AppPaidMemeberOrderReqDto {
/**
* 商户订单编号
*/
@NotEmpty(message = "商户订单号不能为空")
private String merchantOrderId;
/**
* 支付订单编号
*/
@NotNull(message = "支付订单编号不能为空")
private Long payOrderId;
}

View File

@ -6,10 +6,12 @@ import cn.iocoder.yudao.module.pay.controller.app.member.vo.AppPaidMemberOrderRe
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.time.LocalDateTime;
@Mapper
public interface PayMemberOrderConvert {
PayMemberOrderConvert INSTANCE = Mappers.getMapper(PayMemberOrderConvert.class);
AppPaidMemberOrderRespVO convert(PaidMemberOrderDO bean);
AppPaidMemberOrderRespVO convert(Long id, Long payOrderId, LocalDateTime cardExpirationTime, Integer activate);
}

View File

@ -5,13 +5,16 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
public interface ErrorCodeConstants {
ErrorCode MANAGE_NOT_EXISTS = new ErrorCode(11111, "预约不存在");
ErrorCode STAFF_NOT_EXISTS = new ErrorCode(22222, "预约人员不存在");
ErrorCode ORGANIZATION_NOT_EXISTS = new ErrorCode(33333, "机构不存在");
ErrorCode STAFF_NOT_EXISTS = new ErrorCode(11112, "预约人员不存在");
ErrorCode ORGANIZATION_NOT_EXISTS = new ErrorCode(11113, "机构不存在");
ErrorCode LITEMALL_TECHNICIAN_NOT_EXISTS = new ErrorCode(111, "人员管理不存在");
ErrorCode LITEMALL_TECHNICIAN_NOT_EXISTS = new ErrorCode(11114, "人员管理不存在");
ErrorCode LITEMALL_BRAND_NOT_EXISTS = new ErrorCode(222, "门店管理不存在");
ErrorCode LITEMALL_BRAND_NOT_EXISTS = new ErrorCode(11115, "门店管理不存在");
ErrorCode LITEMALL_RESERVATION_NOT_EXISTS = new ErrorCode(333, "预约订单不存在");
ErrorCode LITEMALL_RESERVATION_NOT_EXISTS = new ErrorCode(11116, "预约订单不存在");
// ========== 预约项目 TODO 补充编号 ==========
ErrorCode PROJECT_NOT_EXISTS = new ErrorCode(11117, "预约项目不存在");
}

View File

@ -0,0 +1,104 @@
package cn.iocoder.yudao.module.srbscribe.controller.admin.project;
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectPageReqVO;
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectRespVO;
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectSaveReqVO;
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.project.ProjectDO;
import cn.iocoder.yudao.module.srbscribe.service.project.ProjectService;
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.*;
@Tag(name = "管理后台 - 预约项目")
@RestController
@RequestMapping("/subscribe/project")
@Validated
public class ProjectController {
@Resource
private ProjectService projectService;
@PostMapping("/create")
@Operation(summary = "创建预约项目")
@PreAuthorize("@ss.hasPermission('subscribe:project:create')")
public CommonResult<Long> createProject(@Valid @RequestBody ProjectSaveReqVO createReqVO) {
return success(projectService.createProject(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新预约项目")
@PreAuthorize("@ss.hasPermission('subscribe:project:update')")
public CommonResult<Boolean> updateProject(@Valid @RequestBody ProjectSaveReqVO updateReqVO) {
projectService.updateProject(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除预约项目")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('subscribe:project:delete')")
public CommonResult<Boolean> deleteProject(@RequestParam("id") Long id) {
projectService.deleteProject(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得预约项目")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('subscribe:project:query')")
public CommonResult<ProjectRespVO> getProject(@RequestParam("id") Long id) {
ProjectDO project = projectService.getProject(id);
return success(BeanUtils.toBean(project, ProjectRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得预约项目分页")
@PreAuthorize("@ss.hasPermission('subscribe:project:query')")
public CommonResult<PageResult<ProjectRespVO>> getProjectPage(@Valid ProjectPageReqVO pageReqVO) {
PageResult<ProjectDO> pageResult = projectService.getProjectPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ProjectRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出预约项目 Excel")
@PreAuthorize("@ss.hasPermission('subscribe:project:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportProjectExcel(@Valid ProjectPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ProjectDO> list = projectService.getProjectPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "预约项目.xls", "数据", ProjectRespVO.class,
BeanUtils.toBean(list, ProjectRespVO.class));
}
@GetMapping("/getProjectName")
public CommonResult<List<ProjectDO>> getProjectPage() {
List<ProjectDO> projectName = projectService.getProjectName();
return success(projectName);
}
}

View File

@ -0,0 +1,45 @@
package cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo;
import cn.hutool.core.date.DateTime;
import lombok.*;
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.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
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 ProjectPageReqVO extends PageParam {
@Schema(description = "所属门店", example = "18441")
private Long brandId;
@Schema(description = "项目名称", example = "芋艿")
private String name;
@Schema(description = "项目图片")
private String pictrue;
@Schema(description = "项目简介")
private String content;
@Schema(description = "状态", example = "1")
private Integer status;
@Schema(description = "可预约日期")
private String timeInterval;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,57 @@
package cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo;
import cn.hutool.core.date.DateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
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 ProjectRespVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21557")
@ExcelProperty("ID")
private Long id;
@Schema(description = "所属门店", requiredMode = Schema.RequiredMode.REQUIRED, example = "18441")
@ExcelProperty("所属门店")
private Long brandId;
@Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@ExcelProperty("项目名称")
private String name;
@Schema(description = "项目图片", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("项目图片")
private String pictrue;
@Schema(description = "项目简介")
@ExcelProperty("项目简介")
private String content;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty(value = "状态", converter = DictConvert.class)
@DictFormat("subscribe_project_status") // TODO 代码优化建议设置到对应的 DictTypeConstants 枚举类中
private Integer status;
@Schema(description = "可预约日期", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("可预约日期")
private String timeInterval;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
private String brandName;
}

View File

@ -0,0 +1,42 @@
package cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo;
import cn.hutool.core.date.DateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.validation.constraints.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 预约项目新增/修改 Request VO")
@Data
public class ProjectSaveReqVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21557")
private Long id;
@Schema(description = "所属门店", requiredMode = Schema.RequiredMode.REQUIRED, example = "18441")
@NotNull(message = "所属门店不能为空")
private Long brandId;
@Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@NotEmpty(message = "项目名称不能为空")
private String name;
@Schema(description = "项目图片", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "项目图片不能为空")
private String pictrue;
@Schema(description = "项目简介")
private String content;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "状态不能为空")
private Integer status;
@Schema(description = "可预约日期", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "可预约日期不能为空")
private String timeInterval;
}

View File

@ -15,20 +15,9 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@ToString(callSuper = true)
public class LitemallTechnicianPageReqVO extends PageParam {
@Schema(description = "人员编号")
private String techSn;
@Schema(description = "人员类型", example = "1")
private Integer type;
@Schema(description = "人员名称", example = "赵六")
private String technicianName;
@Schema(description = "门店id", example = "28184")
private Long brandId;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "项目id", example = "28184")
private Long projectId;
@Schema(description = "照片")
private String photo;
@ -40,9 +29,6 @@ public class LitemallTechnicianPageReqVO extends PageParam {
@Schema(description = "服务范围")
private String serviceScope;
@Schema(description = "手机号")
private String phone;
@Schema(description = "约满标记")
private Integer ym;

View File

@ -19,27 +19,9 @@ public class LitemallTechnicianRespVO {
@ExcelProperty("id")
private Long id;
@Schema(description = "人员编号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("人员编号")
private String techSn;
@Schema(description = "人员类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty(value = "人员类型", converter = DictConvert.class)
@DictFormat("types") // TODO 代码优化建议设置到对应的 DictTypeConstants 枚举类中
private Integer type;
@Schema(description = "人员名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@ExcelProperty("人员名称")
private String technicianName;
@Schema(description = "门店id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28184")
@ExcelProperty("门店id")
private Long brandId;
@Schema(description = "性别")
@ExcelProperty(value = "性别", converter = DictConvert.class)
@DictFormat("sex") // TODO 代码优化建议设置到对应的 DictTypeConstants 枚举类中
private Integer sex;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28184")
@ExcelProperty("项目id")
private Long projectId;
@Schema(description = "照片")
@ExcelProperty("照片")
@ -53,9 +35,6 @@ public class LitemallTechnicianRespVO {
@ExcelProperty("服务范围")
private String serviceScope;
@Schema(description = "手机号")
@ExcelProperty("手机号")
private String phone;
@Schema(description = "约满标记")
@ExcelProperty("约满标记")

View File

@ -12,23 +12,9 @@ public class LitemallTechnicianSaveReqVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26372")
private Long id;
@Schema(description = "人员编号", requiredMode = Schema.RequiredMode.REQUIRED)
private String techSn;
@Schema(description = "人员类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "人员类型不能为空")
private Integer type;
@Schema(description = "人员名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@NotEmpty(message = "人员名称不能为空")
private String technicianName;
@Schema(description = "门店id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28184")
@NotNull(message = "门店不能为空")
private Long brandId;
@Schema(description = "性别")
private Integer sex;
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28184")
@NotNull(message = "项目不能为空")
private Long projectId;
@Schema(description = "照片")
private String photo;
@ -39,9 +25,6 @@ public class LitemallTechnicianSaveReqVO {
@Schema(description = "服务范围")
private String serviceScope;
@Schema(description = "手机号")
private String phone;
@Schema(description = "约满标记")
private Integer ym;

View File

@ -0,0 +1,64 @@
package cn.iocoder.yudao.module.srbscribe.dal.dataobject.project;
import cn.hutool.core.date.DateTime;
import lombok.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 预约项目 DO
*
* @author 管理员
*/
@TableName("subscribe_project")
@KeySequence("subscribe_project_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProjectDO extends BaseDO {
/**
* ID
*/
@TableId
private Long id;
/**
* 所属门店
*/
private Long brandId;
/**
* 项目名称
*/
private String name;
/**
* 项目图片
*/
private String pictrue;
/**
* 项目简介
*/
private String content;
/**
* 状态
*
* 枚举 {@link TODO subscribe_project_status 对应的类}
*/
private Integer status;
/**
* 可预约日期
*/
private String timeInterval;
@TableField(exist = false)
private String brandName;
}

View File

@ -29,29 +29,9 @@ public class LitemallTechnicianDO extends BaseDO {
@TableId
private Long id;
/**
* 人员编号
* 项目id
*/
private String techSn;
/**
* 人员类型
*
* 枚举 {@link TODO types 对应的类}
*/
private Integer type;
/**
* 人员名称
*/
private String technicianName;
/**
* 门店id
*/
private Long brandId;
/**
* 性别
*
* 枚举 {@link TODO sex 对应的类}
*/
private Integer sex;
private Long projectId;
/**
* 照片
*/
@ -64,10 +44,6 @@ public class LitemallTechnicianDO extends BaseDO {
* 服务范围
*/
private String serviceScope;
/**
* 手机号
*/
private String phone;
/**
* 约满标记
*/

View File

@ -0,0 +1,31 @@
package cn.iocoder.yudao.module.srbscribe.dal.mysql.project;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectPageReqVO;
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.project.ProjectDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 预约项目 Mapper
*
* @author 管理员
*/
@Mapper
public interface ProjectMapper extends BaseMapperX<ProjectDO> {
default PageResult<ProjectDO> selectPage(ProjectPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ProjectDO>()
.eqIfPresent(ProjectDO::getBrandId, reqVO.getBrandId())
.likeIfPresent(ProjectDO::getName, reqVO.getName())
.eqIfPresent(ProjectDO::getPictrue, reqVO.getPictrue())
.eqIfPresent(ProjectDO::getContent, reqVO.getContent())
.eqIfPresent(ProjectDO::getStatus, reqVO.getStatus())
.eqIfPresent(ProjectDO::getTimeInterval, reqVO.getTimeInterval())
.betweenIfPresent(ProjectDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ProjectDO::getId));
}
}

View File

@ -21,15 +21,9 @@ public interface LitemallTechnicianMapper extends BaseMapperX<LitemallTechnician
default PageResult<LitemallTechnicianDO> selectPage(LitemallTechnicianPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<LitemallTechnicianDO>()
.eqIfPresent(LitemallTechnicianDO::getTechSn, reqVO.getTechSn())
.eqIfPresent(LitemallTechnicianDO::getType, reqVO.getType())
.likeIfPresent(LitemallTechnicianDO::getTechnicianName, reqVO.getTechnicianName())
.eqIfPresent(LitemallTechnicianDO::getBrandId, reqVO.getBrandId())
.eqIfPresent(LitemallTechnicianDO::getSex, reqVO.getSex())
.eqIfPresent(LitemallTechnicianDO::getPhoto, reqVO.getPhoto())
.betweenIfPresent(LitemallTechnicianDO::getServiceTime, reqVO.getServiceTime())
.eqIfPresent(LitemallTechnicianDO::getServiceScope, reqVO.getServiceScope())
.eqIfPresent(LitemallTechnicianDO::getPhone, reqVO.getPhone())
.eqIfPresent(LitemallTechnicianDO::getYm, reqVO.getYm())
.eqIfPresent(LitemallTechnicianDO::getStatus, reqVO.getStatus())
.eqIfPresent(LitemallTechnicianDO::getContent, reqVO.getContent())

View File

@ -0,0 +1,59 @@
package cn.iocoder.yudao.module.srbscribe.service.project;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectPageReqVO;
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectSaveReqVO;
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.project.ProjectDO;
import javax.validation.*;
import java.util.List;
/**
* 预约项目 Service 接口
*
* @author 管理员
*/
public interface ProjectService {
/**
* 创建预约项目
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createProject(@Valid ProjectSaveReqVO createReqVO);
/**
* 更新预约项目
*
* @param updateReqVO 更新信息
*/
void updateProject(@Valid ProjectSaveReqVO updateReqVO);
/**
* 删除预约项目
*
* @param id 编号
*/
void deleteProject(Long id);
/**
* 获得预约项目
*
* @param id 编号
* @return 预约项目
*/
ProjectDO getProject(Long id);
/**
* 获得预约项目分页
*
* @param pageReqVO 分页查询
* @return 预约项目分页
*/
PageResult<ProjectDO> getProjectPage(ProjectPageReqVO pageReqVO);
List<ProjectDO> getProjectName();
}

View File

@ -0,0 +1,89 @@
package cn.iocoder.yudao.module.srbscribe.service.project;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectPageReqVO;
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectSaveReqVO;
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.brand.LitemallBrandDO;
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.project.ProjectDO;
import cn.iocoder.yudao.module.srbscribe.dal.mysql.brand.LitemallBrandMapper;
import cn.iocoder.yudao.module.srbscribe.dal.mysql.project.ProjectMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.subscribe.enums.ErrorCodeConstants.*;
/**
* 预约项目 Service 实现类
*
* @author 管理员
*/
@Service
@Validated
public class ProjectServiceImpl implements ProjectService {
@Resource
private ProjectMapper projectMapper;
@Resource
private LitemallBrandMapper litemallBrandMapper;
@Override
public Long createProject(ProjectSaveReqVO createReqVO) {
// 插入
ProjectDO project = BeanUtils.toBean(createReqVO, ProjectDO.class);
projectMapper.insert(project);
// 返回
return project.getId();
}
@Override
public void updateProject(ProjectSaveReqVO updateReqVO) {
// 校验存在
validateProjectExists(updateReqVO.getId());
// 更新
ProjectDO updateObj = BeanUtils.toBean(updateReqVO, ProjectDO.class);
projectMapper.updateById(updateObj);
}
@Override
public void deleteProject(Long id) {
// 校验存在
validateProjectExists(id);
// 删除
projectMapper.deleteById(id);
}
private void validateProjectExists(Long id) {
if (projectMapper.selectById(id) == null) {
throw exception(PROJECT_NOT_EXISTS);
}
}
@Override
public ProjectDO getProject(Long id) {
return projectMapper.selectById(id);
}
@Override
public PageResult<ProjectDO> getProjectPage(ProjectPageReqVO pageReqVO) {
PageResult<ProjectDO> projectDOPageResult = projectMapper.selectPage(pageReqVO);
for (int i = 0; i < projectDOPageResult.getList().size(); i++) {
ProjectDO projectDO = projectDOPageResult.getList().get(i);
LitemallBrandDO litemallBrandDO = litemallBrandMapper.selectOne("id", projectDO.getBrandId());
projectDO.setBrandName(litemallBrandDO.getName());
}
return projectDOPageResult;
}
@Override
public List<ProjectDO> getProjectName() {
return projectMapper.selectList();
}
}

View File

@ -113,8 +113,8 @@ public class LitemallReservationServiceImpl implements LitemallReservationServic
litemallReservationDO.setBrandName(litemallBrandDO.getName());
litemallReservationDO.setBrandaddress(litemallBrandDO.getAddress());
LitemallTechnicianDO litemallTechnicianDO = litemallTechnicianMapper.selectOne("id", litemallReservationDO.getTechnicianId());
litemallReservationDO.setTechnicianName(litemallTechnicianDO.getTechnicianName());
// LitemallTechnicianDO litemallTechnicianDO = litemallTechnicianMapper.selectOne("id", litemallReservationDO.getTechnicianId());
// litemallReservationDO.setTechnicianName(litemallTechnicianDO.getTechnicianName());
MemberUserDO memberUserDO = memberUserMapper.selectOne("id", litemallReservationDO.getUserId());
litemallReservationDO.setNickname(memberUserDO.getNickname());

View File

@ -6,8 +6,10 @@ import cn.iocoder.yudao.module.srbscribe.controller.admin.technician.vo.Litemall
import cn.iocoder.yudao.module.srbscribe.controller.admin.technician.vo.LitemallTechnicianSaveReqVO;
import cn.iocoder.yudao.module.srbscribe.controller.admin.technician.vo.ServiceTimeVO;
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.brand.LitemallBrandDO;
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.project.ProjectDO;
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.technician.LitemallTechnicianDO;
import cn.iocoder.yudao.module.srbscribe.dal.mysql.brand.LitemallBrandMapper;
import cn.iocoder.yudao.module.srbscribe.dal.mysql.project.ProjectMapper;
import cn.iocoder.yudao.module.srbscribe.dal.mysql.technician.LitemallTechnicianMapper;
import cn.iocoder.yudao.module.srbscribe.service.brand.LitemallBrandService;
import com.alibaba.fastjson.JSON;
@ -40,6 +42,9 @@ public class LitemallTechnicianServiceImpl implements LitemallTechnicianService
@Resource
private LitemallBrandMapper litemallBrandMapper;
@Resource
private ProjectMapper projectMapper;
/**
* 查询技师管理列表
@ -110,8 +115,8 @@ public class LitemallTechnicianServiceImpl implements LitemallTechnicianService
String serviceTime = "";
for (int i = 0; i < litemallTechnicianDOPageResult.getList().size(); i++) {
LitemallTechnicianDO litemallTechnicianDO = litemallTechnicianDOPageResult.getList().get(i);
LitemallBrandDO litemallBrandDO = litemallBrandMapper.selectOne("id", litemallTechnicianDO.getBrandId());
litemallTechnicianDO.setBrandName(litemallBrandDO.getName());
ProjectDO projectDO = projectMapper.selectOne("id", litemallTechnicianDO.getProjectId());
litemallTechnicianDO.setBrandName(projectDO.getName());
if(litemallTechnicianDO.getServiceTime() != null && litemallTechnicianDO.getServiceTime() != ""){
//把StringJSON格式serviceTime转成对象