f2d74e4a by chentao

no message

1 parent fe14ef53
......@@ -3,9 +3,11 @@ package com.lego.core.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lego.common.core.page.TableDataInfo;
import com.lego.common.core.service.OssService;
import com.lego.common.utils.MessageUtils;
import com.lego.common.utils.StreamUtils;
import com.lego.core.annotation.LanguageAnnotation;
......@@ -25,6 +27,7 @@ import org.springframework.stereotype.Service;
import java.rmi.ServerException;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
/**
......@@ -39,6 +42,7 @@ public class CourseServiceImpl implements ICourseService {
private final CourseMapper baseMapper;
private final IBuildingBlockService buildingBlockService;
private final ISysOssService iSysOssService;
private final OssService ossUrlService;
/**
* 查询所有列表
......@@ -116,6 +120,13 @@ public class CourseServiceImpl implements ICourseService {
return list;
}
public List<CourseVo> selectCanPackList() {
LambdaQueryWrapper<Course> w = Wrappers.lambdaQuery();
w.eq(Course::getCanPack, 1);
return baseMapper.selectVoList(w);
}
/**
* 获取所有课程
* @return
......@@ -126,45 +137,69 @@ public class CourseServiceImpl implements ICourseService {
for (CourseVo vo : list) {
if(StrUtil.isNotBlank(vo.getTwoDimensionalOssId())){
SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalOssId()));
if(Objects.nonNull(oss)) {
vo.setTwoDimensionalOssUrl(oss.getUrl());
}
}
if(StrUtil.isNotBlank(vo.getTwoDimensionalUrl())){
SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalUrl()));
if(Objects.nonNull(oss)) {
vo.setTwoDimensionalUrl(oss.getUrl());
}
}
if(StrUtil.isNotBlank(vo.getTwoDimensionalType())){
SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTwoDimensionalType()));
if(Objects.nonNull(oss)) {
vo.setTwoDimensionalType(oss.getUrl());
}
}
if(StrUtil.isNotBlank(vo.getThreeDimensionalOssId())){
SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalOssId()));
if(Objects.nonNull(oss)) {
vo.setThreeDimensionalOssUrl(oss.getUrl());
}
}
if(StrUtil.isNotBlank(vo.getThreeDimensionalUrl())){
SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalUrl()));
if(Objects.nonNull(oss)) {
vo.setThreeDimensionalUrl(oss.getUrl());
}
}
if(StrUtil.isNotBlank(vo.getThreeDimensionalType())){
SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getThreeDimensionalType()));
if(Objects.nonNull(oss)) {
vo.setThreeDimensionalType(oss.getUrl());
}
}
if(StrUtil.isNotBlank(vo.getCaseOssId())){
SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getCaseOssId()));
if(Objects.nonNull(oss)) {
vo.setCaseOssUrl(oss.getUrl());
vo.setCaseFileVoList(ossUrlService.selectFileVoByIds(vo.getCaseOssId()));
}
}
if(StrUtil.isNotBlank(vo.getTeachingOssId())){
SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getTeachingOssId()));
if(Objects.nonNull(oss)) {
vo.setTeachingOssUrl(oss.getUrl());
vo.setTeachingFileVoList(ossUrlService.selectFileVoByIds(vo.getTeachingOssId()));
}
}
if(StrUtil.isNotBlank(vo.getPptOssId())){
SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getPptOssId()));
if(Objects.nonNull(oss)) {
vo.setPptOssUrl(oss.getUrl());
vo.setPptFileVoList(ossUrlService.selectFileVoByIds(vo.getPptOssId()));
}
}
if(StrUtil.isNotBlank(vo.getOssId())){
SysOssVo oss = iSysOssService.getById(Long.valueOf(vo.getOssId()));
if(Objects.nonNull(oss)) {
vo.setOssUrl(oss.getUrl());
}
}
}
return list;
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!