|
@@ -18,6 +18,7 @@ import com.zhongzheng.modules.base.bo.ConsoleQueryBo;
|
|
|
import com.zhongzheng.modules.base.domain.ShoppingCart;
|
|
|
import com.zhongzheng.modules.base.service.IShoppingCartService;
|
|
|
import com.zhongzheng.modules.course.mapper.CourseMapper;
|
|
|
+import com.zhongzheng.modules.course.mapper.CourseMenuMapper;
|
|
|
import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseMenuService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseSectionService;
|
|
@@ -32,9 +33,11 @@ import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
|
|
|
import com.zhongzheng.modules.goods.bo.CheckGoodsStatusBo;
|
|
|
import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
|
|
|
import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
|
+import com.zhongzheng.modules.goods.bo.GoodsSectionListBo;
|
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsCourseService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
+import com.zhongzheng.modules.goods.vo.GoodsSectionListVo;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.grade.domain.ClassGradeGoods;
|
|
|
import com.zhongzheng.modules.grade.domain.ClassGradeUser;
|
|
@@ -146,6 +149,9 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
|
@Autowired
|
|
|
private IShoppingCartService iShoppingCartService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CourseMenuMapper courseMenuMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public OrderGoodsVo queryById(Long orderGoodsId) {
|
|
|
OrderGoods db = this.baseMapper.selectById(orderGoodsId);
|
|
@@ -640,6 +646,25 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<GoodsSectionListVo> getGoodsSectionList(GoodsSectionListBo bo) {
|
|
|
+ List<GoodsSectionListVo> resultVos = baseMapper.getGoodsSectionList(bo.getGoodsId());
|
|
|
+ if (CollectionUtils.isEmpty(resultVos)){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNull(bo.getRebuild()) || bo.getRebuild() == 0){
|
|
|
+ return resultVos;
|
|
|
+ }
|
|
|
+ //获取需要重修的节
|
|
|
+ resultVos.forEach(item -> {
|
|
|
+ Integer rebuild = courseMenuMapper.rebuildSectionCheck(item.getSectionId(),item.getModuleId(), item.getChapterId(),bo.getGradeId(), bo.getUserId(),item.getCourseId());
|
|
|
+ if (rebuild > 0) {
|
|
|
+ item.setRebuild(1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return resultVos.stream().filter(s -> s.getRebuild() != null && s.getRebuild().equals(1)).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
private boolean checkUnique(Long GoodsId,Long UserId) {
|
|
|
ShoppingCart info = iShoppingCartService.getOne(new LambdaQueryWrapper<ShoppingCart>()
|
|
|
.eq(ShoppingCart::getUserId,UserId).eq(ShoppingCart::getGoodsId,GoodsId).last("limit 1"));
|