需求一:对每天的课设置预约次数的限制
需求二:对每周的预约次数进行次数限制 需求三:所有课程48小时内不能取消预约设置可配置
This commit is contained in:
@@ -19,7 +19,7 @@ public class VenueDTO implements Serializable {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@@ -122,6 +122,16 @@ public class VenueDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer deleted;
|
private Integer deleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每天预约限制
|
||||||
|
*/
|
||||||
|
private Integer limitDay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每周预约限制
|
||||||
|
*/
|
||||||
|
private Integer limitWeek;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 场馆图片列表
|
* 场馆图片列表
|
||||||
*/
|
*/
|
||||||
@@ -140,7 +150,7 @@ public class VenueDTO implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 设置
|
* 设置
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
public void setId(Integer id){
|
public void setId(Integer id){
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@@ -149,7 +159,7 @@ public class VenueDTO implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 获取
|
* 获取
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Integer getId(){
|
public Integer getId(){
|
||||||
return id;
|
return id;
|
||||||
@@ -527,4 +537,20 @@ public class VenueDTO implements Serializable {
|
|||||||
public void setCodeUrl(String codeUrl) {
|
public void setCodeUrl(String codeUrl) {
|
||||||
this.codeUrl = codeUrl;
|
this.codeUrl = codeUrl;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public Integer getLimitDay() {
|
||||||
|
return limitDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimitDay(Integer limitDay) {
|
||||||
|
this.limitDay = limitDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getLimitWeek() {
|
||||||
|
return limitWeek;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimitWeek(Integer limitWeek) {
|
||||||
|
this.limitWeek = limitWeek;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,9 +22,8 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class VenueLessonDTO implements Serializable {
|
public class VenueLessonDTO implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@@ -180,6 +179,11 @@ public class VenueLessonDTO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String venueName;
|
private String venueName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可取消预约时间(小时)
|
||||||
|
*/
|
||||||
|
private Integer orderLimit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期集合
|
* 日期集合
|
||||||
*/
|
*/
|
||||||
@@ -189,7 +193,7 @@ public class VenueLessonDTO implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 设置
|
* 设置
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
public void setId(Integer id){
|
public void setId(Integer id){
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@@ -198,7 +202,7 @@ public class VenueLessonDTO implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 获取
|
* 获取
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Integer getId(){
|
public Integer getId(){
|
||||||
return id;
|
return id;
|
||||||
@@ -615,4 +619,12 @@ public class VenueLessonDTO implements Serializable {
|
|||||||
public void setType(Integer type) {
|
public void setType(Integer type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public Integer getOrderLimit() {
|
||||||
|
return orderLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderLimit(Integer orderLimit) {
|
||||||
|
this.orderLimit = orderLimit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -151,6 +151,16 @@ public class Venue implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer deleted;
|
private Integer deleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每天预约限制
|
||||||
|
*/
|
||||||
|
private Integer limitDay;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每周预约限制
|
||||||
|
*/
|
||||||
|
private Integer limitWeek;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置
|
* 设置
|
||||||
@@ -574,4 +584,20 @@ public class Venue implements Serializable {
|
|||||||
public void setNumber(Integer number) {
|
public void setNumber(Integer number) {
|
||||||
this.number = number;
|
this.number = number;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public Integer getLimitDay() {
|
||||||
|
return limitDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimitDay(Integer limitDay) {
|
||||||
|
this.limitDay = limitDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getLimitWeek() {
|
||||||
|
return limitWeek;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimitWeek(Integer limitWeek) {
|
||||||
|
this.limitWeek = limitWeek;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class VenueLesson implements Serializable {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@@ -136,12 +136,15 @@ public class VenueLesson implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Integer deleted;
|
private Integer deleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可取消预约时间(小时)
|
||||||
|
*/
|
||||||
|
private Integer orderLimit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置
|
* 设置
|
||||||
*
|
*
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
public void setId(Integer id){
|
public void setId(Integer id){
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@@ -150,7 +153,7 @@ public class VenueLesson implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 获取
|
* 获取
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Integer getId(){
|
public Integer getId(){
|
||||||
return id;
|
return id;
|
||||||
@@ -520,4 +523,12 @@ public class VenueLesson implements Serializable {
|
|||||||
public void setType(Integer type) {
|
public void setType(Integer type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public Integer getOrderLimit() {
|
||||||
|
return orderLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrderLimit(Integer orderLimit) {
|
||||||
|
this.orderLimit = orderLimit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -81,6 +81,16 @@
|
|||||||
</el-time-picker>
|
</el-time-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 每天预约限制 -->
|
||||||
|
<el-form-item label="公益每天可预约" prop="name">
|
||||||
|
<el-input-number v-model="form.limitDay" min="0" :precision="0" placeholder="请输入每天预约限制次数"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 每周预约限制 -->
|
||||||
|
<el-form-item label="公益每周可预约" prop="name">
|
||||||
|
<el-input-number v-model="form.limitWeek" min="0" :precision="0" placeholder="请输入每周预约限制次数"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="门店GPS位置" prop="address" :required="true">
|
<el-form-item label="门店GPS位置" prop="address" :required="true">
|
||||||
<div style="color:red">*请点击地图选择一个位置,用于小程序前端导航</div>
|
<div style="color:red">*请点击地图选择一个位置,用于小程序前端导航</div>
|
||||||
<div id="container" class="map" tabindex="0" style="width:900px;margin-top:10px"></div>
|
<div id="container" class="map" tabindex="0" style="width:900px;margin-top:10px"></div>
|
||||||
@@ -126,7 +136,7 @@
|
|||||||
</el-time-picker>
|
</el-time-picker>
|
||||||
<el-button style="font-size: 13px;background-color: rgba(245,108,108,.1);border-color: rgba(245,108,108,.2); color:#f56c6c;" @click="handleDelete(i)">删除</el-button>
|
<el-button style="font-size: 13px;background-color: rgba(245,108,108,.1);border-color: rgba(245,108,108,.2); color:#f56c6c;" @click="handleDelete(i)">删除</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<el-button style="font-size: 13px;" type="success" @click="changePrice" v-if="form.type==1">添加时间段价格</el-button>
|
<el-button style="font-size: 13px;" type="success" @click="changePrice" v-if="form.type==1">添加时间段价格</el-button>
|
||||||
<el-dialog title="价格设置" :visible.sync="dialogFormVisible" size="tiny">
|
<el-dialog title="价格设置" :visible.sync="dialogFormVisible" size="tiny">
|
||||||
@@ -213,6 +223,8 @@ export default {
|
|||||||
starTime : '',
|
starTime : '',
|
||||||
endTime:'',
|
endTime:'',
|
||||||
priceDate: undefined,
|
priceDate: undefined,
|
||||||
|
limitDay: 1,
|
||||||
|
limitWeek: 1,
|
||||||
},
|
},
|
||||||
imgs: [],
|
imgs: [],
|
||||||
timeData: undefined,
|
timeData: undefined,
|
||||||
@@ -336,6 +348,8 @@ export default {
|
|||||||
this.form.businessStartTime = response.venue.businessStartTime;
|
this.form.businessStartTime = response.venue.businessStartTime;
|
||||||
this.form.businessEndTime = response.venue.businessEndTime;
|
this.form.businessEndTime = response.venue.businessEndTime;
|
||||||
this.form.cardContent = response.venue.cardContent;
|
this.form.cardContent = response.venue.cardContent;
|
||||||
|
this.form.limitDay = response.venue.limitDay;
|
||||||
|
this.form.limitWeek = response.venue.limitWeek;
|
||||||
this.timeData = [
|
this.timeData = [
|
||||||
response.venue.businessStartTime,
|
response.venue.businessStartTime,
|
||||||
response.venue.businessEndTime
|
response.venue.businessEndTime
|
||||||
@@ -370,7 +384,7 @@ export default {
|
|||||||
starTime : this.form.priceDate[0],
|
starTime : this.form.priceDate[0],
|
||||||
endTime : this.form.priceDate[1],
|
endTime : this.form.priceDate[1],
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -60,6 +60,11 @@
|
|||||||
<el-input :disabled="true" v-model.number="form.saleNum" style="width:180px"></el-input>
|
<el-input :disabled="true" v-model.number="form.saleNum" style="width:180px"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- 可取消预约时间(小时) -->
|
||||||
|
<el-form-item label="取消限制(时)" prop="orderLimit">
|
||||||
|
<el-input-number v-model="form.orderLimit" min="0" :precision="0" placeholder="请输入小时数"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<!-- 教练ID -->
|
<!-- 教练ID -->
|
||||||
<el-form-item label="教练" prop="coachId">
|
<el-form-item label="教练" prop="coachId">
|
||||||
<el-select v-model="form.coachId" filterable placeholder="请选择教练">
|
<el-select v-model="form.coachId" filterable placeholder="请选择教练">
|
||||||
@@ -147,7 +152,8 @@ export default {
|
|||||||
platformId: '',
|
platformId: '',
|
||||||
lessonImage: [],
|
lessonImage: [],
|
||||||
tags: [],
|
tags: [],
|
||||||
note: ''
|
note: '',
|
||||||
|
orderLimit: 48
|
||||||
},
|
},
|
||||||
multip: 3,
|
multip: 3,
|
||||||
imgs: [],
|
imgs: [],
|
||||||
@@ -253,6 +259,7 @@ export default {
|
|||||||
this.form.tags = response.venueLesson.tags
|
this.form.tags = response.venueLesson.tags
|
||||||
this.form.note = response.venueLesson.note
|
this.form.note = response.venueLesson.note
|
||||||
this.form.type = response.venueLesson.type
|
this.form.type = response.venueLesson.type
|
||||||
|
this.form.orderLimit = response.venueLesson.orderLimit
|
||||||
response.venueLesson.lessonImage.forEach(element => {
|
response.venueLesson.lessonImage.forEach(element => {
|
||||||
this.imgs.push({ name: element, url: element })
|
this.imgs.push({ name: element, url: element })
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.sv.mapper;
|
package com.sv.mapper;
|
||||||
|
|
||||||
|
import com.sv.annotation.NoPlatform;
|
||||||
import com.sv.annotation.PlatformKey;
|
import com.sv.annotation.PlatformKey;
|
||||||
import com.sv.dto.api.MemberLessonTicketDTO;
|
import com.sv.dto.api.MemberLessonTicketDTO;
|
||||||
import com.sv.dto.api.MemberLessonTicketDetailDTO;
|
import com.sv.dto.api.MemberLessonTicketDetailDTO;
|
||||||
@@ -155,4 +156,4 @@ public interface MemberLessonTicketMapper {
|
|||||||
Integer findByZero(@Param("memberId") Integer memberId,@Param("lessonId") Integer lessonId);
|
Integer findByZero(@Param("memberId") Integer memberId,@Param("lessonId") Integer lessonId);
|
||||||
|
|
||||||
List<MemberLessonTicketDetailDTO> findTicketByStatusAndTime(@Param("memberId") Integer memberId,@Param("status") Integer status,@Param("startDate") String startDate,@Param("endDate") String endDate);
|
List<MemberLessonTicketDetailDTO> findTicketByStatusAndTime(@Param("memberId") Integer memberId,@Param("status") Integer status,@Param("startDate") String startDate,@Param("endDate") String endDate);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.sv.mapper;
|
package com.sv.mapper;
|
||||||
|
|
||||||
|
import com.sv.annotation.NoPlatform;
|
||||||
import com.sv.annotation.PlatformKey;
|
import com.sv.annotation.PlatformKey;
|
||||||
import com.sv.entity.MemberLessonTicket;
|
import com.sv.entity.MemberLessonTicket;
|
||||||
import com.sv.entity.VenueLessonTicket;
|
import com.sv.entity.VenueLessonTicket;
|
||||||
@@ -108,4 +109,20 @@ public interface VenueLessonTicketMapper {
|
|||||||
*/
|
*/
|
||||||
@PlatformKey
|
@PlatformKey
|
||||||
Integer findNum(Integer venueId);
|
Integer findNum(Integer venueId);
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* 检验是否满足公益课当天预约限制
|
||||||
|
* @param memberId
|
||||||
|
* @param venueId
|
||||||
|
*/
|
||||||
|
@NoPlatform
|
||||||
|
Integer countFreeDayLimit(@Param("memberId") Integer memberId,@Param("venueId") Integer venueId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验是否满足公益课当周预约限制
|
||||||
|
* @param memberId
|
||||||
|
* @param venueId
|
||||||
|
*/
|
||||||
|
@NoPlatform
|
||||||
|
Integer countFreeWeekLimit(@Param("memberId") Integer memberId,@Param("venueId") Integer venueId);
|
||||||
|
}
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ public class MemberLessonTicketService extends BaseServiceImpl {
|
|||||||
@Resource
|
@Resource
|
||||||
private VenueLessonService venueLessonService;
|
private VenueLessonService venueLessonService;
|
||||||
@Resource
|
@Resource
|
||||||
|
private VenueService venueService;
|
||||||
|
@Resource
|
||||||
private VenueLessonTicketService venueLessonTicketService;
|
private VenueLessonTicketService venueLessonTicketService;
|
||||||
@Resource
|
@Resource
|
||||||
private MemberCardOrderService memberCardOrderService;
|
private MemberCardOrderService memberCardOrderService;
|
||||||
@@ -196,6 +198,13 @@ public class MemberLessonTicketService extends BaseServiceImpl {
|
|||||||
|
|
||||||
// 课程是公益课 判断用户是否可以购买公益课
|
// 课程是公益课 判断用户是否可以购买公益课
|
||||||
memberService.verifyMemberBanType(member);
|
memberService.verifyMemberBanType(member);
|
||||||
|
// 课程是公益课
|
||||||
|
Venue venue = venueService.findById(venueLesson.getVenueId());
|
||||||
|
Integer limitDay = venue.getLimitDay() == null ? 1 : venue.getLimitDay();
|
||||||
|
Integer limitWeek = venue.getLimitWeek() == null ? 2 : venue.getLimitWeek();
|
||||||
|
// 1、对每天的课设置预约次数的限制
|
||||||
|
// 2、对每周的预约次数进行次数限制
|
||||||
|
venueLessonService.checkFreeLimit(member.getId(),venueLesson.getVenueId(),limitDay,limitWeek);
|
||||||
}
|
}
|
||||||
|
|
||||||
venueLessonService.decide(venueLesson, lessonTicketOrderDTO.getNum());
|
venueLessonService.decide(venueLesson, lessonTicketOrderDTO.getNum());
|
||||||
@@ -494,8 +503,11 @@ public class MemberLessonTicketService extends BaseServiceImpl {
|
|||||||
double min = between / 3600;
|
double min = between / 3600;
|
||||||
DecimalFormat df = new DecimalFormat("#.#");
|
DecimalFormat df = new DecimalFormat("#.#");
|
||||||
Double hour = Double.parseDouble(df.format(min));
|
Double hour = Double.parseDouble(df.format(min));
|
||||||
Double subHour = 48D;
|
Integer orderLimit = venueLesson.getOrderLimit();
|
||||||
if (hour <= subHour) {
|
if (orderLimit == null){
|
||||||
|
orderLimit = 48;
|
||||||
|
}
|
||||||
|
if (hour <= orderLimit) {
|
||||||
throw new ServiceException(ExceptionCodeTemplate.LESSON_CANCEL);
|
throw new ServiceException(ExceptionCodeTemplate.LESSON_CANCEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,9 @@ import com.github.pagehelper.PageHelper;
|
|||||||
import com.sv.dto.api.VenueLessonDTO;
|
import com.sv.dto.api.VenueLessonDTO;
|
||||||
import com.sv.dto.app.VenueLessonStatus;
|
import com.sv.dto.app.VenueLessonStatus;
|
||||||
import com.sv.entity.Member;
|
import com.sv.entity.Member;
|
||||||
import com.sv.entity.MemberLessonTicket;
|
|
||||||
import com.sv.entity.VenueLesson;
|
import com.sv.entity.VenueLesson;
|
||||||
import com.sv.entity.VenueLessonTicket;
|
|
||||||
import com.sv.mapper.VenueLessonMapper;
|
import com.sv.mapper.VenueLessonMapper;
|
||||||
|
import com.sv.mapper.VenueLessonTicketMapper;
|
||||||
import com.sv.service.api.util.DateUtilCard;
|
import com.sv.service.api.util.DateUtilCard;
|
||||||
import com.sv.service.api.util.WeekDayUtil;
|
import com.sv.service.api.util.WeekDayUtil;
|
||||||
import com.ydd.framework.core.common.Pagination;
|
import com.ydd.framework.core.common.Pagination;
|
||||||
@@ -45,7 +44,7 @@ public class VenueLessonService extends BaseServiceImpl {
|
|||||||
@Resource
|
@Resource
|
||||||
private MemberService memberService;
|
private MemberService memberService;
|
||||||
@Resource
|
@Resource
|
||||||
private VenueLessonTicketService venueLessonTicketService;
|
private VenueLessonTicketMapper venueLessonTicketMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建场馆课程
|
* 创建场馆课程
|
||||||
@@ -333,5 +332,22 @@ public class VenueLessonService extends BaseServiceImpl {
|
|||||||
return venueLessonMapper.getLessonStatus(venueId);
|
return venueLessonMapper.getLessonStatus(venueId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验是否满足公益课预约限制
|
||||||
|
* @param memberId
|
||||||
|
* @param venueId
|
||||||
|
* @param limitDay
|
||||||
|
* @param limitWeek
|
||||||
|
*/
|
||||||
|
public void checkFreeLimit(Integer memberId, Integer venueId, Integer limitDay, Integer limitWeek) {
|
||||||
|
Integer dayCount = venueLessonTicketMapper.countFreeDayLimit(memberId, venueId);
|
||||||
|
if (dayCount + 1 > limitDay){
|
||||||
|
throw new ServiceException("该场馆当天最多可预约" + limitDay + "个公益课");
|
||||||
|
}
|
||||||
|
Integer weekCount = venueLessonTicketMapper.countFreeWeekLimit(memberId, venueId);
|
||||||
|
if (weekCount + 1 > limitWeek){
|
||||||
|
throw new ServiceException("该场馆一周最多可预约" + limitWeek + "个公益课");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
<result column="deleted" property="deleted"/>
|
<result column="deleted" property="deleted"/>
|
||||||
<result column="note" property="note"/>
|
<result column="note" property="note"/>
|
||||||
<result column="type" property="type"></result>
|
<result column="type" property="type"></result>
|
||||||
|
<result column="order_limit" property="orderLimit"></result>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<resultMap id="VenueLessonOrderDtoMap" type="com.sv.dto.api.VenueLessonDTO" extends="VenueLessonMap">
|
<resultMap id="VenueLessonOrderDtoMap" type="com.sv.dto.api.VenueLessonDTO" extends="VenueLessonMap">
|
||||||
<result column="address" property="address"/>
|
<result column="address" property="address"/>
|
||||||
@@ -70,7 +71,8 @@
|
|||||||
deleted,
|
deleted,
|
||||||
note,
|
note,
|
||||||
status,
|
status,
|
||||||
type
|
type,
|
||||||
|
order_limit
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 字段值 -->
|
<!-- 字段值 -->
|
||||||
@@ -96,6 +98,7 @@
|
|||||||
#{deleted, jdbcType=TINYINT},
|
#{deleted, jdbcType=TINYINT},
|
||||||
#{note, jdbcType=VARCHAR},
|
#{note, jdbcType=VARCHAR},
|
||||||
#{status, jdbcType=INTEGER}
|
#{status, jdbcType=INTEGER}
|
||||||
|
#{orderLimit, jdbcType=INTEGER}
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 查询全部记录 -->
|
<!-- 查询全部记录 -->
|
||||||
@@ -177,6 +180,9 @@
|
|||||||
<if test="deleted != null">
|
<if test="deleted != null">
|
||||||
deleted,
|
deleted,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="orderLimit != null">
|
||||||
|
order_limit,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
@@ -242,6 +248,9 @@
|
|||||||
<if test="deleted != null">
|
<if test="deleted != null">
|
||||||
#{deleted},
|
#{deleted},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="orderLimit != null">
|
||||||
|
#{orderLimit},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -333,6 +342,9 @@
|
|||||||
<if test="note != null">
|
<if test="note != null">
|
||||||
note = #{note},
|
note = #{note},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="orderLimit != null">
|
||||||
|
order_limit = #{orderLimit},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@@ -487,6 +499,7 @@
|
|||||||
ve.latitude,
|
ve.latitude,
|
||||||
ve.longitude,
|
ve.longitude,
|
||||||
le.type,
|
le.type,
|
||||||
|
le.order_limit,
|
||||||
ve.`name` AS venueName
|
ve.`name` AS venueName
|
||||||
FROM
|
FROM
|
||||||
sv_venue_lesson AS le
|
sv_venue_lesson AS le
|
||||||
@@ -508,7 +521,8 @@
|
|||||||
vl.price,
|
vl.price,
|
||||||
vl.num,
|
vl.num,
|
||||||
vl.sale_num,
|
vl.sale_num,
|
||||||
vl.note
|
vl.note,
|
||||||
|
vl.order_limit
|
||||||
FROM
|
FROM
|
||||||
sv_venue_lesson AS vl
|
sv_venue_lesson AS vl
|
||||||
LEFT JOIN sv_venue AS ue ON vl.venue_id = ue.id
|
LEFT JOIN sv_venue AS ue ON vl.venue_id = ue.id
|
||||||
|
|||||||
@@ -344,4 +344,40 @@
|
|||||||
lesson_id = #{venueId}
|
lesson_id = #{venueId}
|
||||||
AND deleted = 0
|
AND deleted = 0
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
|
||||||
|
<select id="countFreeWeekLimit" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
COUNT(0)
|
||||||
|
FROM
|
||||||
|
sv_member_lesson_ticket t,sv_venue_lesson a
|
||||||
|
WHERE
|
||||||
|
t.lesson_id = a.id
|
||||||
|
AND t.venue_id = #{venueId}
|
||||||
|
AND a.type = 1
|
||||||
|
AND t.deleted = 0
|
||||||
|
AND t.status in (0,1,3)
|
||||||
|
AND t.member_id = #{memberId}
|
||||||
|
AND (CASE WHEN DAYNAME(CURDATE())='Sunday'
|
||||||
|
THEN DATE_SUB(CURDATE(),INTERVAL 6 DAY)
|
||||||
|
ELSE DATE_SUB(CURDATE(),INTERVAL DAYOFWEEK(CURDATE())-2 DAY) END) <![CDATA[ <= ]]> DATE(t.created_time)
|
||||||
|
AND (CASE WHEN DAYNAME(CURDATE())='Sunday'
|
||||||
|
THEN CURDATE()
|
||||||
|
ELSE DATE_ADD(CURDATE(),INTERVAL 8-DAYOFWEEK(CURDATE()) DAY) END) <![CDATA[ >= ]]> DATE(t.created_time);
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="countFreeDayLimit" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
COUNT(0)
|
||||||
|
FROM
|
||||||
|
sv_member_lesson_ticket t,sv_venue_lesson a
|
||||||
|
WHERE
|
||||||
|
t.lesson_id = a.id
|
||||||
|
AND t.venue_id = #{venueId}
|
||||||
|
AND a.type = 1
|
||||||
|
AND t.deleted = 0
|
||||||
|
AND t.status in (0,1,3)
|
||||||
|
AND t.member_id = #{memberId}
|
||||||
|
AND CURDATE() <![CDATA[ <= ]]> DATE(t.created_time)
|
||||||
|
AND CURDATE() <![CDATA[ >= ]]> DATE(t.created_time);
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|||||||
@@ -28,6 +28,8 @@
|
|||||||
<result column="modified_time" property="modifiedTime"/>
|
<result column="modified_time" property="modifiedTime"/>
|
||||||
<result column="code_url" property="codeUrl"></result>
|
<result column="code_url" property="codeUrl"></result>
|
||||||
<result column="deleted" property="deleted"/>
|
<result column="deleted" property="deleted"/>
|
||||||
|
<result column="limit_day" property="limitDay"/>
|
||||||
|
<result column="limit_week" property="limitWeek"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="VenueDtoMap" type="com.sv.dto.api.VenueDTO">
|
<resultMap id="VenueDtoMap" type="com.sv.dto.api.VenueDTO">
|
||||||
@@ -50,6 +52,8 @@
|
|||||||
<result column="created_time" property="createdTime"/>
|
<result column="created_time" property="createdTime"/>
|
||||||
<result column="modified_time" property="modifiedTime"/>
|
<result column="modified_time" property="modifiedTime"/>
|
||||||
<result column="deleted" property="deleted"/>
|
<result column="deleted" property="deleted"/>
|
||||||
|
<result column="limit_day" property="limitDay"/>
|
||||||
|
<result column="limit_week" property="limitWeek"/>
|
||||||
<result column="code_url" property="codeUrl"></result>
|
<result column="code_url" property="codeUrl"></result>
|
||||||
<association property="cards" select="com.sv.mapper.VenueCardMapper.findByVenueId"
|
<association property="cards" select="com.sv.mapper.VenueCardMapper.findByVenueId"
|
||||||
column="{venueId = id,venueType=type}"></association>
|
column="{venueId = id,venueType=type}"></association>
|
||||||
@@ -105,7 +109,9 @@
|
|||||||
created_time,
|
created_time,
|
||||||
modified_time,
|
modified_time,
|
||||||
code_url,
|
code_url,
|
||||||
deleted
|
deleted,
|
||||||
|
limit_day,
|
||||||
|
limit_week
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 字段值 -->
|
<!-- 字段值 -->
|
||||||
@@ -129,6 +135,8 @@
|
|||||||
#{createdTime, jdbcType=TIMESTAMP},
|
#{createdTime, jdbcType=TIMESTAMP},
|
||||||
#{modifiedTime, jdbcType=TIMESTAMP},
|
#{modifiedTime, jdbcType=TIMESTAMP},
|
||||||
#{deleted, jdbcType=TINYINT}
|
#{deleted, jdbcType=TINYINT}
|
||||||
|
#{limit_day, jdbcType=TINYINT}
|
||||||
|
#{limit_week, jdbcType=TINYINT}
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 查询全部记录 -->
|
<!-- 查询全部记录 -->
|
||||||
@@ -251,6 +259,12 @@
|
|||||||
<if test="deleted != null">
|
<if test="deleted != null">
|
||||||
deleted,
|
deleted,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="limitDay != null">
|
||||||
|
limit_day,
|
||||||
|
</if>
|
||||||
|
<if test="limitWeek != null">
|
||||||
|
limit_week,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
@@ -325,6 +339,12 @@
|
|||||||
<if test="deleted != null">
|
<if test="deleted != null">
|
||||||
#{deleted},
|
#{deleted},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="limitDay != null">
|
||||||
|
#{limitDay},
|
||||||
|
</if>
|
||||||
|
<if test="limitWeek != null">
|
||||||
|
#{limitWeek},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -430,6 +450,12 @@
|
|||||||
<if test="codeUrl != null">
|
<if test="codeUrl != null">
|
||||||
code_url = #{codeUrl},
|
code_url = #{codeUrl},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="limitDay != null">
|
||||||
|
limit_day = #{limitDay},
|
||||||
|
</if>
|
||||||
|
<if test="limitWeek != null">
|
||||||
|
limit_week = #{limitWeek},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
@@ -465,7 +491,9 @@
|
|||||||
description,
|
description,
|
||||||
longitude,
|
longitude,
|
||||||
latitude,
|
latitude,
|
||||||
card_content
|
card_content,
|
||||||
|
limit_day,
|
||||||
|
limit_week
|
||||||
FROM
|
FROM
|
||||||
sv_venue
|
sv_venue
|
||||||
WHERE
|
WHERE
|
||||||
@@ -535,4 +563,4 @@
|
|||||||
<delete id="deleteMember">
|
<delete id="deleteMember">
|
||||||
delete from sv_venue_member where member_id = #{memberId} and venue_id = #{venueId}
|
delete from sv_venue_member where member_id = #{memberId} and venue_id = #{venueId}
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user