|
|
@@ -7,6 +7,14 @@ import com.zhongzheng.common.core.page.TableDataInfo;
|
|
|
import com.zhongzheng.common.enums.BusinessType;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.framework.web.service.WxTokenService;
|
|
|
+import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
|
|
|
+import com.zhongzheng.modules.bank.bo.QuestionModuleChapterQueryBo;
|
|
|
+import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
|
|
|
+import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
|
|
|
+import com.zhongzheng.modules.bank.vo.ExamVo;
|
|
|
+import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
|
|
|
+import com.zhongzheng.modules.collect.bo.CollectQuestionQueryBo;
|
|
|
+import com.zhongzheng.modules.collect.service.ICollectQuestionService;
|
|
|
import com.zhongzheng.modules.course.bo.CourseQueryBo;
|
|
|
import com.zhongzheng.modules.goods.bo.*;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
|
|
|
@@ -14,7 +22,11 @@ import com.zhongzheng.modules.goods.service.IGoodsAuditionConfigService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
+import com.zhongzheng.modules.user.bo.UserExamRecordQueryBo;
|
|
|
+import com.zhongzheng.modules.user.bo.UserExamWrongRecordQueryBo;
|
|
|
import com.zhongzheng.modules.user.entity.ClientLoginUser;
|
|
|
+import com.zhongzheng.modules.user.service.IUserExamRecordService;
|
|
|
+import com.zhongzheng.modules.user.service.IUserExamWrongRecordService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.models.auth.In;
|
|
|
@@ -23,9 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* 商品Controller
|
|
|
@@ -45,6 +55,16 @@ public class GoodsController extends BaseController {
|
|
|
|
|
|
private final WxTokenService wxTokenService;
|
|
|
|
|
|
+ private final IUserExamRecordService iUserExamRecordService;
|
|
|
+
|
|
|
+
|
|
|
+ private final IUserExamWrongRecordService iUserExamWrongRecordService;
|
|
|
+
|
|
|
+ private final ICollectQuestionService iCollectQuestionService;
|
|
|
+
|
|
|
+ private final IQuestionModuleChapterService iQuestionModuleChapterService;
|
|
|
+
|
|
|
+ private final IQuestionChapterExamService iQuestionChapterExamService;
|
|
|
|
|
|
/**
|
|
|
* 获取商品详细信息
|
|
|
@@ -60,4 +80,79 @@ public class GoodsController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取商品详细信息
|
|
|
+ */
|
|
|
+ @ApiOperation("获取题库商品题目数统计信息")
|
|
|
+ @GetMapping("/bank/questionNum/{goodsId}")
|
|
|
+ public AjaxResult<Map<String,Object>> questionNum(@PathVariable("goodsId" ) Long goodsId) {
|
|
|
+ ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+
|
|
|
+ Map<String,Object> numMap = new HashMap<>();
|
|
|
+
|
|
|
+ UserExamWrongRecordQueryBo wBo = new UserExamWrongRecordQueryBo();
|
|
|
+ wBo.setGoodsId(goodsId);
|
|
|
+ wBo.setUserId(loginUser.getUser().getUserId());
|
|
|
+ Integer wrongNum = iUserExamWrongRecordService.recordNum(wBo);
|
|
|
+ numMap.put("wrongNum",wrongNum);
|
|
|
+
|
|
|
+ CollectQuestionQueryBo collectQuestionQueryBo = new CollectQuestionQueryBo();
|
|
|
+ collectQuestionQueryBo.setGoodsId(goodsId);
|
|
|
+ collectQuestionQueryBo.setUserId(loginUser.getUser().getUserId());
|
|
|
+ Integer collectNum = iCollectQuestionService.collectNum(collectQuestionQueryBo);
|
|
|
+ numMap.put("collectNum",collectNum);
|
|
|
+
|
|
|
+ UserExamRecordQueryBo userExamRecordQueryBo = new UserExamRecordQueryBo();
|
|
|
+ userExamRecordQueryBo.setGoodsId(goodsId);
|
|
|
+ userExamRecordQueryBo.setUserId(loginUser.getUser().getUserId());
|
|
|
+ Long doNum = iUserExamRecordService.selectDoNum(userExamRecordQueryBo);
|
|
|
+ numMap.put("doNum",doNum);
|
|
|
+
|
|
|
+ userExamRecordQueryBo.setGoodsId(goodsId);
|
|
|
+ userExamRecordQueryBo.setUserId(loginUser.getUser().getUserId());
|
|
|
+ Long rightNum = iUserExamRecordService.selectRightNum(userExamRecordQueryBo);
|
|
|
+ numMap.put("rightNum",rightNum);
|
|
|
+
|
|
|
+ numMap.put("totalNum",467);
|
|
|
+
|
|
|
+ return AjaxResult.success(numMap);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("查询商品题库目录列表")
|
|
|
+ @GetMapping("/bank/list")
|
|
|
+ public AjaxResult<List<GoodsAttachedVo>> bankList(GoodsAttachedQueryBo bo) {
|
|
|
+ ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ bo.setUserId(loginUser.getUser().getUserId());
|
|
|
+ List<GoodsAttachedVo> list = iGoodsAttachedService.selectList(bo);
|
|
|
+ return AjaxResult.success(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("查询商品题库做过目录列表")
|
|
|
+ @GetMapping("/bank/dolist")
|
|
|
+ public AjaxResult<List<GoodsAttachedVo>> bankDoList(GoodsAttachedQueryBo bo) {
|
|
|
+ ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ bo.setUserId(loginUser.getUser().getUserId());
|
|
|
+ List<GoodsAttachedVo> list = iGoodsAttachedService.selectDoList(bo);
|
|
|
+ return AjaxResult.success(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询关联章卷列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询模块卷关联章卷做过列表")
|
|
|
+ @GetMapping("/chapter/dolist")
|
|
|
+ public AjaxResult<List<QuestionChapterVo>> chapterDoList(QuestionModuleChapterQueryBo bo) {
|
|
|
+ List<QuestionChapterVo> list = iQuestionModuleChapterService.getDoList(bo);
|
|
|
+ return AjaxResult.success(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询关联试卷列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询章卷关联试卷做过列表")
|
|
|
+ @GetMapping("/exam/dolist")
|
|
|
+ public AjaxResult<List<ExamVo>> examDoList(QuestionChapterExamQueryBo bo) {
|
|
|
+ List<ExamVo> list = iQuestionChapterExamService.getDoList(bo);
|
|
|
+ return AjaxResult.success(list);
|
|
|
+ }
|
|
|
}
|