|
@@ -12,17 +12,20 @@ import com.github.pagehelper.Page;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.modules.base.vo.BaseFilterVo;
|
|
|
-import com.zhongzheng.modules.course.bo.CourseEducationTierAddBo;
|
|
|
-import com.zhongzheng.modules.course.bo.CourseEducationTypeAddBo;
|
|
|
-import com.zhongzheng.modules.course.bo.CourseEducationTypeEditBo;
|
|
|
-import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
|
|
|
+import com.zhongzheng.modules.course.bo.*;
|
|
|
import com.zhongzheng.modules.course.domain.CourseEducationTier;
|
|
|
import com.zhongzheng.modules.course.domain.CourseEducationType;
|
|
|
import com.zhongzheng.modules.course.mapper.CourseEducationTypeMapper;
|
|
|
+import com.zhongzheng.modules.course.service.ICourseBusinessService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseEducationTierService;
|
|
|
import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
|
|
|
+import com.zhongzheng.modules.course.vo.CourseBusinessVo;
|
|
|
import com.zhongzheng.modules.course.vo.CourseEducationTierVo;
|
|
|
import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
|
|
|
+import com.zhongzheng.modules.top.goods.bo.TopCourseBusinessQueryBo;
|
|
|
+import com.zhongzheng.modules.top.goods.domain.TopCourseEducationType;
|
|
|
+import com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo;
|
|
|
+import com.zhongzheng.modules.top.goods.vo.TopCourseEducationTypeVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.StringUtils;
|
|
@@ -44,6 +47,9 @@ public class CourseEducationTypeServiceImpl extends ServiceImpl<CourseEducationT
|
|
|
@Autowired
|
|
|
private ICourseEducationTierService courseEducationTierService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICourseBusinessService iCourseBusinessService;
|
|
|
+
|
|
|
@Override
|
|
|
public CourseEducationTypeVo queryById(Long id){
|
|
|
CourseEducationType db = this.baseMapper.selectById(id);
|
|
@@ -77,6 +83,27 @@ public class CourseEducationTypeServiceImpl extends ServiceImpl<CourseEducationT
|
|
|
return entity2Vo(this.list(lqw));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<CourseEducationTypeVo> queryAllList(CourseEducationTypeQueryBo bo) {
|
|
|
+ LambdaQueryWrapper<CourseEducationType> lqw = Wrappers.lambdaQuery();
|
|
|
+ lqw.like(StrUtil.isNotBlank(bo.getEducationName()), CourseEducationType::getEducationName, bo.getEducationName());
|
|
|
+ lqw.eq(StrUtil.isNotBlank(bo.getEncoder()), CourseEducationType::getEncoder, bo.getEncoder());
|
|
|
+ lqw.eq(bo.getStatus() != null, CourseEducationType::getStatus, bo.getStatus());
|
|
|
+ lqw.in(CourseEducationType::getStatus, 1);
|
|
|
+ lqw.eq(bo.getSort() != null, CourseEducationType::getSort, bo.getSort());
|
|
|
+ List<CourseEducationTypeVo> courseEducationTypeVos = entity2Vo(this.list(lqw));
|
|
|
+ if (CollectionUtils.isEmpty(courseEducationTypeVos)){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ courseEducationTypeVos.forEach(item -> {
|
|
|
+ CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
|
|
|
+ queryBo.setEducationId(item.getId());
|
|
|
+ List<CourseBusinessVo> businessVoList = iCourseBusinessService.queryAllList(queryBo);
|
|
|
+ item.setBusinessList(businessVoList);
|
|
|
+ });
|
|
|
+ return courseEducationTypeVos;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 实体类转化成视图对象
|
|
|
*
|