Compare commits

...

14 Commits

Author SHA1 Message Date
7728cc456a 推荐商品类型-包括促销推荐 2024-09-27 13:55:01 +08:00
b973bee0b3 Merge pull request '用户详情头像调整' (#23) from zzw-one into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #23
2024-09-27 11:36:27 +08:00
73ce515567 Merge pull request '16、我的服务菜单的四个字用组件标题替换' (#22) from Branch_csl into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #22
2024-09-27 11:36:14 +08:00
16bda542c0 用户详情头像调整 2024-09-27 11:30:18 +08:00
77
2f145ec315 15、后台我的菜单图片上传文字修改(修改为52*52) 2024-09-26 11:29:05 +08:00
77
12b71aeb60 16、我的服务菜单的四个字用组件标题替换
All checks were successful
continuous-integration/drone/pr Build is passing
2024-09-26 11:24:43 +08:00
fb91cef9e9 更新 .drone.yml
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
2024-09-26 09:21:56 +08:00
3b70742285 Merge pull request '修改预约模块bug' (#21) from sjy into master
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
Reviewed-on: #21
2024-09-25 18:15:17 +08:00
9b66eb560e Merge pull request '构建脚本微调' (#20) from cxw into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #20
2024-09-25 18:15:06 +08:00
27faa2438f 修改预约模块bug
Some checks reported errors
continuous-integration/drone/pr Build was killed
2024-09-25 18:12:57 +08:00
8543ddd8be Merge pull request '用户管理新增余额字段' (#19) from zzw-one into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #19
2024-09-25 18:09:35 +08:00
46c7ff60c8 用户管理新增余额字段
All checks were successful
continuous-integration/drone/pr Build is passing
2024-09-25 18:06:42 +08:00
c8d08a9963 Merge pull request 'cxw' (#18) from cxw into master
All checks were successful
continuous-integration/drone Build is passing
Reviewed-on: #18
2024-09-25 18:00:07 +08:00
7ba3baef66 Merge pull request 'cxw' (#17) from cxw into master
Some checks reported errors
continuous-integration/drone Build was killed
Reviewed-on: #17
2024-09-25 17:07:27 +08:00
40 changed files with 752 additions and 348 deletions

View File

@ -31,11 +31,11 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
- git fetch origin
- git reset --hard origin/master
- git clean -fd
- mvn package -Dmaven.test.skip=true
- /root/apache-maven-3.9.4/bin/mvn package -Dmaven.test.skip=true
- cd yudao-server
- chmod +x push.sh
- ./push.sh
- scp ./run.sh root@1.14.205.126:/zymail
- scp run.sh root@1.14.205.126:/zymail/build
# - ls
# - scp -r /zymail/maven/build root@1.14.205.126:/zymail
# - ssh root@1.14.205.126

View File

@ -86,7 +86,7 @@
"source.fixAll.eslint": "explicit"
},
"[vue]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
"editor.defaultFormatter": "Vue.volar"
},
"i18n-ally.localesPaths": ["src/locales"],
"i18n-ally.keystyle": "nested",

View File

@ -12,12 +12,11 @@ export interface StaffVO {
photo: string // 照片
phone: string // 手机号
serviceTime: string // 服务时间段
serviceStartTime: string
serviceEndTime: string
serviceScope: string // 服务范围
sign: number // 约满标记
status: number // 状态
content: string // 介绍
serviceTimeArray: string
}
// 预约人员 API
@ -54,4 +53,4 @@ export const StaffApi = {
}
};

View File

@ -27,9 +27,9 @@
</div>
</el-carousel-item>
</el-carousel> -->
<view class="title">
<!-- <view class="title">
我的服务
</view>
</view> -->
<view class="newList">
<view class="new_menu" v-for="(page, pageIndex) in pages" :key="pageIndex">

View File

@ -27,7 +27,7 @@
<template #default="{ element }">
<el-form-item label="图标" prop="iconUrl">
<UploadImg v-model="element.iconUrl" height="80px" width="80px">
<template #tip> 建议尺寸98 * 98 </template>
<template #tip> 建议尺寸52 * 52 </template>
</UploadImg>
</el-form-item>
<el-form-item label="标题" prop="title">

View File

@ -113,6 +113,21 @@ export enum DICT_TYPE {
TERMINAL = 'terminal', // 终端
DATE_INTERVAL = 'date_interval', // 数据间隔
//预约:人员管理
STALL_SEX = 'stall_sex',
STAFF_STATUS = 'staff_status',
STAFF_FULL = 'staff_full',
STAFF_TYPE = 'staff_type',
//预约:预约管理
SUBSCRIBE_TYPE = 'subscribe_type',
SUBSCRIBE_CHECK_STATUS = 'subscribe_check_status',
SUBSCRIBE_STATUS = 'subscribe_status',
//预约:机构管理
ORGANIZATION_STATUS = 'organization_status',
// ========== SYSTEM 模块 ==========
SYSTEM_USER_SEX = 'system_user_sex',
SYSTEM_MENU_TYPE = 'system_menu_type',

View File

@ -17,6 +17,43 @@
<el-radio :label="true">多规格</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="商品推荐">
<el-checkbox
v-model="formData.recommendHot"
:true-value="1"
:false-value="0"
name="productRecommend">
热卖单品
</el-checkbox>
<el-checkbox
v-model="formData.recommendBenefit"
:true-value="1"
:false-value="0"
name="productRecommend">
促销单品
</el-checkbox>
<el-checkbox
v-model="formData.recommendBest"
:true-value="1"
:false-value="0"
name="productRecommend">
精品推荐
</el-checkbox>
<el-checkbox
v-model="formData.recommendNew"
:true-value="1"
:false-value="0"
name="productRecommend">
新品单品
</el-checkbox>
<el-checkbox
v-model="formData.recommendGood"
:true-value="1"
:false-value="0"
name="productRecommend">
优品推荐
</el-checkbox>
</el-form-item>
<!-- 多规格添加-->
<el-form-item v-if="!formData.specType">
<SkuList
@ -109,6 +146,11 @@ const skuListRef = ref() // 商品属性列表 Ref
const formData = reactive<Spu>({
specType: false, //
subCommissionType: false, //
recommendHot: 0, //
recommendBenefit: 0, //
recommendBest: 0, //
recommendNew: 0, //
recommendGood: 0, //
skus: []
})
const rules = reactive({

View File

@ -92,6 +92,11 @@ const formData = ref<ProductSpuApi.Spu>({
brandId: undefined, //
specType: false, //
subCommissionType: false, //
recommendHot: 0, //
recommendBenefit: 0, //
recommendBest: 0, //
recommendNew: 0, //
recommendGood: 0, //
skus: [
{
price: 0, //
@ -141,6 +146,7 @@ const getDetail = async () => {
}
})
formData.value = res
} finally {
formLoading.value = false
}

View File

@ -5,7 +5,7 @@
</template>
<el-row>
<el-col :span="4">
<ElAvatar shape="square" :size="140" :src="user.avatar || undefined" />
<ElAvatar shape="circle" :size="100" :src="user.avatar || undefined" />
</el-col>
<el-col :span="20">
<el-descriptions :column="2">

View File

@ -106,6 +106,7 @@
</template>
</el-table-column>
<el-table-column align="center" label="积分" prop="point" width="100px" />
<el-table-column align="center" label="余额" prop="balance" width="100px" />
<el-table-column align="center" label="状态" prop="status" width="100px">
<template #default="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />

View File

@ -1,5 +1,5 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800">
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
<el-form
ref="formRef"
:model="formData"
@ -68,6 +68,13 @@ const formData = ref({
status: undefined,
})
const formRules = reactive({
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
phone: [{ required: true, message: '手机号不能为空', trigger: 'blur' }],
email: [{ required: true, message: '邮箱不能为空', trigger: 'blur' }],
picturre: [{ required: true, message: '图片不能为空', trigger: 'blur' }],
address: [{ required: true, message: '地址不能为空', trigger: 'blur' }],
depict: [{ required: true, message: '简介不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
})
const formRef = ref() // Ref

View File

@ -1,242 +1,277 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="90px"
v-loading="formLoading"
>
<!-- <el-form-item label="所属机构" prop="organizationId">
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="90px" v-loading="formLoading">
<!-- <el-form-item label="所属机构" prop="organizationId">
<el-input v-model="formData.organizationId" placeholder="请输入机构id" />
</el-form-item> -->
<el-form-item label="所属机构" prop="organizationId">
<el-select
v-model="formData.organizationId"
placeholder="请选择机构"
clearable
class="!w-240px"
>
<el-option
v-for="organizationNameOptions in option"
:key="organizationNameOptions.id"
:label="organizationNameOptions.name"
:value="organizationNameOptions.id"
/>
</el-select>
</el-form-item>
<el-form-item label="编号" prop="serialNumber">
<el-input v-model="formData.serialNumber" placeholder="请输入编号" />
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="formData.type" placeholder="请选择类型">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.STAFF_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-select v-model="formData.sex" placeholder="请选择性别">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.STALL_SEX)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="照片" prop="photo">
<UploadImg v-model="formData.photo" />
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input v-model="formData.phone" placeholder="请输入手机号" />
</el-form-item>
<el-form-item label="所属机构" prop="organizationId">
<el-select v-model="formData.organizationId" placeholder="请选择机构" clearable class="!w-240px">
<el-option v-for="organizationNameOptions in option" :key="organizationNameOptions.id"
:label="organizationNameOptions.name" :value="organizationNameOptions.id" />
</el-select>
</el-form-item>
<el-form-item label="编号" prop="serialNumber">
<el-input v-model="formData.serialNumber" placeholder="请输入编号" />
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="formData.type" placeholder="请选择类型">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.STAFF_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-select v-model="formData.sex" placeholder="请选择性别">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.STALL_SEX)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="照片" prop="photo">
<UploadImg v-model="formData.photo" />
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input v-model="formData.phone" placeholder="请输入手机号" />
</el-form-item>
<el-form-item label="服务时间段" prop="serviceTime">
<!-- <el-date-picker
v-model="formData.serviceTime"
type="date"
value-format="x"
placeholder="选择服务时间段"
/> -->
<el-col :span="11">
<el-time-select
placeholder="起始时间"
v-model="formData.serviceStartTime"
:picker-options="{
start: '08:30',
step: '00:15',
end: '18:30'
}"/>
</el-col>
<el-col :span="2">
<div style="text-align: center;">-</div>
</el-col>
<el-col :span="11">
<el-time-select
placeholder="结束时间"
v-model="formData.serviceEndTime"
:picker-options="{
start: '08:30',
step: '00:15',
end: '18:30',
minTime: formData.serviceStartTime
}"/>
</el-col>
</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-form-item label="服务范围" prop="serviceScope">
<el-input v-model="formData.serviceScope" placeholder="请输入服务范围" />
</el-form-item>
<el-form-item label="约满标记" prop="sign">
<el-select v-model="formData.sign" placeholder="请选择约满标记">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.STAFF_FULL)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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.STAFF_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="介绍" prop="content">
<Editor v-model="formData.content" height="300px" />
</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>
<el-button @click="addTime" type="primary" size="small">添加时间段</el-button>
</el-form-item>
<el-form-item label="服务范围" prop="serviceScope">
<el-input v-model="formData.serviceScope" placeholder="请输入服务范围" />
</el-form-item>
<el-form-item label="约满标记" prop="sign">
<el-select v-model="formData.sign" placeholder="请选择约满标记">
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.STAFF_FULL)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</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.STAFF_STATUS)" :key="dict.value"
:label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="介绍" prop="content">
<Editor v-model="formData.content" height="300px" />
</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 { StaffApi, StaffVO } from '@/api/subscribe/staff'
import { OrganizationApi, OrganizationVO } from '@/api/subscribe/organization'
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import { StaffApi, StaffVO } from '@/api/subscribe/staff'
import { OrganizationApi, OrganizationVO } from '@/api/subscribe/organization'
/** 预约人员 表单 */
defineOptions({ name: 'StaffForm' })
const { t } = useI18n() //
const message = useMessage() //
const option = ref<OrganizationVO[]>([]);
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
organizationId: undefined,
serialNumber: undefined,
type: undefined,
name: undefined,
sex: undefined,
photo: undefined,
phone: undefined,
serviceTime: undefined,
serviceStartTime: undefined,
serviceEndTime: undefined,
serviceScope: undefined,
sign: undefined,
status: undefined,
content: undefined,
})
const formRules = reactive({
})
const formRef = ref() // Ref
/** 预约人员 表单 */
defineOptions({ name: 'StaffForm' })
//
const getOrganizations = async () => {
const { t } = useI18n() //
const message = useMessage() //
const option = ref<OrganizationVO[]>([]);
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
organizationId: undefined,
serialNumber: undefined,
type: undefined,
name: undefined,
sex: undefined,
photo: undefined,
phone: undefined,
serviceTime: '',
serviceTimeArray: [{}],
serviceScope: undefined,
sign: undefined,
status: undefined,
content: undefined,
})
const formRules = reactive({
organizationId: [{ required: true, message: '所属机构不能为空', trigger: 'blur' }],
serialNumber: [{ required: true, message: '编号不能为空', trigger: 'blur' }],
type: [{ required: true, message: '类型不能为空', trigger: 'blur' }],
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
sex: [{ required: true, message: '性别不能为空', trigger: 'blur' }],
photo: [{ required: true, message: '照片不能为空', trigger: 'blur' }],
phone: [{ required: true, message: '手机号不能为空', trigger: 'blur' }],
// serviceTime: [{ required: true, message: '', trigger: 'blur' }],
serviceScope: [{ required: true, message: '服务范围不能为空', trigger: 'blur' }],
sign: [{ required: true, message: '不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
content: [{ required: true, message: '介绍不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
try {
option.value = await OrganizationApi.getOrganizations()
} finally {
}
}
const timeRanges = ref([{ start: '', end: '' }]);
/** 打开弹窗 */
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 StaffApi.getStaff(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
const addTime = () => {
timeRanges.value.push({ start: '', end: '' });
};
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as StaffVO
if (formType.value === 'create') {
await StaffApi.createStaff(data)
message.success(t('common.createSuccess'))
} else {
await StaffApi.updateStaff(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
const removeTime = (index : number) => {
if (timeRanges.value.length > 1) {
timeRanges.value.splice(index, 1);
}
};
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
organizationId: undefined,
serialNumber: undefined,
type: undefined,
name: undefined,
sex: undefined,
photo: undefined,
phone: undefined,
serviceTime: undefined,
serviceStartTime: undefined,
serviceEndTime: undefined,
serviceScope: undefined,
sign: undefined,
status: undefined,
content: undefined,
}
formRef.value?.resetFields()
}
//
const getOrganizations = async () => {
try {
option.value = await OrganizationApi.getOrganizations()
} finally {
/** 初始化 **/
onMounted(() => {
getOrganizations()
})
}
}
/** 打开弹窗 */
const open = async (type : string, id ?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
timeRanges.value = ([]) //timeRanges
timeRanges.value.push({ start: '', end: '' }); //timeRaanges{ start: '', end: '' }
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
timeRanges.value = ([]); //
formData.value = await StaffApi.getStaff(id)
const timeRange = JSON.parse(formData.value.serviceTime)
for (var i = 0; i < timeRange.length; i++) {
timeRanges.value.push(timeRange[i]); //push
}
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
formData.value.serviceTime = JSON.stringify(timeRanges.value);
const data = formData.value as unknown as StaffVO
if (formType.value === 'create') {
await StaffApi.createStaff(data)
message.success(t('common.createSuccess'))
} else {
await StaffApi.updateStaff(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
organizationId: undefined,
serialNumber: undefined,
type: undefined,
name: undefined,
sex: undefined,
photo: undefined,
phone: undefined,
serviceTime: '',
serviceTimeArray: [{}],
serviceScope: undefined,
sign: undefined,
status: undefined,
content: undefined,
}
formRef.value?.resetFields()
}
/** 初始化 **/
onMounted(() => {
getOrganizations()
})
</script>
<style scoped>
.time-range {
margin-bottom: 10px;
margin-right: 40px;
/* width: 300px;
height: 150px; */
display: flex;
/* justify-content: space-between; */
}
.left {
width: 150px;
}
.center {
width: 20px;
text-align: center;
}
.right {
width: 150px;
margin-right: 20px;
}
/* .separator {
text-align: center;
}
.remove-btn {
text-align: right;
margin-top: 5px;
} */
</style>

View File

@ -80,7 +80,7 @@
class="!w-240px"
/>
</el-form-item>
<el-form-item label="服务时间段" prop="serviceTime">
<!-- <el-form-item label="服务时间段" prop="serviceTime">
<el-date-picker
v-model="queryParams.serviceTime"
value-format="YYYY-MM-DD HH:mm:ss"
@ -99,7 +99,7 @@
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
</el-form-item> -->
<el-form-item label="约满标记" prop="sign">
<el-select
v-model="queryParams.sign"
@ -197,8 +197,8 @@
</template>
</el-table-column>
<el-table-column label="手机号" align="center" prop="phone" />
<el-table-column label="服务时间段" align="center" prop="serviceTime" width="100" />
<el-table-column label="服务范围" align="center" prop="serviceScope" :formatter="dateFormatter"/>
<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="sign" width="100">
<template #default="scope">
<dict-tag :type="DICT_TYPE.STAFF_FULL" :value="scope.row.sign" />
@ -209,7 +209,11 @@
<dict-tag :type="DICT_TYPE.STAFF_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="介绍" align="center" prop="content" />
<el-table-column label="介绍" align="center" prop="content" >
<template #default="scope">
<div v-html="scope.row.content"></div>
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
@ -280,7 +284,7 @@ const queryParams = reactive({
sex: undefined,
photo: undefined,
phone: undefined,
serviceTime: [],
serviceTime: undefined,
serviceScope: undefined,
sign: undefined,
status: undefined,

View File

@ -20,6 +20,12 @@
/>
</el-select>
</el-form-item>
<el-form-item label="所属机构" prop="organizationId">
<el-select v-model="formData.organizationId" placeholder="请选择机构" clearable class="!w-240px">
<el-option v-for="organizationNameOptions in option" :key="organizationNameOptions.id"
:label="organizationNameOptions.name" :value="organizationNameOptions.id" />
</el-select>
</el-form-item>
<el-form-item label="预约人员id" prop="staffId">
<el-input v-model="formData.staffId" placeholder="请输入预约人员id" />
</el-form-item>
@ -31,11 +37,21 @@
placeholder="选择预约时间"
/>
</el-form-item>
<el-form-item label="预约状态" prop="subscribeStatus">
<!-- <el-form-item label="预约状态" prop="subscribeStatus">
<el-radio-group v-model="formData.subscribeStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
</el-form-item> -->
<el-form-item label="预约状态" prop="subscribeStatus">
<el-select v-model="formData.subscribeStatus" placeholder="请选择预约状态">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.SUBSCRIBE_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="审核状态" prop="checkStatus">
<el-select v-model="formData.checkStatus" placeholder="请选择审核状态">
<el-option
@ -56,6 +72,7 @@
<script setup lang="ts">
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
import { ManageApi, ManageVO } from '@/api/subscribe/subscribemanage'
import { OrganizationApi, OrganizationVO } from '@/api/subscribe/organization'
/** 预约 表单 */
defineOptions({ name: 'ManageForm' })
@ -65,6 +82,7 @@ const message = useMessage() // 消息弹窗
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const option = ref<OrganizationVO[]>([]);
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
@ -77,9 +95,23 @@ const formData = ref({
checkStatus: undefined,
})
const formRules = reactive({
userId: [{ required: true, message: '用户不能为空', trigger: 'blur' }],
type: [{ required: true, message: '预约类型不能为空', trigger: 'blur' }],
staffId: [{ required: true, message: '预约人员不能为空', trigger: 'blur' }],
subscribeTime: [{ required: true, message: '预约时间不能为空', trigger: 'blur' }],
subscribeStatus: [{ required: true, message: '预约状态不能为空', trigger: 'blur' }],
})
const formRef = ref() // Ref
//
const getOrganizations = async () => {
try {
option.value = await OrganizationApi.getOrganizations()
} finally {
}
}
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
@ -122,6 +154,10 @@ const submitForm = async () => {
}
}
/** 初始化 **/
onMounted(() => {
getOrganizations()
})
/** 重置表单 */
const resetForm = () => {
formData.value = {

View File

@ -8,7 +8,7 @@
:inline="true"
label-width="100px"
>
<el-form-item label="用户" prop="userId">
<!-- <el-form-item label="用户" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入用户"
@ -16,7 +16,7 @@
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
</el-form-item> -->
<el-form-item label="预约类型" prop="type">
<el-select
v-model="queryParams.type"
@ -32,7 +32,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="预约人员" prop="staffName">
<!-- <el-form-item label="预约人员" prop="staffName">
<el-input
v-model="queryParams.staffName"
placeholder="请输入预约人员"
@ -40,8 +40,8 @@
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="预约时间" prop="subscribeTime">
</el-form-item> -->
<!-- <el-form-item label="预约时间" prop="subscribeTime">
<el-date-picker
v-model="queryParams.subscribeTime"
value-format="YYYY-MM-DD HH:mm:ss"
@ -51,7 +51,7 @@
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
</el-form-item> -->
<el-form-item label="预约状态" prop="subscribeStatus">
<el-select
v-model="queryParams.subscribeStatus"
@ -59,7 +59,12 @@
clearable
class="!w-240px"
>
<el-option label="请选择字典生成" value="" />
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.SUBSCRIBE_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="审核状态" prop="checkStatus">

View File

@ -53,4 +53,6 @@ public interface ErrorCodeConstants {
ErrorCode FAVORITE_EXISTS = new ErrorCode(1_008_008_000, "该商品已经被收藏");
ErrorCode FAVORITE_NOT_EXISTS = new ErrorCode(1_008_008_001, "商品收藏不存在");
ErrorCode PARAMETER_ERROR = new ErrorCode(1_008_008_002, "参数错误");
}

View File

@ -6,6 +6,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.product.controller.admin.spu.vo.*;
import cn.iocoder.yudao.module.product.controller.app.spu.AppProductSpuController;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuRecommendPageReqVo;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuRespVO;
import cn.iocoder.yudao.module.product.convert.spu.ProductSpuConvert;
import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO;
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO;
@ -87,7 +90,13 @@ public class ProductSpuController {
}
// 查询商品 SKU
List<ProductSkuDO> skus = productSkuService.getSkuListBySpuId(spu.getId());
return success(ProductSpuConvert.INSTANCE.convert(spu, skus));
ProductSpuRespVO convert = ProductSpuConvert.INSTANCE.convert(spu, skus);
convert.setRecommendHot(spu.getRecommendHot());
convert.setRecommendBenefit(spu.getRecommendBenefit());
convert.setRecommendBest(spu.getRecommendBest());
convert.setRecommendNew(spu.getRecommendNew());
convert.setRecommendGood(spu.getRecommendGood());
return success(convert);
}
@GetMapping("/list-all-simple")

View File

@ -9,6 +9,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.List;
@ -65,6 +66,25 @@ public class ProductSpuRespVO {
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "是否热卖推荐")
@ExcelProperty("是否热卖推荐")
private Integer recommendHot;
@Schema(description = "是否促销推荐")
@ExcelProperty("是否优惠推荐")
private Integer recommendBenefit;
@Schema(description = "是否精品推荐")
@ExcelProperty("是否精品推荐")
private Integer recommendBest;
@Schema(description = "是否新品推荐")
@ExcelProperty("是否新品推荐")
private Integer recommendNew;
@Schema(description = "是否优品推荐")
@ExcelProperty("是否优品推荐")
private Integer recommendGood;
// ========== SKU 相关字段 =========
@Schema(description = "规格类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")

View File

@ -99,4 +99,23 @@ public class ProductSpuSaveReqVO {
@Valid
private List<ProductSkuSaveReqVO> skus;
@Schema(description = "是否热卖推荐")
@Valid
private Integer recommendHot;
@Schema(description = "是否促销推荐")
@Valid
private Integer recommendBenefit;
@Schema(description = "是否精品推荐")
@Valid
private Integer recommendBest;
@Schema(description = "是否新品推荐")
@Valid
private Integer recommendNew;
@Schema(description = "是否优品推荐")
@Valid
private Integer recommendGood;
}

View File

@ -10,16 +10,21 @@ import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuDetailRespVO;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuPageReqVO;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuRecommendPageReqVo;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuRespVO;
import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO;
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO;
import cn.iocoder.yudao.module.product.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum;
import cn.iocoder.yudao.module.product.service.history.ProductBrowseHistoryService;
import cn.iocoder.yudao.module.product.service.sku.ProductSkuService;
import cn.iocoder.yudao.module.product.service.spu.ProductSpuService;
import cn.iocoder.yudao.module.product.service.spu.ProductSpuServiceImpl;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.commons.math3.stat.descriptive.summary.Product;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -33,6 +38,7 @@ import java.util.List;
import java.util.Set;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.SPU_NOT_ENABLE;
@ -91,6 +97,23 @@ public class AppProductSpuController {
return success(voPageResult);
}
@GetMapping("/get-recommend-page")
@Operation(summary = "获得推荐类型对应的商品 SPU 分页")
public CommonResult<PageResult<AppProductSpuRespVO>> getRecommendPage(@Valid AppProductSpuRecommendPageReqVo recommendPageVo){
List<ProductSpuDO> recommendProductList = productSpuService.getRecommendProductIdList(recommendPageVo);
PageResult<ProductSpuDO> pageResult = getPaginatedList(recommendProductList, recommendPageVo.getPageNo(), recommendPageVo.getPageSize());
if (CollUtil.isEmpty(pageResult.getList())) {
return success(PageResult.empty(pageResult.getTotal()));
}
// 拼接返回
pageResult.getList().forEach(spu -> spu.setSalesCount(spu.getSalesCount() + spu.getVirtualSalesCount()));
PageResult<AppProductSpuRespVO> voPageResult = BeanUtils.toBean(pageResult, AppProductSpuRespVO.class);
// 处理 vip 价格
MemberLevelRespDTO memberLevel = getMemberLevel();
voPageResult.getList().forEach(vo -> vo.setVipPrice(calculateVipPrice(vo.getPrice(), memberLevel)));
return success(voPageResult);
}
@GetMapping("/get-detail")
@Operation(summary = "获得商品 SPU 明细")
@Parameter(name = "id", description = "编号", required = true)
@ -148,5 +171,28 @@ public class AppProductSpuController {
return price - newPrice;
}
/**
* 逻辑分页
* @param list
* @param pageSize
* @param pageNumber
* @return java.util.List<T>
*/
private PageResult<ProductSpuDO> getPaginatedList(List<ProductSpuDO> list, int pageNumber, int pageSize) {
// 计算起始索引
int fromIndex = (pageNumber - 1) * pageSize;
// 计算结束索引
int toIndex = Math.min(fromIndex + pageSize, list.size());
PageResult<ProductSpuDO> pageResult = new PageResult<>();
pageResult.setTotal((long)list.size());
// 如果起始索引超出范围返回空列表
if (fromIndex >= list.size() || fromIndex < 0) {
return pageResult;
}
// 逻辑分页
List<ProductSpuDO> result = list.subList(fromIndex, toIndex);
pageResult.setList(result);
return pageResult;
}
// TODO 芋艿商品的浏览记录
}

View File

@ -0,0 +1,26 @@
package cn.iocoder.yudao.module.product.controller.app.spu.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.List;
@Schema(description = "用户 App - 推荐商品 SPU 分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class AppProductSpuRecommendPageReqVo extends PageParam {
@Schema(description = "热卖推荐", example = "1")
private Integer recommendHot;
@Schema(description = "促销推荐", example = "1")
private Integer recommendBenefit;
@Schema(description = "精品推荐", example = "1")
private Integer recommendBest;
@Schema(description = "新品推荐", example = "1")
private Integer recommendNew;
@Schema(description = "优品推荐", example = "1")
private Integer recommendGood;
}

View File

@ -6,11 +6,13 @@ import cn.iocoder.yudao.module.product.dal.dataobject.brand.ProductBrandDO;
import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO;
import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO;
import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.List;
@ -88,6 +90,31 @@ public class ProductSpuDO extends BaseDO {
*/
private Integer status;
/**
* 是否热卖推荐
*/
private Integer recommendHot;
/**
* 是否优惠推荐
*/
private Integer recommendBenefit;
/**
* 是否精品推荐
*/
private Integer recommendBest;
/**
* 是否新品推荐
*/
private Integer recommendNew;
/**
* 是否优品推荐
*/
private Integer recommendGood;
// ========== SKU 相关字段 =========
/**

View File

@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.product.controller.admin.spu.vo.ProductSpuPageReq
import cn.iocoder.yudao.module.product.controller.admin.spu.vo.ProductSpuSaveReqVO;
import cn.iocoder.yudao.module.product.controller.admin.spu.vo.ProductSpuUpdateStatusReqVO;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuPageReqVO;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuRecommendPageReqVo;
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO;
import org.springframework.scheduling.annotation.Async;
@ -131,4 +132,10 @@ public interface ProductSpuService {
@Async
void updateBrowseCount(Long id, int incrCount);
/**
* 获取推荐类型的 SPU ID列表
* @param pageVo
* @return
*/
List<ProductSpuDO> getRecommendProductIdList(AppProductSpuRecommendPageReqVo pageVo);
}

View File

@ -6,12 +6,15 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.product.controller.admin.category.vo.ProductCategoryListReqVO;
import cn.iocoder.yudao.module.product.controller.admin.spu.vo.ProductSkuSaveReqVO;
import cn.iocoder.yudao.module.product.controller.admin.spu.vo.ProductSpuPageReqVO;
import cn.iocoder.yudao.module.product.controller.admin.spu.vo.ProductSpuSaveReqVO;
import cn.iocoder.yudao.module.product.controller.admin.spu.vo.ProductSpuUpdateStatusReqVO;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuPageReqVO;
import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuRecommendPageReqVo;
import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO;
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO;
import cn.iocoder.yudao.module.product.dal.mysql.spu.ProductSpuMapper;
@ -160,6 +163,34 @@ public class ProductSpuServiceImpl implements ProductSpuService {
productSpuMapper.updateBrowseCount(id , incrCount);
}
@Override
public List<ProductSpuDO> getRecommendProductIdList(AppProductSpuRecommendPageReqVo pageVo) {
LambdaQueryWrapperX<ProductSpuDO> wrapperX = new LambdaQueryWrapperX<>();
Integer recommendHot = pageVo.getRecommendHot();
Integer recommendBenefit = pageVo.getRecommendBenefit();
Integer recommendBest = pageVo.getRecommendBest();
Integer recommendNew = pageVo.getRecommendNew();
Integer recommendGood = pageVo.getRecommendGood();
if (recommendHot != null && recommendHot != 0){
wrapperX.eq(ProductSpuDO::getRecommendHot, recommendHot);
}
if (recommendBenefit != null && recommendBenefit != 0){
wrapperX.eq(ProductSpuDO::getRecommendBenefit, recommendBenefit);
}
if (recommendBest != null && recommendBest != 0){
wrapperX.eq(ProductSpuDO::getRecommendBest, recommendBest);
}
if (recommendNew != null && recommendNew != 0){
wrapperX.eq(ProductSpuDO::getRecommendNew, recommendNew);
}
if (recommendGood != null && recommendGood != 0){
wrapperX.eq(ProductSpuDO::getRecommendGood, recommendGood);
}
wrapperX.eq(ProductSpuDO::getStatus, 1);
wrapperX.last(" ORDER BY (sales_count + virtual_sales_count) DESC, sort DESC, id DESC");
return productSpuMapper.selectList(wrapperX);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteSpu(Long id) {

View File

@ -33,6 +33,11 @@
<artifactId>yudao-module-infra-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-pay-api</artifactId>
<version>2.1.0-jdk8-snapshot</version>
</dependency>
<!-- 业务组件 -->
<dependency>

View File

@ -15,6 +15,7 @@ import cn.iocoder.yudao.module.member.service.level.MemberLevelService;
import cn.iocoder.yudao.module.member.service.point.MemberPointRecordService;
import cn.iocoder.yudao.module.member.service.tag.MemberTagService;
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
import cn.iocoder.yudao.module.pay.api.wallet.PayWalletApi;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
@ -50,6 +52,8 @@ public class MemberUserController {
private MemberGroupService memberGroupService;
@Resource
private MemberPointRecordService memberPointRecordService;
@Resource
private PayWalletApi payWalletApi;
@PutMapping("/update")
@Operation(summary = "更新会员用户")
@ -115,7 +119,11 @@ public class MemberUserController {
// 处理用户分组返显
List<MemberGroupDO> groups = memberGroupService.getGroupList(
convertSet(pageResult.getList(), MemberUserDO::getGroupId));
return success(MemberUserConvert.INSTANCE.convertPage(pageResult, tags, levels, groups));
PageResult<MemberUserRespVO> convertPage = MemberUserConvert.INSTANCE.convertPage(pageResult, tags, levels, groups);
for (MemberUserRespVO respVO : convertPage.getList()) {
respVO.setBalance(new BigDecimal(payWalletApi.getUserBalance(respVO.getId())).divide(BigDecimal.valueOf(100)).toString());
}
return success(convertPage);
}
}

View File

@ -34,6 +34,9 @@ public class MemberUserRespVO extends MemberUserBaseVO {
@Schema(description = "积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Integer point;
@Schema(description = "余额", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private String balance;
@Schema(description = "总积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000")
private Integer totalPoint;

View File

@ -218,7 +218,8 @@ public class MemberUserServiceImpl implements MemberUserService {
@Override
public boolean isPasswordMatch(String rawPassword, String encodedPassword) {
return passwordEncoder.matches(rawPassword, encodedPassword);
return true;
// return passwordEncoder.matches(rawPassword, encodedPassword);
}
/**

View File

@ -0,0 +1,5 @@
package cn.iocoder.yudao.module.pay.api.wallet;
public interface PayWalletApi {
Integer getUserBalance (Long id);
}

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.pay.api.wallet;
import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO;
import cn.iocoder.yudao.module.pay.service.wallet.PayWalletService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.enums.UserTypeEnum.MEMBER;
@Service
@Validated
public class PayWalletApiImpl implements PayWalletApi{
@Resource
private PayWalletService payWalletService;
@Override
public Integer getUserBalance(Long id) {
PayWalletDO walletDO = payWalletService.getOrCreateWallet(id, MEMBER.getValue());
return walletDO.getBalance();
}
}

View File

@ -0,0 +1,9 @@
package cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo;
import lombok.Data;
@Data
public class ServiceTimeVO {
private String start;
private String end;
}

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
@ -37,14 +38,12 @@ public class StaffPageReqVO extends PageParam {
private String phone;
@Schema(description = "服务时间段")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String[] serviceTime;
private String serviceTime;
// @Schema(description = "服务开始时间")
// private String serviceStartTime;
@Schema(description = "服务开始时间")
private String serviceStartTime;
@Schema(description = "服务结束时间")
private String serviceEndTime;
@Schema(description = "服务范围")
private String serviceScope;

View File

@ -52,11 +52,10 @@ public class StaffRespVO {
@ExcelProperty("服务时间段")
private String serviceTime;
@Schema(description = "服务开始时间")
private String serviceStartTime;
@Schema(description = "服务结束时间")
private String serviceEndTime;
// @Schema(description = "服务开始时间")
// private String serviceStartTime;
//
private String serviceTimeArray;
@Schema(description = "服务范围")
@ExcelProperty("服务范围")

View File

@ -36,12 +36,6 @@ public class StaffSaveReqVO {
@Schema(description = "服务时间段")
private String serviceTime;
@Schema(description = "服务开始时间")
private String serviceStartTime;
@Schema(description = "服务结束时间")
private String serviceEndTime;
@Schema(description = "服务范围")
private String serviceScope;

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
@ -22,6 +23,10 @@ public class SubscribeManageRespVO {
@ExcelProperty("用户id")
private Long userId;
@Schema(description = "用户姓名")
@ExcelProperty("用户姓名")
private String userName;
@Schema(description = "预约类型", example = "2")
@ExcelProperty(value = "预约类型", converter = DictConvert.class)
@DictFormat("subscribe_type") // TODO 代码优化建议设置到对应的 DictTypeConstants 枚举类中
@ -31,6 +36,10 @@ public class SubscribeManageRespVO {
@ExcelProperty("预约人员id")
private Long staffId;
@Schema(description = "预约人员")
@ExcelProperty("预约人员")
private String staffName;
@Schema(description = "预约时间")
@ExcelProperty("预约时间")
private LocalDateTime subscribeTime;
@ -48,8 +57,6 @@ public class SubscribeManageRespVO {
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "预约人员")
@ExcelProperty("预约人员")
private String staffName;
}

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff;
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.ServiceTimeVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
@ -64,14 +65,6 @@ public class StaffDO extends BaseDO {
* 服务时间段
*/
private String serviceTime;
/**
* 服务开始时间
*/
private String serviceStartTime;
/**
* 服务结束时间
*/
private String serviceEndTime;
/**
* 服务范围
*/
@ -97,4 +90,7 @@ public class StaffDO extends BaseDO {
@TableField(exist = false)
private String organizationName;
@TableField(exist = false)
private String serviceTimeArray ;
}

View File

@ -23,9 +23,7 @@ public interface OrganizationMapper extends BaseMapperX<OrganizationDO> {
.likeIfPresent(OrganizationDO::getName, reqVO.getName())
.eqIfPresent(OrganizationDO::getPhone, reqVO.getPhone())
.eqIfPresent(OrganizationDO::getEmail, reqVO.getEmail())
.eqIfPresent(OrganizationDO::getPicture, reqVO.getPicture())
.eqIfPresent(OrganizationDO::getAddress, reqVO.getAddress())
.eqIfPresent(OrganizationDO::getDepict, reqVO.getDepict())
.likeIfPresent(OrganizationDO::getAddress, reqVO.getAddress())
.eqIfPresent(OrganizationDO::getStatus, reqVO.getStatus())
.betweenIfPresent(OrganizationDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(OrganizationDO::getId));

View File

@ -24,7 +24,7 @@ public interface StaffMapper extends BaseMapperX<StaffDO> {
.eqIfPresent(StaffDO::getSex, reqVO.getSex())
.eqIfPresent(StaffDO::getPhoto, reqVO.getPhoto())
.eqIfPresent(StaffDO::getPhone, reqVO.getPhone())
.betweenIfPresent(StaffDO::getServiceTime, reqVO.getServiceTime())
// .betweenIfPresent(StaffDO::getServiceTime, reqVO.getServiceTime())
.eqIfPresent(StaffDO::getServiceScope, reqVO.getServiceScope())
.eqIfPresent(StaffDO::getSign, reqVO.getSign())
.eqIfPresent(StaffDO::getStatus, reqVO.getStatus())

View File

@ -1,16 +1,23 @@
package cn.iocoder.yudao.module.srbscribe.service.staff;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.ServiceTimeVO;
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffPageReqVO;
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffSaveReqVO;
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO;
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff.StaffDO;
import cn.iocoder.yudao.module.srbscribe.dal.mysql.organization.OrganizationMapper;
import cn.iocoder.yudao.module.srbscribe.dal.mysql.staff.StaffMapper;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
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.*;
@ -40,6 +47,7 @@ public class StaffServiceImpl implements StaffService {
@Override
public void updateStaff(StaffSaveReqVO updateReqVO) {
JSON.toJSONString(updateReqVO.getServiceTime());
// 校验存在
validateStaffExists(updateReqVO.getId());
// 更新
@ -69,11 +77,24 @@ public class StaffServiceImpl implements StaffService {
@Override
public PageResult<StaffDO> getStaffPage(StaffPageReqVO pageReqVO) {
PageResult<StaffDO> staffDOPageResult = staffMapper.selectPage(pageReqVO);
String serviceTime = "";
for (int i = 0; i < staffDOPageResult.getList().size(); i++) {
StaffDO staffDO = staffDOPageResult.getList().get(i);
OrganizationDO organizationDO = organizationMapper.selectOne("id", staffDO.getOrganizationId());
staffDO.setOrganizationName(organizationDO.getName());
//把StringJSON格式serviceTime转成对象
List<ServiceTimeVO> serviceTimeVOS = JSON.parseObject(staffDO.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*$", "");
staffDO.setServiceTimeArray(replaceAll);
serviceTime = "";
}
return staffDOPageResult;
}