Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
rszt
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
rszt
Commits
8afb4d5a
提交
8afb4d5a
authored
12月 14, 2020
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
b8257174
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
13 行增加
和
90 行删除
+13
-90
QueryVideoLibraryForm.java
.../form/resource/bg/videolibrary/QueryVideoLibraryForm.java
+0
-10
SaveUpdateVideoLibraryForm.java
.../resource/bg/videolibrary/SaveUpdateVideoLibraryForm.java
+1
-1
SaveVideoLibraryForm.java
...e/form/resource/bg/videolibrary/SaveVideoLibraryForm.java
+0
-11
VideoLibraryListVO.java
...rqx/core/vo/resource/videolibrary/VideoLibraryListVO.java
+3
-1
VideoLibraryOneVO.java
...zrqx/core/vo/resource/videolibrary/VideoLibraryOneVO.java
+1
-1
VideoLibraryController.java
...ce/bg/controller/videoLibrary/VideoLibraryController.java
+2
-20
VideoLibraryMapper.java
...x/resource/bg/mapper/videolibrary/VideoLibraryMapper.java
+3
-20
VideoLibrarySerivceImpl.java
...urce/bg/service/videolibrary/VideoLibrarySerivceImpl.java
+3
-26
没有找到文件。
com.zrqx.core/src/main/java/com/zrqx/core/form/resource/bg/videolibrary/QueryVideoLibraryForm.java
浏览文件 @
8afb4d5a
package
com
.
zrqx
.
core
.
form
.
resource
.
bg
.
videolibrary
;
import
java.util.List
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -12,12 +10,4 @@ public class QueryVideoLibraryForm {
private
String
name
;
@ApiModelProperty
(
"状态:1已上架,0已下架"
)
private
String
status
;
@ApiModelProperty
(
value
=
"上传时间-开始"
)
private
String
beginTime
;
@ApiModelProperty
(
value
=
"上传时间-结束"
)
private
String
endTime
;
@ApiModelProperty
(
value
=
"自定义分类id"
)
private
List
<
Integer
>
diyTypeId
;
@ApiModelProperty
(
"自定义分类code"
)
private
String
diyTypeCode
;
}
com.zrqx.core/src/main/java/com/zrqx/core/form/resource/bg/videolibrary/SaveUpdateVideoLibraryForm.java
浏览文件 @
8afb4d5a
...
...
@@ -15,7 +15,7 @@ public class SaveUpdateVideoLibraryForm {
@ApiModelProperty
(
value
=
"视频名称"
)
private
String
name
;
@ApiModelProperty
(
"来源"
)
private
String
adSlogan
;
private
String
source
;
@ApiModelProperty
(
value
=
"分类id"
)
private
List
<
VideoLibraryDiyType
>
diyType
;
@ApiModelProperty
(
"封面"
)
...
...
com.zrqx.core/src/main/java/com/zrqx/core/form/resource/bg/videolibrary/SaveVideoLibraryForm.java
浏览文件 @
8afb4d5a
...
...
@@ -2,12 +2,9 @@ package com.zrqx.core.form.resource.bg.videolibrary;
import
java.util.List
;
import
com.zrqx.core.model.resource.videolibrary.VideoLibraryDiyType
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
scala.math.BigDecimal
;
@Data
@ApiModel
(
value
=
"SaveVideoLibraryForm"
,
description
=
"添加视频库"
)
public
class
SaveVideoLibraryForm
{
...
...
@@ -17,18 +14,12 @@ public class SaveVideoLibraryForm {
private
String
source
;
@ApiModelProperty
(
"关键词"
)
private
String
keywords
;
@ApiModelProperty
(
"定价"
)
private
BigDecimal
price
;
@ApiModelProperty
(
"售价"
)
private
BigDecimal
realPrice
;
@ApiModelProperty
(
"简介"
)
private
String
synopsis
;
@ApiModelProperty
(
"video"
)
private
List
<
String
>
video
;
@ApiModelProperty
(
"封面"
)
private
String
cover
;
@ApiModelProperty
(
value
=
"分类id"
)
private
VideoLibraryDiyType
diyType
;
@ApiModelProperty
(
"格式"
)
private
List
<
String
>
formats
;
@ApiModelProperty
(
"文件大小"
)
...
...
@@ -37,6 +28,4 @@ public class SaveVideoLibraryForm {
private
List
<
String
>
timeLength
;
@ApiModelProperty
(
"video名称"
)
private
List
<
String
>
videoName
;
@ApiModelProperty
(
"来源"
)
private
String
adSlogan
;
}
com.zrqx.core/src/main/java/com/zrqx/core/vo/resource/videolibrary/VideoLibraryListVO.java
浏览文件 @
8afb4d5a
...
...
@@ -11,7 +11,7 @@ public class VideoLibraryListVO {
@ApiModelProperty
(
value
=
"资源名称"
)
private
String
name
;
@ApiModelProperty
(
"来源"
)
private
String
adSlogan
;
private
String
source
;
@ApiModelProperty
(
"上传时间"
)
private
String
uploadTime
;
@ApiModelProperty
(
"状态:1已上架,2已下架"
)
...
...
@@ -22,4 +22,6 @@ public class VideoLibraryListVO {
private
String
timeLength
;
@ApiModelProperty
(
"文件大小"
)
private
String
size
;
@ApiModelProperty
(
"排序"
)
private
Integer
sort
;
}
com.zrqx.core/src/main/java/com/zrqx/core/vo/resource/videolibrary/VideoLibraryOneVO.java
浏览文件 @
8afb4d5a
...
...
@@ -16,7 +16,7 @@ public class VideoLibraryOneVO {
@ApiModelProperty
(
value
=
"视频名称"
)
private
String
name
;
@ApiModelProperty
(
"来源"
)
private
String
adSlogan
;
private
String
source
;
@ApiModelProperty
(
value
=
"分类id"
)
private
List
<
VideoLibraryDiyType
>
diyType
;
@ApiModelProperty
(
"封面"
)
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/controller/videoLibrary/VideoLibraryController.java
浏览文件 @
8afb4d5a
package
com
.
zrqx
.
resource
.
bg
.
controller
.
videoLibrary
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -15,30 +11,20 @@ import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.zrqx.core.enums.resource.LibraryStatusEnum
;
import
com.zrqx.core.enums.resource.PriceOptionEnum
;
import
com.zrqx.core.exception.BaseException
;
import
com.zrqx.core.form.resource.bg.recommend.UpdateRecommendResourceForm
;
import
com.zrqx.core.form.resource.bg.videolibrary.BatchUpdateVideoLibraryForm
;
import
com.zrqx.core.form.resource.bg.videolibrary.QueryVideoLibraryForm
;
import
com.zrqx.core.form.resource.bg.videolibrary.SaveUpdateVideoLibraryForm
;
import
com.zrqx.core.form.resource.bg.videolibrary.SaveVideoLibraryForm
;
import
com.zrqx.core.model.recommend.RecommendResource
;
import
com.zrqx.core.model.resource.imagelibrary.ImageLibrary
;
import
com.zrqx.core.model.resource.videolibrary.VideoLibrary
;
import
com.zrqx.core.model.resource.videolibrary.VideoLibraryDiyType
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.util.response.CallBack
;
import
com.zrqx.core.vo.ImportLabelVo
;
import
com.zrqx.core.vo.resource.videolibrary.VideoLibraryListVO
;
import
com.zrqx.core.vo.resource.videolibrary.VideoLibraryOneVO
;
import
com.zrqx.resource.bg.service.recommend.RecommendResourceService
;
import
com.zrqx.resource.bg.service.videolibrary.VideoLibraryDiyTypeService
;
import
com.zrqx.resource.bg.service.videolibrary.VideoLibraryService
;
import
io.swagger.annotations.Api
;
...
...
@@ -54,11 +40,6 @@ import tk.mybatis.mapper.entity.Example;
public
class
VideoLibraryController
{
@Autowired
private
VideoLibraryService
service
;
@Autowired
private
VideoLibraryDiyTypeService
vdrService
;
/** 推荐位内容 */
@Autowired
private
RecommendResourceService
recommendResourceService
;
@ApiOperation
(
value
=
"新增/修改 视频资源"
,
notes
=
"新增/修改 视频资源"
)
@PostMapping
(
value
=
"/save"
)
...
...
@@ -131,9 +112,10 @@ public class VideoLibraryController {
@ApiOperation
(
value
=
"查询"
,
notes
=
"根据ID查询"
)
@GetMapping
(
value
=
"/get/{oid}"
)
public
CallBack
<
VideoLibraryOneVO
>
getById
(
@PathVariable
String
oid
)
{
VideoLibrary
entity
=
service
.
selectByPrimaryKey
(
oid
);
VideoLibrary
entity
=
service
.
selectByPrimaryKey
(
oid
);
VideoLibraryOneVO
vo
=
new
VideoLibraryOneVO
();
BeanUtils
.
copyProperties
(
entity
,
vo
);
vo
.
setSource
(
entity
.
getAdSlogan
());
return
CallBack
.
success
(
vo
);
}
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/mapper/videolibrary/VideoLibraryMapper.java
浏览文件 @
8afb4d5a
...
...
@@ -17,31 +17,14 @@ import com.zrqx.resource.bg.mapper.MapperConstants;
*/
public
interface
VideoLibraryMapper
extends
BaseMapper
<
VideoLibrary
>
{
@Select
(
"<script>"
+
"<if test = 'form.diyTypeCode==null'>"
+
"select DISTINCT a.id,a.name,a.adSlogan,a.size,a.timeLength, DATE_FORMAT(a.uploadTime,'%Y-%m-%d %H:%i') uploadTime,a.status "
+
"select DISTINCT a.id,a.name,a.adSlogan source,a.size,a.timeLength, DATE_FORMAT(a.uploadTime,'%Y-%m-%d %H:%i') uploadTime,a.status,a.sort "
+
"from res_Video_Library a "
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(form.diyTypeCode)'>"
+
"select DISTINCT a.id,a.name,a.adSlogan,a.size,a.timeLength, DATE_FORMAT(a.uploadTime,'%Y-%m-%d %H:%i') uploadTime,a.status "
+
"from res_Video_Library a left join res_Video_Library_Diy_Type ad "
+
"on a.id = ad.vlid "
+
"</if>"
+
"where 1=1 "
+
"<if test = '"
+
NOTBLANK
+
"(form.diyTypeCode)'>"
+
" and ad.code like concat(#{form.diyTypeCode},'%') "
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(form.name)'>"
+
" and a.name like concat('%',#{form.name},'%')
or a.adSlogan like concat('%',#{form.name},'%')
"
+
" and a.name like concat('%',#{form.name},'%')"
+
"</if>"
+
"<if test='form.status != null'>"
+
" and a.status = #{form.status}"
+
"</if>"
+
" <if test = '"
+
NOTBLANK
+
"(form.beginTime)'> "
+
" and a.uploadTime >= concat(#{form.beginTime}, ' 00:00:00' ) "
+
" </if> "
+
" <if test = '"
+
NOTBLANK
+
"(form.endTime)'> "
+
" and a.uploadTime <= concat(#{form.endTime}, ' 23:59:59') "
+
" </if> "
+
"</script>"
)
List
<
VideoLibraryListVO
>
query
(
@Param
(
"form"
)
QueryVideoLibraryForm
form
);
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/videolibrary/VideoLibrarySerivceImpl.java
浏览文件 @
8afb4d5a
...
...
@@ -78,28 +78,16 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
entity
.
setBrowseNum
(
0
);
entity
.
setSalesNum
(
0
);
entity
.
setClickNum
(
0
);
entity
.
setAdSlogan
(
form
.
getSource
());
mapper
.
insert
(
entity
);
}
else
{
//修改
/* entity = mapper.selectByPrimaryKey(form.getId());
BeanUtils.copyProperties(form, entity);*/
entity
.
setUpdateTime
(
new
Date
());
entity
.
setAdSlogan
(
form
.
getSource
());
mapper
.
updateByPrimaryKeySelective
(
entity
);
//删除当前对象与自定义分类的关系
VideoLibraryDiyType
old
=
new
VideoLibraryDiyType
();
old
.
setVlId
(
entity
.
getId
());
vdrMapper
.
delete
(
old
);
}
//添加当前对象与自定义分类的关系
if
(
form
.
getDiyType
()
!=
null
&&
form
.
getDiyType
().
size
()
>
0
){
List
<
VideoLibraryDiyType
>
list
=
form
.
getDiyType
();
list
.
forEach
(
li
->
{
li
.
setVlId
(
entity
.
getId
());
li
.
setCreateTime
(
new
Date
());
li
.
setCreater
(
redis
.
getUser
().
getUserName
());
});
vdrMapper
.
insertUuidList
(
list
);
}
return
true
;
}
/**
...
...
@@ -132,15 +120,8 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
obj
.
setRealPrice
(
new
BigDecimal
(
0.00
));
obj
.
setSalesNum
(
0
);
obj
.
setVideoName
(
form
.
getNames
().
get
(
i
));
obj
.
setAdSlogan
(
form
.
get
AdSlogan
());
obj
.
setAdSlogan
(
form
.
get
Source
());
mapper
.
insert
(
obj
);
if
(
form
.
getDiyType
()
!=
null
){
VideoLibraryDiyType
videoLibraryDiyType
=
new
VideoLibraryDiyType
();
videoLibraryDiyType
.
setCode
(
form
.
getDiyType
().
getCode
());
videoLibraryDiyType
.
setDtId
(
form
.
getDiyType
().
getDtId
());
videoLibraryDiyType
.
setVlId
(
obj
.
getId
());
vdrMapper
.
insert
(
videoLibraryDiyType
);
}
}
return
true
;
...
...
@@ -186,8 +167,6 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
pageParam
.
setOrderBy
(
" updateTime desc"
);
}
startPage
(
pageParam
);
//暂不用自定义分类id 做in查询
form
.
setDiyTypeId
(
null
);
List
<
VideoLibraryListVO
>
list
=
mapper
.
query
(
form
);
list
.
forEach
(
f
->
{
if
(
f
.
getStatus
()
!=
null
)
{
...
...
@@ -244,8 +223,6 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
@Override
public
PageInfo
<
VideoLibraryListVO
>
livePage
(
QueryVideoLibraryForm
form
,
PageParam
pageParam
)
{
startPage
(
pageParam
);
//暂不用自定义分类id 做in查询
form
.
setDiyTypeId
(
null
);
List
<
VideoLibraryListVO
>
list
=
mapper
.
liveQuery
(
form
);
list
.
forEach
(
f
->
{
if
(
f
.
getStatus
()
!=
null
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论