Merge branch 'master' of http://g.jimilicai.com:8000/legobackend/lego-manage
# Conflicts: # lego-admin/src/main/resources/application.yml
Showing
15 changed files
with
248 additions
and
19 deletions
| ... | @@ -40,7 +40,18 @@ public class BuildingBlockController extends BaseController { | ... | @@ -40,7 +40,18 @@ public class BuildingBlockController extends BaseController { |
| 40 | @PostMapping("listPage") | 40 | @PostMapping("listPage") |
| 41 | public TableDataInfo<BuildingBlockVo> listPage(@RequestBody BuildingBlockQueryBo query, HttpServletRequest request) { | 41 | public TableDataInfo<BuildingBlockVo> listPage(@RequestBody BuildingBlockQueryBo query, HttpServletRequest request) { |
| 42 | String language = request.getHeader("content-language"); | 42 | String language = request.getHeader("content-language"); |
| 43 | return service.listPage(query,language); | 43 | return service.listPage(query, language); |
| 44 | } | ||
| 45 | |||
| 46 | /** | ||
| 47 | * 根据ID查询详情 | ||
| 48 | * | ||
| 49 | * @param id | ||
| 50 | * @return | ||
| 51 | */ | ||
| 52 | @GetMapping("/getById/{id}") | ||
| 53 | public R<BuildingBlockVo> getById(@RequestParam("id") String id) { | ||
| 54 | return R.ok(service.get(id)); | ||
| 44 | } | 55 | } |
| 45 | 56 | ||
| 46 | /** | 57 | /** | ... | ... |
| ... | @@ -40,7 +40,29 @@ public class CourseController extends BaseController { | ... | @@ -40,7 +40,29 @@ public class CourseController extends BaseController { |
| 40 | @PostMapping("listPage") | 40 | @PostMapping("listPage") |
| 41 | public TableDataInfo<CourseVo> listPage(@RequestBody CourseQueryBo query, HttpServletRequest request) { | 41 | public TableDataInfo<CourseVo> listPage(@RequestBody CourseQueryBo query, HttpServletRequest request) { |
| 42 | String language = request.getHeader("content-language"); | 42 | String language = request.getHeader("content-language"); |
| 43 | return service.listPage(query,language); | 43 | return service.listPage(query, language); |
| 44 | } | ||
| 45 | |||
| 46 | /** | ||
| 47 | * 根据系列id查找的课程列表 | ||
| 48 | * | ||
| 49 | * @param buildingBlockId | ||
| 50 | * @return | ||
| 51 | */ | ||
| 52 | @GetMapping("/list/{buildingBlockId}") | ||
| 53 | public R<List<CourseVo>> list(@RequestParam("buildingBlockId") String buildingBlockId) { | ||
| 54 | return R.ok(service.list(buildingBlockId)); | ||
| 55 | } | ||
| 56 | |||
| 57 | /** | ||
| 58 | * 课程详情 | ||
| 59 | * | ||
| 60 | * @param id | ||
| 61 | * @return | ||
| 62 | */ | ||
| 63 | @GetMapping("/getById/{id}") | ||
| 64 | public R<CourseVo> getById(@RequestParam("id") String id) { | ||
| 65 | return R.ok(service.getById(id)); | ||
| 44 | } | 66 | } |
| 45 | 67 | ||
| 46 | /** | 68 | /** | ... | ... |
| ... | @@ -138,7 +138,12 @@ security: | ... | @@ -138,7 +138,12 @@ security: |
| 138 | - /actuator/** | 138 | - /actuator/** |
| 139 | - /core/advert/list | 139 | - /core/advert/list |
| 140 | - /core/buildingBlock/list | 140 | - /core/buildingBlock/list |
| 141 | - /core/buildingBlock/listPage | ||
| 142 | - /core/buildingBlock/getById/** | ||
| 141 | - /core/course/listPage | 143 | - /core/course/listPage |
| 144 | - /core/course/** | ||
| 145 | - /core/getById/** | ||
| 146 | - /core/entirety/listPage | ||
| 142 | - /core/entirety/list | 147 | - /core/entirety/list |
| 143 | - /core/question/listPage | 148 | - /core/question/listPage |
| 144 | - /core/upgrade/listPage | 149 | - /core/upgrade/listPage | ... | ... |
| ... | @@ -40,6 +40,11 @@ public class BuildingBlockVo { | ... | @@ -40,6 +40,11 @@ public class BuildingBlockVo { |
| 40 | private String ossId; | 40 | private String ossId; |
| 41 | 41 | ||
| 42 | /** | 42 | /** |
| 43 | * 图片URL | ||
| 44 | */ | ||
| 45 | private String ossUrl; | ||
| 46 | |||
| 47 | /** | ||
| 43 | * 前端APP数据国际化(zh_CN、en_US、ru_RU) | 48 | * 前端APP数据国际化(zh_CN、en_US、ru_RU) |
| 44 | */ | 49 | */ |
| 45 | private String language; | 50 | private String language; | ... | ... |
| ... | @@ -49,6 +49,11 @@ public class CourseVo { | ... | @@ -49,6 +49,11 @@ public class CourseVo { |
| 49 | private String twoDimensionalUrl; | 49 | private String twoDimensionalUrl; |
| 50 | 50 | ||
| 51 | /** | 51 | /** |
| 52 | * 2D oss URL | ||
| 53 | */ | ||
| 54 | private String twoDimensionalOssUrl; | ||
| 55 | |||
| 56 | /** | ||
| 52 | * 2D oss_id | 57 | * 2D oss_id |
| 53 | */ | 58 | */ |
| 54 | private String twoDimensionalOssId; | 59 | private String twoDimensionalOssId; |
| ... | @@ -69,6 +74,11 @@ public class CourseVo { | ... | @@ -69,6 +74,11 @@ public class CourseVo { |
| 69 | private String threeDimensionalOssId; | 74 | private String threeDimensionalOssId; |
| 70 | 75 | ||
| 71 | /** | 76 | /** |
| 77 | * 3D oss_URL | ||
| 78 | */ | ||
| 79 | private String threeDimensionalOssUrl; | ||
| 80 | |||
| 81 | /** | ||
| 72 | * 案例OSS_id | 82 | * 案例OSS_id |
| 73 | */ | 83 | */ |
| 74 | private String caseOssId; | 84 | private String caseOssId; | ... | ... |
| ... | @@ -2,6 +2,8 @@ package com.lego.core.domin.vo; | ... | @@ -2,6 +2,8 @@ package com.lego.core.domin.vo; |
| 2 | 2 | ||
| 3 | import lombok.Data; | 3 | import lombok.Data; |
| 4 | 4 | ||
| 5 | import java.util.List; | ||
| 6 | |||
| 5 | /** | 7 | /** |
| 6 | * 套件视图对象 core_entirety | 8 | * 套件视图对象 core_entirety |
| 7 | * | 9 | * |
| ... | @@ -40,7 +42,17 @@ public class EntiretyVo { | ... | @@ -40,7 +42,17 @@ public class EntiretyVo { |
| 40 | private String ossId; | 42 | private String ossId; |
| 41 | 43 | ||
| 42 | /** | 44 | /** |
| 45 | * 文件URL | ||
| 46 | */ | ||
| 47 | private String ossUrl; | ||
| 48 | |||
| 49 | /** | ||
| 43 | * 前端APP数据国际化(zh_CN、en_US、ru_RU) | 50 | * 前端APP数据国际化(zh_CN、en_US、ru_RU) |
| 44 | */ | 51 | */ |
| 45 | private String language; | 52 | private String language; |
| 53 | |||
| 54 | /** | ||
| 55 | * 系列信息 | ||
| 56 | */ | ||
| 57 | List<BuildingBlockVo> BuildingblockList; | ||
| 46 | } | 58 | } | ... | ... |
| ... | @@ -30,11 +30,21 @@ public class QuestionVo { | ... | @@ -30,11 +30,21 @@ public class QuestionVo { |
| 30 | private String coverOssId; | 30 | private String coverOssId; |
| 31 | 31 | ||
| 32 | /** | 32 | /** |
| 33 | * 封面URl | ||
| 34 | */ | ||
| 35 | private String coverOssUrl; | ||
| 36 | |||
| 37 | /** | ||
| 33 | * 视频 ossId | 38 | * 视频 ossId |
| 34 | */ | 39 | */ |
| 35 | private String videoOssId; | 40 | private String videoOssId; |
| 36 | 41 | ||
| 37 | /** | 42 | /** |
| 43 | * 视频URL | ||
| 44 | */ | ||
| 45 | private String videoOssUrl; | ||
| 46 | |||
| 47 | /** | ||
| 38 | * Android展示状态 0 不展示 1展示 | 48 | * Android展示状态 0 不展示 1展示 |
| 39 | */ | 49 | */ |
| 40 | private String showAndroid; | 50 | private String showAndroid; | ... | ... |
| ... | @@ -28,6 +28,11 @@ public class UpgradeVo { | ... | @@ -28,6 +28,11 @@ public class UpgradeVo { |
| 28 | private String fileOssId; | 28 | private String fileOssId; |
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| 31 | * 文件地址 | ||
| 32 | */ | ||
| 33 | private String ossUrl; | ||
| 34 | |||
| 35 | /** | ||
| 31 | * 升级包类型 Android IOS windows | 36 | * 升级包类型 Android IOS windows |
| 32 | */ | 37 | */ |
| 33 | private String platformType; | 38 | private String platformType; | ... | ... |
| 1 | package com.lego.core.service; | 1 | package com.lego.core.service; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | import com.lego.common.core.domain.PageQuery; | ||
| 5 | import com.lego.common.core.page.TableDataInfo; | 4 | import com.lego.common.core.page.TableDataInfo; |
| 6 | import com.lego.core.domin.BuildingBlock; | ||
| 7 | import com.lego.core.domin.bo.AdvertBo; | ||
| 8 | import com.lego.core.domin.bo.BuildingBlockBo; | 5 | import com.lego.core.domin.bo.BuildingBlockBo; |
| 9 | import com.lego.core.domin.bo.BuildingBlockQueryBo; | 6 | import com.lego.core.domin.bo.BuildingBlockQueryBo; |
| 10 | import com.lego.core.domin.bo.EntiretyBo; | ||
| 11 | import com.lego.core.domin.vo.AdvertVo; | ||
| 12 | import com.lego.core.domin.vo.BuildingBlockVo; | 7 | import com.lego.core.domin.vo.BuildingBlockVo; |
| 13 | import com.lego.core.domin.vo.EntiretyVo; | ||
| 14 | 8 | ||
| 15 | import java.rmi.ServerException; | 9 | import java.rmi.ServerException; |
| 16 | import java.util.Collection; | 10 | import java.util.Collection; |
| ... | @@ -29,7 +23,7 @@ public interface IBuildingBlockService { | ... | @@ -29,7 +23,7 @@ public interface IBuildingBlockService { |
| 29 | * @param queryBo | 23 | * @param queryBo |
| 30 | * @return | 24 | * @return |
| 31 | */ | 25 | */ |
| 32 | TableDataInfo<BuildingBlockVo> listPage(BuildingBlockQueryBo queryBo,String language); | 26 | TableDataInfo<BuildingBlockVo> listPage(BuildingBlockQueryBo queryBo, String language); |
| 33 | 27 | ||
| 34 | /** | 28 | /** |
| 35 | * 不带分页查询 | 29 | * 不带分页查询 |
| ... | @@ -39,6 +33,13 @@ public interface IBuildingBlockService { | ... | @@ -39,6 +33,13 @@ public interface IBuildingBlockService { |
| 39 | List<BuildingBlockVo> list(String language); | 33 | List<BuildingBlockVo> list(String language); |
| 40 | 34 | ||
| 41 | /** | 35 | /** |
| 36 | * (根据套件ID)不带分页查询 | ||
| 37 | * | ||
| 38 | * @return | ||
| 39 | */ | ||
| 40 | List<BuildingBlockVo> list(String language, Collection<String> entiretyIds); | ||
| 41 | |||
| 42 | /** | ||
| 42 | * 新增 | 43 | * 新增 |
| 43 | * | 44 | * |
| 44 | * @param blockBo | 45 | * @param blockBo |
| ... | @@ -66,9 +67,19 @@ public interface IBuildingBlockService { | ... | @@ -66,9 +67,19 @@ public interface IBuildingBlockService { |
| 66 | 67 | ||
| 67 | /** | 68 | /** |
| 68 | * 根据ID集合获取积木 | 69 | * 根据ID集合获取积木 |
| 70 | * | ||
| 69 | * @param ids | 71 | * @param ids |
| 70 | * @return | 72 | * @return |
| 71 | * @throws ServerException | 73 | * @throws ServerException |
| 72 | */ | 74 | */ |
| 73 | List<BuildingBlockVo> getListByIds(Collection<String> ids); | 75 | List<BuildingBlockVo> getListByIds(Collection<String> ids); |
| 76 | |||
| 77 | /** | ||
| 78 | * 根据ID获取详情 | ||
| 79 | * | ||
| 80 | * @param id | ||
| 81 | * @return | ||
| 82 | */ | ||
| 83 | BuildingBlockVo get(String id); | ||
| 84 | |||
| 74 | } | 85 | } | ... | ... |
| ... | @@ -6,6 +6,7 @@ import com.lego.core.domin.bo.CourseQueryBo; | ... | @@ -6,6 +6,7 @@ import com.lego.core.domin.bo.CourseQueryBo; |
| 6 | import com.lego.core.domin.vo.CourseVo; | 6 | import com.lego.core.domin.vo.CourseVo; |
| 7 | 7 | ||
| 8 | import java.rmi.ServerException; | 8 | import java.rmi.ServerException; |
| 9 | import java.util.List; | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * 课程Service接口 | 12 | * 课程Service接口 |
| ... | @@ -20,7 +21,23 @@ public interface ICourseService { | ... | @@ -20,7 +21,23 @@ public interface ICourseService { |
| 20 | * @param query | 21 | * @param query |
| 21 | * @return | 22 | * @return |
| 22 | */ | 23 | */ |
| 23 | TableDataInfo<CourseVo> listPage(CourseQueryBo query,String language); | 24 | TableDataInfo<CourseVo> listPage(CourseQueryBo query, String language); |
| 25 | |||
| 26 | /** | ||
| 27 | * 根据系列id查找的课程列表 | ||
| 28 | * | ||
| 29 | * @param buildingBlockId | ||
| 30 | * @return | ||
| 31 | */ | ||
| 32 | List<CourseVo> list(String buildingBlockId); | ||
| 33 | |||
| 34 | /** | ||
| 35 | * 课程详情 | ||
| 36 | * | ||
| 37 | * @param id | ||
| 38 | * @return | ||
| 39 | */ | ||
| 40 | CourseVo getById(String id); | ||
| 24 | 41 | ||
| 25 | /** | 42 | /** |
| 26 | * 新增 | 43 | * 新增 | ... | ... |
| ... | @@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil; | ... | @@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil; |
| 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 8 | import com.lego.common.core.page.TableDataInfo; | 8 | import com.lego.common.core.page.TableDataInfo; |
| 9 | import com.lego.common.core.service.OssService; | ||
| 9 | import com.lego.common.utils.MessageUtils; | 10 | import com.lego.common.utils.MessageUtils; |
| 10 | import com.lego.common.utils.StreamUtils; | 11 | import com.lego.common.utils.StreamUtils; |
| 11 | import com.lego.core.annotation.LanguageAnnotation; | 12 | import com.lego.core.annotation.LanguageAnnotation; |
| ... | @@ -37,6 +38,7 @@ import java.util.Set; | ... | @@ -37,6 +38,7 @@ import java.util.Set; |
| 37 | public class BuildingBlockServiceImpl implements IBuildingBlockService { | 38 | public class BuildingBlockServiceImpl implements IBuildingBlockService { |
| 38 | private final BuildingBlockMapper baseMapper; | 39 | private final BuildingBlockMapper baseMapper; |
| 39 | private final IEntiretyService entiretyService; | 40 | private final IEntiretyService entiretyService; |
| 41 | private final OssService ossService; | ||
| 40 | 42 | ||
| 41 | /** | 43 | /** |
| 42 | * 查询所有列表(带分页) | 44 | * 查询所有列表(带分页) |
| ... | @@ -49,17 +51,24 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { | ... | @@ -49,17 +51,24 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { |
| 49 | Page<BuildingBlockVo> page = baseMapper.selectVoPage(queryBo.build(), Wrappers.<BuildingBlock>lambdaQuery() | 51 | Page<BuildingBlockVo> page = baseMapper.selectVoPage(queryBo.build(), Wrappers.<BuildingBlock>lambdaQuery() |
| 50 | .eq(StrUtil.isNotBlank(queryBo.getSearchKey()), BuildingBlock::getName, queryBo.getSearchKey()) | 52 | .eq(StrUtil.isNotBlank(queryBo.getSearchKey()), BuildingBlock::getName, queryBo.getSearchKey()) |
| 51 | .eq(BuildingBlock::getLanguage, language)); | 53 | .eq(BuildingBlock::getLanguage, language)); |
| 52 | List<BuildingBlockVo> list = page.getRecords(); | 54 | setInfo(page.getRecords()); |
| 55 | return TableDataInfo.build(page); | ||
| 56 | } | ||
| 57 | |||
| 58 | private void setInfo(List<BuildingBlockVo> list) { | ||
| 53 | if (ObjectUtil.isNotEmpty(list)) { | 59 | if (ObjectUtil.isNotEmpty(list)) { |
| 54 | Set<String> ids = StreamUtils.toSet(list, BuildingBlockVo::getEntiretyId); | 60 | Set<String> ids = StreamUtils.toSet(list, BuildingBlockVo::getEntiretyId); |
| 55 | List<EntiretyVo> entiretyList = entiretyService.getListByIds(ids); | 61 | List<EntiretyVo> entiretyList = entiretyService.getListByIds(ids); |
| 56 | Map<String, EntiretyVo> entiretyMap = StreamUtils.toMap(entiretyList, EntiretyVo::getId, v -> v); | 62 | Map<String, EntiretyVo> entiretyMap = StreamUtils.toMap(entiretyList, EntiretyVo::getId, v -> v); |
| 57 | for (BuildingBlockVo vo : list) { | 63 | for (BuildingBlockVo vo : list) { |
| 58 | vo.setEntiretyName(entiretyMap.getOrDefault(vo.getEntiretyId(), new EntiretyVo()).getName()); | 64 | vo.setEntiretyName(entiretyMap.getOrDefault(vo.getEntiretyId(), new EntiretyVo()).getName()); |
| 65 | if (StrUtil.isNotBlank(vo.getOssId())) { | ||
| 66 | vo.setOssUrl(ossService.selectUrlByIds(vo.getOssId())); | ||
| 59 | } | 67 | } |
| 60 | } | 68 | } |
| 61 | return TableDataInfo.build(page); | ||
| 62 | } | 69 | } |
| 70 | } | ||
| 71 | |||
| 63 | 72 | ||
| 64 | /** | 73 | /** |
| 65 | * 不带分页查询 | 74 | * 不带分页查询 |
| ... | @@ -68,7 +77,23 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { | ... | @@ -68,7 +77,23 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { |
| 68 | */ | 77 | */ |
| 69 | @Override | 78 | @Override |
| 70 | public List<BuildingBlockVo> list(String language) { | 79 | public List<BuildingBlockVo> list(String language) { |
| 71 | return baseMapper.selectVoList(Wrappers.<BuildingBlock>lambdaQuery().eq(BuildingBlock::getLanguage, language)); | 80 | List<BuildingBlockVo> list = baseMapper.selectVoList(Wrappers.<BuildingBlock>lambdaQuery().eq(BuildingBlock::getLanguage, language)); |
| 81 | setInfo(list); | ||
| 82 | return list; | ||
| 83 | } | ||
| 84 | |||
| 85 | /** | ||
| 86 | * (根据套件ID)不带分页查询 | ||
| 87 | * | ||
| 88 | * @param language | ||
| 89 | * @param entiretyIds | ||
| 90 | * @return | ||
| 91 | */ | ||
| 92 | @Override | ||
| 93 | public List<BuildingBlockVo> list(String language, Collection<String> entiretyIds) { | ||
| 94 | List<BuildingBlockVo> list = baseMapper.selectVoList(Wrappers.<BuildingBlock>lambdaQuery().eq(BuildingBlock::getLanguage, language).in(BuildingBlock::getEntiretyId, entiretyIds)); | ||
| 95 | setInfo(list); | ||
| 96 | return list; | ||
| 72 | } | 97 | } |
| 73 | 98 | ||
| 74 | /** | 99 | /** |
| ... | @@ -120,7 +145,14 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { | ... | @@ -120,7 +145,14 @@ public class BuildingBlockServiceImpl implements IBuildingBlockService { |
| 120 | */ | 145 | */ |
| 121 | @Override | 146 | @Override |
| 122 | public List<BuildingBlockVo> getListByIds(Collection<String> ids) { | 147 | public List<BuildingBlockVo> getListByIds(Collection<String> ids) { |
| 123 | return baseMapper.selectVoList(Wrappers.<BuildingBlock>lambdaQuery().in(BuildingBlock::getId, ids)); | 148 | List<BuildingBlockVo> list = baseMapper.selectVoList(Wrappers.<BuildingBlock>lambdaQuery().in(BuildingBlock::getId, ids)); |
| 149 | setInfo(list); | ||
| 150 | return list; | ||
| 151 | } | ||
| 152 | |||
| 153 | @Override | ||
| 154 | public BuildingBlockVo get(String id) { | ||
| 155 | return baseMapper.selectVoById(id); | ||
| 124 | } | 156 | } |
| 125 | 157 | ||
| 126 | 158 | ... | ... |
| ... | @@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil; | ... | @@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil; |
| 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 8 | import com.lego.common.core.page.TableDataInfo; | 8 | import com.lego.common.core.page.TableDataInfo; |
| 9 | import com.lego.common.core.service.OssService; | ||
| 9 | import com.lego.common.utils.MessageUtils; | 10 | import com.lego.common.utils.MessageUtils; |
| 10 | import com.lego.common.utils.StreamUtils; | 11 | import com.lego.common.utils.StreamUtils; |
| 11 | import com.lego.core.annotation.LanguageAnnotation; | 12 | import com.lego.core.annotation.LanguageAnnotation; |
| ... | @@ -39,6 +40,7 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -39,6 +40,7 @@ public class CourseServiceImpl implements ICourseService { |
| 39 | private final CourseMapper baseMapper; | 40 | private final CourseMapper baseMapper; |
| 40 | private final IBuildingBlockService buildingBlockService; | 41 | private final IBuildingBlockService buildingBlockService; |
| 41 | private final ISysOssService ossService; | 42 | private final ISysOssService ossService; |
| 43 | private final OssService ossUrlService; | ||
| 42 | 44 | ||
| 43 | /** | 45 | /** |
| 44 | * 查询所有列表 | 46 | * 查询所有列表 |
| ... | @@ -47,10 +49,10 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -47,10 +49,10 @@ public class CourseServiceImpl implements ICourseService { |
| 47 | * @return | 49 | * @return |
| 48 | */ | 50 | */ |
| 49 | @Override | 51 | @Override |
| 50 | public TableDataInfo<CourseVo> listPage(CourseQueryBo query,String language) { | 52 | public TableDataInfo<CourseVo> listPage(CourseQueryBo query, String language) { |
| 51 | Page<CourseVo> page = baseMapper.selectVoPage(query.build(), | 53 | Page<CourseVo> page = baseMapper.selectVoPage(query.build(), |
| 52 | Wrappers.<Course>lambdaQuery().eq(StrUtil.isNotBlank(query.getSearchKey()), Course::getName, query.getSearchKey()) | 54 | Wrappers.<Course>lambdaQuery().eq(StrUtil.isNotBlank(query.getSearchKey()), Course::getName, query.getSearchKey()) |
| 53 | .eq(Course::getLanguage,language)); | 55 | .eq(Course::getLanguage, language)); |
| 54 | List<CourseVo> list = page.getRecords(); | 56 | List<CourseVo> list = page.getRecords(); |
| 55 | if (ObjectUtil.isNotEmpty(list)) { | 57 | if (ObjectUtil.isNotEmpty(list)) { |
| 56 | Set<String> ids = StreamUtils.toSet(list, CourseVo::getBuildingBlockId); | 58 | Set<String> ids = StreamUtils.toSet(list, CourseVo::getBuildingBlockId); |
| ... | @@ -58,12 +60,47 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -58,12 +60,47 @@ public class CourseServiceImpl implements ICourseService { |
| 58 | Map<String, BuildingBlockVo> blockMap = StreamUtils.toMap(blockList, BuildingBlockVo::getId, v -> v); | 60 | Map<String, BuildingBlockVo> blockMap = StreamUtils.toMap(blockList, BuildingBlockVo::getId, v -> v); |
| 59 | for (CourseVo vo : list) { | 61 | for (CourseVo vo : list) { |
| 60 | vo.setBuildingBlockName(blockMap.getOrDefault(vo.getBuildingBlockId(), new BuildingBlockVo()).getName()); | 62 | vo.setBuildingBlockName(blockMap.getOrDefault(vo.getBuildingBlockId(), new BuildingBlockVo()).getName()); |
| 63 | if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){ | ||
| 64 | vo.setTwoDimensionalOssUrl(ossUrlService.selectUrlByIds(vo.getTwoDimensionalOssId())); | ||
| 65 | } | ||
| 66 | if(StrUtil.isNotBlank(vo.getThreeDimensionalOssId())){ | ||
| 67 | vo.setThreeDimensionalOssUrl(ossUrlService.selectUrlByIds(vo.getThreeDimensionalOssId())); | ||
| 68 | } | ||
| 61 | } | 69 | } |
| 62 | } | 70 | } |
| 63 | return TableDataInfo.build(page); | 71 | return TableDataInfo.build(page); |
| 64 | } | 72 | } |
| 65 | 73 | ||
| 66 | /** | 74 | /** |
| 75 | * | ||
| 76 | * @param buildingBlockId | ||
| 77 | * @return | ||
| 78 | */ | ||
| 79 | @Override | ||
| 80 | public List<CourseVo> list(String buildingBlockId) { | ||
| 81 | List<CourseVo> list = baseMapper.selectVoList(Wrappers.<Course>lambdaQuery().eq(Course::getBuildingBlockId, buildingBlockId)); | ||
| 82 | for (CourseVo vo : list) { | ||
| 83 | if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){ | ||
| 84 | vo.setTwoDimensionalOssUrl(ossUrlService.selectUrlByIds(vo.getTwoDimensionalOssId())); | ||
| 85 | } | ||
| 86 | if(StrUtil.isNotBlank(vo.getThreeDimensionalOssId())){ | ||
| 87 | vo.setThreeDimensionalOssUrl(ossUrlService.selectUrlByIds(vo.getThreeDimensionalOssId())); | ||
| 88 | } | ||
| 89 | } | ||
| 90 | return list; | ||
| 91 | } | ||
| 92 | |||
| 93 | /** | ||
| 94 | * 课程详情 | ||
| 95 | * @param id | ||
| 96 | * @return | ||
| 97 | */ | ||
| 98 | @Override | ||
| 99 | public CourseVo getById(String id) { | ||
| 100 | return baseMapper.selectVoById(id); | ||
| 101 | } | ||
| 102 | |||
| 103 | /** | ||
| 67 | * 新增 | 104 | * 新增 |
| 68 | * | 105 | * |
| 69 | * @param courseBo | 106 | * @param courseBo |
| ... | @@ -96,6 +133,7 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -96,6 +133,7 @@ public class CourseServiceImpl implements ICourseService { |
| 96 | 133 | ||
| 97 | /** | 134 | /** |
| 98 | * 从上传文件中获取案例名称 | 135 | * 从上传文件中获取案例名称 |
| 136 | * | ||
| 99 | * @param course | 137 | * @param course |
| 100 | */ | 138 | */ |
| 101 | private void setCaseName(Course course) { | 139 | private void setCaseName(Course course) { | ... | ... |
| ... | @@ -6,19 +6,22 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ... | @@ -6,19 +6,22 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 7 | import com.lego.common.core.domain.PageQuery; | 7 | import com.lego.common.core.domain.PageQuery; |
| 8 | import com.lego.common.core.page.TableDataInfo; | 8 | import com.lego.common.core.page.TableDataInfo; |
| 9 | import com.lego.common.core.service.OssService; | ||
| 9 | import com.lego.common.utils.MessageUtils; | 10 | import com.lego.common.utils.MessageUtils; |
| 11 | import com.lego.common.utils.StreamUtils; | ||
| 10 | import com.lego.core.annotation.LanguageAnnotation; | 12 | import com.lego.core.annotation.LanguageAnnotation; |
| 11 | import com.lego.core.domin.Entirety; | 13 | import com.lego.core.domin.Entirety; |
| 12 | import com.lego.core.domin.bo.EntiretyBo; | 14 | import com.lego.core.domin.bo.EntiretyBo; |
| 15 | import com.lego.core.domin.vo.BuildingBlockVo; | ||
| 13 | import com.lego.core.domin.vo.EntiretyVo; | 16 | import com.lego.core.domin.vo.EntiretyVo; |
| 14 | import com.lego.core.mapper.EntiretyMapper; | 17 | import com.lego.core.mapper.EntiretyMapper; |
| 18 | import com.lego.core.service.IBuildingBlockService; | ||
| 15 | import com.lego.core.service.IEntiretyService; | 19 | import com.lego.core.service.IEntiretyService; |
| 16 | import lombok.RequiredArgsConstructor; | 20 | import lombok.RequiredArgsConstructor; |
| 17 | import org.springframework.stereotype.Service; | 21 | import org.springframework.stereotype.Service; |
| 18 | 22 | ||
| 19 | import java.rmi.ServerException; | 23 | import java.rmi.ServerException; |
| 20 | import java.util.Collection; | 24 | import java.util.*; |
| 21 | import java.util.List; | ||
| 22 | 25 | ||
| 23 | /** | 26 | /** |
| 24 | * 套件Service业务层处理 | 27 | * 套件Service业务层处理 |
| ... | @@ -30,6 +33,8 @@ import java.util.List; | ... | @@ -30,6 +33,8 @@ import java.util.List; |
| 30 | @Service | 33 | @Service |
| 31 | public class EntiretyServiceImpl implements IEntiretyService { | 34 | public class EntiretyServiceImpl implements IEntiretyService { |
| 32 | private final EntiretyMapper baseMapper; | 35 | private final EntiretyMapper baseMapper; |
| 36 | private final OssService ossService; | ||
| 37 | private final IBuildingBlockService buildingBlockService; | ||
| 33 | 38 | ||
| 34 | /** | 39 | /** |
| 35 | * 查询所有列表 | 40 | * 查询所有列表 |
| ... | @@ -41,6 +46,22 @@ public class EntiretyServiceImpl implements IEntiretyService { | ... | @@ -41,6 +46,22 @@ public class EntiretyServiceImpl implements IEntiretyService { |
| 41 | public TableDataInfo<EntiretyVo> listPage(PageQuery query, String language) { | 46 | public TableDataInfo<EntiretyVo> listPage(PageQuery query, String language) { |
| 42 | Page<EntiretyVo> page = baseMapper.selectVoPage(query.build(), Wrappers.<Entirety>lambdaQuery() | 47 | Page<EntiretyVo> page = baseMapper.selectVoPage(query.build(), Wrappers.<Entirety>lambdaQuery() |
| 43 | .eq(Entirety::getLanguage, language).orderByAsc(Entirety::getSort)); | 48 | .eq(Entirety::getLanguage, language).orderByAsc(Entirety::getSort)); |
| 49 | /** | ||
| 50 | * 处理二级数据 | ||
| 51 | */ | ||
| 52 | List<EntiretyVo> list = page.getRecords(); | ||
| 53 | Set<String> BuildingBlockIdList = StreamUtils.toSet(list,EntiretyVo::getId); | ||
| 54 | List<BuildingBlockVo> BuildingBlockList = buildingBlockService.list(language, BuildingBlockIdList); | ||
| 55 | for(BuildingBlockVo vo : BuildingBlockList){ | ||
| 56 | if(StrUtil.isNotBlank(vo.getOssId())) { | ||
| 57 | vo.setOssUrl(ossService.selectUrlByIds(vo.getOssId())); | ||
| 58 | } | ||
| 59 | } | ||
| 60 | Map<String,List<BuildingBlockVo>> buildingBlockMap = StreamUtils.groupByKey(BuildingBlockList,BuildingBlockVo::getEntiretyId); | ||
| 61 | for(EntiretyVo vo:list){ | ||
| 62 | vo.setOssUrl(ossService.selectUrlByIds(vo.getOssId())); | ||
| 63 | vo.setBuildingblockList(buildingBlockMap.get(vo.getId())); | ||
| 64 | } | ||
| 44 | return TableDataInfo.build(page); | 65 | return TableDataInfo.build(page); |
| 45 | } | 66 | } |
| 46 | 67 | ||
| ... | @@ -51,7 +72,20 @@ public class EntiretyServiceImpl implements IEntiretyService { | ... | @@ -51,7 +72,20 @@ public class EntiretyServiceImpl implements IEntiretyService { |
| 51 | */ | 72 | */ |
| 52 | @Override | 73 | @Override |
| 53 | public List<EntiretyVo> list(String language) { | 74 | public List<EntiretyVo> list(String language) { |
| 54 | return baseMapper.selectVoList(Wrappers.<Entirety>lambdaQuery().eq(Entirety::getLanguage, language).orderByAsc(Entirety::getSort)); | 75 | List<EntiretyVo> list = baseMapper.selectVoList(Wrappers.<Entirety>lambdaQuery().eq(Entirety::getLanguage, language).orderByAsc(Entirety::getSort)); |
| 76 | for(EntiretyVo vo:list){ | ||
| 77 | if(StrUtil.isNotBlank(vo.getOssId())){ | ||
| 78 | vo.setOssUrl(ossService.selectUrlByIds(vo.getOssId())); | ||
| 79 | } | ||
| 80 | List<BuildingBlockVo> buildingBlockVoList = vo.getBuildingblockList(); | ||
| 81 | for(BuildingBlockVo blockVo:buildingBlockVoList){ | ||
| 82 | if(StrUtil.isNotBlank(blockVo.getOssId())){ | ||
| 83 | blockVo.setOssUrl(ossService.selectUrlByIds(blockVo.getOssId())); | ||
| 84 | } | ||
| 85 | } | ||
| 86 | } | ||
| 87 | |||
| 88 | return list; | ||
| 55 | } | 89 | } |
| 56 | 90 | ||
| 57 | /** | 91 | /** | ... | ... |
| ... | @@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil; | ... | @@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil; |
| 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 7 | import com.lego.common.core.page.TableDataInfo; | 7 | import com.lego.common.core.page.TableDataInfo; |
| 8 | import com.lego.common.core.service.OssService; | ||
| 8 | import com.lego.common.utils.MessageUtils; | 9 | import com.lego.common.utils.MessageUtils; |
| 9 | import com.lego.core.annotation.LanguageAnnotation; | 10 | import com.lego.core.annotation.LanguageAnnotation; |
| 10 | import com.lego.core.domin.Question; | 11 | import com.lego.core.domin.Question; |
| ... | @@ -30,6 +31,7 @@ import java.util.List; | ... | @@ -30,6 +31,7 @@ import java.util.List; |
| 30 | @Service | 31 | @Service |
| 31 | public class QuestionServiceImpl implements IQuestionService { | 32 | public class QuestionServiceImpl implements IQuestionService { |
| 32 | private final QuestionMapper baseMapper; | 33 | private final QuestionMapper baseMapper; |
| 34 | private final OssService ossService; | ||
| 33 | 35 | ||
| 34 | /** | 36 | /** |
| 35 | * 查询列表 | 37 | * 查询列表 |
| ... | @@ -58,6 +60,12 @@ public class QuestionServiceImpl implements IQuestionService { | ... | @@ -58,6 +60,12 @@ public class QuestionServiceImpl implements IQuestionService { |
| 58 | if (StrUtil.isNotBlank(sb.toString())) { | 60 | if (StrUtil.isNotBlank(sb.toString())) { |
| 59 | vo.setShowStr(sb.substring(0, sb.length() - 1)); | 61 | vo.setShowStr(sb.substring(0, sb.length() - 1)); |
| 60 | } | 62 | } |
| 63 | if(StrUtil.isNotBlank(vo.getCoverOssId())){ | ||
| 64 | vo.setCoverOssUrl(ossService.selectUrlByIds(vo.getCoverOssId())); | ||
| 65 | } | ||
| 66 | if(StrUtil.isNotBlank(vo.getVideoOssId())){ | ||
| 67 | vo.setVideoOssUrl(ossService.selectUrlByIds(vo.getVideoOssUrl())); | ||
| 68 | } | ||
| 61 | } | 69 | } |
| 62 | return TableDataInfo.build(page); | 70 | return TableDataInfo.build(page); |
| 63 | } | 71 | } | ... | ... |
| ... | @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ... | @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 8 | import com.lego.common.core.page.TableDataInfo; | 8 | import com.lego.common.core.page.TableDataInfo; |
| 9 | import com.lego.common.core.service.OssService; | ||
| 9 | import com.lego.common.utils.DateUtils; | 10 | import com.lego.common.utils.DateUtils; |
| 10 | import com.lego.common.utils.MessageUtils; | 11 | import com.lego.common.utils.MessageUtils; |
| 11 | import com.lego.core.annotation.LanguageAnnotation; | 12 | import com.lego.core.annotation.LanguageAnnotation; |
| ... | @@ -20,6 +21,7 @@ import lombok.RequiredArgsConstructor; | ... | @@ -20,6 +21,7 @@ import lombok.RequiredArgsConstructor; |
| 20 | import org.springframework.stereotype.Service; | 21 | import org.springframework.stereotype.Service; |
| 21 | 22 | ||
| 22 | import java.rmi.ServerException; | 23 | import java.rmi.ServerException; |
| 24 | import java.util.List; | ||
| 23 | 25 | ||
| 24 | /** | 26 | /** |
| 25 | * APP升级Service业务层处理 | 27 | * APP升级Service业务层处理 |
| ... | @@ -31,6 +33,7 @@ import java.rmi.ServerException; | ... | @@ -31,6 +33,7 @@ import java.rmi.ServerException; |
| 31 | @Service | 33 | @Service |
| 32 | public class UpgradeServiceImpl implements IUpgradeService { | 34 | public class UpgradeServiceImpl implements IUpgradeService { |
| 33 | private final UpgradeMapper baseMapper; | 35 | private final UpgradeMapper baseMapper; |
| 36 | private final OssService ossService; | ||
| 34 | 37 | ||
| 35 | /** | 38 | /** |
| 36 | * 查询列表 | 39 | * 查询列表 |
| ... | @@ -45,6 +48,12 @@ public class UpgradeServiceImpl implements IUpgradeService { | ... | @@ -45,6 +48,12 @@ public class UpgradeServiceImpl implements IUpgradeService { |
| 45 | .eq(StrUtil.isNotBlank(query.getFileType()), Upgrade::getFileType, query.getFileType()) | 48 | .eq(StrUtil.isNotBlank(query.getFileType()), Upgrade::getFileType, query.getFileType()) |
| 46 | .eq(StrUtil.isNotBlank(query.getPlatformType()), Upgrade::getPlatformType, query.getPlatformType()) | 49 | .eq(StrUtil.isNotBlank(query.getPlatformType()), Upgrade::getPlatformType, query.getPlatformType()) |
| 47 | .eq(Upgrade::getLanguage, language)); | 50 | .eq(Upgrade::getLanguage, language)); |
| 51 | List<UpgradeVo> list = page.getRecords(); | ||
| 52 | for (UpgradeVo vo : list) { | ||
| 53 | if (StrUtil.isNotBlank(vo.getFileOssId())) { | ||
| 54 | vo.setOssUrl(ossService.selectUrlByIds(vo.getFileOssId())); | ||
| 55 | } | ||
| 56 | } | ||
| 48 | return TableDataInfo.build(page); | 57 | return TableDataInfo.build(page); |
| 49 | } | 58 | } |
| 50 | 59 | ... | ... |
-
Please register or sign in to post a comment