api-显示当前场馆的预订信息
This commit is contained in:
@@ -2,6 +2,7 @@ package com.sv.mapper;
|
||||
|
||||
import com.sv.annotation.PlatformKey;
|
||||
import com.sv.dto.api.VenueLessonDTO;
|
||||
import com.sv.dto.app.VenueLessonStatus;
|
||||
import com.sv.dto.oms.VenueLessonOmsDTO;
|
||||
import com.sv.entity.MemberLessonTicket;
|
||||
import com.sv.entity.VenueLesson;
|
||||
@@ -131,4 +132,13 @@ public interface VenueLessonMapper {
|
||||
* api 修改库存
|
||||
*/
|
||||
void updateSaleNumBy(@Param("num")Integer num,@Param("lessonId") Integer lessonId);
|
||||
|
||||
/**
|
||||
* APP获取当前预订情况
|
||||
* @param venueId
|
||||
* @param searchDate
|
||||
* and b.date = #{searchDate} and b.venue_id = #{venueId}
|
||||
* @return
|
||||
*/
|
||||
List<VenueLessonStatus> getLessonStatus(@Param("venueId") Integer venueId,@Param("searchDate") String searchDate);
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.sv.service.api;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.sv.dto.api.VenueLessonDTO;
|
||||
import com.sv.dto.app.VenueLessonStatus;
|
||||
import com.sv.entity.Member;
|
||||
import com.sv.entity.MemberLessonTicket;
|
||||
import com.sv.entity.VenueLesson;
|
||||
@@ -322,5 +323,12 @@ public class VenueLessonService extends BaseServiceImpl {
|
||||
public void updateSaleNum(Integer num,Integer lessonId){
|
||||
venueLessonMapper.updateSaleNumBy(num,lessonId);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<VenueLessonStatus> getLessonOrder(Integer venueId,String searchDate){
|
||||
// 校验场馆是否存在 TODO
|
||||
return venueLessonMapper.getLessonStatus(venueId,searchDate);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -602,4 +602,23 @@
|
||||
WHERE
|
||||
id = #{lessonId}
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 修改库存 -->
|
||||
<select id="getLessonStatus" resultType="com.sv.dto.app.VenueLessonStatus">
|
||||
select (select x.name from sv_venue x where x.id = a.venue_id) as 'venueName',
|
||||
a.`name` as 'lessonName',a.date as 'searchDate',
|
||||
a.start_time as 'startTime',a.end_time as 'endTime',a.num,
|
||||
a.sale_num as 'saleNum',(a.num-a.sale_num) as 'limitNum',
|
||||
IFNULL(t.orderUsers,'暂无预订') as 'orderUsers',a.note
|
||||
from sv_venue_lesson a LEFT JOIN
|
||||
(select b.lesson_id,group_concat(d.nickname,'(',d.mobile,')') as 'orderUsers'
|
||||
from sv_member_lesson_ticket b , sv_member d
|
||||
where b.member_id = d.id
|
||||
and b.`status` != '2'
|
||||
GROUP BY b.lesson_id) t on a.id = t.lesson_id
|
||||
where a.date = #{searchDate}
|
||||
and a.venue_id = #{venueId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user