|
@@ -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;
|
|
@@ -69,17 +74,17 @@ public class DetailServiceImpl implements IDetailService {
|
|
|
List<PlaceInfoVO.PlaceInfoMsgVO> placeInfoMsgVOS = new ArrayList<>();
|
|
|
appSitePlaceMapper.selectList(Wrappers.<AppSitePlace>lambdaQuery().eq(AppSitePlace::getSiteId, id)
|
|
|
.eq(AppSitePlace::getType,0)).forEach(appSitePlace -> {
|
|
|
- appSitePriceRulesMapper.selectList(Wrappers.<AppSitePriceRules>lambdaQuery()
|
|
|
- .eq(AppSitePriceRules::getSitePlaceId, id)
|
|
|
- .eq(AppSitePriceRules::getStatus, 0)
|
|
|
- .eq(AppSitePriceRules::getType,0)).forEach(appSitePriceRules -> {
|
|
|
- PlaceInfoVO.PlaceInfoMsgVO placeInfoMsgVO = new PlaceInfoVO.PlaceInfoMsgVO();
|
|
|
- placeInfoMsgVO.setName(appSite.getName())
|
|
|
- .setSales(getPlaceSales(id))
|
|
|
- .setOriginalPrice(appSitePriceRules.getOriginalPrice())
|
|
|
- .setSellingPrice(appSitePriceRules.getSellingPrice());
|
|
|
- placeInfoMsgVOS.add(placeInfoMsgVO);
|
|
|
- });
|
|
|
+ PlaceInfoVO.PlaceInfoMsgVO placeInfoMsgVO = new PlaceInfoVO.PlaceInfoMsgVO();
|
|
|
+ placeInfoMsgVO.setName(appSitePlace.getName())
|
|
|
+ .setSales(getPlaceSales(id))
|
|
|
+ .setOriginalPrice(appSitePriceRulesMapper.selectOne(Wrappers.<AppSitePriceRules>lambdaQuery()
|
|
|
+ .eq(AppSitePriceRules::getSitePlaceId, appSitePlace.getId())
|
|
|
+ .last("limit 1").orderByDesc(AppSitePriceRules::getOriginalPrice)).getOriginalPrice())
|
|
|
+ .setSellingPrice(appSitePriceRulesMapper.selectOne(Wrappers.<AppSitePriceRules>lambdaQuery()
|
|
|
+ .eq(AppSitePriceRules::getSitePlaceId, appSitePlace.getId())
|
|
|
+ .last("limit 1").orderByDesc(AppSitePriceRules::getSellingPrice)).getSellingPrice())
|
|
|
+ .setCategory(getCategoryName(appSitePlace.getCategoryId()));
|
|
|
+ placeInfoMsgVOS.add(placeInfoMsgVO);
|
|
|
});
|
|
|
placeInfo.setPlaceInfoMsgVO(placeInfoMsgVOS);
|
|
|
return placeInfo;
|
|
@@ -103,26 +108,29 @@ public class DetailServiceImpl implements IDetailService {
|
|
|
appCoursesPriceRulesMapper.selectList(Wrappers.<AppCoursesPriceRules>lambdaQuery()
|
|
|
.eq(AppCoursesPriceRules::getCoursesId, courseInfoVO.getId())).forEach(appCourses -> {
|
|
|
CourseInfoVO.CourseDetailVO courseDetailVO = new CourseInfoVO.CourseDetailVO();
|
|
|
- BeanUtils.copyProperties(courseDetailVO, appCourses);
|
|
|
+ BeanUtils.copyProperties(appCourses,courseDetailVO);
|
|
|
courseDetailVOList.add(courseDetailVO);
|
|
|
});
|
|
|
+
|
|
|
courseInfoVO.setCourseDetail(courseDetailVOList);
|
|
|
return courseInfoVO;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<PlaceInfoVO.CourseInfoVO> courseInfoVOList(String type, String id) {
|
|
|
+ public List<PlaceInfoVO.CourseInfoVO> courseInfoVOList(String categoryId,String id) {
|
|
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
List<PlaceInfoVO.CourseInfoVO> courseInfoVOList = new ArrayList<>();
|
|
|
appCoursesMapper.selectList(Wrappers.<AppCourses>lambdaQuery()
|
|
|
.eq(AppCourses::getSiteId, id)
|
|
|
+ .like(AppCourses::getCategoryId, categoryId)
|
|
|
.eq(AppCourses::getStatus, 0)
|
|
|
.eq(AppCourses::getDelFlag, 0)).forEach(appCourses -> {
|
|
|
PlaceInfoVO.CourseInfoVO courseInfoVO = new PlaceInfoVO.CourseInfoVO();
|
|
|
- BeanUtils.copyProperties(courseInfoVO, appCourses);
|
|
|
+ BeanUtils.copyProperties(appCourses, courseInfoVO);
|
|
|
courseInfoVO.setSales(getCourseSalesCount(appCourses.getId()));
|
|
|
courseInfoVO.setSalesYear(getCourseSales(appCourses.getId()));
|
|
|
courseInfoVO.setPriceType(isFirstPurchase(user.getId()));
|
|
|
+ courseInfoVO.setAddress(appSiteMapper.selectById(appCourses.getSiteId()).getAddress());
|
|
|
courseInfoVOList.add(courseInfoVO);
|
|
|
});
|
|
|
return courseInfoVOList;
|
|
@@ -143,6 +151,33 @@ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<AppCategory> getAllCategory(String id) {
|
|
|
+ AppSite appSite = appSiteMapper.selectById(id);
|
|
|
+ return appCategoryMapper.selectList(Wrappers.<AppCategory>lambdaQuery()
|
|
|
+ .eq(AppCategory::getStatus,0).eq(AppCategory::getOrgCode,appSite.getOrgCode())
|
|
|
+ .eq(AppCategory::getDelFlag,0));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @return
|
|
|
* @Author SheepHy
|