Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
legobackend
/
lego-manage
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f2d74e4a
authored
2025-06-14 15:26:45 +0800
by
chentao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
no message
1 parent
fe14ef53
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
lego-core/src/main/java/com/lego/core/service/impl/CourseServiceImpl.java
lego-core/src/main/java/com/lego/core/service/impl/CourseServiceImpl.java
View file @
f2d74e4
...
...
@@ -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
;
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment