no message
Showing
1 changed file
with
45 additions
and
10 deletions
| ... | @@ -3,9 +3,11 @@ package com.lego.core.service.impl; | ... | @@ -3,9 +3,11 @@ package com.lego.core.service.impl; |
| 3 | import cn.hutool.core.bean.BeanUtil; | 3 | import cn.hutool.core.bean.BeanUtil; |
| 4 | import cn.hutool.core.util.ObjectUtil; | 4 | import cn.hutool.core.util.ObjectUtil; |
| 5 | import cn.hutool.core.util.StrUtil; | 5 | import cn.hutool.core.util.StrUtil; |
| 6 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 6 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | 7 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| 7 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 8 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| 8 | import com.lego.common.core.page.TableDataInfo; | 9 | import com.lego.common.core.page.TableDataInfo; |
| 10 | import com.lego.common.core.service.OssService; | ||
| 9 | import com.lego.common.utils.MessageUtils; | 11 | import com.lego.common.utils.MessageUtils; |
| 10 | import com.lego.common.utils.StreamUtils; | 12 | import com.lego.common.utils.StreamUtils; |
| 11 | import com.lego.core.annotation.LanguageAnnotation; | 13 | import com.lego.core.annotation.LanguageAnnotation; |
| ... | @@ -25,6 +27,7 @@ import org.springframework.stereotype.Service; | ... | @@ -25,6 +27,7 @@ import org.springframework.stereotype.Service; |
| 25 | import java.rmi.ServerException; | 27 | import java.rmi.ServerException; |
| 26 | import java.util.List; | 28 | import java.util.List; |
| 27 | import java.util.Map; | 29 | import java.util.Map; |
| 30 | import java.util.Objects; | ||
| 28 | import java.util.Set; | 31 | import java.util.Set; |
| 29 | 32 | ||
| 30 | /** | 33 | /** |
| ... | @@ -39,6 +42,7 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -39,6 +42,7 @@ public class CourseServiceImpl implements ICourseService { |
| 39 | private final CourseMapper baseMapper; | 42 | private final CourseMapper baseMapper; |
| 40 | private final IBuildingBlockService buildingBlockService; | 43 | private final IBuildingBlockService buildingBlockService; |
| 41 | private final ISysOssService iSysOssService; | 44 | private final ISysOssService iSysOssService; |
| 45 | private final OssService ossUrlService; | ||
| 42 | 46 | ||
| 43 | /** | 47 | /** |
| 44 | * 查询所有列表 | 48 | * 查询所有列表 |
| ... | @@ -116,6 +120,13 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -116,6 +120,13 @@ public class CourseServiceImpl implements ICourseService { |
| 116 | return list; | 120 | return list; |
| 117 | } | 121 | } |
| 118 | 122 | ||
| 123 | public List<CourseVo> selectCanPackList() { | ||
| 124 | LambdaQueryWrapper<Course> w = Wrappers.lambdaQuery(); | ||
| 125 | w.eq(Course::getCanPack, 1); | ||
| 126 | return baseMapper.selectVoList(w); | ||
| 127 | |||
| 128 | } | ||
| 129 | |||
| 119 | /** | 130 | /** |
| 120 | * 获取所有课程 | 131 | * 获取所有课程 |
| 121 | * @return | 132 | * @return |
| ... | @@ -126,43 +137,67 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -126,43 +137,67 @@ public class CourseServiceImpl implements ICourseService { |
| 126 | for (CourseVo vo : list) { | 137 | for (CourseVo vo : list) { |
| 127 | if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){ | 138 | if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){ |
| 128 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalOssId())); | 139 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalOssId())); |
| 129 | vo.setTwoDimensionalOssUrl(oss.getUrl()); | 140 | if(Objects.nonNull(oss)) { |
| 141 | vo.setTwoDimensionalOssUrl(oss.getUrl()); | ||
| 142 | } | ||
| 130 | } | 143 | } |
| 131 | if(StrUtil.isNotBlank(vo.getTwoDimensionalUrl())){ | 144 | if(StrUtil.isNotBlank(vo.getTwoDimensionalUrl())){ |
| 132 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalUrl())); | 145 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalUrl())); |
| 133 | vo.setTwoDimensionalUrl(oss.getUrl()); | 146 | if(Objects.nonNull(oss)) { |
| 147 | vo.setTwoDimensionalUrl(oss.getUrl()); | ||
| 148 | } | ||
| 134 | } | 149 | } |
| 135 | if(StrUtil.isNotBlank(vo.getTwoDimensionalType())){ | 150 | if(StrUtil.isNotBlank(vo.getTwoDimensionalType())){ |
| 136 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalType())); | 151 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalType())); |
| 137 | vo.setTwoDimensionalType(oss.getUrl()); | 152 | if(Objects.nonNull(oss)) { |
| 153 | vo.setTwoDimensionalType(oss.getUrl()); | ||
| 154 | } | ||
| 138 | } | 155 | } |
| 139 | if(StrUtil.isNotBlank(vo.getThreeDimensionalOssId())){ | 156 | if(StrUtil.isNotBlank(vo.getThreeDimensionalOssId())){ |
| 140 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalOssId())); | 157 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalOssId())); |
| 141 | vo.setThreeDimensionalOssUrl(oss.getUrl()); | 158 | if(Objects.nonNull(oss)) { |
| 159 | vo.setThreeDimensionalOssUrl(oss.getUrl()); | ||
| 160 | } | ||
| 142 | } | 161 | } |
| 143 | if(StrUtil.isNotBlank(vo.getThreeDimensionalUrl())){ | 162 | if(StrUtil.isNotBlank(vo.getThreeDimensionalUrl())){ |
| 144 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalUrl())); | 163 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalUrl())); |
| 145 | vo.setThreeDimensionalUrl(oss.getUrl()); | 164 | if(Objects.nonNull(oss)) { |
| 165 | vo.setThreeDimensionalUrl(oss.getUrl()); | ||
| 166 | } | ||
| 146 | } | 167 | } |
| 147 | if(StrUtil.isNotBlank(vo.getThreeDimensionalType())){ | 168 | if(StrUtil.isNotBlank(vo.getThreeDimensionalType())){ |
| 148 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalType())); | 169 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalType())); |
| 149 | vo.setThreeDimensionalType(oss.getUrl()); | 170 | if(Objects.nonNull(oss)) { |
| 171 | vo.setThreeDimensionalType(oss.getUrl()); | ||
| 172 | } | ||
| 150 | } | 173 | } |
| 151 | if(StrUtil.isNotBlank(vo.getCaseOssId())){ | 174 | if(StrUtil.isNotBlank(vo.getCaseOssId())){ |
| 152 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getCaseOssId())); | 175 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getCaseOssId())); |
| 153 | vo.setCaseOssUrl(oss.getUrl()); | 176 | if(Objects.nonNull(oss)) { |
| 177 | vo.setCaseOssUrl(oss.getUrl()); | ||
| 178 | vo.setCaseFileVoList(ossUrlService.selectFileVoByIds(vo.getCaseOssId())); | ||
| 179 | } | ||
| 154 | } | 180 | } |
| 155 | if(StrUtil.isNotBlank(vo.getTeachingOssId())){ | 181 | if(StrUtil.isNotBlank(vo.getTeachingOssId())){ |
| 156 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTeachingOssId())); | 182 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTeachingOssId())); |
| 157 | vo.setTeachingOssUrl(oss.getUrl()); | 183 | if(Objects.nonNull(oss)) { |
| 184 | vo.setTeachingOssUrl(oss.getUrl()); | ||
| 185 | vo.setTeachingFileVoList(ossUrlService.selectFileVoByIds(vo.getTeachingOssId())); | ||
| 186 | } | ||
| 158 | } | 187 | } |
| 159 | if(StrUtil.isNotBlank(vo.getPptOssId())){ | 188 | if(StrUtil.isNotBlank(vo.getPptOssId())){ |
| 160 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getPptOssId())); | 189 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getPptOssId())); |
| 161 | vo.setPptOssUrl(oss.getUrl()); | 190 | if(Objects.nonNull(oss)) { |
| 191 | vo.setPptOssUrl(oss.getUrl()); | ||
| 192 | vo.setPptFileVoList(ossUrlService.selectFileVoByIds(vo.getPptOssId())); | ||
| 193 | } | ||
| 162 | } | 194 | } |
| 195 | |||
| 163 | if(StrUtil.isNotBlank(vo.getOssId())){ | 196 | if(StrUtil.isNotBlank(vo.getOssId())){ |
| 164 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getOssId())); | 197 | SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getOssId())); |
| 165 | vo.setOssUrl(oss.getUrl()); | 198 | if(Objects.nonNull(oss)) { |
| 199 | vo.setOssUrl(oss.getUrl()); | ||
| 200 | } | ||
| 166 | } | 201 | } |
| 167 | } | 202 | } |
| 168 | return list; | 203 | return list; | ... | ... |
-
Please register or sign in to post a comment