增加课程排序
Showing
2 changed files
with
8 additions
and
2 deletions
| ... | @@ -123,4 +123,9 @@ public class Course extends BaseEntity { | ... | @@ -123,4 +123,9 @@ public class Course extends BaseEntity { |
| 123 | */ | 123 | */ |
| 124 | private Integer canPack; | 124 | private Integer canPack; |
| 125 | 125 | ||
| 126 | /** | ||
| 127 | * 排序 | ||
| 128 | */ | ||
| 129 | private Long sort; | ||
| 130 | |||
| 126 | } | 131 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -11,6 +11,7 @@ import com.lego.common.core.service.OssService; | ... | @@ -11,6 +11,7 @@ import com.lego.common.core.service.OssService; |
| 11 | import com.lego.common.utils.MessageUtils; | 11 | import com.lego.common.utils.MessageUtils; |
| 12 | import com.lego.common.utils.StreamUtils; | 12 | import com.lego.common.utils.StreamUtils; |
| 13 | import com.lego.core.annotation.LanguageAnnotation; | 13 | import com.lego.core.annotation.LanguageAnnotation; |
| 14 | import com.lego.core.domin.Advert; | ||
| 14 | import com.lego.core.domin.Course; | 15 | import com.lego.core.domin.Course; |
| 15 | import com.lego.core.domin.bo.CourseBo; | 16 | import com.lego.core.domin.bo.CourseBo; |
| 16 | import com.lego.core.domin.bo.CourseQueryBo; | 17 | import com.lego.core.domin.bo.CourseQueryBo; |
| ... | @@ -54,7 +55,7 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -54,7 +55,7 @@ public class CourseServiceImpl implements ICourseService { |
| 54 | public TableDataInfo<CourseVo> listPage(CourseQueryBo query, String language) { | 55 | public TableDataInfo<CourseVo> listPage(CourseQueryBo query, String language) { |
| 55 | Page<CourseVo> page = baseMapper.selectVoPage(query.build(), | 56 | Page<CourseVo> page = baseMapper.selectVoPage(query.build(), |
| 56 | Wrappers.<Course>lambdaQuery().like(StrUtil.isNotBlank(query.getSearchKey()), Course::getName, query.getSearchKey()) | 57 | Wrappers.<Course>lambdaQuery().like(StrUtil.isNotBlank(query.getSearchKey()), Course::getName, query.getSearchKey()) |
| 57 | .eq(Course::getLanguage, language)); | 58 | .eq(Course::getLanguage, language).orderByAsc(Course::getSort)); |
| 58 | List<CourseVo> list = page.getRecords(); | 59 | List<CourseVo> list = page.getRecords(); |
| 59 | if (ObjectUtil.isNotEmpty(list)) { | 60 | if (ObjectUtil.isNotEmpty(list)) { |
| 60 | Set<String> ids = StreamUtils.toSet(list, CourseVo::getBuildingBlockId); | 61 | Set<String> ids = StreamUtils.toSet(list, CourseVo::getBuildingBlockId); |
| ... | @@ -94,7 +95,7 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -94,7 +95,7 @@ public class CourseServiceImpl implements ICourseService { |
| 94 | */ | 95 | */ |
| 95 | @Override | 96 | @Override |
| 96 | public List<CourseVo> list(String buildingBlockId) { | 97 | public List<CourseVo> list(String buildingBlockId) { |
| 97 | List<CourseVo> list = baseMapper.selectVoList(Wrappers.<Course>lambdaQuery().eq(Course::getBuildingBlockId, buildingBlockId)); | 98 | List<CourseVo> list = baseMapper.selectVoList(Wrappers.<Course>lambdaQuery().eq(Course::getBuildingBlockId, buildingBlockId).orderByAsc(Course::getSort)); |
| 98 | for (CourseVo vo : list) { | 99 | for (CourseVo vo : list) { |
| 99 | if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){ | 100 | if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){ |
| 100 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalOssId())); | 101 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalOssId())); | ... | ... |
-
Please register or sign in to post a comment