查询场馆列表数据
This commit is contained in:
@@ -13,9 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
public class AppVenueLessonController {
|
||||
@@ -31,7 +29,6 @@ public class AppVenueLessonController {
|
||||
*/
|
||||
@RequestMapping("/getLessonOrder/{id}")
|
||||
public String getLessonOrder(@PathVariable("id") Integer id,String date) {
|
||||
System.out.println("测试一下 ====================== " + date);
|
||||
if (date == null && "".equals(date)){
|
||||
LocalDate now = LocalDate.now();
|
||||
date = now.toString();
|
||||
@@ -44,20 +41,19 @@ public class AppVenueLessonController {
|
||||
LocalDate now = LocalDate.now();
|
||||
date = now.toString();
|
||||
}
|
||||
List<VenueLessonStatus> lessonOrder = venueLessonService.getLessonOrder(id, date);
|
||||
List<VenueLessonStatus> lessonOrder = venueLessonService.getLessonOrder(id);
|
||||
if (lessonOrder != null && lessonOrder.size() > 0){
|
||||
String returnHtml = concatResult(lessonOrder);
|
||||
return returnHtml;
|
||||
}else {
|
||||
return "<h1 align=\"center\">~_~该场馆当天没有课程~_~<h1>";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private String concatResult(List<VenueLessonStatus> lessonOrder) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("<html><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><head></head>");
|
||||
sb.append("<body bgcolor=\"#3C3C3C\">");
|
||||
sb.append("<body>");
|
||||
sb.append("<h1 align=\"center\">【" + lessonOrder.get(0).getVenueName() + "】(" + lessonOrder.get(0).getSearchDate() + ")预订信息一览表" + "<h1>");
|
||||
sb.append("<table width = 100% bgcolor=\"#FFFFFF\" align=\"center\" border=\"1\">");
|
||||
sb.append("<tr bgcolor=\"#3399ff\" align=\"center\">" +
|
||||
|
||||
@@ -136,9 +136,8 @@ public interface VenueLessonMapper {
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
List<VenueLessonStatus> getLessonStatus(@Param("venueId") Integer venueId);
|
||||
}
|
||||
|
||||
@@ -325,9 +325,8 @@ public class VenueLessonService extends BaseServiceImpl {
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<VenueLessonStatus> getLessonOrder(Integer venueId,String searchDate){
|
||||
// 校验场馆是否存在 TODO
|
||||
return venueLessonMapper.getLessonStatus(venueId,searchDate);
|
||||
public List<VenueLessonStatus> getLessonOrder(Integer venueId){
|
||||
return venueLessonMapper.getLessonStatus(venueId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -612,13 +612,14 @@
|
||||
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'
|
||||
(select b.lesson_id,group_concat(d.nickname,'(',d.mobile,')','<![CDATA[ <br/> ]]>') 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}
|
||||
where a.date <![CDATA[ >= ]]> NOW()
|
||||
AND a.date <![CDATA[ <= ]]> DATE_ADD(NOW(),INTERVAL 2 DAY)
|
||||
and a.venue_id = #{venueId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user