|
@@ -10,11 +10,16 @@ import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.modules.course.bo.CourseChapterSectionListAddBo;
|
|
|
+import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
|
|
|
import com.zhongzheng.modules.course.bo.CourseQueryBo;
|
|
|
import com.zhongzheng.modules.course.domain.CourseChapterSection;
|
|
|
import com.zhongzheng.modules.course.mapper.CourseChapterMapper;
|
|
|
import com.zhongzheng.modules.course.mapper.CourseMapper;
|
|
|
+import com.zhongzheng.modules.course.service.ICourseMenuService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseService;
|
|
|
+import com.zhongzheng.modules.course.vo.CourseMenuVo;
|
|
|
+import com.zhongzheng.modules.course.vo.CourseModuleFreeExamVo;
|
|
|
+import com.zhongzheng.modules.course.vo.CourseVo;
|
|
|
import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
|
|
|
import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
|
|
|
import com.zhongzheng.modules.goods.bo.*;
|
|
@@ -71,9 +76,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
@Autowired
|
|
|
private IOrderGoodsService iOrderGoodsService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private IGoodsService iGoodsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICourseMenuService iCourseMenuService;
|
|
|
|
|
|
@Override
|
|
|
public GoodsVo queryById(Long goodsId){
|
|
@@ -442,4 +447,38 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
return baseMapper.queryUpGoods();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取商品模块绑定赠送的题库卷列表
|
|
|
+ * @param goodsId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<CourseModuleFreeExamVo> moduleFreeExamList(Long goodsId) {
|
|
|
+ List<CourseModuleFreeExamVo> moduleExamList = new ArrayList<>();
|
|
|
+ List<CourseVo> courseVoList = iGoodsCourseService.selectList(goodsId);
|
|
|
+ for(CourseVo vo : courseVoList){
|
|
|
+ CourseMenuQueryBo bo = new CourseMenuQueryBo();
|
|
|
+ bo.setCourseId(vo.getCourseId());
|
|
|
+ bo.setType(1);//过滤模块
|
|
|
+ List<CourseMenuVo> moduleList = iCourseMenuService.selectList(bo);
|
|
|
+ for(CourseMenuVo menuVo : moduleList){
|
|
|
+ if(Validator.isNotEmpty(menuVo.getExamType())&&Validator.isNotEmpty(menuVo.getFreeExamId())){
|
|
|
+ //获取模块绑定的免费卷ID
|
|
|
+ CourseModuleFreeExamVo freeExamVo = BeanUtil.toBean(menuVo, CourseModuleFreeExamVo.class);
|
|
|
+ boolean hasExit = false;
|
|
|
+ for(int i=0;i<moduleExamList.size();i++){
|
|
|
+ if(moduleExamList.get(i).getExamType()==freeExamVo.getExamType()&&moduleExamList.get(i).getFreeExamId().longValue()==freeExamVo.getFreeExamId().longValue()){
|
|
|
+ hasExit = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!hasExit){
|
|
|
+ moduleExamList.add(freeExamVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return moduleExamList;
|
|
|
+ }
|
|
|
+
|
|
|
}
|