课程重复预订提示调整

This commit is contained in:
limqhz
2023-02-15 14:33:51 +08:00
parent 6910ba2f4f
commit 438c044128
4 changed files with 26 additions and 2 deletions

View File

@@ -150,6 +150,11 @@ public interface MemberLessonTicketMapper {
*/
void updateMemberStatus(@Param("id") Integer id);
/**
* 判断用户是否购买过课程价格为0的
*/
Integer findByNoPay(@Param("memberId") Integer memberId,@Param("lessonId") Integer lessonId);
/**
* 判断用户是否购买过课程价格为0的
*/

View File

@@ -215,6 +215,10 @@ public class MemberLessonTicketService extends BaseServiceImpl {
venueLessonService.decide(venueLesson, lessonTicketOrderDTO.getNum());
Integer countByZero = memberLessonTicketMapper.findByZero(memberId, lessonTicketOrderDTO.getLessonId());
if (countByZero != 0) {
Integer contNoPay = memberLessonTicketMapper.findByNoPay(memberId, lessonTicketOrderDTO.getLessonId());
if (contNoPay != 0) {
throw new ServiceException("您两分钟内已预订过该课程,请稍候再试");
}
throw new ServiceException("不可重复预约相同课程");
}
// 判断是否预约过价格为0的课程