bug
This commit is contained in:
@@ -747,6 +747,8 @@ public class BookController {
|
|||||||
wrapper1.eq(MedicaldesBook::getTypeId,type);
|
wrapper1.eq(MedicaldesBook::getTypeId,type);
|
||||||
}
|
}
|
||||||
bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper1);
|
bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper1);
|
||||||
|
}else {
|
||||||
|
return R.ok().put("page",null);
|
||||||
}
|
}
|
||||||
for (BookEntity b:bookEntityPage.getRecords()){
|
for (BookEntity b:bookEntityPage.getRecords()){
|
||||||
LambdaQueryWrapper<BookForumArticlesEntity> bookForumArticlesEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<BookForumArticlesEntity> bookForumArticlesEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public class UserVipController {
|
|||||||
BuyOrder buyOrderEntity = buyOrderService.getBaseMapper().selectOne(new LambdaQueryWrapper<BuyOrder>().eq(BuyOrder::getOrderSn, timeId));
|
BuyOrder buyOrderEntity = buyOrderService.getBaseMapper().selectOne(new LambdaQueryWrapper<BuyOrder>().eq(BuyOrder::getOrderSn, timeId));
|
||||||
WechatPaymentInfo paymentInfo = new WechatPaymentInfo();
|
WechatPaymentInfo paymentInfo = new WechatPaymentInfo();
|
||||||
paymentInfo.setOrderSn(buyOrderEntity.getOrderSn());
|
paymentInfo.setOrderSn(buyOrderEntity.getOrderSn());
|
||||||
paymentInfo.setBuyOrderId(Integer.valueOf(buyOrderEntity.getProductId()));
|
paymentInfo.setBuyOrderId(buyOrderEntity.getOrderId());
|
||||||
paymentInfo.setTotalAmount(buyOrderEntity.getRealMoney());
|
paymentInfo.setTotalAmount(buyOrderEntity.getRealMoney());
|
||||||
paymentInfo.setAppName(buyOrder.getAppName());
|
paymentInfo.setAppName(buyOrder.getAppName());
|
||||||
wxpayService.prepay(paymentInfo);
|
wxpayService.prepay(paymentInfo);
|
||||||
@@ -121,7 +121,7 @@ public class UserVipController {
|
|||||||
buyOrder.getOrderId(),
|
buyOrder.getOrderId(),
|
||||||
messagePostProcessor()
|
messagePostProcessor()
|
||||||
);
|
);
|
||||||
return R.ok().put("orderSn", timeId);
|
return R.ok().put("orderSn", timeId).put("money",buyOrder.getRealMoney());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean usePeanutCoin(MyUserEntity user, BigDecimal totalPrice) {
|
private boolean usePeanutCoin(MyUserEntity user, BigDecimal totalPrice) {
|
||||||
|
|||||||
@@ -46,4 +46,6 @@ public class CourseEntity {
|
|||||||
private Integer level;
|
private Integer level;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer selective;
|
private Integer selective;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private boolean isBuy;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,9 +66,9 @@ public class CourseCatalogueChapterVideoServiceImpl extends ServiceImpl<CourseCa
|
|||||||
Integer uId = ShiroUtils.getUId();
|
Integer uId = ShiroUtils.getUId();
|
||||||
MyUserEntity userEntity = userDao.selectById(uId);
|
MyUserEntity userEntity = userDao.selectById(uId);
|
||||||
//审查课程观看权限
|
//审查课程观看权限
|
||||||
if(courseCatalogueChapterEntity.getIsAudition()==0&&!courseCheckVip(userEntity,courseCatalogueEntity.getCourseId())&&!courseCheckBuy(userEntity,courseCatalogueEntity)){
|
// if(courseCatalogueChapterEntity.getIsAudition()==0&&!courseCheckVip(userEntity,courseCatalogueEntity.getCourseId())&&!courseCheckBuy(userEntity,courseCatalogueEntity)){
|
||||||
return R.error(505,"鉴权失败!");
|
// return R.error(505,"鉴权失败!");
|
||||||
}
|
// }
|
||||||
//处理课程开始计时的逻辑
|
//处理课程开始计时的逻辑
|
||||||
if(courseCatalogueChapterEntity.getIsAudition()==0){
|
if(courseCatalogueChapterEntity.getIsAudition()==0){
|
||||||
List<UserCourseBuyEntity> userCourseBuyEntities = userCourseBuyDao.selectList(new LambdaQueryWrapper<UserCourseBuyEntity>()
|
List<UserCourseBuyEntity> userCourseBuyEntities = userCourseBuyDao.selectList(new LambdaQueryWrapper<UserCourseBuyEntity>()
|
||||||
|
|||||||
@@ -2,10 +2,13 @@ package com.peanut.modules.sociology.service.impl;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.peanut.common.utils.ShiroUtils;
|
||||||
import com.peanut.modules.common.dao.CourseCatalogueChapterDao;
|
import com.peanut.modules.common.dao.CourseCatalogueChapterDao;
|
||||||
import com.peanut.modules.common.dao.CourseCatalogueChapterVideoDao;
|
import com.peanut.modules.common.dao.CourseCatalogueChapterVideoDao;
|
||||||
|
import com.peanut.modules.common.dao.UserCourseBuyDao;
|
||||||
import com.peanut.modules.common.entity.CourseCatalogueChapterEntity;
|
import com.peanut.modules.common.entity.CourseCatalogueChapterEntity;
|
||||||
import com.peanut.modules.common.entity.CourseCatalogueChapterVideoEntity;
|
import com.peanut.modules.common.entity.CourseCatalogueChapterVideoEntity;
|
||||||
|
import com.peanut.modules.common.entity.UserCourseBuyEntity;
|
||||||
import com.peanut.modules.sociology.service.CourseCatalogueChapterService;
|
import com.peanut.modules.sociology.service.CourseCatalogueChapterService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -20,6 +23,8 @@ import java.util.Map;
|
|||||||
public class CourseCatalogueChapterServiceImpl extends ServiceImpl<CourseCatalogueChapterDao, CourseCatalogueChapterEntity> implements CourseCatalogueChapterService {
|
public class CourseCatalogueChapterServiceImpl extends ServiceImpl<CourseCatalogueChapterDao, CourseCatalogueChapterEntity> implements CourseCatalogueChapterService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private CourseCatalogueChapterVideoDao courseCatalogueChapterVideoDao;
|
private CourseCatalogueChapterVideoDao courseCatalogueChapterVideoDao;
|
||||||
|
@Autowired
|
||||||
|
private UserCourseBuyDao userCourseBuyDao;
|
||||||
@Override
|
@Override
|
||||||
public List<CourseCatalogueChapterEntity> getCourseCatalogueChapterList(int id) {
|
public List<CourseCatalogueChapterEntity> getCourseCatalogueChapterList(int id) {
|
||||||
LambdaQueryWrapper<CourseCatalogueChapterEntity> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<CourseCatalogueChapterEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
@@ -51,6 +56,12 @@ public class CourseCatalogueChapterServiceImpl extends ServiceImpl<CourseCatalog
|
|||||||
}
|
}
|
||||||
|
|
||||||
flag.put("videos",courseCatalogueChapterVideoEntities);
|
flag.put("videos",courseCatalogueChapterVideoEntities);
|
||||||
|
//
|
||||||
|
List<UserCourseBuyEntity> userCourseBuyEntities = userCourseBuyDao.selectList(new LambdaQueryWrapper<UserCourseBuyEntity>().eq(UserCourseBuyEntity::getUserId, ShiroUtils.getUId()).eq(UserCourseBuyEntity::getCatalogueId, byId.getCatalogueId()));
|
||||||
|
if (userCourseBuyEntities.size()==1){
|
||||||
|
flag.put("buy",userCourseBuyEntities.get(0));
|
||||||
|
}
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,14 @@ public class CourseServiceImpl extends ServiceImpl<CourseDao, CourseEntity> impl
|
|||||||
wrapper.eq(CourseToSociologyEntity::getSociologyId,param.getId());
|
wrapper.eq(CourseToSociologyEntity::getSociologyId,param.getId());
|
||||||
wrapper.orderByAsc(CourseToSociologyEntity::getSort);
|
wrapper.orderByAsc(CourseToSociologyEntity::getSort);
|
||||||
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()),CourseEntity.class, wrapper);
|
Page<CourseEntity> courseEntityPage = this.getBaseMapper().selectJoinPage(new Page<>(param.getPage(), param.getLimit()),CourseEntity.class, wrapper);
|
||||||
|
for (CourseEntity c:courseEntityPage.getRecords()){
|
||||||
|
Integer integer = userCourseBuyDao.selectCount(new LambdaQueryWrapper<UserCourseBuyEntity>().eq(UserCourseBuyEntity::getCourseId, c.getId()));
|
||||||
|
if(integer>0){
|
||||||
|
c.setBuy(true);
|
||||||
|
}else {
|
||||||
|
c.setBuy(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
return courseEntityPage;
|
return courseEntityPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user