预约模块修改
This commit is contained in:
parent
208d0a6e97
commit
1603d9d525
56
yudao-admin-vue3/src/api/subscribe/configuration/index.ts
Normal file
56
yudao-admin-vue3/src/api/subscribe/configuration/index.ts
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 预约配置 VO
|
||||||
|
export interface ConfigurationVO {
|
||||||
|
id: number // id
|
||||||
|
projectdayId: number
|
||||||
|
serviceTime: string
|
||||||
|
technicianId: number // 套餐id
|
||||||
|
technicianName: string
|
||||||
|
timeQuantum: string // 时间段
|
||||||
|
availableNumber: number // 可预约数
|
||||||
|
residueNumber: number // 剩余预约数
|
||||||
|
status: number // 状态
|
||||||
|
}
|
||||||
|
|
||||||
|
// 预约配置 API
|
||||||
|
export const ConfigurationApi = {
|
||||||
|
// 查询预约配置分页
|
||||||
|
getConfigurationPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/subscribe/configuration/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询预约配置详情
|
||||||
|
getConfiguration: async (id: number) => {
|
||||||
|
return await request.get({ url: `/subscribe/configuration/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增预约配置
|
||||||
|
createConfiguration: async (data: ConfigurationVO) => {
|
||||||
|
return await request.post({ url: `/subscribe/configuration/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改预约配置
|
||||||
|
updateConfiguration: async (data: ConfigurationVO) => {
|
||||||
|
return await request.put({ url: `/subscribe/configuration/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除预约配置
|
||||||
|
deleteConfiguration: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/subscribe/configuration/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出预约配置 Excel
|
||||||
|
exportConfiguration: async (params) => {
|
||||||
|
return await request.download({ url: `/subscribe/configuration/export-excel`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// addUpdConfiguration: async (projectdayId: number,technicianId: number,serviceTimes: string) => {
|
||||||
|
// return await request.post({ url: `/subscribe/configuration/addUpdConfiguration?projectdayId=`+projectdayId+`&technicianId=`+technicianId+`&serviceTimes=`+serviceTimes })
|
||||||
|
// },
|
||||||
|
|
||||||
|
|
||||||
|
addUpdConfiguration: async (data: ConfigurationVO) => {
|
||||||
|
return await request.post({ url: `/subscribe/configuration/addUpdConfiguration`, data })
|
||||||
|
},
|
||||||
|
}
|
@ -4,6 +4,7 @@ import request from '@/config/axios'
|
|||||||
export interface ProjectVO {
|
export interface ProjectVO {
|
||||||
id: number // ID
|
id: number // ID
|
||||||
brandId: number // 所属门店
|
brandId: number // 所属门店
|
||||||
|
yuyueNum: number //可预约数量
|
||||||
name: string // 项目名称
|
name: string // 项目名称
|
||||||
pictrue: string // 项目图片
|
pictrue: string // 项目图片
|
||||||
content: string // 项目简介
|
content: string // 项目简介
|
||||||
@ -48,4 +49,15 @@ export const ProjectApi = {
|
|||||||
return await request.get({ url: `/subscribe/project/getProjectName` })
|
return await request.get({ url: `/subscribe/project/getProjectName` })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getProjectDay: async (id: number) => {
|
||||||
|
return await request.get({ url: `/subscribe/project/getProjectDay?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
getConfiguration: async (id: number) => {
|
||||||
|
return await request.get({ url: `/subscribe/configuration/getConfiguration?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -5,13 +5,21 @@ export interface LitemallReservationVO {
|
|||||||
id: number // id
|
id: number // id
|
||||||
userId: number // 用户id
|
userId: number // 用户id
|
||||||
nickname: string
|
nickname: string
|
||||||
type: number // 预约类型
|
// type: number // 预约类型
|
||||||
brandId: string // 门店id
|
brandId: string // 门店id
|
||||||
brandName: string
|
|
||||||
technicianId: string // 人员id
|
technicianId: string // 人员id
|
||||||
|
|
||||||
|
name: string
|
||||||
|
phone: string
|
||||||
|
brandName: string
|
||||||
|
porjectName: string
|
||||||
technicianName: string
|
technicianName: string
|
||||||
reAddTime: Date // 预约时间
|
days: string
|
||||||
hsstr: string // 预约时间段
|
timeQuantum: string
|
||||||
|
|
||||||
|
|
||||||
|
// reAddTime: Date // 预约时间
|
||||||
|
// hsstr: string // 预约时间段
|
||||||
reStatus: number // 预约状态
|
reStatus: number // 预约状态
|
||||||
status: number // 审核状态
|
status: number // 审核状态
|
||||||
remark: string // 备注
|
remark: string // 备注
|
||||||
|
@ -2,7 +2,8 @@ import request from '@/config/axios'
|
|||||||
|
|
||||||
// 人员管理 VO
|
// 人员管理 VO
|
||||||
export interface LitemallTechnicianVO {
|
export interface LitemallTechnicianVO {
|
||||||
id: number // id
|
id: number // idd
|
||||||
|
name: string
|
||||||
projectId: number // 项目id
|
projectId: number // 项目id
|
||||||
brandName: string //项目名称
|
brandName: string //项目名称
|
||||||
photo: string // 照片
|
photo: string // 照片
|
||||||
|
@ -126,6 +126,9 @@ export enum DICT_TYPE {
|
|||||||
|
|
||||||
//预约:项目
|
//预约:项目
|
||||||
SUBSCRIBE_PROJECT_STATUS = 'subscribe_project_status',
|
SUBSCRIBE_PROJECT_STATUS = 'subscribe_project_status',
|
||||||
|
|
||||||
|
//预约:配置
|
||||||
|
SUBSCRIBE_CONFIGURATION_STATUS = 'subscribe_configuration_status',
|
||||||
|
|
||||||
//预约:人员管理
|
//预约:人员管理
|
||||||
STALL_SEX = 'stall_sex',
|
STALL_SEX = 'stall_sex',
|
||||||
|
@ -1,292 +1,209 @@
|
|||||||
<template>
|
<template>
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<el-form
|
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
||||||
class="-mb-15px"
|
|
||||||
:model="queryParams"
|
|
||||||
ref="queryFormRef"
|
|
||||||
:inline="true"
|
|
||||||
label-width="68px"
|
|
||||||
>
|
|
||||||
<!-- <el-form-item label="门店管理员id" prop="userId">-->
|
|
||||||
<!-- <el-input-->
|
|
||||||
<!-- v-model="queryParams.userId"-->
|
|
||||||
<!-- placeholder="请输入门店管理员id"-->
|
|
||||||
<!-- 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="name">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.name"
|
|
||||||
placeholder="请输入门店名称"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
class="!w-240px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="门店邮箱" prop="mail">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.mail"
|
|
||||||
placeholder="请输入门店邮箱"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
class="!w-240px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="门店地址" prop="address">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.address"
|
|
||||||
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.BRAND_STATUS)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="权重" prop="weight">-->
|
|
||||||
<!-- <el-input-->
|
|
||||||
<!-- v-model="queryParams.weight"-->
|
|
||||||
<!-- 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:litemall-brand:create']"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
@click="handleExport"
|
|
||||||
:loading="exportLoading"
|
|
||||||
v-hasPermi="['subscribe:litemall-brand:export']"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</ContentWrap>
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
<el-form-item label="联系电话" prop="phone">
|
||||||
<ContentWrap>
|
<el-input v-model="queryParams.phone" placeholder="请输入联系电话" clearable @keyup.enter="handleQuery"
|
||||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
class="!w-240px" />
|
||||||
<el-table-column label="ID" align="center" prop="id" />
|
</el-form-item>
|
||||||
<!-- <el-table-column label="门店管理员" align="center" prop="userId" />-->
|
<el-form-item label="门店名称" prop="name">
|
||||||
<el-table-column label="联系电话" align="center" prop="phone" />
|
<el-input v-model="queryParams.name" placeholder="请输入门店名称" clearable @keyup.enter="handleQuery"
|
||||||
<el-table-column label="门店名称" align="center" prop="name" />
|
class="!w-240px" />
|
||||||
<el-table-column label="门店邮箱" align="center" prop="mail" />
|
</el-form-item>
|
||||||
<el-table-column label="门店图片" align="center" prop="picUrl" >
|
<el-form-item label="门店邮箱" prop="mail">
|
||||||
<template #default="{ row }">
|
<el-input v-model="queryParams.mail" placeholder="请输入门店邮箱" clearable @keyup.enter="handleQuery"
|
||||||
<div class="flex">
|
class="!w-240px" />
|
||||||
<el-image
|
</el-form-item>
|
||||||
fit="cover"
|
<el-form-item label="门店地址" prop="address">
|
||||||
:src="row.picUrl"
|
<el-input v-model="queryParams.address" placeholder="请输入门店地址" clearable @keyup.enter="handleQuery"
|
||||||
class="flex-none w-50px h-50px"
|
class="!w-240px" />
|
||||||
@click="imagePreview(row.picUrl)"
|
</el-form-item>
|
||||||
/>
|
<el-form-item label="门店状态" prop="status">
|
||||||
</div>
|
<el-select v-model="queryParams.status" placeholder="请选择门店状态" clearable class="!w-240px">
|
||||||
</template>
|
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.BRAND_STATUS)" :key="dict.value"
|
||||||
</el-table-column>
|
:label="dict.label" :value="dict.value" />
|
||||||
<el-table-column label="门店地址" align="center" prop="address" />
|
</el-select>
|
||||||
<el-table-column label="门店简介" align="center" prop="depict" >
|
</el-form-item>
|
||||||
<template #default="scope">
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
<div v-html="scope.row.depict"></div>
|
<el-date-picker v-model="queryParams.createTime" value-format="YYYY-MM-DD HH:mm:ss" type="daterange"
|
||||||
</template>
|
start-placeholder="开始日期" end-placeholder="结束日期"
|
||||||
</el-table-column>
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" class="!w-240px" />
|
||||||
<el-table-column label="门店状态" align="center" prop="status">
|
</el-form-item>
|
||||||
<template #default="scope">
|
<el-form-item>
|
||||||
<dict-tag :type="DICT_TYPE.BRAND_STATUS" :value="scope.row.status" />
|
<el-button @click="handleQuery">
|
||||||
</template>
|
<Icon icon="ep:search" class="mr-5px" /> 搜索
|
||||||
</el-table-column>
|
</el-button>
|
||||||
<!-- <el-table-column label="权重" align="center" prop="weight" />-->
|
<el-button @click="resetQuery">
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<Icon icon="ep:refresh" class="mr-5px" /> 重置
|
||||||
<el-table-column
|
</el-button>
|
||||||
label="创建时间"
|
<el-button type="primary" plain @click="openForm('create')"
|
||||||
align="center"
|
v-hasPermi="['subscribe:litemall-brand:create']">
|
||||||
prop="createTime"
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
:formatter="dateFormatter"
|
</el-button>
|
||||||
width="180px"
|
<el-button type="success" plain @click="handleExport" :loading="exportLoading"
|
||||||
/>
|
v-hasPermi="['subscribe:litemall-brand:export']">
|
||||||
<el-table-column label="操作" align="center" fixed="right" width="110">
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
<template #default="scope">
|
</el-button>
|
||||||
<el-button
|
</el-form-item>
|
||||||
link
|
</el-form>
|
||||||
type="primary"
|
</ContentWrap>
|
||||||
@click="openForm('update', scope.row.id)"
|
|
||||||
v-hasPermi="['subscribe:litemall-brand:update']"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="danger"
|
|
||||||
@click="handleDelete(scope.row.id)"
|
|
||||||
v-hasPermi="['subscribe:litemall-brand: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>
|
|
||||||
|
|
||||||
<!-- 表单弹窗:添加/修改 -->
|
<!-- 列表 -->
|
||||||
<LitemallBrandForm ref="formRef" @success="getList" />
|
<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="userId" />-->
|
||||||
|
<el-table-column label="门店图片" align="center" prop="picUrl">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div class="flex">
|
||||||
|
<el-image fit="cover" :src="row.picUrl" class="flex-none w-50px h-50px"
|
||||||
|
@click="imagePreview(row.picUrl)" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="门店名称" align="center" prop="name" />
|
||||||
|
<el-table-column label="联系电话" align="center" prop="phone" />
|
||||||
|
|
||||||
|
<el-table-column label="门店邮箱" align="center" prop="mail" />
|
||||||
|
|
||||||
|
<el-table-column label="门店地址" align="center" prop="address" />
|
||||||
|
<el-table-column label="门店简介" align="center" prop="depict">
|
||||||
|
<template #default="scope">
|
||||||
|
<div v-html="scope.row.depict"></div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="门店状态" align="center" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.BRAND_STATUS" :value="scope.row.status" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column label="权重" align="center" prop="weight" />-->
|
||||||
|
<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" fixed="right" width="110">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['subscribe:litemall-brand:update']">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button link type="danger" @click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['subscribe:litemall-brand: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>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<LitemallBrandForm ref="formRef" @success="getList" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
import { dateFormatter } from '@/utils/formatTime'
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import { LitemallBrandApi, LitemallBrandVO } from '@/api/subscribe/brand'
|
import { LitemallBrandApi, LitemallBrandVO } from '@/api/subscribe/brand'
|
||||||
import LitemallBrandForm from './LitemallBrandForm.vue'
|
import LitemallBrandForm from './LitemallBrandForm.vue'
|
||||||
|
|
||||||
/** 门店管理 列表 */
|
/** 门店管理 列表 */
|
||||||
defineOptions({ name: 'LitemallBrand' })
|
defineOptions({ name: 'LitemallBrand' })
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
import {createImageViewer} from "@/components/ImageViewer";
|
// import {createImageViewer} from "@/components/ImageViewer";
|
||||||
|
|
||||||
const loading = ref(true) // 列表的加载中
|
const loading = ref(true) // 列表的加载中
|
||||||
const list = ref<LitemallBrandVO[]>([]) // 列表的数据
|
const list = ref<LitemallBrandVO[]>([]) // 列表的数据
|
||||||
const total = ref(0) // 列表的总页数
|
const total = ref(0) // 列表的总页数
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
mail: undefined,
|
mail: undefined,
|
||||||
picUrl: undefined,
|
picUrl: undefined,
|
||||||
address: undefined,
|
address: undefined,
|
||||||
depict: undefined,
|
depict: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
weight: undefined,
|
weight: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
createTime: []
|
createTime: []
|
||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
const exportLoading = ref(false) // 导出的加载中
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await LitemallBrandApi.getLitemallBrandPage(queryParams)
|
const data = await LitemallBrandApi.getLitemallBrandPage(queryParams)
|
||||||
list.value = data.list
|
list.value = data.list
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const imagePreview = (imgUrl: string) => {
|
const imagePreview = (imgUrl : string) => {
|
||||||
createImageViewer({
|
createImageViewer({
|
||||||
urlList: [imgUrl]
|
urlList: [imgUrl]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
queryParams.pageNo = 1
|
queryParams.pageNo = 1
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
const resetQuery = () => {
|
const resetQuery = () => {
|
||||||
queryFormRef.value.resetFields()
|
queryFormRef.value.resetFields()
|
||||||
handleQuery()
|
handleQuery()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加/修改操作 */
|
/** 添加/修改操作 */
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const openForm = (type: string, id?: number) => {
|
const openForm = (type : string, id ?: number) => {
|
||||||
formRef.value.open(type, id)
|
formRef.value.open(type, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (id: number) => {
|
const handleDelete = async (id : number) => {
|
||||||
try {
|
try {
|
||||||
// 删除的二次确认
|
// 删除的二次确认
|
||||||
await message.delConfirm()
|
await message.delConfirm()
|
||||||
// 发起删除
|
// 发起删除
|
||||||
await LitemallBrandApi.deleteLitemallBrand(id)
|
await LitemallBrandApi.deleteLitemallBrand(id)
|
||||||
message.success(t('common.delSuccess'))
|
message.success(t('common.delSuccess'))
|
||||||
// 刷新列表
|
// 刷新列表
|
||||||
await getList()
|
await getList()
|
||||||
} catch {}
|
} catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
try {
|
try {
|
||||||
// 导出的二次确认
|
// 导出的二次确认
|
||||||
await message.exportConfirm()
|
await message.exportConfirm()
|
||||||
// 发起导出
|
// 发起导出
|
||||||
exportLoading.value = true
|
exportLoading.value = true
|
||||||
const data = await LitemallBrandApi.exportLitemallBrand(queryParams)
|
const data = await LitemallBrandApi.exportLitemallBrand(queryParams)
|
||||||
download.excel(data, '门店管理.xls')
|
download.excel(data, '门店管理.xls')
|
||||||
} catch {
|
} catch {
|
||||||
} finally {
|
} finally {
|
||||||
exportLoading.value = false
|
exportLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
@ -0,0 +1,121 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-form-item label="套餐id" prop="technicianId">
|
||||||
|
<el-input v-model="formData.technicianId" placeholder="请输入套餐id" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="时间段" prop="timeQuantum">
|
||||||
|
<el-input v-model="formData.timeQuantum" placeholder="请输入时间段" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="可预约数" prop="availableNumber">
|
||||||
|
<el-input v-model="formData.availableNumber" placeholder="请输入可预约数" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="剩余预约数" prop="residueNumber">
|
||||||
|
<el-input v-model="formData.residueNumber" 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.SUBSCRIBE_CONFIGURATION_STATUS)"
|
||||||
|
: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 { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { ConfigurationApi, ConfigurationVO } from '@/api/subscribe/configuration'
|
||||||
|
|
||||||
|
/** 预约配置 表单 */
|
||||||
|
defineOptions({ name: 'ConfigurationForm' })
|
||||||
|
|
||||||
|
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,
|
||||||
|
technicianId: undefined,
|
||||||
|
timeQuantum: undefined,
|
||||||
|
availableNumber: undefined,
|
||||||
|
residueNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
technicianId: [{ required: true, message: '套餐id不能为空', trigger: 'blur' }],
|
||||||
|
timeQuantum: [{ 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 ConfigurationApi.getConfiguration(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 ConfigurationVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await ConfigurationApi.createConfiguration(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ConfigurationApi.updateConfiguration(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
technicianId: undefined,
|
||||||
|
timeQuantum: undefined,
|
||||||
|
availableNumber: undefined,
|
||||||
|
residueNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
242
yudao-admin-vue3/src/views/subscribe/configuration/index.vue
Normal file
242
yudao-admin-vue3/src/views/subscribe/configuration/index.vue
Normal file
@ -0,0 +1,242 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="套餐id" prop="technicianId">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.technicianId"
|
||||||
|
placeholder="请输入套餐id"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="时间段" prop="timeQuantum">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.timeQuantum"
|
||||||
|
placeholder="请输入时间段"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="可预约数" prop="availableNumber">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.availableNumber"
|
||||||
|
placeholder="请输入可预约数"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="剩余预约数" prop="residueNumber">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.residueNumber"
|
||||||
|
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_CONFIGURATION_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="['subscribe:configuration:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['subscribe:configuration: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="technicianName" />
|
||||||
|
<el-table-column label="时间段" align="center" prop="timeQuantum" />
|
||||||
|
<el-table-column label="可预约数" align="center" prop="availableNumber" />
|
||||||
|
<el-table-column label="剩余预约数" align="center" prop="residueNumber" />
|
||||||
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.SUBSCRIBE_CONFIGURATION_STATUS" :value="scope.row.status" />
|
||||||
|
</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="['subscribe:configuration:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['subscribe:configuration: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>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<ConfigurationForm 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 { ConfigurationApi, ConfigurationVO } from '@/api/subscribe/configuration'
|
||||||
|
import ConfigurationForm from './ConfigurationForm.vue'
|
||||||
|
|
||||||
|
/** 预约配置 列表 */
|
||||||
|
defineOptions({ name: 'Configuration' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<ConfigurationVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
technicianId: undefined,
|
||||||
|
timeQuantum: undefined,
|
||||||
|
availableNumber: undefined,
|
||||||
|
residueNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
createTime: [],
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await ConfigurationApi.getConfigurationPage(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 ConfigurationApi.deleteConfiguration(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await ConfigurationApi.exportConfiguration(queryParams)
|
||||||
|
download.excel(data, '预约配置.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
@ -34,7 +34,6 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="可预约日期" prop="timeInterval">
|
<el-form-item label="可预约日期" prop="timeInterval">
|
||||||
<!-- <el-input v-model="formData.timeInterval" placeholder="请输入可预约日期" /> -->
|
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formData.timeInterval"
|
v-model="formData.timeInterval"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
@ -96,7 +95,7 @@ const open = async (type: string, id?: number) => {
|
|||||||
try {
|
try {
|
||||||
formData.value = await ProjectApi.getProject(id)
|
formData.value = await ProjectApi.getProject(id)
|
||||||
formData.value.timeInterval = JSON.parse(formData.value.timeInterval)
|
formData.value.timeInterval = JSON.parse(formData.value.timeInterval)
|
||||||
console.log('11111111111',formData.value)
|
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
@ -107,6 +106,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
|
console.log('11111111111',formData.value.timeInterval)
|
||||||
formData.value.timeInterval = JSON.stringify(formData.value.timeInterval);
|
formData.value.timeInterval = JSON.stringify(formData.value.timeInterval);
|
||||||
// 校验表单
|
// 校验表单
|
||||||
await formRef.value.validate()
|
await formRef.value.validate()
|
||||||
|
@ -49,10 +49,10 @@
|
|||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
<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="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="name" />
|
||||||
<!-- <el-table-column label="项目图片" align="center" prop="pictrue" /> -->
|
<!-- <el-table-column label="项目图片" align="center" prop="pictrue" /> -->
|
||||||
<el-table-column label="照片" align="center" prop="pictrue">
|
<el-table-column label="项目图片" align="center" prop="pictrue">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="flex" style="display: flex; align-items: center;">
|
<div class="flex" style="display: flex; align-items: center;">
|
||||||
<el-image fit="cover" :src="row.pictrue" class="flex-none w-50px h-50px"
|
<el-image fit="cover" :src="row.pictrue" class="flex-none w-50px h-50px"
|
||||||
@ -72,6 +72,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="可预约日期" align="center" prop="timeInterval" />
|
<el-table-column label="可预约日期" align="center" prop="timeInterval" />
|
||||||
|
<el-table-column label="所属门店" align="center" prop="brandName" />
|
||||||
<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">
|
<el-table-column label="操作" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
@ -8,16 +8,7 @@
|
|||||||
:inline="true"
|
:inline="true"
|
||||||
label-width="68px"
|
label-width="68px"
|
||||||
>
|
>
|
||||||
<!-- <el-form-item label="用户id" prop="userId">-->
|
<!-- <el-form-item label="预约类型" prop="type">
|
||||||
<!-- <el-input-->
|
|
||||||
<!-- v-model="queryParams.userId"-->
|
|
||||||
<!-- placeholder="请输入用户id"-->
|
|
||||||
<!-- clearable-->
|
|
||||||
<!-- @keyup.enter="handleQuery"-->
|
|
||||||
<!-- class="!w-240px"-->
|
|
||||||
<!-- />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<el-form-item label="预约类型" prop="type">
|
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.type"
|
v-model="queryParams.type"
|
||||||
placeholder="请选择预约类型"
|
placeholder="请选择预约类型"
|
||||||
@ -31,7 +22,7 @@
|
|||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<!-- <el-form-item label="门店id" prop="brandId">-->
|
<!-- <el-form-item label="门店id" prop="brandId">-->
|
||||||
<!-- <el-input-->
|
<!-- <el-input-->
|
||||||
<!-- v-model="queryParams.brandId"-->
|
<!-- v-model="queryParams.brandId"-->
|
||||||
@ -85,7 +76,7 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="审核状态" prop="status">
|
<!-- <el-form-item label="审核状态" prop="status">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="queryParams.status"
|
v-model="queryParams.status"
|
||||||
placeholder="请选择审核状态"
|
placeholder="请选择审核状态"
|
||||||
@ -99,7 +90,7 @@
|
|||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="创建时间" prop="createTime">
|
<el-form-item label="创建时间" prop="createTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="queryParams.createTime"
|
v-model="queryParams.createTime"
|
||||||
@ -114,14 +105,14 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
<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 @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
<el-button
|
<!-- <el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
@click="openForm('create')"
|
@click="openForm('create')"
|
||||||
v-hasPermi="['subscribe:litemall-reservation:create']"
|
v-hasPermi="['subscribe:litemall-reservation:create']"
|
||||||
>
|
>
|
||||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
</el-button>
|
</el-button> -->
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
plain
|
plain
|
||||||
@ -139,32 +130,34 @@
|
|||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
<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="ID" align="center" prop="id" />
|
||||||
<el-table-column label="用户" align="center" prop="nickname" />
|
<!-- <el-table-column label="用户" align="center" prop="nickname" /> -->
|
||||||
<el-table-column label="预约类型" align="center" prop="type">
|
<el-table-column label="姓名" align="center" prop="name" />
|
||||||
<template #default="scope">
|
<el-table-column label="手机号码" align="center" prop="phone" />
|
||||||
<dict-tag :type="DICT_TYPE.TYPE" :value="scope.row.type" />
|
<el-table-column label="门店" align="center" prop="brandName" />
|
||||||
</template>
|
<el-table-column label="项目" align="center" prop="projectName" />
|
||||||
</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="days" />
|
||||||
<el-table-column label="预约人员" align="center" prop="technicianName" />
|
<el-table-column label="时间段" align="center" prop="timeQuantum" />
|
||||||
<el-table-column
|
|
||||||
|
<!-- <el-table-column label="预约人员" align="center" prop="technicianName" /> -->
|
||||||
|
<!-- <el-table-column
|
||||||
label="预约时间"
|
label="预约时间"
|
||||||
align="center"
|
align="center"
|
||||||
prop="reAddTime"
|
prop="reAddTime"
|
||||||
:formatter="dateFormatter"
|
:formatter="dateFormatter"
|
||||||
width="180px"
|
width="180px"
|
||||||
/>
|
/> -->
|
||||||
<el-table-column label="预约时间段" align="center" prop="hsstr" />
|
<!-- <el-table-column label="预约时间段" align="center" prop="hsstr" /> -->
|
||||||
<el-table-column label="预约状态" align="center" prop="reStatus">
|
<el-table-column label="预约状态" align="center" prop="reStatus">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.RE_STATUS" :value="scope.row.reStatus" />
|
<dict-tag :type="DICT_TYPE.RE_STATUS" :value="scope.row.reStatus" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="审核状态" align="center" prop="status">
|
<!-- <el-table-column label="审核状态" align="center" prop="status">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.STATUS" :value="scope.row.status" />
|
<dict-tag :type="DICT_TYPE.STATUS" :value="scope.row.status" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="创建时间"
|
label="创建时间"
|
||||||
@ -175,14 +168,14 @@
|
|||||||
/>
|
/>
|
||||||
<el-table-column label="操作" align="center" fixed="right" width="110">
|
<el-table-column label="操作" align="center" fixed="right" width="110">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<!-- <el-button
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="openForm('update', scope.row.id)"
|
@click="openForm('update', scope.row.id)"
|
||||||
v-hasPermi="['subscribe:litemall-reservation:update']"
|
v-hasPermi="['subscribe:litemall-reservation:update']"
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button> -->
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@ -227,13 +220,19 @@ const queryParams = reactive({
|
|||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
type: undefined,
|
|
||||||
brandId: undefined,
|
brandId: undefined,
|
||||||
|
projectId: undefined,
|
||||||
|
projectdayId: undefined,
|
||||||
|
configurationId: undefined,
|
||||||
|
name: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
brandName: undefined,
|
||||||
|
porjectName: undefined,
|
||||||
|
days: undefined,
|
||||||
|
timeQuantum: undefined,
|
||||||
|
technicianName: undefined,
|
||||||
technicianId: undefined,
|
technicianId: undefined,
|
||||||
reAddTime: [],
|
|
||||||
hsstr: undefined,
|
|
||||||
reStatus: undefined,
|
reStatus: undefined,
|
||||||
status: undefined,
|
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
createTime: []
|
createTime: []
|
||||||
})
|
})
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1000px">
|
||||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading">
|
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px" v-loading="formLoading">
|
||||||
|
|
||||||
|
<el-form-item label="名称" prop="name">
|
||||||
|
<el-input v-model="formData.name" placeholder="请输入套餐名称" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="项目" prop="projectId">
|
<el-form-item label="项目" prop="projectId">
|
||||||
<el-select v-model="formData.projectId" placeholder="请选择项目" clearable class="!w-240px">
|
<el-select v-model="formData.projectId" placeholder="请选择项目" clearable class="!w-240px" >
|
||||||
<el-option v-for="organizationNameOptions in option" :key="organizationNameOptions.id"
|
<el-option v-for="organizationNameOptions in option" :key="organizationNameOptions.id"
|
||||||
:label="organizationNameOptions.name" :value="organizationNameOptions.id" />
|
:label="organizationNameOptions.name" :value="organizationNameOptions.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="照片" prop="photo">
|
<el-form-item label="照片" prop="photo">
|
||||||
<UploadImg v-model="formData.photo" />
|
<UploadImg v-model="formData.photo" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="服务时间段" prop="serviceTime">
|
|
||||||
<div v-for="(item, index) in timeRanges" :key="index" class="time-range">
|
|
||||||
<div class="left">
|
|
||||||
<el-time-select v-model="item.start" :max-time="item.end" class="mr-4" placeholder="开始时间"
|
|
||||||
start="07:00" step="00:05" end="23:30" />
|
|
||||||
</div>
|
|
||||||
<div class="center">
|
|
||||||
-
|
|
||||||
</div>
|
|
||||||
<div class="right">
|
|
||||||
<el-time-select v-model="item.end" :min-time="item.start" placeholder="结束时间" start="07:00"
|
|
||||||
step="00:05" end="23:30" />
|
|
||||||
</div>
|
|
||||||
<el-button @click="removeTime(index)" type="danger" size="mini">移除</el-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-button @click="addTime" type="primary" size="small">添加时间段</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="服务范围" prop="serviceScope">
|
<el-form-item label="服务范围" prop="serviceScope">
|
||||||
<el-input v-model="formData.serviceScope" placeholder="请输入服务范围" />
|
<el-input v-model="formData.serviceScope" placeholder="请输入服务范围" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -59,6 +44,7 @@
|
|||||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
import { LitemallTechnicianApi, LitemallTechnicianVO } from '@/api/subscribe/technician'
|
import { LitemallTechnicianApi, LitemallTechnicianVO } from '@/api/subscribe/technician'
|
||||||
import { ProjectApi, ProjectVO } from '@/api/subscribe/project'
|
import { ProjectApi, ProjectVO } from '@/api/subscribe/project'
|
||||||
|
|
||||||
/** 人员管理 表单 */
|
/** 人员管理 表单 */
|
||||||
defineOptions({ name: 'LitemallTechnicianForm' })
|
defineOptions({ name: 'LitemallTechnicianForm' })
|
||||||
|
|
||||||
@ -71,6 +57,7 @@
|
|||||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
projectId: undefined,
|
projectId: undefined,
|
||||||
photo: undefined,
|
photo: undefined,
|
||||||
serviceTime: '',
|
serviceTime: '',
|
||||||
@ -82,52 +69,42 @@
|
|||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
// techSn: [{ required: true, message: '人员编号不能为空', trigger: 'blur' }],
|
// techSn: [{ required: true, message: '人员编号不能为空', trigger: 'blur' }],
|
||||||
type: [{ required: true, message: '人员类型不能为空', trigger: 'change' }],
|
projectId: [{ required: true, message: '项目名称不能为空', trigger: 'change' }],
|
||||||
technicianName: [{ required: true, message: '人员名称不能为空', trigger: 'blur' }],
|
name: [{ required: true, message: '套餐名称不能为空', trigger: 'blur' }],
|
||||||
brandId: [{ required: true, message: '门店不能为空', trigger: 'blur' }],
|
brandId: [{ required: true, message: '门店不能为空', trigger: 'blur' }],
|
||||||
// status: [{ required: true, message: '状态不能为空', trigger: 'change' }]
|
status: [{ required: true, message: '状态不能为空', trigger: 'change' }]
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
const timeRanges = ref([{ start: '', end: '' }]);
|
|
||||||
|
//初始化机构名称下拉框
|
||||||
|
const getProjectName = async () => {
|
||||||
|
try {
|
||||||
|
option.value = await ProjectApi.getProjectName()
|
||||||
|
} finally {
|
||||||
|
|
||||||
const addTime = () => {
|
|
||||||
timeRanges.value.push({ start: '', end: '' });
|
|
||||||
};
|
|
||||||
|
|
||||||
const removeTime = (index : number) => {
|
|
||||||
if (timeRanges.value.length > 1) {
|
|
||||||
timeRanges.value.splice(index, 1);
|
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
//初始化机构名称下拉框
|
|
||||||
const getProjectName = async () => {
|
|
||||||
try {
|
|
||||||
option.value = await ProjectApi.getProjectName()
|
|
||||||
} finally {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (type : string, id ?: number) => {
|
const open = async (type : string, id ?: number) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
dialogTitle.value = t('action.' + type)
|
dialogTitle.value = t('action.' + type)
|
||||||
timeRanges.value = ([]) //清空timeRanges的数据
|
// timeRanges.value = ([]) //清空timeRanges的数据
|
||||||
timeRanges.value.push({ start: '', end: '' }); //再将timeRaanges设置为{ start: '', end: '' }
|
// timeRanges.value.push({ start: '', end: '', subscribeNum: '' }); //再将timeRaanges设置为{ start: '', end: '' }
|
||||||
formType.value = type
|
formType.value = type
|
||||||
resetForm()
|
resetForm()
|
||||||
// 修改时,设置数据
|
// 修改时,设置数据
|
||||||
if (id) {
|
if (id) {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
timeRanges.value = ([]); //修改页面:组件设置为空
|
// timeRanges.value = ([]); //修改页面:组件设置为空
|
||||||
formData.value = await LitemallTechnicianApi.getLitemallTechnician(id)
|
formData.value = await LitemallTechnicianApi.getLitemallTechnician(id)
|
||||||
const timeRange = JSON.parse(formData.value.serviceTime)
|
|
||||||
for (var i = 0; i < timeRange.length; i++) {
|
// const timeRange = JSON.parse(formData.value.serviceTime)
|
||||||
timeRanges.value.push(timeRange[i]); //原有的时间段push上去
|
// for (var i = 0; i < timeRange.length; i++) {
|
||||||
}
|
// timeRanges.value.push(timeRange[i]); //原有的时间段push上去
|
||||||
|
// }
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
@ -145,7 +122,7 @@
|
|||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
formData.value.serviceTime = JSON.stringify(timeRanges.value);
|
// formData.value.serviceTime = JSON.stringify(timeRanges.value);
|
||||||
const data = formData.value as unknown as LitemallTechnicianVO
|
const data = formData.value as unknown as LitemallTechnicianVO
|
||||||
if (formType.value === 'create') {
|
if (formType.value === 'create') {
|
||||||
await LitemallTechnicianApi.createLitemallTechnician(data)
|
await LitemallTechnicianApi.createLitemallTechnician(data)
|
||||||
@ -167,6 +144,7 @@
|
|||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
projectId: undefined,
|
projectId: undefined,
|
||||||
photo: undefined,
|
photo: undefined,
|
||||||
serviceTime: '',
|
serviceTime: '',
|
||||||
@ -207,4 +185,4 @@
|
|||||||
width: 150px;
|
width: 150px;
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -2,30 +2,12 @@
|
|||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<!-- 搜索工作栏 -->
|
<!-- 搜索工作栏 -->
|
||||||
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
<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>
|
|
||||||
</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-form-item label="所属门店" prop="brandId">
|
<el-form-item label="所属门店" prop="brandId">
|
||||||
<el-select v-model="queryParams.brandId" placeholder="请选择门店" clearable class="!w-240px">
|
<el-select v-model="queryParams.brandId" placeholder="请选择门店" clearable class="!w-240px">
|
||||||
<el-option v-for="organizationNameOptions in option" :key="organizationNameOptions.id"
|
<el-option v-for="organizationNameOptions in option" :key="organizationNameOptions.id"
|
||||||
:label="organizationNameOptions.name" :value="organizationNameOptions.id" />
|
:label="organizationNameOptions.name" :value="organizationNameOptions.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</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-form-item label="状态" prop="status">
|
||||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
|
||||||
@ -62,19 +44,7 @@
|
|||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
<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="ID" align="center" prop="id" />
|
||||||
<!-- <el-table-column label="人员编号" align="center" prop="techSn" />
|
<el-table-column label="名称" align="center" prop="name" />
|
||||||
<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">
|
|
||||||
<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 label="图片" align="center" prop="photo">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
@ -83,9 +53,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="服务时间段" align="center" prop="serviceTimeArray" width="200" />
|
<!-- <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="serviceScope" />
|
||||||
<el-table-column label="约满标记" align="center" prop="ym" />
|
<!-- <el-table-column label="约满标记" align="center" prop="ym" /> -->
|
||||||
<el-table-column label="状态" align="center" prop="status">
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.TECHNICIAN_STATUS" :value="scope.row.status" />
|
<dict-tag :type="DICT_TYPE.TECHNICIAN_STATUS" :value="scope.row.status" />
|
||||||
@ -96,10 +66,14 @@
|
|||||||
<div v-html="scope.row.content"></div>
|
<div v-html="scope.row.content"></div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="归属项目" align="center" prop="brandName" />
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<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">
|
<el-table-column label="操作" align="center" fixed="right" width="200">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
<el-button @click="openday(scope.row.projectId,scope.row.id)">
|
||||||
|
配置
|
||||||
|
</el-button>
|
||||||
<el-button link type="primary" @click="openForm('update', scope.row.id)"
|
<el-button link type="primary" @click="openForm('update', scope.row.id)"
|
||||||
v-hasPermi="['subscribe:litemall-technician:update']">
|
v-hasPermi="['subscribe:litemall-technician:update']">
|
||||||
编辑
|
编辑
|
||||||
@ -118,6 +92,42 @@
|
|||||||
|
|
||||||
<!-- 表单弹窗:添加/修改 -->
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
<LitemallTechnicianForm ref="formRef" @success="getList" />
|
<LitemallTechnicianForm ref="formRef" @success="getList" />
|
||||||
|
|
||||||
|
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
||||||
|
|
||||||
|
<el-form label-width="100px" v-loading="formLoading">
|
||||||
|
<el-form-item label="可预约日期">
|
||||||
|
<el-select v-model="formData.projectdayId" placeholder="请选择日期" size="large" clearable class="!w-240px" @change="handleProjectChange(formData.projectdayId)">
|
||||||
|
<el-option v-for="item in optionDays" :key="item.id" :label="item.days" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="服务时间段" prop="serviceTime">
|
||||||
|
<div v-for="(item, index) in timeRanges" :key="index" class="time-range">
|
||||||
|
<div class="left">
|
||||||
|
<el-time-select v-model="item.start" :max-time="item.end" class="mr-4" placeholder="开始时间"
|
||||||
|
start="07:00" step="00:05" end="23:30" />
|
||||||
|
</div>
|
||||||
|
<div class="center">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div class="right">
|
||||||
|
<el-time-select v-model="item.end" :min-time="item.start" placeholder="结束时间" start="07:00"
|
||||||
|
step="00:05" end="23:30" />
|
||||||
|
</div>
|
||||||
|
<span>可预约数 :</span>
|
||||||
|
<input v-model="item.subscribeNum" style="width: 40px;margin-right: 20px;" />
|
||||||
|
<el-button @click="removeTime(index)" type="danger" size="mini">移除</el-button>
|
||||||
|
</div>
|
||||||
|
<el-button @click="addTime" type="primary" size="small">添加时间段</el-button>
|
||||||
|
</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>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -126,11 +136,14 @@
|
|||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import { LitemallTechnicianApi, LitemallTechnicianVO } from '@/api/subscribe/technician'
|
import { LitemallTechnicianApi, LitemallTechnicianVO } from '@/api/subscribe/technician'
|
||||||
import LitemallTechnicianForm from './LitemallTechnicianForm.vue'
|
import LitemallTechnicianForm from './LitemallTechnicianForm.vue'
|
||||||
|
|
||||||
import { createImageViewer } from "@/components/ImageViewer";
|
import { createImageViewer } from "@/components/ImageViewer";
|
||||||
import { ProjectApi, ProjectVO } from '@/api/subscribe/project'
|
import { ProjectApi, ProjectVO } from '@/api/subscribe/project'
|
||||||
|
import { ConfigurationApi, ConfigurationVO } from '@/api/subscribe/configuration'
|
||||||
/** 人员管理 列表 */
|
/** 人员管理 列表 */
|
||||||
defineOptions({ name: 'LitemallTechnician' })
|
defineOptions({ name: 'LitemallTechnician' })
|
||||||
|
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const option = ref<ProjectVO[]>([]);
|
const option = ref<ProjectVO[]>([]);
|
||||||
@ -158,6 +171,88 @@
|
|||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
const exportLoading = ref(false) // 导出的加载中
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
serviceTimes: '',
|
||||||
|
projectdayId: undefined,
|
||||||
|
technicianId: undefined,
|
||||||
|
timeQuantum: undefined,
|
||||||
|
availableNumber: undefined,
|
||||||
|
residueNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
})
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
|
||||||
|
const timeRanges = ref([{ id: '', start: '', end: '', subscribeNum: '' }]);
|
||||||
|
|
||||||
|
const addTime = () => {
|
||||||
|
timeRanges.value.push({ id: '', start: '', end: '', subscribeNum: '' });
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const optionDays = ref()
|
||||||
|
|
||||||
|
const technicianDay = ref()
|
||||||
|
const serviceTimes = ref('') //时间段
|
||||||
|
const taoCanId = ref() //套餐id
|
||||||
|
|
||||||
|
const removeTime = (index : number) => {
|
||||||
|
if (timeRanges.value.length > 1) {
|
||||||
|
timeRanges.value.splice(index, 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//打开弹窗
|
||||||
|
const openday = async (projectId: number,id) => {
|
||||||
|
formData.value.projectdayId = undefined
|
||||||
|
timeRanges.value = ([]) //清空timeRanges的数据
|
||||||
|
formData.value.technicianId = id
|
||||||
|
optionDays.value = await ProjectApi.getProjectDay(projectId)
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
//监听预约天的下拉框
|
||||||
|
const handleProjectChange = async (id: number) => {
|
||||||
|
timeRanges.value = ([]) //清空timeRanges的数据
|
||||||
|
|
||||||
|
|
||||||
|
console.log('选择的预约日期 ID:', id);
|
||||||
|
technicianDay.value = await ProjectApi.getConfiguration(id)
|
||||||
|
|
||||||
|
const timeRange = technicianDay.value
|
||||||
|
for (var i = 0; i < timeRange.length; i++) {
|
||||||
|
timeRanges.value.push(timeRange[i]); //原有的时间段push上去
|
||||||
|
}
|
||||||
|
if(timeRange.length <= 0){
|
||||||
|
timeRanges.value.push({ id: '', start: '', end: '', subscribeNum: '' }); //再将timeRaanges设置为{ start: '', end: '' }
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
// await formRef.value.validate()
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value.serviceTimes = JSON.stringify(timeRanges.value);
|
||||||
|
|
||||||
|
console.log('1111111', JSON.stringify(timeRanges.value))
|
||||||
|
const data = formData.value as unknown as ConfigurationVO
|
||||||
|
await ConfigurationApi.addUpdConfiguration(data)
|
||||||
|
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
@ -203,6 +298,7 @@
|
|||||||
const openForm = (type : string, id ?: number) => {
|
const openForm = (type : string, id ?: number) => {
|
||||||
formRef.value.open(type, id)
|
formRef.value.open(type, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
const handleDelete = async (id : number) => {
|
const handleDelete = async (id : number) => {
|
||||||
@ -232,6 +328,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList()
|
getList()
|
||||||
|
@ -7,6 +7,7 @@ import java.time.LocalDateTime;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class AppPointOrderVO {
|
public class AppPointOrderVO {
|
||||||
|
private Long id;
|
||||||
private String status; //状态
|
private String status; //状态
|
||||||
private String label;
|
private String label;
|
||||||
private LocalDateTime createTime; //时间
|
private LocalDateTime createTime; //时间
|
||||||
|
@ -143,6 +143,8 @@ public class AppTradeOrderDetailRespVO {
|
|||||||
@Schema(description = "拼团记录编号", example = "100")
|
@Schema(description = "拼团记录编号", example = "100")
|
||||||
private Long combinationRecordId;
|
private Long combinationRecordId;
|
||||||
|
|
||||||
|
private Integer usePoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单项数组
|
* 订单项数组
|
||||||
*/
|
*/
|
||||||
|
@ -176,6 +176,8 @@ public interface TradeOrderConvert {
|
|||||||
TradeOrderProperties tradeOrderProperties,
|
TradeOrderProperties tradeOrderProperties,
|
||||||
DeliveryExpressDO express) {
|
DeliveryExpressDO express) {
|
||||||
AppTradeOrderDetailRespVO orderVO = convert3(order, orderItems);
|
AppTradeOrderDetailRespVO orderVO = convert3(order, orderItems);
|
||||||
|
//添加抵扣积分
|
||||||
|
order.setUsePoint(order.getUsePoint());
|
||||||
orderVO.setPayExpireTime(addTime(tradeOrderProperties.getPayExpireTime()));
|
orderVO.setPayExpireTime(addTime(tradeOrderProperties.getPayExpireTime()));
|
||||||
if (StrUtil.isNotEmpty(order.getPayChannelCode())) {
|
if (StrUtil.isNotEmpty(order.getPayChannelCode())) {
|
||||||
orderVO.setPayChannelName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.CHANNEL_CODE, order.getPayChannelCode()));
|
orderVO.setPayChannelName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.CHANNEL_CODE, order.getPayChannelCode()));
|
||||||
|
@ -17,4 +17,10 @@ public interface ErrorCodeConstants {
|
|||||||
// ========== 预约项目 TODO 补充编号 ==========
|
// ========== 预约项目 TODO 补充编号 ==========
|
||||||
ErrorCode PROJECT_NOT_EXISTS = new ErrorCode(11117, "预约项目不存在");
|
ErrorCode PROJECT_NOT_EXISTS = new ErrorCode(11117, "预约项目不存在");
|
||||||
|
|
||||||
|
// ========== 预约配置 TODO 补充编号 ==========
|
||||||
|
ErrorCode CONFIGURATION_NOT_EXISTS = new ErrorCode(11118, "预约配置不存在");
|
||||||
|
|
||||||
|
// ========== 预约项目可预约天 TODO 补充编号 ==========
|
||||||
|
ErrorCode PROJECTDAY_NOT_EXISTS = new ErrorCode(11119, "预约项目可预约天不存在");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,10 @@
|
|||||||
<version>0.0.20131108.vaadin1</version>
|
<version>0.0.20131108.vaadin1</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -0,0 +1,113 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.controller.admin.configuration;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.configuration.vo.ConfigurationPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.configuration.vo.ConfigurationRespVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.configuration.vo.ConfigurationSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.technician.vo.ServiceTimeVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.configuration.ConfigurationDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.technician.LitemallTechnicianDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.service.configuration.ConfigurationService;
|
||||||
|
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.*;
|
||||||
|
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/configuration")
|
||||||
|
@Validated
|
||||||
|
public class ConfigurationController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigurationService configurationService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建预约配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('subscribe:configuration:create')")
|
||||||
|
public CommonResult<Long> createConfiguration(@Valid @RequestBody ConfigurationSaveReqVO createReqVO) {
|
||||||
|
return success(configurationService.createConfiguration(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新预约配置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('subscribe:configuration:update')")
|
||||||
|
public CommonResult<Boolean> updateConfiguration(@Valid @RequestBody ConfigurationSaveReqVO updateReqVO) {
|
||||||
|
configurationService.updateConfiguration(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除预约配置")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('subscribe:configuration:delete')")
|
||||||
|
public CommonResult<Boolean> deleteConfiguration(@RequestParam("id") Long id) {
|
||||||
|
configurationService.deleteConfiguration(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得预约配置")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('subscribe:configuration:query')")
|
||||||
|
public CommonResult<ConfigurationRespVO> getConfiguration(@RequestParam("id") Long id) {
|
||||||
|
ConfigurationDO configuration = configurationService.getConfiguration(id);
|
||||||
|
return success(BeanUtils.toBean(configuration, ConfigurationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得预约配置分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('subscribe:configuration:query')")
|
||||||
|
public CommonResult<PageResult<ConfigurationRespVO>> getConfigurationPage(@Valid ConfigurationPageReqVO pageReqVO) {
|
||||||
|
PageResult<ConfigurationDO> pageResult = configurationService.getConfigurationPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ConfigurationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出预约配置 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('subscribe:configuration:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportConfigurationExcel(@Valid ConfigurationPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ConfigurationDO> list = configurationService.getConfigurationPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "预约配置.xls", "数据", ConfigurationRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ConfigurationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//根据项目预约天id查找预约套餐时间段
|
||||||
|
@GetMapping("/getConfiguration")
|
||||||
|
public CommonResult<List<ServiceTimeVO>> getConfiguration(Integer id) {
|
||||||
|
List<ServiceTimeVO> serviceTimeVOS = configurationService.getConfiguration(id);
|
||||||
|
return success(serviceTimeVOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加预约套餐时间段配置
|
||||||
|
@PostMapping("/addUpdConfiguration")
|
||||||
|
public CommonResult<Long> addConfiguration(@RequestBody ConfigurationDO pageReqVO) {
|
||||||
|
Long aLong = configurationService.addUpdConfiguration(pageReqVO);
|
||||||
|
return success(aLong);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.controller.admin.configuration.vo;
|
||||||
|
|
||||||
|
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.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 ConfigurationPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "套餐id", example = "32669")
|
||||||
|
private Long technicianId;
|
||||||
|
|
||||||
|
private String serviceTimes;
|
||||||
|
|
||||||
|
@Schema(description = "项目预约天id", example = "32669")
|
||||||
|
private Long projectdayId;
|
||||||
|
|
||||||
|
@Schema(description = "时间段")
|
||||||
|
private String timeQuantum;
|
||||||
|
|
||||||
|
@Schema(description = "可预约数")
|
||||||
|
private Integer availableNumber;
|
||||||
|
|
||||||
|
@Schema(description = "剩余预约数")
|
||||||
|
private Integer residueNumber;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "1")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.controller.admin.configuration.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
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 ConfigurationRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25212")
|
||||||
|
@ExcelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "项目预约天id",requiredMode = Schema.RequiredMode.REQUIRED, example = "32669")
|
||||||
|
private Long projectdayId;
|
||||||
|
|
||||||
|
@Schema(description = "套餐id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32669")
|
||||||
|
@ExcelProperty("套餐id")
|
||||||
|
private Long technicianId;
|
||||||
|
|
||||||
|
private String technicianName;
|
||||||
|
|
||||||
|
@Schema(description = "时间段", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("时间段")
|
||||||
|
private String timeQuantum;
|
||||||
|
|
||||||
|
@Schema(description = "可预约数")
|
||||||
|
@ExcelProperty("可预约数")
|
||||||
|
private Integer availableNumber;
|
||||||
|
|
||||||
|
@Schema(description = "剩余预约数")
|
||||||
|
@ExcelProperty("剩余预约数")
|
||||||
|
private Integer residueNumber;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "1")
|
||||||
|
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||||
|
@DictFormat("subscribe_configuration_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.controller.admin.configuration.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 ConfigurationSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "25212")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "项目预约天id", example = "32669")
|
||||||
|
@NotNull(message = "项目预约天id不能为空")
|
||||||
|
private Long projectdayId;
|
||||||
|
|
||||||
|
@Schema(description = "套餐id", requiredMode = Schema.RequiredMode.REQUIRED, example = "32669")
|
||||||
|
@NotNull(message = "套餐id不能为空")
|
||||||
|
private Long technicianId;
|
||||||
|
|
||||||
|
@Schema(description = "时间段", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "时间段不能为空")
|
||||||
|
private String timeQuantum;
|
||||||
|
|
||||||
|
@Schema(description = "可预约数")
|
||||||
|
private Integer availableNumber;
|
||||||
|
|
||||||
|
@Schema(description = "剩余预约数")
|
||||||
|
private Integer residueNumber;
|
||||||
|
|
||||||
|
@Schema(description = "状态", example = "1")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
@ -3,7 +3,9 @@ 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.ProjectPageReqVO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectRespVO;
|
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.controller.admin.project.vo.ProjectSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.SelectDataVO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.project.ProjectDO;
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.project.ProjectDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.projectday.ProjectdayDO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.service.project.ProjectService;
|
import cn.iocoder.yudao.module.srbscribe.service.project.ProjectService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@ -100,5 +102,12 @@ public class ProjectController {
|
|||||||
return success(projectName);
|
return success(projectName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//根据id获取项目天数集合
|
||||||
|
@GetMapping("/getProjectDay")
|
||||||
|
public CommonResult<List<ProjectdayDO>> getProjectList(Integer id){
|
||||||
|
List<ProjectdayDO> projectDate = projectService.getProjectDay(id);
|
||||||
|
return success(projectDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目可预约天下拉框数据
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SelectDataVO {
|
||||||
|
private String dateTime;
|
||||||
|
}
|
@ -0,0 +1,97 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.controller.admin.projectday;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.projectday.vo.ProjectdayPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.projectday.vo.ProjectdayRespVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.projectday.vo.ProjectdaySaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.projectday.ProjectdayDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.service.projectday.ProjectdayService;
|
||||||
|
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/projectday")
|
||||||
|
@Validated
|
||||||
|
public class ProjectdayController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectdayService projectdayService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建预约项目可预约天")
|
||||||
|
@PreAuthorize("@ss.hasPermission('subscribe:projectday:create')")
|
||||||
|
public CommonResult<Long> createProjectday(@Valid @RequestBody ProjectdaySaveReqVO createReqVO) {
|
||||||
|
return success(projectdayService.createProjectday(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新预约项目可预约天")
|
||||||
|
@PreAuthorize("@ss.hasPermission('subscribe:projectday:update')")
|
||||||
|
public CommonResult<Boolean> updateProjectday(@Valid @RequestBody ProjectdaySaveReqVO updateReqVO) {
|
||||||
|
projectdayService.updateProjectday(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除预约项目可预约天")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('subscribe:projectday:delete')")
|
||||||
|
public CommonResult<Boolean> deleteProjectday(@RequestParam("id") Long id) {
|
||||||
|
projectdayService.deleteProjectday(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得预约项目可预约天")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('subscribe:projectday:query')")
|
||||||
|
public CommonResult<ProjectdayRespVO> getProjectday(@RequestParam("id") Long id) {
|
||||||
|
ProjectdayDO projectday = projectdayService.getProjectday(id);
|
||||||
|
return success(BeanUtils.toBean(projectday, ProjectdayRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得预约项目可预约天分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('subscribe:projectday:query')")
|
||||||
|
public CommonResult<PageResult<ProjectdayRespVO>> getProjectdayPage(@Valid ProjectdayPageReqVO pageReqVO) {
|
||||||
|
PageResult<ProjectdayDO> pageResult = projectdayService.getProjectdayPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ProjectdayRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出预约项目可预约天 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('subscribe:projectday:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportProjectdayExcel(@Valid ProjectdayPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ProjectdayDO> list = projectdayService.getProjectdayPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "预约项目可预约天.xls", "数据", ProjectdayRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ProjectdayRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.controller.admin.projectday.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 ProjectdayPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "项目id", example = "4549")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "可预约天")
|
||||||
|
private String days;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.controller.admin.projectday.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 预约项目可预约天 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ProjectdayRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15955")
|
||||||
|
@ExcelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "4549")
|
||||||
|
@ExcelProperty("项目id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "可预约天")
|
||||||
|
@ExcelProperty("可预约天")
|
||||||
|
private String days;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.controller.admin.projectday.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 ProjectdaySaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15955")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "4549")
|
||||||
|
@NotNull(message = "项目id不能为空")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "可预约天")
|
||||||
|
private String days;
|
||||||
|
|
||||||
|
}
|
@ -18,27 +18,22 @@ public class LitemallReservationPageReqVO extends PageParam {
|
|||||||
@Schema(description = "用户id", example = "27338")
|
@Schema(description = "用户id", example = "27338")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
@Schema(description = "预约类型", example = "2")
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "门店id", example = "9453")
|
@Schema(description = "门店id", example = "9453")
|
||||||
private String brandId;
|
private Long brandId;
|
||||||
|
|
||||||
@Schema(description = "人员id", example = "2596")
|
@Schema(description = "项目id", example = "9453")
|
||||||
private String technicianId;
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "套餐id", example = "2596")
|
||||||
|
private Long technicianId;
|
||||||
|
|
||||||
@Schema(description = "预约时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] reAddTime;
|
|
||||||
|
|
||||||
@Schema(description = "预约时间段")
|
|
||||||
private String hsstr;
|
|
||||||
|
|
||||||
@Schema(description = "预约状态", example = "2")
|
@Schema(description = "预约状态", example = "2")
|
||||||
private Integer reStatus;
|
private Integer reStatus;
|
||||||
|
|
||||||
@Schema(description = "审核状态", example = "2")
|
// @Schema(description = "审核状态", example = "2")
|
||||||
private Integer status;
|
// private Integer status;
|
||||||
|
|
||||||
@Schema(description = "备注", example = "随便")
|
@Schema(description = "备注", example = "随便")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
@ -19,39 +19,32 @@ public class LitemallReservationRespVO {
|
|||||||
@ExcelProperty("用户id")
|
@ExcelProperty("用户id")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
@Schema(description = "预约类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
|
||||||
@ExcelProperty(value = "预约类型", converter = DictConvert.class)
|
|
||||||
@DictFormat("type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "门店id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9453")
|
@Schema(description = "门店id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9453")
|
||||||
@ExcelProperty("门店id")
|
@ExcelProperty("门店id")
|
||||||
private String brandId;
|
private Long brandId;
|
||||||
|
|
||||||
@Schema(description = "人员id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2596")
|
@Schema(description = "人员id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2596")
|
||||||
@ExcelProperty("人员id")
|
@ExcelProperty("人员id")
|
||||||
private String technicianId;
|
private Long technicianId;
|
||||||
|
|
||||||
@Schema(description = "预约时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@ExcelProperty("预约时间")
|
|
||||||
private LocalDateTime reAddTime;
|
|
||||||
|
|
||||||
@Schema(description = "预约时间段", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@ExcelProperty("预约时间段")
|
|
||||||
private String hsstr;
|
|
||||||
|
|
||||||
@Schema(description = "预约状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
@Schema(description = "预约状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
@ExcelProperty(value = "预约状态", converter = DictConvert.class)
|
@ExcelProperty(value = "预约状态", converter = DictConvert.class)
|
||||||
@DictFormat("re_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
@DictFormat("re_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
private Integer reStatus;
|
private Integer reStatus;
|
||||||
|
|
||||||
@Schema(description = "审核状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
// @Schema(description = "审核状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
@ExcelProperty(value = "审核状态", converter = DictConvert.class)
|
// @ExcelProperty(value = "审核状态", converter = DictConvert.class)
|
||||||
@DictFormat("status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
// @DictFormat("status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
private Integer status;
|
// private Integer status;
|
||||||
|
private String timeQuantum;
|
||||||
|
private String days;
|
||||||
private String technicianName;
|
private String technicianName;
|
||||||
|
private String name;
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
@Schema(description = "创建时间")
|
||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
@ -63,12 +56,6 @@ public class LitemallReservationRespVO {
|
|||||||
@ExcelProperty("用户名称")
|
@ExcelProperty("用户名称")
|
||||||
private String nickname;
|
private String nickname;
|
||||||
|
|
||||||
//电话
|
|
||||||
private String memberphone;
|
|
||||||
|
|
||||||
//门店地址
|
|
||||||
private String brandaddress;
|
|
||||||
|
|
||||||
@Schema(description = "备注", example = "随便")
|
@Schema(description = "备注", example = "随便")
|
||||||
@ExcelProperty("备注")
|
@ExcelProperty("备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
@ -17,31 +17,19 @@ public class LitemallReservationSaveReqVO {
|
|||||||
@Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27338")
|
@Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27338")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
@Schema(description = "预约类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
|
||||||
@NotNull(message = "预约类型不能为空")
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "门店id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9453")
|
@Schema(description = "门店id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9453")
|
||||||
@NotEmpty(message = "门店不能为空")
|
@NotEmpty(message = "门店不能为空")
|
||||||
private String brandId;
|
private Long brandId;
|
||||||
|
|
||||||
@Schema(description = "人员id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2596")
|
@Schema(description = "人员id", requiredMode = Schema.RequiredMode.REQUIRED, example = "2596")
|
||||||
@NotEmpty(message = "人员不能为空")
|
@NotEmpty(message = "人员不能为空")
|
||||||
private String technicianId;
|
private Long technicianId;
|
||||||
|
|
||||||
@Schema(description = "预约时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "预约时间不能为空")
|
|
||||||
private String reAddTime;
|
|
||||||
|
|
||||||
@Schema(description = "预约时间段", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
// @NotNull(message = "预约时间段不能为空")
|
|
||||||
private String hsstr;
|
|
||||||
|
|
||||||
@Schema(description = "预约状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
@Schema(description = "预约状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
private Integer reStatus;
|
private Integer reStatus;
|
||||||
|
|
||||||
@Schema(description = "审核状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
// @Schema(description = "审核状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
private Integer status;
|
// private Integer status;
|
||||||
|
|
||||||
@Schema(description = "备注", example = "随便")
|
@Schema(description = "备注", example = "随便")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
@ -105,4 +105,8 @@ public class LitemallTechnicianController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -15,6 +15,8 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class LitemallTechnicianPageReqVO extends PageParam {
|
public class LitemallTechnicianPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
@Schema(description = "项目id", example = "28184")
|
@Schema(description = "项目id", example = "28184")
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
@ -19,6 +19,9 @@ public class LitemallTechnicianRespVO {
|
|||||||
@ExcelProperty("id")
|
@ExcelProperty("id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28184")
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28184")
|
||||||
@ExcelProperty("项目id")
|
@ExcelProperty("项目id")
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
@ -12,6 +12,10 @@ public class LitemallTechnicianSaveReqVO {
|
|||||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26372")
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26372")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "名称")
|
||||||
|
@NotNull(message = "套餐名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28184")
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "28184")
|
||||||
@NotNull(message = "项目不能为空")
|
@NotNull(message = "项目不能为空")
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
@ -4,6 +4,8 @@ import lombok.Data;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class ServiceTimeVO {
|
public class ServiceTimeVO {
|
||||||
|
private Long id;
|
||||||
private String start;
|
private String start;
|
||||||
private String end;
|
private String end;
|
||||||
|
private String subscribeNum;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.srbscribe.controller.app.brand;
|
package cn.iocoder.yudao.module.srbscribe.controller.app.brand;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.brand.vo.LitemallBrandPageReqVO;
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.brand.vo.LitemallBrandPageReqVO;
|
||||||
@ -10,6 +11,8 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,13 +32,19 @@ public class AppBrandController {
|
|||||||
return "cscscs";
|
return "cscscs";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 查询医馆管理列表
|
// * 查询医馆管理列表
|
||||||
*/
|
// */
|
||||||
@GetMapping("/list")
|
// @GetMapping("/list")
|
||||||
public Object list(LitemallBrandPageReqVO litemallBrandPageReqVO) {
|
// public Object list(LitemallBrandPageReqVO litemallBrandPageReqVO) {
|
||||||
PageResult<LitemallBrandDO> pageResult = litemallBrandService.getLitemallBrandPage(litemallBrandPageReqVO);
|
// PageResult<LitemallBrandDO> pageResult = litemallBrandService.getLitemallBrandPage(litemallBrandPageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, LitemallBrandRespVO.class));
|
// return success(BeanUtils.toBean(pageResult, LitemallBrandRespVO.class));
|
||||||
|
// }
|
||||||
|
|
||||||
|
@GetMapping("/getBrand")
|
||||||
|
public CommonResult<List<LitemallBrandDO>> getBrandList(){
|
||||||
|
List<LitemallBrandDO> organization = litemallBrandService.getOrganization();
|
||||||
|
return success(organization);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.controller.app.configuration;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.configuration.ConfigurationDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.service.configuration.ConfigurationService;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/h5/configuration")
|
||||||
|
public class AppConfigurationController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigurationService configurationService;
|
||||||
|
|
||||||
|
//查询套餐时间段
|
||||||
|
@GetMapping("/getConfiguration")
|
||||||
|
public CommonResult<List<ConfigurationDO>> getConfigurationList(Integer projectdayId, Integer technicianId){
|
||||||
|
List<ConfigurationDO> configurationList = configurationService.getConfigurationList(projectdayId, technicianId);
|
||||||
|
return CommonResult.success(configurationList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.controller.app.project;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
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.service.project.ProjectService;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/h5/project")
|
||||||
|
public class AppProjectController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectService projectService;
|
||||||
|
|
||||||
|
@GetMapping("/getProject")
|
||||||
|
public CommonResult<List<ProjectDO>> getProjectList(Integer id){
|
||||||
|
List<ProjectDO> projectById = projectService.getProjectById(id);
|
||||||
|
return CommonResult.success(projectById);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.controller.app.projectday;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.project.ProjectDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.projectday.ProjectdayDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.mysql.projectday.ProjectdayMapper;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.service.projectday.ProjectdayService;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/h5/projectday")
|
||||||
|
public class AppProjectDayController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectdayService projectdayService;
|
||||||
|
|
||||||
|
|
||||||
|
//获取预约天
|
||||||
|
@GetMapping("/getProjectday")
|
||||||
|
public CommonResult<List<ProjectdayDO>> getProjecdaytList(Integer id){
|
||||||
|
List<ProjectdayDO> projectday = projectdayService.getProjectday(id);
|
||||||
|
return CommonResult.success(projectday);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -17,6 +17,7 @@ import javax.annotation.Resource;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -57,18 +58,42 @@ public class AppReservationController {
|
|||||||
/**
|
/**
|
||||||
* 新增预约管理
|
* 新增预约管理
|
||||||
*/
|
*/
|
||||||
@PostMapping("/add")
|
// @PostMapping("/add")
|
||||||
public CommonResult<Long> createLitemallReservation(Integer type,String brandId,String technicianId,String reAddTime,String hsstr,Long userId) {
|
// public CommonResult<Long> createLitemallReservation(Integer type,String brandId,String technicianId,String reAddTime,String hsstr,Long userId) {
|
||||||
|
//
|
||||||
|
// LitemallReservationSaveReqVO litemallReservationSaveReqVO = new LitemallReservationSaveReqVO();
|
||||||
|
// litemallReservationSaveReqVO.setType(type);
|
||||||
|
// litemallReservationSaveReqVO.setBrandId(brandId);
|
||||||
|
// litemallReservationSaveReqVO.setTechnicianId(technicianId);
|
||||||
|
// litemallReservationSaveReqVO.setReAddTime(reAddTime);
|
||||||
|
// litemallReservationSaveReqVO.setHsstr(hsstr);
|
||||||
|
// litemallReservationSaveReqVO.setUserId(userId);
|
||||||
|
//
|
||||||
|
// return success(litemallReservationService.createReservation(litemallReservationSaveReqVO));
|
||||||
|
// }
|
||||||
|
|
||||||
LitemallReservationSaveReqVO litemallReservationSaveReqVO = new LitemallReservationSaveReqVO();
|
|
||||||
litemallReservationSaveReqVO.setType(type);
|
|
||||||
litemallReservationSaveReqVO.setBrandId(brandId);
|
|
||||||
litemallReservationSaveReqVO.setTechnicianId(technicianId);
|
|
||||||
litemallReservationSaveReqVO.setReAddTime(reAddTime);
|
|
||||||
litemallReservationSaveReqVO.setHsstr(hsstr);
|
|
||||||
litemallReservationSaveReqVO.setUserId(userId);
|
|
||||||
|
|
||||||
return success(litemallReservationService.createReservation(litemallReservationSaveReqVO));
|
@GetMapping("/addReservation")
|
||||||
|
public CommonResult<Integer> addReservation(Integer brandId,Integer projectId,Integer technicianId,
|
||||||
|
Integer projectdayId,Integer timeId,String name,String phone){
|
||||||
|
LitemallReservationDO litemallReservationDO = new LitemallReservationDO();
|
||||||
|
litemallReservationDO.setUserId(getLoginUserId());
|
||||||
|
litemallReservationDO.setBrandId((long)brandId);
|
||||||
|
litemallReservationDO.setProjectId((long)projectId);
|
||||||
|
litemallReservationDO.setTechnicianId((long)technicianId);
|
||||||
|
litemallReservationDO.setProjectdayId((long)projectdayId);
|
||||||
|
litemallReservationDO.setConfigurationId((long)timeId);
|
||||||
|
litemallReservationDO.setName(name);
|
||||||
|
litemallReservationDO.setPhone(phone);
|
||||||
|
return success(litemallReservationService.addReservation(litemallReservationDO));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//预约记录
|
||||||
|
@GetMapping("/reservationInfo")
|
||||||
|
public CommonResult<List<LitemallReservationDO>> reservationInfo(){
|
||||||
|
List<LitemallReservationDO> litemallReservationDOList = litemallReservationService.reservationInfo(getLoginUserId());
|
||||||
|
return success(litemallReservationDOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员
|
* 套餐
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/h5/technician")
|
@RequestMapping("/h5/technician")
|
||||||
@ -49,33 +49,39 @@ public class AppTechnicianController {
|
|||||||
/**
|
/**
|
||||||
* 查询技师管理详情
|
* 查询技师管理详情
|
||||||
*/
|
*/
|
||||||
@GetMapping("/h5xq")
|
// @GetMapping("/h5xq")
|
||||||
public Object h5xq(LitemallTechnicianDO litemallTechnician) throws JSONException {
|
// public Object h5xq(LitemallTechnicianDO litemallTechnician) throws JSONException {
|
||||||
|
//
|
||||||
|
// LitemallTechnicianDO litemallTechnicianDO = new LitemallTechnicianDO();
|
||||||
|
// litemallTechnicianDO = litemallTechnicianService.getLitemallTechnician(litemallTechnician.getId());
|
||||||
|
// litemallTechnicianDO.getAddDate();
|
||||||
|
// String serviceTime = litemallTechnicianDO.getServiceTime();
|
||||||
|
// JSONArray jsonArray = new JSONArray(serviceTime);
|
||||||
|
// List<Object> relist = new ArrayList<>();
|
||||||
|
// for (int i = 0; i < jsonArray.length(); i++) {
|
||||||
|
// Map maps = (Map) JSON.parse(jsonArray.get(i).toString());
|
||||||
|
// String serviceTime1 = maps.get("startTime") + "-" + maps.get("endTime");
|
||||||
|
// LitemallReservationDO litemallReservationDO = new LitemallReservationDO();
|
||||||
|
// litemallReservationDO.setTechnicianId(litemallTechnician.getId());
|
||||||
|
// litemallReservationDO.setReAddTime(litemallTechnician.getAddDate());
|
||||||
|
// litemallReservationDO.setHsstr(serviceTime1);
|
||||||
|
// List<LitemallReservationDO> list = litemallReservationService.selectLitemallReservationList(litemallReservationDO);
|
||||||
|
// if (list.size() != 0) {
|
||||||
|
//// if (list.size()!=0||litemallTechnician2.getYm().equals("1")){
|
||||||
|
// maps.put("ym", "true");
|
||||||
|
// } else {
|
||||||
|
// maps.put("ym", "false");
|
||||||
|
// }
|
||||||
|
// relist.add(maps);
|
||||||
|
// }
|
||||||
|
// litemallTechnicianDO.setServiceTime(relist.toString());
|
||||||
|
// return success(litemallTechnicianDO);
|
||||||
|
// }
|
||||||
|
|
||||||
LitemallTechnicianDO litemallTechnicianDO = new LitemallTechnicianDO();
|
@GetMapping("/getTechnician")
|
||||||
litemallTechnicianDO = litemallTechnicianService.getLitemallTechnician(litemallTechnician.getId());
|
public CommonResult<List<LitemallTechnicianDO>> getTechnician(Integer id){
|
||||||
litemallTechnicianDO.getAddDate();
|
List<LitemallTechnicianDO> technician = litemallTechnicianService.getTechnician(id);
|
||||||
String serviceTime = litemallTechnicianDO.getServiceTime();
|
return success(technician);
|
||||||
JSONArray jsonArray = new JSONArray(serviceTime);
|
|
||||||
List<Object> relist = new ArrayList<>();
|
|
||||||
for (int i = 0; i < jsonArray.length(); i++) {
|
|
||||||
Map maps = (Map) JSON.parse(jsonArray.get(i).toString());
|
|
||||||
String serviceTime1 = maps.get("startTime") + "-" + maps.get("endTime");
|
|
||||||
LitemallReservationDO litemallReservationDO = new LitemallReservationDO();
|
|
||||||
litemallReservationDO.setTechnicianId(String.valueOf(litemallTechnician.getId()));
|
|
||||||
litemallReservationDO.setReAddTime(litemallTechnician.getAddDate());
|
|
||||||
litemallReservationDO.setHsstr(serviceTime1);
|
|
||||||
List<LitemallReservationDO> list = litemallReservationService.selectLitemallReservationList(litemallReservationDO);
|
|
||||||
if (list.size() != 0) {
|
|
||||||
// if (list.size()!=0||litemallTechnician2.getYm().equals("1")){
|
|
||||||
maps.put("ym", "true");
|
|
||||||
} else {
|
|
||||||
maps.put("ym", "false");
|
|
||||||
}
|
|
||||||
relist.add(maps);
|
|
||||||
}
|
|
||||||
litemallTechnicianDO.setServiceTime(relist.toString());
|
|
||||||
return success(litemallTechnicianDO);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,58 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.dal.dataobject.configuration;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约配置 DO
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@TableName("subscribe_configuration")
|
||||||
|
@KeySequence("subscribe_configuration_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ConfigurationDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 套餐id
|
||||||
|
*/
|
||||||
|
private Long technicianId;
|
||||||
|
|
||||||
|
private Long projectdayId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String serviceTimes;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String technicianName;
|
||||||
|
/**
|
||||||
|
* 时间段
|
||||||
|
*/
|
||||||
|
private String timeQuantum;
|
||||||
|
/**
|
||||||
|
* 可预约数
|
||||||
|
*/
|
||||||
|
private Integer availableNumber;
|
||||||
|
/**
|
||||||
|
* 剩余预约数
|
||||||
|
*/
|
||||||
|
private Integer residueNumber;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*
|
||||||
|
* 枚举 {@link TODO subscribe_configuration_status 对应的类}
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.dal.dataobject.projectday;
|
||||||
|
|
||||||
|
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 管理员
|
||||||
|
*/
|
||||||
|
@TableName("subscribe_projectday")
|
||||||
|
@KeySequence("subscribe_projectday_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ProjectdayDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
/**
|
||||||
|
* 可预约天
|
||||||
|
*/
|
||||||
|
private String days;
|
||||||
|
|
||||||
|
private String week;
|
||||||
|
|
||||||
|
}
|
@ -28,42 +28,53 @@ public class LitemallReservationDO extends BaseDO {
|
|||||||
* 用户id
|
* 用户id
|
||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String memberphone;
|
private String memberphone;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String nickname;
|
private String nickname;
|
||||||
/**
|
private String name;
|
||||||
* 预约类型
|
private String phone;
|
||||||
*
|
|
||||||
* 枚举 {@link TODO type 对应的类}
|
|
||||||
*/
|
|
||||||
private Integer type;
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String typeName;
|
|
||||||
/**
|
/**
|
||||||
* 门店id
|
* 门店id
|
||||||
*/
|
*/
|
||||||
private String brandId;
|
private Long brandId;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String brandName;
|
private String brandName;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String brandphone;
|
private String brandphone;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String brandaddress;
|
private String brandaddress;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String timeQuantum;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员id
|
* 项目id
|
||||||
*/
|
*/
|
||||||
private String technicianId;
|
private Long projectId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String projectName;
|
||||||
|
/**
|
||||||
|
* 套餐id
|
||||||
|
*/
|
||||||
|
private Long technicianId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String stat;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String technicianName;
|
private String technicianName;
|
||||||
/**
|
|
||||||
* 预约时间
|
private Long projectdayId;
|
||||||
*/
|
@TableField(exist = false)
|
||||||
private String reAddTime;
|
private String days;
|
||||||
/**
|
|
||||||
* 预约时间段
|
private Long configurationId;
|
||||||
*/
|
|
||||||
private String hsstr;
|
|
||||||
/**
|
/**
|
||||||
* 预约状态
|
* 预约状态
|
||||||
*
|
*
|
||||||
@ -75,7 +86,7 @@ public class LitemallReservationDO extends BaseDO {
|
|||||||
*
|
*
|
||||||
* 枚举 {@link TODO status 对应的类}
|
* 枚举 {@link TODO status 对应的类}
|
||||||
*/
|
*/
|
||||||
private Integer status;
|
// private Integer status;
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
@ -28,6 +28,10 @@ public class LitemallTechnicianDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableId
|
@TableId
|
||||||
private Long id;
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 套餐名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
/**
|
/**
|
||||||
* 项目id
|
* 项目id
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.dal.mysql.configuration;
|
||||||
|
|
||||||
|
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.configuration.vo.ConfigurationPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.configuration.ConfigurationDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约配置 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ConfigurationMapper extends BaseMapperX<ConfigurationDO> {
|
||||||
|
|
||||||
|
default PageResult<ConfigurationDO> selectPage(ConfigurationPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigurationDO>()
|
||||||
|
.eqIfPresent(ConfigurationDO::getTechnicianId, reqVO.getTechnicianId())
|
||||||
|
.eqIfPresent(ConfigurationDO::getTimeQuantum, reqVO.getTimeQuantum())
|
||||||
|
.eqIfPresent(ConfigurationDO::getAvailableNumber, reqVO.getAvailableNumber())
|
||||||
|
.eqIfPresent(ConfigurationDO::getResidueNumber, reqVO.getResidueNumber())
|
||||||
|
.eqIfPresent(ConfigurationDO::getStatus, reqVO.getStatus())
|
||||||
|
.betweenIfPresent(ConfigurationDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(ConfigurationDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.dal.mysql.projectday;
|
||||||
|
|
||||||
|
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.projectday.vo.ProjectdayPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.projectday.ProjectdayDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约项目可预约天 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ProjectdayMapper extends BaseMapperX<ProjectdayDO> {
|
||||||
|
|
||||||
|
default PageResult<ProjectdayDO> selectPage(ProjectdayPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ProjectdayDO>()
|
||||||
|
.eqIfPresent(ProjectdayDO::getProjectId, reqVO.getProjectId())
|
||||||
|
.eqIfPresent(ProjectdayDO::getDays, reqVO.getDays())
|
||||||
|
.betweenIfPresent(ProjectdayDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(ProjectdayDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -23,13 +23,9 @@ public interface LitemallReservationMapper extends BaseMapperX<LitemallReservati
|
|||||||
default PageResult<LitemallReservationDO> selectPage(LitemallReservationPageReqVO reqVO) {
|
default PageResult<LitemallReservationDO> selectPage(LitemallReservationPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<LitemallReservationDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<LitemallReservationDO>()
|
||||||
.eqIfPresent(LitemallReservationDO::getUserId, reqVO.getUserId())
|
.eqIfPresent(LitemallReservationDO::getUserId, reqVO.getUserId())
|
||||||
.eqIfPresent(LitemallReservationDO::getType, reqVO.getType())
|
|
||||||
.eqIfPresent(LitemallReservationDO::getBrandId, reqVO.getBrandId())
|
.eqIfPresent(LitemallReservationDO::getBrandId, reqVO.getBrandId())
|
||||||
.eqIfPresent(LitemallReservationDO::getTechnicianId, reqVO.getTechnicianId())
|
.eqIfPresent(LitemallReservationDO::getTechnicianId, reqVO.getTechnicianId())
|
||||||
.betweenIfPresent(LitemallReservationDO::getReAddTime, reqVO.getReAddTime())
|
|
||||||
.eqIfPresent(LitemallReservationDO::getHsstr, reqVO.getHsstr())
|
|
||||||
.eqIfPresent(LitemallReservationDO::getReStatus, reqVO.getReStatus())
|
.eqIfPresent(LitemallReservationDO::getReStatus, reqVO.getReStatus())
|
||||||
.eqIfPresent(LitemallReservationDO::getStatus, reqVO.getStatus())
|
|
||||||
.eqIfPresent(LitemallReservationDO::getRemark, reqVO.getRemark())
|
.eqIfPresent(LitemallReservationDO::getRemark, reqVO.getRemark())
|
||||||
.betweenIfPresent(LitemallReservationDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(LitemallReservationDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(LitemallReservationDO::getId));
|
.orderByDesc(LitemallReservationDO::getId));
|
||||||
|
@ -60,4 +60,6 @@ public interface LitemallBrandService {
|
|||||||
*/
|
*/
|
||||||
List<LitemallBrandDO> getOrganization();
|
List<LitemallBrandDO> getOrganization();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.service.configuration;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.configuration.vo.ConfigurationPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.configuration.vo.ConfigurationSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.technician.vo.ServiceTimeVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.configuration.ConfigurationDO;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约配置 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface ConfigurationService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建预约配置
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createConfiguration(@Valid ConfigurationSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新预约配置
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateConfiguration(@Valid ConfigurationSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除预约配置
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteConfiguration(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得预约配置
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 预约配置
|
||||||
|
*/
|
||||||
|
ConfigurationDO getConfiguration(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得预约配置分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 预约配置分页
|
||||||
|
*/
|
||||||
|
PageResult<ConfigurationDO> getConfigurationPage(ConfigurationPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
List<ServiceTimeVO> getConfiguration(Integer id);
|
||||||
|
|
||||||
|
Long addUpdConfiguration(ConfigurationDO pageReqVO);
|
||||||
|
|
||||||
|
List<ConfigurationDO> getConfigurationList(Integer projectdayId, Integer technicianId);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,145 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.service.configuration;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.configuration.vo.ConfigurationPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.configuration.vo.ConfigurationSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.technician.vo.ServiceTimeVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.configuration.ConfigurationDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.technician.LitemallTechnicianDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.mysql.configuration.ConfigurationMapper;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.mysql.technician.LitemallTechnicianMapper;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.TypeReference;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
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.ArrayList;
|
||||||
|
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 ConfigurationServiceImpl implements ConfigurationService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigurationMapper configurationMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private LitemallTechnicianMapper litemallTechnicianMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createConfiguration(ConfigurationSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ConfigurationDO configuration = BeanUtils.toBean(createReqVO, ConfigurationDO.class);
|
||||||
|
configurationMapper.insert(configuration);
|
||||||
|
// 返回
|
||||||
|
return configuration.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateConfiguration(ConfigurationSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateConfigurationExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ConfigurationDO updateObj = BeanUtils.toBean(updateReqVO, ConfigurationDO.class);
|
||||||
|
configurationMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteConfiguration(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateConfigurationExists(id);
|
||||||
|
// 删除
|
||||||
|
configurationMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateConfigurationExists(Long id) {
|
||||||
|
if (configurationMapper.selectById(id) == null) {
|
||||||
|
throw exception(CONFIGURATION_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConfigurationDO getConfiguration(Long id) {
|
||||||
|
return configurationMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ConfigurationDO> getConfigurationPage(ConfigurationPageReqVO pageReqVO) {
|
||||||
|
PageResult<ConfigurationDO> configurationDOPageResult = configurationMapper.selectPage(pageReqVO);
|
||||||
|
for (int i = 0; i < configurationDOPageResult.getList().size(); i++) {
|
||||||
|
ConfigurationDO configurationDO = configurationDOPageResult.getList().get(i);
|
||||||
|
LitemallTechnicianDO litemallTechnicianDO = litemallTechnicianMapper.selectOne("id", configurationDO.getTechnicianId());
|
||||||
|
configurationDO.setTechnicianName(litemallTechnicianDO.getName());
|
||||||
|
}
|
||||||
|
return configurationDOPageResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ServiceTimeVO> getConfiguration(Integer id) {
|
||||||
|
List<ConfigurationDO> configurationDOS = configurationMapper.selectList("projectday_id", id);
|
||||||
|
List<ServiceTimeVO> serviceTimeVOList = new ArrayList<>();
|
||||||
|
for (int i = 0; i < configurationDOS.size(); i++) {
|
||||||
|
ConfigurationDO configurationDO = configurationDOS.get(i);
|
||||||
|
ServiceTimeVO serviceTimeVO = new ServiceTimeVO();
|
||||||
|
String[] split = configurationDO.getTimeQuantum().split(" - ");
|
||||||
|
serviceTimeVO.setId(configurationDO.getId());
|
||||||
|
serviceTimeVO.setStart(split[0]);
|
||||||
|
serviceTimeVO.setEnd(split[1]);
|
||||||
|
serviceTimeVO.setSubscribeNum(String.valueOf(configurationDO.getAvailableNumber()));
|
||||||
|
serviceTimeVOList.add(serviceTimeVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return serviceTimeVOList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long addUpdConfiguration(ConfigurationDO pageReqVO) {
|
||||||
|
|
||||||
|
//添加成功后,时间段添加到预约时间段配置中
|
||||||
|
|
||||||
|
if(pageReqVO.getServiceTimes() != null && pageReqVO.getServiceTimes() != ""){
|
||||||
|
//把StringJSON格式serviceTime转成对象
|
||||||
|
List<ServiceTimeVO> serviceTimeVOS = JSON.parseObject(pageReqVO.getServiceTimes(), new TypeReference<List<ServiceTimeVO>>() {});
|
||||||
|
for (int j = 0; j < serviceTimeVOS.size(); j++) {
|
||||||
|
ServiceTimeVO serviceTimeVO = serviceTimeVOS.get(j);
|
||||||
|
String serviceTime = serviceTimeVO.getStart() + " - " + serviceTimeVO.getEnd();
|
||||||
|
|
||||||
|
ConfigurationDO configurationDO = new ConfigurationDO();
|
||||||
|
configurationDO.setTechnicianId(pageReqVO.getTechnicianId());
|
||||||
|
configurationDO.setProjectdayId(pageReqVO.getProjectdayId());
|
||||||
|
configurationDO.setTimeQuantum(serviceTime);
|
||||||
|
configurationDO.setAvailableNumber(Integer.parseInt(serviceTimeVO.getSubscribeNum()));
|
||||||
|
configurationDO.setResidueNumber(Integer.parseInt(serviceTimeVO.getSubscribeNum()));
|
||||||
|
configurationDO.setStatus(1);
|
||||||
|
configurationMapper.insert(configurationDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConfigurationDO> getConfigurationList(Integer projectdayId, Integer technicianId) {
|
||||||
|
QueryWrapper<ConfigurationDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("projectday_id",projectdayId).eq("technician_id",technicianId);
|
||||||
|
List<ConfigurationDO> configurationDOS = configurationMapper.selectList(queryWrapper);
|
||||||
|
|
||||||
|
return configurationDOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.srbscribe.service.project;
|
|||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
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.ProjectPageReqVO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectSaveReqVO;
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.SelectDataVO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.project.ProjectDO;
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.project.ProjectDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.projectday.ProjectdayDO;
|
||||||
|
|
||||||
import javax.validation.*;
|
import javax.validation.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -56,4 +58,9 @@ public interface ProjectService {
|
|||||||
|
|
||||||
List<ProjectDO> getProjectName();
|
List<ProjectDO> getProjectName();
|
||||||
|
|
||||||
|
List<ProjectDO> getProjectById(int id);
|
||||||
|
|
||||||
|
//获取项目预约天的下拉框数据
|
||||||
|
List<ProjectdayDO> getProjectDay(int id);
|
||||||
|
|
||||||
}
|
}
|
@ -3,16 +3,32 @@ package cn.iocoder.yudao.module.srbscribe.service.project;
|
|||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
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.ProjectPageReqVO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectSaveReqVO;
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.ProjectSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.project.vo.SelectDataVO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.brand.LitemallBrandDO;
|
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.project.ProjectDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.projectday.ProjectdayDO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.dal.mysql.brand.LitemallBrandMapper;
|
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.project.ProjectMapper;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.mysql.projectday.ProjectdayMapper;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.google.common.reflect.TypeToken;
|
||||||
|
import com.google.gson.Gson;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.format.TextStyle;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.module.subscribe.enums.ErrorCodeConstants.*;
|
import static cn.iocoder.yudao.module.subscribe.enums.ErrorCodeConstants.*;
|
||||||
@ -32,11 +48,64 @@ public class ProjectServiceImpl implements ProjectService {
|
|||||||
@Resource
|
@Resource
|
||||||
private LitemallBrandMapper litemallBrandMapper;
|
private LitemallBrandMapper litemallBrandMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectdayMapper projectdayMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createProject(ProjectSaveReqVO createReqVO) {
|
public Long createProject(ProjectSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
ProjectDO project = BeanUtils.toBean(createReqVO, ProjectDO.class);
|
ProjectDO project = BeanUtils.toBean(createReqVO, ProjectDO.class);
|
||||||
projectMapper.insert(project);
|
int insert = projectMapper.insert(project);
|
||||||
|
|
||||||
|
if (insert > 0){
|
||||||
|
|
||||||
|
// 创建 Gson 对象
|
||||||
|
Gson gson = new Gson();
|
||||||
|
// 定义数组的类型
|
||||||
|
Type arrayType = new TypeToken<String[]>() {}.getType();
|
||||||
|
|
||||||
|
// 将字符串转换为数组
|
||||||
|
String[] timeIntervalArray = gson.fromJson(project.getTimeInterval(), arrayType);
|
||||||
|
String[] startDate = timeIntervalArray[0].split("T");
|
||||||
|
String[] endDate = timeIntervalArray[1].split("T");
|
||||||
|
|
||||||
|
// 定义日期格式
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
// 定义起始日期和结束日期
|
||||||
|
LocalDate startDates = LocalDate.parse(startDate[0], formatter);
|
||||||
|
LocalDate endDates = LocalDate.parse(endDate[0], formatter);
|
||||||
|
// 获取日期范围内的所有日期
|
||||||
|
List<LocalDate> dateList = getDatesBetween(startDates, endDates);
|
||||||
|
// 创建一个 StringBuilder 来存储所有日期的字符串
|
||||||
|
StringBuilder dateStringBuilder = new StringBuilder();
|
||||||
|
// 拼接所有日期字符串
|
||||||
|
for (LocalDate date : dateList) {
|
||||||
|
dateStringBuilder.append(date.format(formatter)).append(","); // 连接日期和逗号
|
||||||
|
}
|
||||||
|
// 删除最后一个逗号和空格
|
||||||
|
if (dateStringBuilder.length() > 0) {
|
||||||
|
dateStringBuilder.setLength(dateStringBuilder.length() - 1); // 移除最后的逗号和空格
|
||||||
|
}
|
||||||
|
// 输出所有日期作为单个字符串
|
||||||
|
String finalDateString = dateStringBuilder.toString();
|
||||||
|
String[] split = finalDateString.split(",");
|
||||||
|
List<ProjectdayDO> projectdayDOS = new ArrayList<>();
|
||||||
|
for (int i = 0; i < split.length; i++) {
|
||||||
|
ProjectdayDO projectdayDO = new ProjectdayDO();
|
||||||
|
projectdayDO.setProjectId(project.getId());
|
||||||
|
projectdayDO.setDays(split[i]);
|
||||||
|
LocalDate localDate = LocalDate.parse(split[i]);
|
||||||
|
String dayOfWeek = localDate.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.CHINESE);
|
||||||
|
projectdayDO.setWeek(dayOfWeek);
|
||||||
|
projectdayDOS.add(projectdayDO);
|
||||||
|
}
|
||||||
|
projectdayMapper.insertBatch(projectdayDOS);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 返回
|
// 返回
|
||||||
return project.getId();
|
return project.getId();
|
||||||
}
|
}
|
||||||
@ -72,11 +141,22 @@ public class ProjectServiceImpl implements ProjectService {
|
|||||||
@Override
|
@Override
|
||||||
public PageResult<ProjectDO> getProjectPage(ProjectPageReqVO pageReqVO) {
|
public PageResult<ProjectDO> getProjectPage(ProjectPageReqVO pageReqVO) {
|
||||||
PageResult<ProjectDO> projectDOPageResult = projectMapper.selectPage(pageReqVO);
|
PageResult<ProjectDO> projectDOPageResult = projectMapper.selectPage(pageReqVO);
|
||||||
|
// 创建 Gson 对象
|
||||||
|
Gson gson = new Gson();
|
||||||
|
// 定义数组的类型
|
||||||
|
Type arrayType = new TypeToken<String[]>() {
|
||||||
|
}.getType();
|
||||||
|
|
||||||
for (int i = 0; i < projectDOPageResult.getList().size(); i++) {
|
for (int i = 0; i < projectDOPageResult.getList().size(); i++) {
|
||||||
ProjectDO projectDO = projectDOPageResult.getList().get(i);
|
ProjectDO projectDO = projectDOPageResult.getList().get(i);
|
||||||
LitemallBrandDO litemallBrandDO = litemallBrandMapper.selectOne("id", projectDO.getBrandId());
|
LitemallBrandDO litemallBrandDO = litemallBrandMapper.selectOne("id", projectDO.getBrandId());
|
||||||
projectDO.setBrandName(litemallBrandDO.getName());
|
projectDO.setBrandName(litemallBrandDO.getName());
|
||||||
|
|
||||||
|
// 将字符串转换为数组
|
||||||
|
String[] timeIntervalArray = gson.fromJson(projectDO.getTimeInterval(), arrayType);
|
||||||
|
String[] startDate = timeIntervalArray[0].split("T");
|
||||||
|
String[] endDate = timeIntervalArray[1].split("T");
|
||||||
|
projectDO.setTimeInterval(startDate[0] + " - " + endDate[0]);
|
||||||
}
|
}
|
||||||
return projectDOPageResult;
|
return projectDOPageResult;
|
||||||
}
|
}
|
||||||
@ -86,4 +166,44 @@ public class ProjectServiceImpl implements ProjectService {
|
|||||||
return projectMapper.selectList();
|
return projectMapper.selectList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProjectDO> getProjectById(int id) {
|
||||||
|
List<ProjectDO> brand_id = projectMapper.selectList("brand_id", id);
|
||||||
|
// 创建 Gson 对象
|
||||||
|
Gson gson = new Gson();
|
||||||
|
// 定义数组的类型
|
||||||
|
Type arrayType = new TypeToken<String[]>() {
|
||||||
|
}.getType();
|
||||||
|
for (int i = 0; i < brand_id.size(); i++) {
|
||||||
|
ProjectDO projectDO = brand_id.get(i);
|
||||||
|
// 将字符串转换为数组
|
||||||
|
String[] timeIntervalArray = gson.fromJson(projectDO.getTimeInterval(), arrayType);
|
||||||
|
String[] startDate = timeIntervalArray[0].split("T");
|
||||||
|
String[] endDate = timeIntervalArray[1].split("T");
|
||||||
|
projectDO.setTimeInterval(startDate[0] + "-" + endDate[0]);
|
||||||
|
}
|
||||||
|
return brand_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProjectdayDO> getProjectDay(int id) {
|
||||||
|
|
||||||
|
List<ProjectdayDO> projectdayDOS = projectdayMapper.selectList("project_id", id);
|
||||||
|
return projectdayDOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 方法:获取两个日期之间的所有日期
|
||||||
|
public static List<LocalDate> getDatesBetween(LocalDate startDate, LocalDate endDate) {
|
||||||
|
List<LocalDate> dates = new ArrayList<>();
|
||||||
|
LocalDate currentDate = startDate;
|
||||||
|
|
||||||
|
while (!currentDate.isAfter(endDate)) {
|
||||||
|
dates.add(currentDate);
|
||||||
|
currentDate = currentDate.plusDays(1); // 增加一天
|
||||||
|
}
|
||||||
|
|
||||||
|
return dates;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.service.projectday;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.projectday.vo.ProjectdayPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.projectday.vo.ProjectdaySaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.projectday.ProjectdayDO;
|
||||||
|
|
||||||
|
import javax.validation.*;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约项目可预约天 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface ProjectdayService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建预约项目可预约天
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createProjectday(@Valid ProjectdaySaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新预约项目可预约天
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateProjectday(@Valid ProjectdaySaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除预约项目可预约天
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteProjectday(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得预约项目可预约天
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 预约项目可预约天
|
||||||
|
*/
|
||||||
|
ProjectdayDO getProjectday(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得预约项目可预约天分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 预约项目可预约天分页
|
||||||
|
*/
|
||||||
|
PageResult<ProjectdayDO> getProjectdayPage(ProjectdayPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
List<ProjectdayDO> getProjectday(Integer id);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,78 @@
|
|||||||
|
package cn.iocoder.yudao.module.srbscribe.service.projectday;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.projectday.vo.ProjectdayPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.projectday.vo.ProjectdaySaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.projectday.ProjectdayDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.mysql.projectday.ProjectdayMapper;
|
||||||
|
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 ProjectdayServiceImpl implements ProjectdayService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectdayMapper projectdayMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createProjectday(ProjectdaySaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ProjectdayDO projectday = BeanUtils.toBean(createReqVO, ProjectdayDO.class);
|
||||||
|
projectdayMapper.insert(projectday);
|
||||||
|
// 返回
|
||||||
|
return projectday.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProjectday(ProjectdaySaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateProjectdayExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ProjectdayDO updateObj = BeanUtils.toBean(updateReqVO, ProjectdayDO.class);
|
||||||
|
projectdayMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteProjectday(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateProjectdayExists(id);
|
||||||
|
// 删除
|
||||||
|
projectdayMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateProjectdayExists(Long id) {
|
||||||
|
if (projectdayMapper.selectById(id) == null) {
|
||||||
|
throw exception(PROJECTDAY_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProjectdayDO getProjectday(Long id) {
|
||||||
|
return projectdayMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ProjectdayDO> getProjectdayPage(ProjectdayPageReqVO pageReqVO) {
|
||||||
|
return projectdayMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProjectdayDO> getProjectday(Integer id) {
|
||||||
|
List<ProjectdayDO> projectdayDOS = projectdayMapper.selectList("project_id", id);
|
||||||
|
return projectdayDOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -65,6 +65,10 @@ public interface LitemallReservationService {
|
|||||||
*/
|
*/
|
||||||
PageResult<LitemallReservationDO> getLitemallReservationPage(LitemallReservationPageReqVO pageReqVO);
|
PageResult<LitemallReservationDO> getLitemallReservationPage(LitemallReservationPageReqVO pageReqVO);
|
||||||
|
|
||||||
List<LitemallReservationDO> getLitemallReservationList(LitemallReservationDO litemallReservationDO);
|
|
||||||
|
|
||||||
|
int addReservation(LitemallReservationDO litemallReservationDO);
|
||||||
|
|
||||||
|
List<LitemallReservationDO> reservationInfo(Long userId);
|
||||||
|
|
||||||
}
|
}
|
@ -6,9 +6,15 @@ import cn.iocoder.yudao.module.srbscribe.controller.admin.reservation.vo.Litemal
|
|||||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.reservation.vo.LitemallReservationSaveReqVO;
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.reservation.vo.LitemallReservationSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.technician.vo.ServiceTimeVO;
|
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.brand.LitemallBrandDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.configuration.ConfigurationDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.project.ProjectDO;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.projectday.ProjectdayDO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.reservation.LitemallReservationDO;
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.reservation.LitemallReservationDO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.technician.LitemallTechnicianDO;
|
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.brand.LitemallBrandMapper;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.mysql.configuration.ConfigurationMapper;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.mysql.project.ProjectMapper;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.mysql.projectday.ProjectdayMapper;
|
||||||
import cn.iocoder.yudao.module.srbscribe.dal.mysql.reservation.LitemallReservationMapper;
|
import cn.iocoder.yudao.module.srbscribe.dal.mysql.reservation.LitemallReservationMapper;
|
||||||
import cn.iocoder.yudao.module.srbscribe.dal.mysql.technician.LitemallTechnicianMapper;
|
import cn.iocoder.yudao.module.srbscribe.dal.mysql.technician.LitemallTechnicianMapper;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
@ -41,12 +47,24 @@ public class LitemallReservationServiceImpl implements LitemallReservationServic
|
|||||||
@Resource
|
@Resource
|
||||||
private LitemallBrandMapper litemallBrandMapper;
|
private LitemallBrandMapper litemallBrandMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectMapper projectMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private LitemallTechnicianMapper litemallTechnicianMapper;
|
private LitemallTechnicianMapper litemallTechnicianMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private MemberUserMapper memberUserMapper;
|
private MemberUserMapper memberUserMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigurationMapper configurationMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectdayMapper projectdayMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询预约管理列表
|
* 查询预约管理列表
|
||||||
*
|
*
|
||||||
@ -109,27 +127,99 @@ public class LitemallReservationServiceImpl implements LitemallReservationServic
|
|||||||
for (int i = 0; i < litemallReservationDOPageResult.getList().size(); i++) {
|
for (int i = 0; i < litemallReservationDOPageResult.getList().size(); i++) {
|
||||||
LitemallReservationDO litemallReservationDO = litemallReservationDOPageResult.getList().get(i);
|
LitemallReservationDO litemallReservationDO = litemallReservationDOPageResult.getList().get(i);
|
||||||
|
|
||||||
|
//门店信息
|
||||||
LitemallBrandDO litemallBrandDO = litemallBrandMapper.selectOne("id", litemallReservationDO.getBrandId());
|
LitemallBrandDO litemallBrandDO = litemallBrandMapper.selectOne("id", litemallReservationDO.getBrandId());
|
||||||
litemallReservationDO.setBrandName(litemallBrandDO.getName());
|
litemallReservationDO.setBrandName(litemallBrandDO.getName());
|
||||||
litemallReservationDO.setBrandaddress(litemallBrandDO.getAddress());
|
litemallReservationDO.setBrandaddress(litemallBrandDO.getAddress());
|
||||||
|
|
||||||
// LitemallTechnicianDO litemallTechnicianDO = litemallTechnicianMapper.selectOne("id", litemallReservationDO.getTechnicianId());
|
//项目信息
|
||||||
// litemallReservationDO.setTechnicianName(litemallTechnicianDO.getTechnicianName());
|
ProjectDO projectDO = projectMapper.selectOne("id", litemallReservationDO.getProjectId());
|
||||||
|
litemallReservationDO.setProjectName(projectDO.getName());
|
||||||
|
|
||||||
MemberUserDO memberUserDO = memberUserMapper.selectOne("id", litemallReservationDO.getUserId());
|
//套餐信息
|
||||||
litemallReservationDO.setNickname(memberUserDO.getNickname());
|
LitemallTechnicianDO litemallTechnicianDO = litemallTechnicianMapper.selectOne("id", litemallReservationDO.getTechnicianId());
|
||||||
litemallReservationDO.setMemberphone(memberUserDO.getMobile());
|
litemallReservationDO.setTechnicianName(litemallTechnicianDO.getName());
|
||||||
|
|
||||||
|
//预约日期
|
||||||
|
ProjectdayDO projectdayDO = projectdayMapper.selectOne("id", litemallReservationDO.getProjectdayId());
|
||||||
|
litemallReservationDO.setDays(projectdayDO.getDays());
|
||||||
|
|
||||||
|
//预约时间段
|
||||||
|
ConfigurationDO configurationDO = configurationMapper.selectOne("id", litemallReservationDO.getConfigurationId());
|
||||||
|
litemallReservationDO.setTimeQuantum(configurationDO.getTimeQuantum());
|
||||||
|
|
||||||
|
|
||||||
|
// MemberUserDO memberUserDO = memberUserMapper.selectOne("id", litemallReservationDO.getUserId());
|
||||||
|
// litemallReservationDO.setNickname(memberUserDO.getNickname());
|
||||||
|
// litemallReservationDO.setMemberphone(memberUserDO.getMobile());
|
||||||
}
|
}
|
||||||
|
|
||||||
return litemallReservationDOPageResult;
|
return litemallReservationDOPageResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<LitemallReservationDO> getLitemallReservationList(LitemallReservationDO litemallReservationDO) {
|
public int addReservation(LitemallReservationDO litemallReservationDO) {
|
||||||
QueryWrapper<LitemallReservationDO> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.eq("type",litemallReservationDO.getType()).eq("brand_id",litemallReservationDO.getBrandId());
|
ConfigurationDO configurationDO = configurationMapper.selectOne("id", litemallReservationDO.getConfigurationId());
|
||||||
List<LitemallReservationDO> litemallReservationDOS = litemallReservationMapper.selectList(queryWrapper);
|
|
||||||
return litemallReservationDOS;
|
if (configurationDO.getResidueNumber() > 0){ //剩余预约人数大于0,可预约
|
||||||
|
litemallReservationDO.setReStatus(1);
|
||||||
|
litemallReservationMapper.insert(litemallReservationDO);
|
||||||
|
int a = configurationDO.getResidueNumber() - 1;
|
||||||
|
if (a == 0){
|
||||||
|
configurationDO.setStatus(0);//设置该时间段为不可预约
|
||||||
|
}
|
||||||
|
configurationDO.setResidueNumber(a);
|
||||||
|
configurationMapper.updateById(configurationDO);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LitemallReservationDO> reservationInfo(Long userId) {
|
||||||
|
|
||||||
|
List<LitemallReservationDO> litemallReservationDOList = litemallReservationMapper.selectList("user_id", userId);
|
||||||
|
for (int i = 0; i < litemallReservationDOList.size(); i++) {
|
||||||
|
LitemallReservationDO litemallReservationDO = litemallReservationDOList.get(i);
|
||||||
|
if (litemallReservationDO.getReStatus() == 1){
|
||||||
|
litemallReservationDO.setStat("预约成功");
|
||||||
|
}
|
||||||
|
if (litemallReservationDO.getReStatus() == 0){
|
||||||
|
litemallReservationDO.setStat("预约失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//门店信息
|
||||||
|
LitemallBrandDO litemallBrandDO = litemallBrandMapper.selectOne("id", litemallReservationDO.getBrandId());
|
||||||
|
litemallReservationDO.setBrandName(litemallBrandDO.getName());
|
||||||
|
litemallReservationDO.setBrandaddress(litemallBrandDO.getAddress());
|
||||||
|
|
||||||
|
//项目信息
|
||||||
|
ProjectDO projectDO = projectMapper.selectOne("id", litemallReservationDO.getProjectId());
|
||||||
|
litemallReservationDO.setProjectName(projectDO.getName());
|
||||||
|
|
||||||
|
//套餐信息
|
||||||
|
LitemallTechnicianDO litemallTechnicianDO = litemallTechnicianMapper.selectOne("id", litemallReservationDO.getTechnicianId());
|
||||||
|
litemallReservationDO.setTechnicianName(litemallTechnicianDO.getName());
|
||||||
|
|
||||||
|
//预约日期
|
||||||
|
ProjectdayDO projectdayDO = projectdayMapper.selectOne("id", litemallReservationDO.getProjectdayId());
|
||||||
|
litemallReservationDO.setDays(projectdayDO.getDays());
|
||||||
|
|
||||||
|
//预约时间段
|
||||||
|
ConfigurationDO configurationDO = configurationMapper.selectOne("id", litemallReservationDO.getConfigurationId());
|
||||||
|
litemallReservationDO.setTimeQuantum(configurationDO.getTimeQuantum());
|
||||||
|
|
||||||
|
|
||||||
|
// MemberUserDO memberUserDO = memberUserMapper.selectOne("id", litemallReservationDO.getUserId());
|
||||||
|
// litemallReservationDO.setNickname(memberUserDO.getNickname());
|
||||||
|
// litemallReservationDO.setMemberphone(memberUserDO.getMobile());
|
||||||
|
}
|
||||||
|
return litemallReservationDOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -59,4 +59,6 @@ public interface LitemallTechnicianService {
|
|||||||
|
|
||||||
List<LitemallTechnicianDO> getTechnicianName();
|
List<LitemallTechnicianDO> getTechnicianName();
|
||||||
|
|
||||||
|
List<LitemallTechnicianDO> getTechnician(int id);
|
||||||
|
|
||||||
}
|
}
|
@ -1,17 +1,16 @@
|
|||||||
package cn.iocoder.yudao.module.srbscribe.service.technician;
|
package cn.iocoder.yudao.module.srbscribe.service.technician;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.brand.vo.LitemallBrandPageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.technician.vo.LitemallTechnicianPageReqVO;
|
import cn.iocoder.yudao.module.srbscribe.controller.admin.technician.vo.LitemallTechnicianPageReqVO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.technician.vo.LitemallTechnicianSaveReqVO;
|
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.controller.admin.technician.vo.ServiceTimeVO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.brand.LitemallBrandDO;
|
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.configuration.ConfigurationDO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.project.ProjectDO;
|
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.dataobject.technician.LitemallTechnicianDO;
|
||||||
import cn.iocoder.yudao.module.srbscribe.dal.mysql.brand.LitemallBrandMapper;
|
import cn.iocoder.yudao.module.srbscribe.dal.mysql.brand.LitemallBrandMapper;
|
||||||
|
import cn.iocoder.yudao.module.srbscribe.dal.mysql.configuration.ConfigurationMapper;
|
||||||
import cn.iocoder.yudao.module.srbscribe.dal.mysql.project.ProjectMapper;
|
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.dal.mysql.technician.LitemallTechnicianMapper;
|
||||||
import cn.iocoder.yudao.module.srbscribe.service.brand.LitemallBrandService;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.TypeReference;
|
import com.alibaba.fastjson.TypeReference;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -21,6 +20,7 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
@ -45,6 +45,9 @@ public class LitemallTechnicianServiceImpl implements LitemallTechnicianService
|
|||||||
@Resource
|
@Resource
|
||||||
private ProjectMapper projectMapper;
|
private ProjectMapper projectMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ConfigurationMapper configurationMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询技师管理列表
|
* 查询技师管理列表
|
||||||
@ -74,7 +77,9 @@ public class LitemallTechnicianServiceImpl implements LitemallTechnicianService
|
|||||||
public Long createLitemallTechnician(LitemallTechnicianSaveReqVO createReqVO) {
|
public Long createLitemallTechnician(LitemallTechnicianSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
LitemallTechnicianDO litemallTechnician = BeanUtils.toBean(createReqVO, LitemallTechnicianDO.class);
|
LitemallTechnicianDO litemallTechnician = BeanUtils.toBean(createReqVO, LitemallTechnicianDO.class);
|
||||||
litemallTechnicianMapper.insert(litemallTechnician);
|
int insert = litemallTechnicianMapper.insert(litemallTechnician);
|
||||||
|
|
||||||
|
|
||||||
// 返回
|
// 返回
|
||||||
return litemallTechnician.getId();
|
return litemallTechnician.getId();
|
||||||
}
|
}
|
||||||
@ -112,23 +117,24 @@ public class LitemallTechnicianServiceImpl implements LitemallTechnicianService
|
|||||||
|
|
||||||
PageResult<LitemallTechnicianDO> litemallTechnicianDOPageResult = litemallTechnicianMapper.selectPage(pageReqVO);
|
PageResult<LitemallTechnicianDO> litemallTechnicianDOPageResult = litemallTechnicianMapper.selectPage(pageReqVO);
|
||||||
|
|
||||||
String serviceTime = "";
|
// String serviceTime = "";
|
||||||
for (int i = 0; i < litemallTechnicianDOPageResult.getList().size(); i++) {
|
for (int i = 0; i < litemallTechnicianDOPageResult.getList().size(); i++) {
|
||||||
LitemallTechnicianDO litemallTechnicianDO = litemallTechnicianDOPageResult.getList().get(i);
|
LitemallTechnicianDO litemallTechnicianDO = litemallTechnicianDOPageResult.getList().get(i);
|
||||||
ProjectDO projectDO = projectMapper.selectOne("id", litemallTechnicianDO.getProjectId());
|
ProjectDO projectDO = projectMapper.selectOne("id", litemallTechnicianDO.getProjectId());
|
||||||
litemallTechnicianDO.setBrandName(projectDO.getName());
|
litemallTechnicianDO.setBrandName(projectDO.getName());
|
||||||
|
|
||||||
if(litemallTechnicianDO.getServiceTime() != null && litemallTechnicianDO.getServiceTime() != ""){
|
|
||||||
//把StringJSON格式serviceTime转成对象
|
// if(litemallTechnicianDO.getServiceTime() != null && litemallTechnicianDO.getServiceTime() != ""){
|
||||||
List<ServiceTimeVO> serviceTimeVOS = JSON.parseObject(litemallTechnicianDO.getServiceTime(), new TypeReference<List<ServiceTimeVO>>() {});
|
// //把StringJSON格式serviceTime转成对象
|
||||||
for (int j = 0; j < serviceTimeVOS.size(); j++) {
|
// List<ServiceTimeVO> serviceTimeVOS = JSON.parseObject(litemallTechnicianDO.getServiceTime(), new TypeReference<List<ServiceTimeVO>>() {});
|
||||||
ServiceTimeVO serviceTimeVO = serviceTimeVOS.get(j);
|
// for (int j = 0; j < serviceTimeVOS.size(); j++) {
|
||||||
serviceTime = serviceTime + serviceTimeVO.getStart() + " - " + serviceTimeVO.getEnd() + " , ";
|
// ServiceTimeVO serviceTimeVO = serviceTimeVOS.get(j);
|
||||||
}
|
// serviceTime = serviceTime + serviceTimeVO.getStart() + " - " + serviceTimeVO.getEnd() + " , ";
|
||||||
String replaceAll = serviceTime.replaceAll(",\\s*$", "");
|
// }
|
||||||
litemallTechnicianDO.setServiceTimeArray(replaceAll);
|
// String replaceAll = serviceTime.replaceAll(",\\s*$", "");
|
||||||
serviceTime = "";
|
// litemallTechnicianDO.setServiceTimeArray(replaceAll);
|
||||||
}
|
// serviceTime = "";
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
return litemallTechnicianDOPageResult;
|
return litemallTechnicianDOPageResult;
|
||||||
@ -142,4 +148,26 @@ public class LitemallTechnicianServiceImpl implements LitemallTechnicianService
|
|||||||
return litemallTechnicianMapper.selectList();
|
return litemallTechnicianMapper.selectList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<LitemallTechnicianDO> getTechnician(int id) {
|
||||||
|
List<LitemallTechnicianDO> project_id = litemallTechnicianMapper.selectList("project_id", id);
|
||||||
|
// String serviceTime = "";
|
||||||
|
// for (int i = 0; i < project_id.size(); i++) {
|
||||||
|
// LitemallTechnicianDO litemallTechnicianDO = project_id.get(i);
|
||||||
|
// if(litemallTechnicianDO.getServiceTime() != null && litemallTechnicianDO.getServiceTime() != ""){
|
||||||
|
// //把StringJSON格式serviceTime转成对象
|
||||||
|
// List<ServiceTimeVO> serviceTimeVOS = JSON.parseObject(litemallTechnicianDO.getServiceTime(), new TypeReference<List<ServiceTimeVO>>() {});
|
||||||
|
// for (int j = 0; j < serviceTimeVOS.size(); j++) {
|
||||||
|
// ServiceTimeVO serviceTimeVO = serviceTimeVOS.get(j);
|
||||||
|
// serviceTime = serviceTime + serviceTimeVO.getStart() + " - " + serviceTimeVO.getEnd() + " , ";
|
||||||
|
// }
|
||||||
|
// String replaceAll = serviceTime.replaceAll(",\\s*$", "");
|
||||||
|
// litemallTechnicianDO.setServiceTimeArray(replaceAll);
|
||||||
|
// serviceTime = "";
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
return project_id;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user