Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zhiliao
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
zhiliao
Commits
a6b73794
提交
a6b73794
authored
5月 06, 2020
作者:
zhouzhigang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
3d0844e1
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
52 行增加
和
16 行删除
+52
-16
ResourceLibraryController.java
...controller/resourcelibrary/ResourceLibraryController.java
+1
-15
ResourceRelationService.java
...com/zrqx/resource/bg/service/ResourceRelationService.java
+10
-0
ResourceRelationServiceImpl.java
...zrqx/resource/bg/service/ResourceRelationServiceImpl.java
+40
-0
FgResourceRelationMapper.java
...com/zrqx/resource/fg/mapper/FgResourceRelationMapper.java
+1
-1
没有找到文件。
app/resource/src/main/java/com/zrqx/resource/bg/controller/resourcelibrary/ResourceLibraryController.java
浏览文件 @
a6b73794
...
...
@@ -189,21 +189,7 @@ public class ResourceLibraryController {
@ApiOperation
(
value
=
"保存当前视频播放状态"
,
notes
=
"保存当前视频播放状态"
)
@PostMapping
(
value
=
"/relation-resource/update"
)
public
CallBack
<
Boolean
>
updateStatus
(
@RequestBody
UpdatePlayStatusForm
form
){
ResourceRelation
e
=
new
ResourceRelation
();
e
.
setObjectId
(
form
.
getCourseId
());
e
.
setResourceId
(
form
.
getVideoId
());
e
.
setRelationtype
(
1
);
e
.
setResourceType
(
5
);
ResourceRelation
resourceRelation
=
new
ResourceRelation
();
try
{
resourceRelation
=
resourceRelationService
.
selectOne
(
resourceRelation
);
}
catch
(
Exception
e1
)
{
throw
new
BaseException
(
"通过课程id视频id获取课程视频关联关系异常"
);
}
if
(
resourceRelation
!=
null
)
{
resourceRelation
.
setIsPlay
(
"1"
);
}
return
resourceRelationService
.
updateByPrimaryKey
(
resourceRelation
)
?
CallBack
.
success
()
:
CallBack
.
fail
();
return
CallBack
.
success
(
resourceRelationService
.
updateStatus
(
form
));
}
//关联资源begin
...
...
app/resource/src/main/java/com/zrqx/resource/bg/service/ResourceRelationService.java
浏览文件 @
a6b73794
...
...
@@ -5,6 +5,7 @@ import java.util.List;
import
com.zrqx.core.service.BaseService
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.resource.commons.form.bg.QueryResourceRelationForm
;
import
com.zrqx.resource.commons.form.bg.UpdatePlayStatusForm
;
import
com.zrqx.resource.commons.model.resourcerelation.ResourceRelation
;
import
com.zrqx.resource.commons.vo.bg.ResourceRelationVo
;
...
...
@@ -26,4 +27,13 @@ public interface ResourceRelationService extends BaseService<ResourceRelation, I
* @return
*/
Integer
getMaxSort
(
String
resourceType
);
/**
* 保存当前视频播放状态
* @param form
* @return
* @author chyj
* @date: 2020年5月6日 下午4:15:26
*/
boolean
updateStatus
(
UpdatePlayStatusForm
form
);
}
app/resource/src/main/java/com/zrqx/resource/bg/service/ResourceRelationServiceImpl.java
浏览文件 @
a6b73794
...
...
@@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
import
com.github.pagehelper.PageHelper
;
import
com.zrqx.core.enums.AllResourceTypeEnum
;
import
com.zrqx.core.exception.BaseException
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.service.BaseServiceImpl
;
import
com.zrqx.core.util.page.PageParam
;
...
...
@@ -22,6 +23,8 @@ import com.zrqx.resource.bg.mapper.imagelibrary.ImageLibraryMapper;
import
com.zrqx.resource.bg.mapper.projectlibrary.ProjectLibraryMapper
;
import
com.zrqx.resource.bg.mapper.videolibrary.VideoLibraryMapper
;
import
com.zrqx.resource.commons.form.bg.QueryResourceRelationForm
;
import
com.zrqx.resource.commons.form.bg.UpdatePlayStatusForm
;
import
com.zrqx.resource.commons.form.bg.marketing.UpdateStatusForm
;
import
com.zrqx.resource.commons.model.annexlibrary.AnnexLibrary
;
import
com.zrqx.resource.commons.model.articlelibrary.ArticleLibrary
;
import
com.zrqx.resource.commons.model.audiolibrary.AudioLibrary
;
...
...
@@ -155,4 +158,41 @@ public class ResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelatio
}
return
sort
;
}
@Override
public
boolean
updateStatus
(
UpdatePlayStatusForm
form
)
{
//将课程下的其他视频置为不是当前播放状态
ResourceRelation
relation
=
new
ResourceRelation
();
relation
.
setObjectId
(
form
.
getCourseId
());
relation
.
setIsPlay
(
"1"
);
ResourceRelation
rr
=
new
ResourceRelation
();
try
{
rr
=
mapper
.
selectOne
(
relation
);
}
catch
(
Exception
e1
)
{
throw
new
BaseException
(
"通过课程id视频id获取课程视频关联关系异常"
);
}
if
(
rr
!=
null
)
{
rr
.
setIsPlay
(
"0"
);
mapper
.
updateByPrimaryKey
(
rr
);
}
ResourceRelation
e
=
new
ResourceRelation
();
e
.
setObjectId
(
form
.
getCourseId
());
e
.
setResourceId
(
form
.
getVideoId
());
e
.
setRelationtype
(
1
);
e
.
setResourceType
(
5
);
ResourceRelation
resourceRelation
=
new
ResourceRelation
();
try
{
resourceRelation
=
mapper
.
selectOne
(
resourceRelation
);
}
catch
(
Exception
e1
)
{
throw
new
BaseException
(
"通过课程id视频id获取课程视频关联关系异常"
);
}
if
(
resourceRelation
!=
null
)
{
resourceRelation
.
setIsPlay
(
"1"
);
}
return
mapper
.
updateByPrimaryKey
(
resourceRelation
)
>
0
;
}
}
app/resource/src/main/java/com/zrqx/resource/fg/mapper/FgResourceRelationMapper.java
浏览文件 @
a6b73794
...
...
@@ -82,7 +82,7 @@ public interface FgResourceRelationMapper extends BaseMapper<ResourceRelation>
+
"</if>"
+
" and ar.resourceType = 5 and ar.relationtype=1"
+
" union"
+
" select li.id as resourceId,li.resourceType,li.`name`,li.`status`,li.timeLength,li.clickNum,li.uploadTime,sort,li.priceOption from "
+
" select li.id as resourceId,li.resourceType,li.`name`,li.`status`,li.timeLength,li.clickNum,li.uploadTime,sort,li.priceOption
,ar.isPlay
from "
+
"res_resource_relation ar LEFT JOIN res_audio_library li on li.id=ar.resourceId "
+
"where 1 = 1 and li.status = 1 "
+
"<if test='"
+
NOTBLANK
+
"(oid)'> "
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论