zhangxin hace 2 semanas
padre
commit
ea69273942

+ 4 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/IDetailService.java

@@ -1,7 +1,9 @@
 package org.jeecg.modules.app.service;
 
+import org.jeecg.common.api.vo.Result;
 import org.jeecg.modules.app.vo.CourseInfoVO;
 import org.jeecg.modules.app.vo.PlaceInfoVO;
+import org.jeecg.modules.app.vo.stadium.StadiumConcertsVO;
 
 import java.util.List;
 
@@ -41,4 +43,6 @@ public interface IDetailService {
      * @return PlaceInfoVO.theGymnasiumIsCharteredVO
      **/
     PlaceInfoVO.theGymnasiumIsCharteredVO getPlaceInfoNoFixation(String id, String categoryId);
+
+    Result<List<StadiumConcertsVO>> findConcerts(String siteId, String categoryId);
 }

+ 24 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/app/service/impl/DetailServiceImpl.java

@@ -3,12 +3,17 @@ package org.jeecg.modules.app.service.impl;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.extern.log4j.Log4j2;
 import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.modules.app.service.IDetailService;
 import org.jeecg.modules.app.vo.CourseInfoVO;
 import org.jeecg.modules.app.vo.PlaceInfoVO;
+import org.jeecg.modules.app.vo.stadium.ConcertsVO;
+import org.jeecg.modules.app.vo.stadium.StadiumConcertsVO;
 import org.jeecg.modules.system.app.entity.*;
 import org.jeecg.modules.system.app.mapper.*;
+import org.jeecg.modules.system.app.utils.TimeRangeFinder;
+import org.jeecg.modules.system.app.vo.time.NextSevenDayVo;
 import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.mapper.SysUserMapper;
 import org.jeecg.modules.system.util.PositionUtil;
@@ -143,6 +148,25 @@ public class DetailServiceImpl implements IDetailService {
                 .setTimeSlot(collect);
     }
 
+    @Override
+    public Result<List<StadiumConcertsVO>> findConcerts(String siteId, String categoryId) {
+        List<NextSevenDayVo> nextSevenDays = TimeRangeFinder.getNextSevenDays();
+        List<StadiumConcertsVO> stadiumConcertsVOS = new ArrayList<>();
+        for (NextSevenDayVo nextSevenDay : nextSevenDays) {
+            StadiumConcertsVO stadiumConcertsVO = new StadiumConcertsVO();
+            BeanUtils.copyProperties(nextSevenDay,stadiumConcertsVO);
+            //
+            //查询预约总数
+//            appSitePlaceMapper.findCount();
+//            查询过期和已预约数
+            //查询当天所有场地和场次
+            List<ConcertsVO>  concertsVOList= appSitePlaceMapper.findByConcerts(stadiumConcertsVO.getWeekDay(),siteId,categoryId);
+            stadiumConcertsVO.setConcertsVOList(concertsVOList);
+            stadiumConcertsVOS.add(stadiumConcertsVO);
+        }
+        return Result.ok(stadiumConcertsVOS);
+    }
+
     /**
      * @return
      * @Author SheepHy

+ 3 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppSitePlaceMapper.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.system.app.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.jeecg.modules.app.vo.PlaceInfoVO;
+import org.jeecg.modules.app.vo.stadium.ConcertsVO;
 import org.jeecg.modules.system.app.entity.AppSitePlace;
 import org.apache.ibatis.annotations.Param;
 import java.util.List;
@@ -21,4 +22,6 @@ public interface AppSitePlaceMapper extends BaseMapper<AppSitePlace> {
      * @return
      **/
     List<PlaceInfoVO.PlaceInfoGymMsgVO> getPlaceInfoNoFixation(@Param("id")String id);
+
+    List<ConcertsVO> findByConcerts(Integer weekDay, String siteId, String categoryId);
 }

+ 18 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppSitePlaceMapper.xml

@@ -1,6 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.system.app.mapper.AppSitePlaceMapper">
+    <resultMap id="ConcertsVOResult" type="org.jeecg.modules.app.vo.stadium.ConcertsVO">
+        <result property="sitePlaceId" column="site_place_id"/>
+        <result property="sitePlaceName" column="site_place_name"/>
+        <collection property="concertsDetailsVOList" ofType="org.jeecg.modules.app.vo.stadium.ConcertsDetailsVO" javaType="java.util.List">
+            <result property="id" column="id" />
+            <result property="startTime" column="start_time" />
+            <result property="endTime" column="end_time"/>
+            <result property="concertStatus" column="concertStatus" />
+            <result property="price" column="selling_price" javaType="java.math.BigDecimal"/>
+        </collection>
+    </resultMap>
+
     <select id="getPlaceInfoNoFixation" resultType="org.jeecg.modules.app.vo.PlaceInfoVO$PlaceInfoGymMsgVO">
         SELECT
             a.id,
@@ -13,4 +25,10 @@
                 LEFT JOIN nm_site_peice_rules b ON a.id = b.site_place_id WHERE a.site_id = #{id} AND a.type != 0 ORDER BY
             b.selling_price ASC
     </select>
+    <select id="findByConcerts" resultMap="ConcertsVOResult" >
+        select b.site_place_id,a.name as site_place_name,
+        b.id,b.start_time,b.end_time ,b.selling_price
+        from nm_site_place a left join  nm_site_price_rules b on a.id = b.site_place_id
+        where a.site_id = #{siteId} and b.category_id =#{categoryId} and b.day_of_week =#{weekDay}
+    </select>
 </mapper>