疗休养

This commit is contained in:
Paidax
2025-06-13 09:24:27 +08:00
parent 726dfd50be
commit d3364e96f5
7 changed files with 114 additions and 91 deletions
@@ -99,6 +99,10 @@ public class TheRapyRecuperationLineUnionSelect extends BaseModel {
@Comment("最少参与教工")
private Integer minimumGroupSize;
@Column
@ColDefine(type = ColType.INT)
@Comment("最多报名人数")
private Integer maxApplyNum;
@Column
@ColDefine(type = ColType.VARCHAR, width = 50)
@@ -1,6 +1,7 @@
package io.v.nutz.zhgh.therapyRecuperation.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.pinyin.PinyinUtil;
import cn.hutool.json.JSONUtil;
@@ -194,6 +195,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
u.username AS createUserName,
ta.travelAgencyName,
us.contact,
us.maxApplyNum,
us.contactPhone,
lot.lotName,
lot.lotValue,
@@ -1024,7 +1026,8 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
signUpStartTime = lineUnionSelect.getSignUpStartTime();
signUpEndTime = lineUnionSelect.getSignUpEndTime();
changeEndTime = lineUnionSelect.getChangeEndTime();
//线路人数,省外线路最多报名数
//此条线路最多报名人数(包含家属)
Integer maxApplyNum = lineUnionSelect.getMaxApplyNum();
if (DateUtil.compare(new Date(), signUpStartTime) < 0) {
return Map.of(false, "报名未开始,请耐心等待");
@@ -1033,6 +1036,35 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
return Map.of(false, "报名时间已过,抱歉不能报名");
}
// 获取此线路已经报名的人数(包含家属)
Sql numSql = Sqls.create("select id from the_rapy_recuperation_enroll where takePartInLineId = @takePartInLineId")
.setParam("takePartInLineId", lineUnionSelect.getId());
numSql.setCallback(Sqls.callback.strList());
dao().execute(numSql);
List<String> list = numSql.getList(String.class);
int enrollNum = list.size();
if (Lang.isNotEmpty(list)) {
int i = dao().count(TheRapyRecuperationEnrollCompanion.class, Cnd.where("trreId", "in", list));
enrollNum = enrollNum + i;
}
// 去判断当前报名的记录,名额有没有超出限制,包含家属
List<TheRapyRecuperationEnrollCompanion> companionList = enrollInfo.getCompanionList();
int applyNum = 1;
if (Lang.isNotEmpty(companionList)) {
applyNum = applyNum + companionList.size();
}
if ((applyNum + enrollNum) > maxApplyNum) {
int canApplyNum = maxApplyNum - enrollNum;
if (canApplyNum == 0) {
return Map.of(false, "此线路报名人数已满,请选择其他线路报名");
} else {
return Map.of(false, "此线路剩余可报名人数为:【" + canApplyNum + "人】,您当前报名人数为:【" + applyNum + "人】,请减少随行人或选择其他线路报名");
}
}
TheRapyRecuperationType trrt = regionTypeLineMap.get(lineInfo.getRegionalNature());
if (StrUtil.isBlank(enrollInfo.getId()) && StrUtil.isNotBlank(enrollInfo.getTakePartInLineId())) {
@@ -1484,6 +1516,8 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
us.signUpEndTime,
us.changeEndTime,
us.minimumGroupSize,
us.maxApplyNum,
us.estimatedCost,
us.estimatedFamilyNumbers,
line.content,
l.lotName,
@@ -172,6 +172,7 @@ public class TheRapyRecuperationLineUnionSelectServiceImpl extends ViServiceImpl
contact,
contactPhone,
minimumGroupSize,
maxApplyNum,
trafficTools,
estimatedCost,
estimatedFamilyNumbers,
@@ -4806,7 +4806,7 @@ ol,ul {
}
.van-action-sheet__subname {
margin-top: 8px;
/*margin-top: 8px;*/
color: #969799;
font-size: 12px;
line-height: 18px
@@ -246,19 +246,16 @@ layout("/mobile/platform.html"){
<label>{{lineData.estimatedCost}}元</label>
</div>
<div v-if="configData.familyInfo == 2">
<!--<span>当前报名:</span>
<span>当前报名:</span>
{{lineData.signUpUserNum + lineData.signUpUserFamilyNum + '(家属' + lineData.signUpUserFamilyNum
+
'人)'}}-->
<span>当前报名:</span>
{{lineData.signUpUserNum + lineData.signUpUserFamilyNum + '人'}}
'人)'}}
</div>
<div v-else>
<span>当前报名:</span>
<!--{{lineData.signUpUserNum + lineData.familyNumber + '(家属' + lineData.familyNumber
{{lineData.signUpUserNum + lineData.familyNumber + '(家属' + lineData.familyNumber
+
'人)'}}-->
{{lineData.signUpUserNum + lineData.familyNumber + '人'}}
'人)'}}
</div>
<!--<div>
<span class="line_label">成团人数包括家属:</span>
@@ -274,17 +271,15 @@ layout("/mobile/platform.html"){
</div>
<div v-if="configData.familyInfo == 2">
<span>当前报名:</span>
<!--{{lineData.signUpUserNum + '(家属' + lineData.signUpUserFamilyNum
{{lineData.signUpUserNum + '(家属' + lineData.signUpUserFamilyNum
+
'人)'}}-->
{{lineData.signUpUserNum + '人'}}
'人)'}}
</div>
<div v-else>
<span>当前报名:</span>
<!--{{lineData.signUpUserNum + '(家属' + lineData.familyNumber
{{lineData.signUpUserNum + '(家属' + lineData.familyNumber
+
'人)'}}-->
{{lineData.signUpUserNum + '人'}}
'人)'}}
</div>
</div>
@@ -365,47 +360,6 @@ layout("/mobile/platform.html"){
</div>
</div>
<!--床位信息-->
<div v-if="configData.bedInfo === true" class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header">
房间信息
</div>
<div class="van-card-body">
<van-field :rules="[{ required: true, message: '请选择是否包房' }]" label="是否包房" name="bedType">
<template #input>
<van-radio-group direction="horizontal" v-model="formData.bedInfo.bedType">
<van-radio name="包房" shape="square">包房</van-radio>
<van-radio name="不包房" shape="square">不包房</van-radio>
</van-radio-group>
</template>
</van-field>
<div>
<span style="color: red;margin-left: 14px;font-size: 14px">包房需自费;不包房两位老师一间且随机分配</span>
</div>
<!--<van-field @click="self = true; roomVisible = true" readonly is-link label="房间" name="bedType"
placeholder="请选择房间" v-model="formData.bedInfo.bedType"
:rules="[{ required: true }]"></van-field>-->
<!--<van-field v-if="formData.bedInfo.bedType == '标准间'" @click="self = true; bedVisible = true"
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位" v-model="formData.bedInfo.bedNum"
:rules="[{ required: true }]"></van-field>
<van-field v-if="formData.bedInfo.bedType == '标准间'" :rules="[{ validator, message: '请选择是否拼房' }]"
label="是否拼房" name="validator">
<template #input>
<van-radio-group direction="horizontal" v-model="formData.bedInfo.isSleepTogether">
<van-radio :name="true" shape="square"></van-radio>
<van-radio :name="false" shape="square"></van-radio>
</van-radio-group>
</template>
</van-field>
<van-field v-if="formData.bedInfo.bedType == '标准间' && formData.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="formData.bedInfo.otherSleepUser"
:rules="[{ required: true }]"></van-field>-->
</div>
</div>
<!--随行人信息-->
<div v-if="index != 2" class="van-doc-card" style="margin-bottom: 16px">
<div></div>
@@ -414,7 +368,8 @@ layout("/mobile/platform.html"){
<span style="float:left;">随行人信息</span>
<div>
<van-tag @click="delCompanion" size="large" type="primary" color="lightgrey">删除随行人</van-tag>
<van-tag @click="addCompanion" size="large" type="primary" color="#1867b0">添加随行人</van-tag>
<van-tag @click="addCompanion" size="large" type="primary"
color="#1867b0" v-if="formData.companionList.length < 3">添加随行人</van-tag>
</div>
</div>
@@ -486,6 +441,23 @@ layout("/mobile/platform.html"){
</template>
</div>
<!--床位信息-->
<div v-if="configData.bedInfo === true" class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header">
房间信息
</div>
<div class="van-card-body">
<van-field @click="self = true; roomVisible = true" readonly is-link label="房间" name="bedType"
placeholder="请选择房间" v-model="formData.bedInfo.bedType"
:rules="[{ required: true }]"></van-field>
<van-field v-if="formData.bedInfo.bedType == '标准间' && formData.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="多个拼房人请用,隔开"
v-model="formData.bedInfo.otherSleepUser"
:rules="[{ required: true }]"></van-field>
</div>
</div>
<div class="submitButton">
<van-button class="join join_submit">提交报名</van-button>
</div>
@@ -499,7 +471,7 @@ layout("/mobile/platform.html"){
<!--房间类型弹出框-->
<van-popup position="bottom" round v-model="roomVisible">
<van-picker
title="入住房间" show-toolbar
title="房间需求数" show-toolbar
:columns="roomColumns"
@confirm="roomConfirm"
@cancel="roomCancel">
@@ -545,7 +517,7 @@ layout("/mobile/platform.html"){
isPdf: false,
isLoad: false,
active: 0,
roomColumns: ['包房', '默认房间'],
roomColumns: ['0.5间(一张床)', "1间(两张床)}", '1.5间(三张床)', '2间(四张床)'],
bedColumns: ['1', '2'],
companionColumns: ['配偶', '子女', '亲属', '其他'],
bedVisible: false,
@@ -658,7 +630,7 @@ layout("/mobile/platform.html"){
url = '/platform/theRapyRecuperation/line/enroll/doSignUpForLine'
}
const toast = vant.Toast.loading({
const loading = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
@@ -667,21 +639,37 @@ layout("/mobile/platform.html"){
const resp = await $.post(url, {
enroll: JSON.stringify(cloneData),
})
setTimeout(() => {
if (resp.code === 0) {
toast.message = '提交成功'
toast.type = 'success'
} else {
toast.message = resp.msg
toast.type = 'fail'
}
setTimeout(() => {
toast.clear()
}, 500)
if (resp.code === 0) {
loading.clear()
if (resp.code === 0) {
vant.Dialog.alert({
title: '提示',
message: '报名成功',
}).then(() => {
location.replace('/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index)
}
}, 1000)
})
} else {
vant.Dialog.alert({
title: '提示',
message: resp.msg,
}).then(() => {
})
}
// setTimeout(() => {
// if (resp.code === 0) {
// toast.message = '提交成功'
// toast.type = 'success'
// } else {
// toast.message = resp.msg
// toast.type = 'fail'
// }
// setTimeout(() => {
// toast.clear()
// }, 500)
// if (resp.code === 0) {
// location.replace('/platform/mobile/theRapyRecuperation/myRecuperation?index=' + this.index)
// }
// }, 1000)
},
addCompanion() {
this.formData.companionList.push({userName: '', loginName: '', sex: '', relation: '', bedInfo: {}})
@@ -353,6 +353,7 @@ layout("/mobile/platform.html"){
<div>
<div class="van-action-sheet__name">{{item.name}}</div>
<div class="van-action-sheet__name">{{item.playTime}}</div>
<div class="van-action-sheet__name" style="color: #bc2a25">{{'报名人数限制:' + item.maxApplyNum + '人'}}</div>
<div class="van-action-sheet__subname">{{item.subname}}</div>
</div>
<div class="sign_button">
@@ -447,25 +448,20 @@ layout("/mobile/platform.html"){
if(this.modifyConfig.familyInfo == 2) {
item.subname = '已报人数:'
+ (item.signUpUserNum + item.signUpUserFamilyNum)
+ ''
+ '(家属' + item.signUpUserFamilyNum + '人)'
} else {
item.subname = '已报人数:'
+ (item.signUpUserNum + item.signUpUserFamilyNum)
+ ''
+ '(家属' + item.familyNumber + '人)'
}
// if(this.modifyConfig.familyInfo == 2) {
// item.subname = '已报人数:'
// + (item.signUpUserNum + item.signUpUserFamilyNum)
// + '(家属' + item.signUpUserFamilyNum + '人)'
// } else {
// item.subname = '已报人数:'
// + (item.signUpUserNum + item.signUpUserFamilyNum)
// + '(家属' + item.familyNumber + '人)'
// }
})
this.selectLinePopup = true
},
onSelect(item) {
if ((item.signUpUserNum + item.signUpUserFamilyNum) >= item.maxApplyNum) {
vant.Toast('报名人数已满')
return
}
this.findOne(item)
},
otherUnionClick() {
@@ -403,11 +403,11 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="交通工具">
<el-form-item :prop="'times.' + $index + '.trafficTools'"
:rules="{required:false,message:'交通工具',trigger:['change','blur']}"
<el-descriptions-item label="最多报名人数">
<el-form-item :prop="'times.' + $index + '.maxApplyNum'"
:rules="{required:false,message:'最多报名人数',trigger:['change','blur']}"
label-width="0">
<el-input clearable v-model="row.trafficTools"></el-input>
<el-input clearable v-model="row.maxApplyNum"></el-input>
</el-form-item>
</el-descriptions-item>
@@ -509,8 +509,8 @@ layout("/layouts/platform.html"){
{{row.minimumGroupSize}}
</el-descriptions-item>
<el-descriptions-item label="交通工具">
{{row.trafficTools}}
<el-descriptions-item label="最多报名人数">
{{row.maxApplyNum}}
</el-descriptions-item>
<el-descriptions-item label="预计费用(元/人次)">