|
@@ -40,7 +40,6 @@ public class DetailServiceImpl implements IDetailService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public PlaceInfoVO getPlaceInfo(String id) {
|
|
public PlaceInfoVO getPlaceInfo(String id) {
|
|
- LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
AppSite appSite = appSiteMapper.selectById(id);
|
|
AppSite appSite = appSiteMapper.selectById(id);
|
|
PlaceInfoVO placeInfo = appSiteMapper.getPlaceInfo(id);
|
|
PlaceInfoVO placeInfo = appSiteMapper.getPlaceInfo(id);
|
|
AppSitePriceRules appSitePriceRules = appSitePriceRulesMapper.selectOne(Wrappers.<AppSitePriceRules>lambdaQuery()
|
|
AppSitePriceRules appSitePriceRules = appSitePriceRulesMapper.selectOne(Wrappers.<AppSitePriceRules>lambdaQuery()
|
|
@@ -57,22 +56,8 @@ public class DetailServiceImpl implements IDetailService {
|
|
instructorVOList.add(vo);
|
|
instructorVOList.add(vo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- List<PlaceInfoVO.CourseInfoVO> courseInfoVOList = new ArrayList<>();
|
|
|
|
- appCoursesMapper.selectList(Wrappers.<AppCourses>lambdaQuery()
|
|
|
|
- .eq(AppCourses::getSiteId, id)
|
|
|
|
- .eq(AppCourses::getStatus, 0)
|
|
|
|
- .eq(AppCourses::getDelFlag, 0)).forEach(appCourses -> {
|
|
|
|
- PlaceInfoVO.CourseInfoVO courseInfoVO = new PlaceInfoVO.CourseInfoVO();
|
|
|
|
- BeanUtils.copyProperties(courseInfoVO, appCourses);
|
|
|
|
- courseInfoVO.setSales(getCourseSalesCount(appCourses.getId()));
|
|
|
|
- courseInfoVO.setSalesYear(getCourseSales(appCourses.getId()));
|
|
|
|
- courseInfoVO.setPriceType(isFirstPurchase(user.getId()));
|
|
|
|
- courseInfoVOList.add(courseInfoVO);
|
|
|
|
- });
|
|
|
|
placeInfo.setInstructorVOList(instructorVOList);
|
|
placeInfo.setInstructorVOList(instructorVOList);
|
|
- placeInfo.setCourseInfoVOList(courseInfoVOList);
|
|
|
|
if(appSite.getType() == 0){
|
|
if(appSite.getType() == 0){
|
|
- //todo 评价查询待添加
|
|
|
|
PlaceInfoVO.PlaceInfoMsgVO placeInfoMsgVO = new PlaceInfoVO.PlaceInfoMsgVO();
|
|
PlaceInfoVO.PlaceInfoMsgVO placeInfoMsgVO = new PlaceInfoVO.PlaceInfoMsgVO();
|
|
placeInfoMsgVO.setName(appSite.getName())
|
|
placeInfoMsgVO.setName(appSite.getName())
|
|
.setSales(getPlaceSales(id))
|
|
.setSales(getPlaceSales(id))
|
|
@@ -81,7 +66,6 @@ public class DetailServiceImpl implements IDetailService {
|
|
placeInfo.setPlaceInfoMsgVO(placeInfoMsgVO);
|
|
placeInfo.setPlaceInfoMsgVO(placeInfoMsgVO);
|
|
return placeInfo;
|
|
return placeInfo;
|
|
}else if(appSite.getType() == 1){
|
|
}else if(appSite.getType() == 1){
|
|
-// //todo 评价查询待添加
|
|
|
|
PlaceInfoVO.PlaceInfoMsgVO placeInfoMsgVO = new PlaceInfoVO.PlaceInfoMsgVO();
|
|
PlaceInfoVO.PlaceInfoMsgVO placeInfoMsgVO = new PlaceInfoVO.PlaceInfoMsgVO();
|
|
placeInfoMsgVO.setName(appSite.getName())
|
|
placeInfoMsgVO.setName(appSite.getName())
|
|
.setSales(getPlaceSales(id))
|
|
.setSales(getPlaceSales(id))
|
|
@@ -109,10 +93,27 @@ public class DetailServiceImpl implements IDetailService {
|
|
courseDetailVOList.add(courseDetailVO);
|
|
courseDetailVOList.add(courseDetailVO);
|
|
});
|
|
});
|
|
courseInfoVO.setCourseDetail(courseDetailVOList);
|
|
courseInfoVO.setCourseDetail(courseDetailVOList);
|
|
- //todo 评价查询待添加
|
|
|
|
return courseInfoVO;
|
|
return courseInfoVO;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public List<PlaceInfoVO.CourseInfoVO> courseInfoVOList(String type, String id) {
|
|
|
|
+ LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
|
+ List<PlaceInfoVO.CourseInfoVO> courseInfoVOList = new ArrayList<>();
|
|
|
|
+ appCoursesMapper.selectList(Wrappers.<AppCourses>lambdaQuery()
|
|
|
|
+ .eq(AppCourses::getSiteId, id)
|
|
|
|
+ .eq(AppCourses::getStatus, 0)
|
|
|
|
+ .eq(AppCourses::getDelFlag, 0)).forEach(appCourses -> {
|
|
|
|
+ PlaceInfoVO.CourseInfoVO courseInfoVO = new PlaceInfoVO.CourseInfoVO();
|
|
|
|
+ BeanUtils.copyProperties(courseInfoVO, appCourses);
|
|
|
|
+ courseInfoVO.setSales(getCourseSalesCount(appCourses.getId()));
|
|
|
|
+ courseInfoVO.setSalesYear(getCourseSales(appCourses.getId()));
|
|
|
|
+ courseInfoVO.setPriceType(isFirstPurchase(user.getId()));
|
|
|
|
+ courseInfoVOList.add(courseInfoVO);
|
|
|
|
+ });
|
|
|
|
+ return courseInfoVOList;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @return
|
|
* @return
|
|
* @Author SheepHy
|
|
* @Author SheepHy
|
|
@@ -148,6 +149,9 @@ public class DetailServiceImpl implements IDetailService {
|
|
return Math.toIntExact(appOrderProductMapper.selectCount(
|
|
return Math.toIntExact(appOrderProductMapper.selectCount(
|
|
Wrappers.<AppOrderProduct>lambdaQuery()
|
|
Wrappers.<AppOrderProduct>lambdaQuery()
|
|
.eq(AppOrderProduct::getProductId, id)
|
|
.eq(AppOrderProduct::getProductId, id)
|
|
|
|
+ .eq(AppOrderProduct::getStatus,0)
|
|
|
|
+ .eq(AppOrderProduct::getDelFlag,0)
|
|
|
|
+ .eq(AppOrderProduct::getProductOrderStatus,1)
|
|
.ge(AppOrderProduct::getCreateTime, Date.from(startOfYear.atZone(ZoneId.systemDefault()).toInstant())) // >= 2025-01-01
|
|
.ge(AppOrderProduct::getCreateTime, Date.from(startOfYear.atZone(ZoneId.systemDefault()).toInstant())) // >= 2025-01-01
|
|
.lt(AppOrderProduct::getCreateTime, Date.from(endOfYear.atZone(ZoneId.systemDefault()).toInstant())) // < 2026-01-01
|
|
.lt(AppOrderProduct::getCreateTime, Date.from(endOfYear.atZone(ZoneId.systemDefault()).toInstant())) // < 2026-01-01
|
|
));
|
|
));
|
|
@@ -175,7 +179,8 @@ public class DetailServiceImpl implements IDetailService {
|
|
* @return
|
|
* @return
|
|
**/
|
|
**/
|
|
private int isFirstPurchase(String userId) {
|
|
private int isFirstPurchase(String userId) {
|
|
- AppOrder appOrder = appOrderMapper.selectOne(Wrappers.<AppOrder>lambdaQuery().eq(AppOrder::getUpdateBy, userId).last("limit 1"));
|
|
|
|
|
|
+ AppOrder appOrder = appOrderMapper.selectOne(Wrappers.<AppOrder>lambdaQuery()
|
|
|
|
+ .eq(AppOrder::getUpdateBy, userId).last("limit 1"));
|
|
if(null == appOrder){
|
|
if(null == appOrder){
|
|
return 1;
|
|
return 1;
|
|
}else {
|
|
}else {
|