|
@@ -7,6 +7,7 @@ import com.zhongzheng.common.core.domain.AjaxResult;
|
|
|
import com.zhongzheng.common.core.page.PageDomain;
|
|
|
import com.zhongzheng.common.core.page.TableDataInfo;
|
|
|
import com.zhongzheng.common.core.page.TableSupport;
|
|
|
+import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.framework.web.service.WxTokenService;
|
|
|
import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
|
|
@@ -22,6 +23,8 @@ import com.zhongzheng.modules.course.bo.CourseQueryBo;
|
|
|
import com.zhongzheng.modules.course.service.ICourseSectionService;
|
|
|
import com.zhongzheng.modules.course.vo.CourseLiveVo;
|
|
|
import com.zhongzheng.modules.course.vo.CourseSectionVo;
|
|
|
+import com.zhongzheng.modules.exam.domain.ExamPaper;
|
|
|
+import com.zhongzheng.modules.exam.service.IExamPaperService;
|
|
|
import com.zhongzheng.modules.goods.bo.*;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
@@ -87,7 +90,7 @@ public class GoodsController extends BaseController {
|
|
|
|
|
|
private final IOrderGoodsFreeService iOrderGoodsFreeService;
|
|
|
|
|
|
-
|
|
|
+ private final IExamPaperService iExamPaperService;
|
|
|
|
|
|
/**
|
|
|
* 获取商品详细信息
|
|
@@ -165,8 +168,10 @@ public class GoodsController extends BaseController {
|
|
|
ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
|
Map<String,Object> numMap = new HashMap<>();
|
|
|
-
|
|
|
-
|
|
|
+ ExamPaper examPaper = iExamPaperService.getOne(new LambdaQueryWrapper<ExamPaper>().eq(ExamPaper::getStatus, 1).eq(ExamPaper::getPaperName,"随机练习").last("limit 1"));
|
|
|
+ if(Validator.isEmpty(examPaper)){
|
|
|
+ throw new CustomException("系统不存在随机练习试卷类型");
|
|
|
+ }
|
|
|
|
|
|
UserExamRecordQueryBo userExamRecordQueryBo = new UserExamRecordQueryBo();
|
|
|
userExamRecordQueryBo.setOrderGoodsId(orderGoodsId);
|
|
@@ -186,7 +191,7 @@ public class GoodsController extends BaseController {
|
|
|
.eq(OrderGoods::getOrderGoodsId, orderGoodsId));
|
|
|
if(Validator.isNotEmpty(orderGoods)){
|
|
|
Long goodsId = orderGoods.getGoodsId();
|
|
|
- Long totalNum = iGoodsService.getQuestionNum(goodsId);
|
|
|
+ Long totalNum = iGoodsService.getRandomQuestionNum(goodsId,examPaper.getPaperId());
|
|
|
numMap.put("totalNum",totalNum);
|
|
|
}
|
|
|
|