|
@@ -13,6 +13,7 @@ import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.modules.activity.bo.ActivityRecommendGoodsQueryBo;
|
|
|
+import com.zhongzheng.modules.bank.mapper.QuestionMapper;
|
|
|
import com.zhongzheng.modules.course.bo.CourseMenuAddBo;
|
|
|
import com.zhongzheng.modules.course.bo.CourseMenuListAddBo;
|
|
|
import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
|
|
@@ -32,6 +33,7 @@ import com.zhongzheng.modules.grade.vo.ClassGradeVo;
|
|
|
import com.zhongzheng.modules.grade.vo.SyncGoodsExport;
|
|
|
import com.zhongzheng.modules.order.domain.OrderGoods;
|
|
|
import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
|
+import net.polyv.common.v1.util.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -105,6 +107,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
@Autowired
|
|
|
private IGoodsSpecService goodsSpecService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private QuestionMapper questionMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public GoodsVo queryById(Long goodsId){
|
|
|
Goods db = this.baseMapper.selectById(goodsId);
|
|
@@ -160,6 +165,18 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|
|
goods.setSpecTemplateId(relation.getSpecTemplateId());
|
|
|
}
|
|
|
}
|
|
|
+ //是否包含每日一练试卷
|
|
|
+ if (goods.getGoodsType() == 2){
|
|
|
+ //题库商品
|
|
|
+ List<BankGoodsExamVo> examVos = questionMapper.getBankGoodsExamList(goods.getGoodsId());
|
|
|
+ if (examVos.stream().filter(x -> StringUtils.isNotBlank(x.getPaperName())).anyMatch(x -> x.getPaperName().equals("每日一练"))){
|
|
|
+ goods.setExamRecord(1);
|
|
|
+ }else {
|
|
|
+ goods.setExamRecord(0);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ goods.setExamRecord(0);
|
|
|
+ }
|
|
|
});
|
|
|
//继教二建统计学时
|
|
|
if (Validator.isNotEmpty(bo.getChapterNum())) {
|