Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
H
hxkf
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
hxkf
Commits
eb364cf0
提交
eb364cf0
authored
4月 22, 2020
作者:
liupengfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
553440c9
显示空白字符变更
内嵌
并排
正在显示
28 个修改的文件
包含
451 行增加
和
500 行删除
+451
-500
CourseLibraryController.java
.../bg/controller/courselibrary/CourseLibraryController.java
+102
-58
VideoLibraryController.java
...ce/bg/controller/videolibrary/VideoLibraryController.java
+30
-89
CourseLibraryMapper.java
...resource/bg/mapper/courselibrary/CourseLibraryMapper.java
+29
-1
VideoLibraryMapper.java
...x/resource/bg/mapper/videolibrary/VideoLibraryMapper.java
+2
-8
CourseLibrarySerivceImpl.java
...ce/bg/service/courselibrary/CourseLibrarySerivceImpl.java
+45
-23
CourseLibraryService.java
...source/bg/service/courselibrary/CourseLibraryService.java
+15
-0
VideoLibrarySerivceImpl.java
...urce/bg/service/videolibrary/VideoLibrarySerivceImpl.java
+34
-44
VideoLibraryService.java
...resource/bg/service/videolibrary/VideoLibraryService.java
+1
-1
BatchUpdateCourseLibraryForm.java
...s/form/bg/courselibrary/BatchUpdateCourseLibraryForm.java
+2
-0
QueryCourseAndVideoForm.java
...ommons/form/bg/courselibrary/QueryCourseAndVideoForm.java
+13
-0
QueryCourseLibraryForm.java
...commons/form/bg/courselibrary/QueryCourseLibraryForm.java
+0
-2
SaveUpdateCourseLibraryForm.java
...ns/form/bg/courselibrary/SaveUpdateCourseLibraryForm.java
+10
-20
BatchUpdateVideoLibraryForm.java
...ons/form/bg/videolibrary/BatchUpdateVideoLibraryForm.java
+7
-2
QueryVideoLibraryForm.java
...e/commons/form/bg/videolibrary/QueryVideoLibraryForm.java
+0
-4
SaveUpdateVideoLibraryForm.java
...mons/form/bg/videolibrary/SaveUpdateVideoLibraryForm.java
+25
-27
SaveVideoLibraryForm.java
...ce/commons/form/bg/videolibrary/SaveVideoLibraryForm.java
+7
-31
CourseLibrary.java
...x/resource/commons/model/courcelibrary/CourseLibrary.java
+12
-16
VideoLibrary.java
...rqx/resource/commons/model/videolibrary/VideoLibrary.java
+34
-42
CourseLibraryListVO.java
...urce/commons/vo/bg/courselibrary/CourseLibraryListVO.java
+5
-23
CourseLibraryVO.java
...resource/commons/vo/bg/courselibrary/CourseLibraryVO.java
+22
-30
VideoLibraryListVO.java
...source/commons/vo/bg/videolibrary/VideoLibraryListVO.java
+13
-13
VideoLibraryOneVO.java
...esource/commons/vo/bg/videolibrary/VideoLibraryOneVO.java
+28
-29
FgResourceLibraryController.java
...ntroller/resourcelibrary/FgResourceLibraryController.java
+6
-6
FgVideoLibraryController.java
.../fg/controller/videolibrary/FgVideoLibraryController.java
+0
-20
FgResourceManageImpl.java
...ource/fg/manage/resourcelibrary/FgResourceManageImpl.java
+1
-1
FgResourceRelationServiceImpl.java
...qx/resource/fg/service/FgResourceRelationServiceImpl.java
+2
-2
FgCourseLibrarySerivceImpl.java
.../fg/service/courselibrary/FgCourseLibrarySerivceImpl.java
+4
-4
FgRecordServiceImpl.java
.../zrqx/resource/fg/service/record/FgRecordServiceImpl.java
+2
-4
没有找到文件。
app/resource/src/main/java/com/zrqx/resource/bg/controller/courselibrary/CourseLibraryController.java
浏览文件 @
eb364cf0
...
...
@@ -3,7 +3,6 @@ package com.zrqx.resource.bg.controller.courselibrary;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -21,26 +20,27 @@ import com.zrqx.core.exception.BaseException;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.util.response.CallBack
;
import
com.zrqx.resource.bg.service.ResourceRelationService
;
import
com.zrqx.resource.bg.service.courselibrary.CourseLibraryDiyTypeService
;
import
com.zrqx.resource.bg.service.courselibrary.CourseLibraryLabelContentDiyTypeService
;
import
com.zrqx.resource.bg.service.courselibrary.CourseLibraryService
;
import
com.zrqx.resource.bg.service.recommend.RecommendResourceService
;
import
com.zrqx.resource.bg.service.videolibrary.VideoLibraryService
;
import
com.zrqx.resource.commons.form.bg.courselibrary.BatchUpdateCourseLibraryForm
;
import
com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseAndVideoForm
;
import
com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseLibraryForm
;
import
com.zrqx.resource.commons.form.bg.courselibrary.SaveUpdateCourseLibraryForm
;
import
com.zrqx.resource.commons.form.bg.recommend.UpdateRecommendResourceForm
;
import
com.zrqx.resource.commons.model.courcelibrary.CourseLibrary
;
import
com.zrqx.resource.commons.model.courcelibrary.CourseLibraryDiyType
;
import
com.zrqx.resource.commons.model.courcelibrary.CourseLibraryLabelContentDiyType
;
import
com.zrqx.resource.commons.model.videolibrary.VideoLibrary
;
import
com.zrqx.resource.commons.vo.bg.courselibrary.CourseLibraryListVO
;
import
com.zrqx.resource.commons.vo.bg.courselibrary.CourseLibraryVO
;
import
com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example.Criteria
;
/**
* 视频库Controller
...
...
@@ -55,50 +55,25 @@ public class CourseLibraryController {
@Autowired
private
CourseLibraryDiyTypeService
courseLibraryDiyTypeService
;
@Autowired
private
CourseLibraryLabelContentDiyTypeService
courseLibraryLabelContentDiyTypeService
;
@Autowired
private
ResourceRelationService
resourceRelationService
;
@Autowired
private
RecommendResourceService
recommendResourceService
;
@Autowired
private
VideoLibraryService
videoLibraryService
;
@ApiOperation
(
value
=
"新增
"
,
notes
=
"新增一个
"
)
@ApiOperation
(
value
=
"新增
/修改 系列课资源"
,
notes
=
"新增/修改 系列课资源
"
)
@PostMapping
(
value
=
"/save"
)
public
CallBack
<
Boolean
>
save
(
@RequestBody
SaveUpdateCourseLibraryForm
form
){
if
(!
service
.
saveOrUpdate
(
form
)){
throw
new
BaseException
(
"操作失败"
);
}
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"更新"
,
notes
=
"根据ID更新"
)
@PostMapping
(
value
=
"/update"
)
public
CallBack
<
Boolean
>
update
(
@RequestBody
SaveUpdateCourseLibraryForm
form
){
if
(!
service
.
saveOrUpdate
(
form
)){
throw
new
BaseException
(
"操作失败"
);
}
if
(
StringUtils
.
isNotBlank
(
form
.
getId
()))
{
CourseLibrary
entity
=
service
.
selectByPrimaryKey
(
form
.
getId
());
//推荐位内容修改
UpdateRecommendResourceForm
res
=
new
UpdateRecommendResourceForm
();
res
.
setResId
(
form
.
getId
());
res
.
setResType
(
entity
.
getResourceType
());
res
.
setResImg
(
form
.
getCover
());
res
.
setResImg
(
form
.
getImg
());
res
.
setResName
(
form
.
getName
());
recommendResourceService
.
updateResourceContent
(
res
);
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"批量审核"
,
notes
=
"批量审核"
)
@PostMapping
(
value
=
"/batch/update/status"
)
public
CallBack
<
Boolean
>
updateArray
(
@RequestBody
List
<
String
>
ids
)
{
Example
example
=
service
.
createExample
();
example
.
createCriteria
().
andIn
(
"id"
,
ids
);
CourseLibrary
entity
=
new
CourseLibrary
();
entity
.
setUpdateTime
(
new
Date
());
entity
.
setStatus
(
LibraryStatusEnum
.
STATUS_1
.
getCode
());
if
(!
service
.
UpdateByExampleSelective
(
entity
,
example
))
{
throw
new
BaseException
(
"操作失败"
);
}
return
CallBack
.
success
();
}
...
...
@@ -109,7 +84,12 @@ public class CourseLibraryController {
Example
example
=
service
.
createExample
();
example
.
createCriteria
().
andIn
(
"id"
,
form
.
getIds
());
CourseLibrary
entity
=
new
CourseLibrary
();
entity
.
setPriceOption
(
form
.
getPriceOption
());
if
(
PriceOptionEnum
.
STATUS_0
.
getCode
().
equals
(
form
.
getPriceOption
()))
{
form
.
setRealPrice
(
new
BigDecimal
(
0
));
}
entity
.
setRealPrice
(
form
.
getRealPrice
());
entity
.
setPrice
(
form
.
getPrice
());
entity
.
setUpdateTime
(
new
Date
());
if
(!
service
.
UpdateByExampleSelective
(
entity
,
example
))
{
throw
new
BaseException
(
"操作失败"
);
...
...
@@ -121,14 +101,8 @@ public class CourseLibraryController {
@PostMapping
(
value
=
"/batch/update/updown"
)
public
CallBack
<
Boolean
>
updateShowState
(
@RequestBody
BatchUpdateCourseLibraryForm
form
){
Example
example
=
service
.
createExample
();
example
.
createCriteria
().
andIn
(
"id"
,
form
.
getIds
());
List
<
CourseLibrary
>
list
=
service
.
selectByExample
(
example
);
for
(
CourseLibrary
entity
:
list
)
{
if
(
entity
.
getStatus
()
==
LibraryStatusEnum
.
STATUS_0
.
getCode
()){
throw
new
BaseException
(
"待审核状态的课程不能直接操作上架状态需通过批量审核操作上架"
);
}
}
CourseLibrary
entity
=
new
CourseLibrary
();
example
.
createCriteria
().
andIn
(
"id"
,
form
.
getIds
());
entity
.
setStatus
(
form
.
getStatus
());
entity
.
setUpdateTime
(
new
Date
());
if
(!
service
.
UpdateByExampleSelective
(
entity
,
example
)){
...
...
@@ -162,14 +136,6 @@ public class CourseLibraryController {
List
<
CourseLibraryDiyType
>
list
=
courseLibraryDiyTypeService
.
selectByExample
(
example
);
//组装自定义分类
vo
.
setDiyType
(
list
);
//组装标签分类
example
=
courseLibraryLabelContentDiyTypeService
.
createExample
();
example
.
createCriteria
().
andEqualTo
(
"courseLibraryId"
,
oid
);
List
<
CourseLibraryLabelContentDiyType
>
vlcdList
=
courseLibraryLabelContentDiyTypeService
.
selectByExample
(
example
);
vo
.
setLabel
(
vlcdList
);
// 选中的LabelContentDiyTypeId
List
<
Integer
>
labelContentDiyTypeIds
=
vlcdList
.
stream
().
map
(
CourseLibraryLabelContentDiyType
::
getLabelContentDiyTypeId
).
collect
(
Collectors
.
toList
());
vo
.
setLabelContentDiyTypeIds
(
labelContentDiyTypeIds
);
return
CallBack
.
success
(
vo
);
}
...
...
@@ -180,18 +146,96 @@ public class CourseLibraryController {
}
/**
*
修改视频价格为免费,id集合
* @param
ids
* @
param status
* @author
ycw
* @date
: 2019年8月1日 下午3:09:5
0
*
相关资源列表
* @param
form 分页条件
* @
return
* @author
xjg
* @date
2018年9月11日 上午10:20:3
0
*/
private
void
updateVideoPrice
(
List
<
String
>
ids
){
Example
example
=
videoLibraryService
.
createExample
();
example
.
createCriteria
().
andIn
(
"bookId"
,
ids
);
VideoLibrary
video
=
new
VideoLibrary
();
video
.
setPriceOption
(
PriceOptionEnum
.
STATUS_0
.
getCode
()
);
video
.
setRealPrice
(
new
BigDecimal
(
0
));
videoLibraryService
.
UpdateByExampleSelective
(
video
,
example
);
@ApiOperation
(
"相关视频资源列表"
)
@GetMapping
(
value
=
"/relation-resource/page"
)
public
CallBack
<
PageInfo
<
VideoLibraryListVO
>>
videoRelationPage
(
String
courseId
,
PageParam
pageParam
)
{
if
(
StringUtils
.
isBlank
(
courseId
))
{
throw
new
BaseException
(
"必须指定courseId"
);
}
return
CallBack
.
success
(
service
.
videoRelationPage
(
courseId
,
pageParam
)
);
}
/**
* 修改视频序号
* @param videoId 视频id
* @param sort 排序号
* @return
* @author xjg
* @date 2018年9月11日 上午10:21:22
*/
@ApiOperation
(
value
=
"修改相关视频资源序号"
,
notes
=
"修改相关视频资源序号"
)
@PostMapping
(
value
=
"/update/relation-resource/sort"
)
public
CallBack
<
Boolean
>
updateSort
(
String
videoId
,
Integer
sort
)
{
VideoLibrary
video
=
videoLibraryService
.
selectByPrimaryKey
(
videoId
);
if
(
video
==
null
)
{
throw
new
BaseException
(
"视频不存在"
);
}
video
.
setSort
(
sort
);
video
.
setUpdateTime
(
new
Date
());
if
(!
videoLibraryService
.
updateByPrimaryKey
(
video
))
{
throw
new
BaseException
(
"修改相关视频资源序号失败!"
);
}
return
CallBack
.
success
();
}
/**
* 批量取消视频关联
* @param ids 视频id数组
* @param courseId 课程id
* @return
* @author xjg
* @date 2018年9月11日 上午10:22:27
*/
@ApiOperation
(
value
=
"取消视频关联"
,
notes
=
"批量取消视频关联"
)
@PostMapping
(
value
=
"/batch/delete/relation-resource"
)
public
CallBack
<
Boolean
>
deleteByVideoIds
(
@RequestBody
List
<
String
>
videoIds
)
{
Example
example
=
new
Example
(
VideoLibrary
.
class
);
example
.
createCriteria
().
andIn
(
"id"
,
videoIds
);
List
<
VideoLibrary
>
list
=
videoLibraryService
.
selectByExample
(
example
);
list
.
forEach
(
f
->
{
f
.
setCourseId
(
null
);
videoLibraryService
.
updateByPrimaryKey
(
f
);
});
return
CallBack
.
success
();
}
/**
* 选择弹窗中的列表
* @param form 选择弹窗中列表的条件
* @return 选择弹窗中的视频集合
* @author xjg
* @date 2018年9月11日 上午10:24:08
*/
@ApiOperation
(
value
=
"选择弹窗中的列表"
,
notes
=
"查询选择弹窗中的列表"
)
@GetMapping
(
value
=
"/relation-resource/pop/page"
)
public
CallBack
<
PageInfo
<
VideoLibraryListVO
>>
popPage
(
QueryCourseAndVideoForm
form
,
PageParam
pageParam
)
{
return
CallBack
.
success
(
service
.
popPage
(
form
,
pageParam
));
}
/**
* 保存相关资源
* @param videoIds 视频id数组
* @param courseId 课程id
* @return
* @author xjg
* @date 2018年9月11日 上午10:25:50
*/
@ApiOperation
(
value
=
"保存相关资源"
,
notes
=
"保存相关资源"
)
@PostMapping
(
value
=
"/save/relation-resource"
)
public
CallBack
<
Boolean
>
saveRelation
(
@RequestBody
List
<
String
>
videoIds
,
String
courseId
)
{
Example
example
=
new
Example
(
VideoLibrary
.
class
);
example
.
createCriteria
().
andIn
(
"id"
,
videoIds
);
VideoLibrary
videoLibrary
=
new
VideoLibrary
();
videoLibrary
.
setCourseId
(
courseId
);
videoLibrary
.
setUpdateTime
(
new
Date
());
videoLibraryService
.
UpdateByExampleSelective
(
videoLibrary
,
example
);
return
CallBack
.
success
();
}
}
app/resource/src/main/java/com/zrqx/resource/bg/controller/videolibrary/VideoLibraryController.java
浏览文件 @
eb364cf0
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
;
...
...
@@ -17,26 +17,21 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
com.zrqx.core.enums.resource.LibraryStatusEnum
;
import
com.zrqx.core.enums.resource.PriceOptionEnum
;
import
com.zrqx.core.exception.BaseException
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.util.response.CallBack
;
import
com.zrqx.resource.bg.service.ResourceRelationService
;
import
com.zrqx.resource.bg.service.marketing.PromotionContentService
;
import
com.zrqx.resource.bg.service.recommend.RecommendResourceService
;
import
com.zrqx.resource.bg.service.videolibrary.VideoLibraryDiyTypeService
;
import
com.zrqx.resource.bg.service.videolibrary.VideoLibraryLabelContentDiyTypeService
;
import
com.zrqx.resource.bg.service.videolibrary.VideoLibraryService
;
import
com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm
;
import
com.zrqx.resource.commons.form.bg.recommend.UpdateRecommendResourceForm
;
import
com.zrqx.resource.commons.form.bg.videolibrary.BatchUpdateVideoLibraryForm
;
import
com.zrqx.resource.commons.form.bg.videolibrary.QueryVideoLibraryForm
;
import
com.zrqx.resource.commons.form.bg.videolibrary.SaveUpdateVideoLibraryForm
;
import
com.zrqx.resource.commons.form.bg.videolibrary.SaveVideoLibraryForm
;
import
com.zrqx.resource.commons.model.marketing.PromotionContent
;
import
com.zrqx.resource.commons.model.videolibrary.VideoLibrary
;
import
com.zrqx.resource.commons.model.videolibrary.VideoLibraryDiyType
;
import
com.zrqx.resource.commons.model.videolibrary.VideoLibraryLabelContentDiyType
;
import
com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO
;
import
com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryOneVO
;
...
...
@@ -56,58 +51,40 @@ public class VideoLibraryController {
private
VideoLibraryService
service
;
@Autowired
private
VideoLibraryDiyTypeService
vdrService
;
@Autowired
private
ResourceRelationService
resourceRelationService
;
/** 推荐位内容*/
@Autowired
private
RecommendResourceService
recommendResourceService
;
/** 促销内容*/
@Autowired
private
PromotionContentService
promotionContentService
;
@Autowired
private
VideoLibraryLabelContentDiyTypeService
alcdService
;
@ApiOperation
(
value
=
"新增
"
,
notes
=
"新增一个
"
)
@ApiOperation
(
value
=
"新增
/修改 视频资源"
,
notes
=
"新增/修改 视频资源
"
)
@PostMapping
(
value
=
"/save"
)
public
CallBack
<
Boolean
>
save
(
@RequestBody
SaveUpdateVideoLibraryForm
form
){
if
(!
service
.
saveOrUpdate
(
form
)){
throw
new
BaseException
(
"操作失败"
);
}
if
(
StringUtils
.
isNotBlank
(
form
.
getId
()))
{
VideoLibrary
entity
=
service
.
selectByPrimaryKey
(
form
.
getId
());
//推荐位内容修改
UpdateRecommendResourceForm
res
=
new
UpdateRecommendResourceForm
();
res
.
setResId
(
form
.
getId
());
res
.
setResType
(
entity
.
getResourceType
());
res
.
setResImg
(
form
.
getImg
());
res
.
setResName
(
form
.
getName
());
recommendResourceService
.
updateResourceContent
(
res
);
}
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"导入视频"
,
notes
=
"导入视频"
)
@PostMapping
(
value
=
"/import"
)
public
CallBack
<
Boolean
>
save
(
@RequestBody
SaveVideoLibraryForm
form
){
public
CallBack
<
Boolean
>
save
(
@RequestBody
List
<
SaveVideoLibraryForm
>
form
){
if
(!
service
.
batchInsert
(
form
)){
throw
new
BaseException
(
"操作失败"
);
}
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"更新"
,
notes
=
"根据ID更新"
)
@PostMapping
(
value
=
"/update"
)
public
CallBack
<
Boolean
>
update
(
@RequestBody
SaveUpdateVideoLibraryForm
form
){
if
(!
service
.
saveOrUpdate
(
form
)){
throw
new
BaseException
(
"操作失败"
);
}
VideoLibrary
entity
=
service
.
selectByPrimaryKey
(
form
.
getId
());
//促销活动内容修改
PromotionContent
con
=
new
PromotionContent
();
con
.
setResourceId
(
form
.
getId
());
con
.
setResourceType
(
entity
.
getResourceType
());
con
.
setName
(
form
.
getName
());
promotionContentService
.
updateContent
(
con
);
//推荐位内容修改
UpdateRecommendResourceForm
res
=
new
UpdateRecommendResourceForm
();
res
.
setResId
(
form
.
getId
());
res
.
setResType
(
entity
.
getResourceType
());
res
.
setResImg
(
form
.
getCover
());
res
.
setResName
(
form
.
getName
());
recommendResourceService
.
updateResourceContent
(
res
);
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"批量修改分类"
,
notes
=
"批量修改分类"
)
@PostMapping
(
value
=
"/batch/update/diytype"
)
...
...
@@ -129,13 +106,19 @@ public class VideoLibraryController {
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"批量修改
价格"
,
notes
=
"批量修改价格
"
)
@ApiOperation
(
value
=
"批量修改
销售设置"
,
notes
=
"批量修改销售设置
"
)
@PostMapping
(
value
=
"/batch/update/price"
)
public
CallBack
<
Boolean
>
updatePrice
(
@RequestBody
BatchUpdateVideoLibraryForm
form
){
Example
example
=
service
.
createExample
();
example
.
createCriteria
().
andIn
(
"id"
,
form
.
getIds
());
VideoLibrary
entity
=
new
VideoLibrary
();
if
(
PriceOptionEnum
.
STATUS_0
.
getCode
().
equals
(
form
.
getPriceOption
()))
{
form
.
setRealPrice
(
new
BigDecimal
(
0
));
}
entity
.
setRealPrice
(
form
.
getRealPrice
());
entity
.
setPrice
(
form
.
getPrice
());
entity
.
setPriceOption
(
form
.
getPriceOption
());
entity
.
setSalesType
(
form
.
getSaleType
());
entity
.
setUpdateTime
(
new
Date
());
if
(!
service
.
UpdateByExampleSelective
(
entity
,
example
)){
throw
new
BaseException
(
"操作失败"
);
...
...
@@ -143,37 +126,20 @@ public class VideoLibraryController {
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"批量审核"
,
notes
=
"批量审核"
)
@PostMapping
(
value
=
"/batch/update/status"
)
public
CallBack
<
Boolean
>
updateArray
(
@RequestBody
List
<
String
>
ids
)
{
Example
example
=
service
.
createExample
();
example
.
createCriteria
().
andIn
(
"id"
,
ids
);
VideoLibrary
entity
=
new
VideoLibrary
();
entity
.
setUpdateTime
(
new
Date
());
entity
.
setStatus
(
LibraryStatusEnum
.
STATUS_1
.
getCode
());
if
(!
service
.
UpdateByExampleSelective
(
entity
,
example
))
{
throw
new
BaseException
(
"操作失败"
);
}
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"批量 上架/下架"
,
notes
=
"批量 上架/下架"
)
@PostMapping
(
value
=
"/batch/update/updown"
)
public
CallBack
<
Boolean
>
updateShowState
(
@RequestBody
BatchUpdateVideoLibraryForm
form
){
Example
example
=
service
.
createExample
();
example
.
createCriteria
().
andIn
(
"id"
,
form
.
getIds
());
List
<
VideoLibrary
>
list
=
service
.
selectByExample
(
example
);
for
(
VideoLibrary
entity
:
list
)
{
if
(
entity
.
getStatus
()
==
LibraryStatusEnum
.
STATUS_0
.
getCode
()){
throw
new
BaseException
(
"待审核状态的文章不能直接操作上架状态需通过批量审核操作上架"
);
}
}
VideoLibrary
entity
=
new
VideoLibrary
();
entity
.
setStatus
(
form
.
getStatus
());
entity
.
setUpdateTime
(
new
Date
());
if
(!
service
.
UpdateByExampleSelective
(
entity
,
example
)){
throw
new
BaseException
(
"操作失败"
);
list
.
forEach
(
f
->
{
f
.
setStatus
(
form
.
getStatus
());
f
.
setUpdateTime
(
new
Date
());
if
(
LibraryStatusEnum
.
STATUS_2
.
getCode
().
equals
(
form
.
getStatus
()))
{
f
.
setCourseId
(
null
);
}
service
.
updateByPrimaryKey
(
f
);
});
return
CallBack
.
success
();
}
...
...
@@ -189,6 +155,7 @@ public class VideoLibraryController {
}
return
CallBack
.
success
(
true
);
}
@ApiOperation
(
value
=
"批量删除"
,
notes
=
"批量删除"
)
@PostMapping
(
value
=
"/batch/delete"
)
public
CallBack
<
Boolean
>
deleteByIds
(
@RequestBody
List
<
String
>
ids
)
{
...
...
@@ -217,14 +184,6 @@ public class VideoLibraryController {
List
<
VideoLibraryDiyType
>
list
=
vdrService
.
selectByExample
(
example
);
//组装自定义分类
vo
.
setDiyType
(
list
);
//组装标签分类
example
=
alcdService
.
createExample
();
example
.
createCriteria
().
andEqualTo
(
"videoId"
,
oid
);
List
<
VideoLibraryLabelContentDiyType
>
vlcdList
=
alcdService
.
selectByExample
(
example
);
vo
.
setLabel
(
vlcdList
);
// 选中的LabelContentDiyTypeId
List
<
Integer
>
labelContentDiyTypeIds
=
vlcdList
.
stream
().
map
(
VideoLibraryLabelContentDiyType
::
getLabelContentDiyTypeId
).
collect
(
Collectors
.
toList
());
vo
.
setLabelContentDiyTypeIds
(
labelContentDiyTypeIds
);
return
CallBack
.
success
(
vo
);
}
...
...
@@ -234,22 +193,4 @@ public class VideoLibraryController {
return
CallBack
.
success
(
service
.
page
(
form
,
pageParam
));
}
@ApiOperation
(
value
=
"选择弹窗中的列表"
,
notes
=
"查询选择弹窗中的列表"
)
@GetMapping
(
value
=
"/relation-resource/pop-page"
)
public
CallBack
<
PageInfo
<
VideoLibraryListVO
>>
page
(
QueryResourceForPoPForm
form
,
PageParam
pageParam
){
return
CallBack
.
success
(
service
.
pageByTitleAndDiyType
(
form
,
pageParam
));
}
@ApiOperation
(
value
=
"批量修改阅读权限"
,
notes
=
"批量修改阅读权限"
)
@PostMapping
(
value
=
"/batch/update/read"
)
public
CallBack
<
Boolean
>
updateReadTextPower
(
@RequestBody
BatchUpdateVideoLibraryForm
form
)
{
Example
example
=
service
.
createExample
();
example
.
createCriteria
().
andIn
(
"id"
,
form
.
getIds
());
VideoLibrary
entity
=
new
VideoLibrary
();
entity
.
setReadTextPower
(
form
.
getReadTextPower
());
if
(!
service
.
UpdateByExampleSelective
(
entity
,
example
))
{
throw
new
BaseException
(
"操作失败"
);
}
return
CallBack
.
success
();
}
}
app/resource/src/main/java/com/zrqx/resource/bg/mapper/courselibrary/CourseLibraryMapper.java
浏览文件 @
eb364cf0
...
...
@@ -8,16 +8,18 @@ import org.apache.ibatis.annotations.Select;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm
;
import
com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseAndVideoForm
;
import
com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseLibraryForm
;
import
com.zrqx.resource.commons.model.courcelibrary.CourseLibrary
;
import
com.zrqx.resource.commons.vo.bg.courselibrary.CourseLibraryListVO
;
import
com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO
;
/**
* 课程库
*/
public
interface
CourseLibraryMapper
extends
BaseMapper
<
CourseLibrary
>
{
@Select
(
"<script>"
+
"select a.id,a.name,a.author,a.
source,a.cover,a.realPrice,DATE_FORMAT(a.authorizationTime,'%Y-%m-%d %H:%i:%s') authorizationTime, DATE_FORMAT(a.uploadTime,'%Y-%m-%d %H:%i:%s
') uploadTime,a.status,a.resourceType "
+
"select a.id,a.name,a.author,a.
img,a.realPrice, DATE_FORMAT(a.uploadTime,'%Y-%m-%d %H:%i
') uploadTime,a.status,a.resourceType "
+
"from res_Course_Library a left join res_Course_Library_Diy_Type ad "
+
"on a.id = ad.CourseLibraryId "
+
"where 1=1 "
...
...
@@ -54,4 +56,30 @@ public interface CourseLibraryMapper extends BaseMapper<CourseLibrary> {
+
"</if>"
+
"</script>"
)
List
<
CourseLibraryListVO
>
queryByTileAndDiyType
(
@Param
(
"form"
)
QueryResourceForPoPForm
form
);
/**
* 根据课程id查询关联视频
* @param courseId
* @return
*/
@Select
(
"<script>"
+
"select id,name,timeLength,sort,status from res_video_library "
+
" where 1 = 1 and status = 1 and courseId = #{courseId}"
+
" order by sort asc,uploadTime desc "
+
"</script>"
)
List
<
VideoLibraryListVO
>
videoRelationPage
(
@Param
(
"courseId"
)
String
courseId
);
/**
* 查询未关联视频列表
* @param form
* @return
*/
@Select
(
"<script>"
+
" select id,name,author,DATE_FORMAT(uploadTime,'%Y-%m-%d %H:%i') uploadTime,status from res_video_library "
+
" where 1 = 1 and status = 1 and courseId is null and salesType = 2 "
+
" like(name,form.name) "
+
" like(author,form.author) "
+
" order by uploadTime desc "
+
"</script>"
)
List
<
VideoLibraryListVO
>
popPage
(
@Param
(
"form"
)
QueryCourseAndVideoForm
form
);
}
app/resource/src/main/java/com/zrqx/resource/bg/mapper/videolibrary/VideoLibraryMapper.java
浏览文件 @
eb364cf0
...
...
@@ -16,12 +16,10 @@ import com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO;
*/
public
interface
VideoLibraryMapper
extends
BaseMapper
<
VideoLibrary
>
{
@Select
(
"<script>"
+
"select a.id,a.name,a.
source,a.bookName,a.realprice,a.timeLength,a.size,a.uploadTime,a.status
"
+
"select a.id,a.name,a.
realprice, DATE_FORMAT(a.uploadTime,'%Y-%m-%d %H:%i') uploadTime,a.status,a.img,a.defaultImg,a.author
"
+
"from res_Video_Library a left join res_Video_Library_Diy_Type ad "
+
"on a.id = ad.vlid "
+
"where 1=1 "
+
" eq(a.nationsType,form.nationsType) "
+
" like(ad.code,form.diyTypeCode) "
/*+ "<if test='form.diyTypeId != null and form.diyTypeId.size > 0'>"
...
...
@@ -32,7 +30,6 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
+ "</if>" */
+
" like(a.name,form.name) "
+
" like(a.bookName,form.bookName) "
+
" eq(a.status,form.status) "
//+ "<if test = '" + NOTBLANK + "(form.beginTime)'>"
...
...
@@ -47,15 +44,12 @@ public interface VideoLibraryMapper extends BaseMapper<VideoLibrary> {
List
<
VideoLibraryListVO
>
query
(
@Param
(
"form"
)
QueryVideoLibraryForm
form
);
@Select
(
"<script>"
+
"select a.id,a.name,a.source,a.author,a.bookName,a.price,a.timeLength,a.size,a.uploadTime,a.status,a.
cover
"
+
"select a.id,a.name,a.source,a.author,a.bookName,a.price,a.timeLength,a.size,a.uploadTime,a.status,a.
img,a.defautImg
"
+
"from res_Video_Library a left join res_Video_Library_Diy_Type ad "
+
"on a.id = ad.vlid "
+
"where 1=1 and a.status = 1 "
+
" eq(a.nationsType,form.nationsType) "
+
" like(ad.code,form.diyTypeCode) "
+
" like(a.name,form.name) "
+
"<if test='form.ids != null and form.ids.size > 0'>"
+
"and a.id not in "
+
" <foreach collection=\"form.ids\" index=\"index\" item=\"id\" open=\"(\" separator=\",\" close=\")\">"
...
...
app/resource/src/main/java/com/zrqx/resource/bg/service/courselibrary/CourseLibrarySerivceImpl.java
浏览文件 @
eb364cf0
...
...
@@ -3,7 +3,6 @@ package com.zrqx.resource.bg.service.courselibrary;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -27,7 +26,9 @@ import com.zrqx.resource.bg.mapper.membercollection.MemberCollectionMapper;
import
com.zrqx.resource.bg.mapper.recommend.RecommendResourceMapper
;
import
com.zrqx.resource.bg.mapper.record.RecordMapper
;
import
com.zrqx.resource.bg.mapper.shoppingcart.ShoppingCartMapper
;
import
com.zrqx.resource.bg.mapper.videolibrary.VideoLibraryMapper
;
import
com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm
;
import
com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseAndVideoForm
;
import
com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseLibraryForm
;
import
com.zrqx.resource.commons.form.bg.courselibrary.SaveUpdateCourseLibraryForm
;
import
com.zrqx.resource.commons.model.courcelibrary.CourseLibrary
;
...
...
@@ -37,7 +38,9 @@ import com.zrqx.resource.commons.model.membercollection.MemberCollection;
import
com.zrqx.resource.commons.model.record.Record
;
import
com.zrqx.resource.commons.model.resourcerelation.ResourceRelation
;
import
com.zrqx.resource.commons.model.shoppingcart.ShoppingCart
;
import
com.zrqx.resource.commons.model.videolibrary.VideoLibrary
;
import
com.zrqx.resource.commons.vo.bg.courselibrary.CourseLibraryListVO
;
import
com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO
;
import
tk.mybatis.mapper.entity.Example
;
...
...
@@ -52,7 +55,7 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
@Autowired
private
CourseLibraryDiyTypeMapper
courseLibraryDiyTypeMapper
;
@Autowired
private
CourseLibraryLabelContentDiyTypeMapper
courseLibraryLabelContentDiyType
Mapper
;
private
VideoLibraryMapper
video
Mapper
;
@Autowired
private
RecommendResourceMapper
recommendResourceMapper
;
@Autowired
...
...
@@ -89,10 +92,11 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
}
if
(
entity
.
getId
()
==
null
){
//添加
entity
.
setStatus
(
LibraryStatusEnum
.
STATUS_
0
.
getCode
());
entity
.
setStatus
(
LibraryStatusEnum
.
STATUS_
2
.
getCode
());
entity
.
setUploadTime
(
new
Date
());
entity
.
setResourceType
(
AllResourceTypeEnum
.
COURSE
.
getCode
());
entity
.
setBrowseNum
(
50
);
entity
.
setBrowseNum
(
0
);
entity
.
setSalesNum
(
0
);
mapper
.
insert
(
entity
);
}
else
{
//修改
...
...
@@ -102,9 +106,6 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
CourseLibraryDiyType
old
=
new
CourseLibraryDiyType
();
old
.
setCourseLibraryId
(
entity
.
getId
());
courseLibraryDiyTypeMapper
.
delete
(
old
);
CourseLibraryLabelContentDiyType
alcdy
=
new
CourseLibraryLabelContentDiyType
();
alcdy
.
setCourseLibraryId
(
entity
.
getId
());
courseLibraryLabelContentDiyTypeMapper
.
delete
(
alcdy
);
}
//添加当前对象与自定义分类的关系
if
(
form
.
getDiyType
()
!=
null
&&
form
.
getDiyType
().
size
()
>
0
){
...
...
@@ -112,14 +113,6 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
list
.
forEach
(
li
->
li
.
setCourseLibraryId
(
entity
.
getId
()));
courseLibraryDiyTypeMapper
.
insertList
(
list
);
}
//添加与标签的关系
if
(
form
.
getLabel
()
!=
null
&&
form
.
getLabel
().
size
()
>
0
){
List
<
CourseLibraryLabelContentDiyType
>
aldcdList
=
form
.
getLabel
().
stream
().
filter
(
f
->
f
.
getLabelId
()
!=
null
).
collect
(
Collectors
.
toList
());
aldcdList
.
stream
().
forEach
(
li
->
li
.
setCourseLibraryId
(
entity
.
getId
()));
if
(!
aldcdList
.
isEmpty
()){
courseLibraryLabelContentDiyTypeMapper
.
insertList
(
aldcdList
);
}
}
return
true
;
}
...
...
@@ -148,9 +141,6 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
example
=
new
Example
(
CourseLibraryDiyType
.
class
);
example
.
createCriteria
().
andIn
(
"courseLibraryId"
,
ids
);
courseLibraryDiyTypeMapper
.
deleteByExample
(
example
);
example
=
new
Example
(
CourseLibraryLabelContentDiyType
.
class
);
example
.
createCriteria
().
andIn
(
"courseLibraryId"
,
ids
);
courseLibraryLabelContentDiyTypeMapper
.
deleteByExample
(
example
);
//这里需要级联删除其他接口关联资源
//----推荐位内容
recommendResourceMapper
.
delectByResourceIds
(
ids
,
AllResourceTypeEnum
.
COURSE
.
getCode
());
...
...
@@ -183,13 +173,15 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
PageParam
pageParam
)
{
startPage
(
pageParam
);
List
<
CourseLibraryListVO
>
list
=
mapper
.
query
(
form
);
ResourceRelation
resourceRelation
=
new
ResourceRelation
();
VideoLibrary
videoLibrary
=
new
VideoLibrary
();
list
.
forEach
(
f
->
{
f
.
setStatus_zh
(
LibraryStatusEnum
.
getName
(
f
.
getStatus
()));
// 视频数量
resourceRelation
.
setObjectId
(
f
.
getId
());
int
videoNum
=
resourceRelationMapper
.
selectCount
(
resourceRelation
);
videoLibrary
.
setCourseId
(
f
.
getId
());
videoLibrary
.
setStatus
(
LibraryStatusEnum
.
STATUS_1
.
getCode
());
int
videoNum
=
videoMapper
.
selectCount
(
videoLibrary
);
f
.
setVideoNum
(
videoNum
);
if
(
f
.
getStatus
()
!=
null
)
{
f
.
setStatus_zh
(
LibraryStatusEnum
.
getName
(
f
.
getStatus
()));
}
});
return
new
PageInfo
<
CourseLibraryListVO
>(
list
);
}
...
...
@@ -209,4 +201,34 @@ public class CourseLibrarySerivceImpl extends BaseServiceImpl<CourseLibrary,Stri
return
new
PageInfo
<
CourseLibraryListVO
>(
list
);
}
/**
* 根据课程id查询视频资源
*/
@Override
public
PageInfo
<
VideoLibraryListVO
>
videoRelationPage
(
String
courseId
,
PageParam
pageParam
)
{
startPage
(
pageParam
);
List
<
VideoLibraryListVO
>
list
=
mapper
.
videoRelationPage
(
courseId
);
list
.
forEach
(
f
->
{
if
(
f
.
getStatus
()
!=
null
)
{
f
.
setStatus_zh
(
LibraryStatusEnum
.
getName
(
f
.
getStatus
()));
}
});
return
new
PageInfo
<
VideoLibraryListVO
>(
list
);
}
/**
* 查询未关联视频资源
*/
@Override
public
PageInfo
<
VideoLibraryListVO
>
popPage
(
QueryCourseAndVideoForm
form
,
PageParam
pageParam
)
{
startPage
(
pageParam
);
List
<
VideoLibraryListVO
>
list
=
mapper
.
popPage
(
form
);
list
.
forEach
(
f
->
{
if
(
f
.
getStatus
()
!=
null
)
{
f
.
setStatus_zh
(
LibraryStatusEnum
.
getName
(
f
.
getStatus
()));
}
});
return
new
PageInfo
<
VideoLibraryListVO
>(
list
);
}
}
app/resource/src/main/java/com/zrqx/resource/bg/service/courselibrary/CourseLibraryService.java
浏览文件 @
eb364cf0
...
...
@@ -6,10 +6,12 @@ import com.zrqx.core.service.BaseService;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.resource.commons.form.bg.QueryResourceForPoPForm
;
import
com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseAndVideoForm
;
import
com.zrqx.resource.commons.form.bg.courselibrary.QueryCourseLibraryForm
;
import
com.zrqx.resource.commons.form.bg.courselibrary.SaveUpdateCourseLibraryForm
;
import
com.zrqx.resource.commons.model.courcelibrary.CourseLibrary
;
import
com.zrqx.resource.commons.vo.bg.courselibrary.CourseLibraryListVO
;
import
com.zrqx.resource.commons.vo.bg.videolibrary.VideoLibraryListVO
;
/**
* 专题库
*/
...
...
@@ -48,4 +50,17 @@ public interface CourseLibraryService extends BaseService<CourseLibrary,String>{
* @date: 2019年1月3日 下午7:12:29
*/
PageInfo
<
CourseLibraryListVO
>
pageByTitleAndDiyType
(
QueryResourceForPoPForm
form
,
PageParam
pageParam
);
/**
* 相关视频资源
* @param courseId
* @param pageParam
* @return
*/
PageInfo
<
VideoLibraryListVO
>
videoRelationPage
(
String
courseId
,
PageParam
pageParam
);
/**
* 关联视频弹窗列表
*/
PageInfo
<
VideoLibraryListVO
>
popPage
(
QueryCourseAndVideoForm
form
,
PageParam
pageParam
);
}
app/resource/src/main/java/com/zrqx/resource/bg/service/videolibrary/VideoLibrarySerivceImpl.java
浏览文件 @
eb364cf0
...
...
@@ -3,7 +3,6 @@ package com.zrqx.resource.bg.service.videolibrary;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -11,8 +10,11 @@ import org.springframework.stereotype.Service;
import
com.zrqx.core.client.order.bg.OrderClient
;
import
com.zrqx.core.enums.AllResourceTypeEnum
;
import
com.zrqx.core.enums.SaleResourceTypeEnum
;
import
com.zrqx.core.enums.StatusEnum
;
import
com.zrqx.core.enums.resource.LibraryStatusEnum
;
import
com.zrqx.core.enums.resource.PriceOptionEnum
;
import
com.zrqx.core.enums.resource.SalsesTypeEnum
;
import
com.zrqx.core.exception.BaseException
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.service.BaseServiceImpl
;
...
...
@@ -91,17 +93,19 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
}
}
BeanUtils
.
copyProperties
(
form
,
entity
);
if
(
StringUtils
.
isNotBlank
(
entity
.
getDefaultImg
()))
{
String
defaultImg
=
entity
.
getDefaultImg
()
+
"/"
+
entity
.
getVideo
()
+
"/1.jpg"
;
entity
.
setDefaultImg
(
defaultImg
);
}
if
(
PriceOptionEnum
.
STATUS_0
.
getCode
()
==
form
.
getPriceOption
()){
entity
.
setRealPrice
(
new
BigDecimal
(
0
));
}
if
(
entity
.
getId
()
==
null
){
//添加
entity
.
setStatus
(
LibraryStatusEnum
.
STATUS_
0
.
getCode
());
entity
.
setStatus
(
LibraryStatusEnum
.
STATUS_
2
.
getCode
());
entity
.
setUploadTime
(
new
Date
());
entity
.
setResourceType
(
AllResourceTypeEnum
.
VIDEO
.
getCode
());
entity
.
setBrowseNum
(
50
);
entity
.
setReadTextPower
(
1
);
entity
.
setClickNum
(
50
);
entity
.
setBrowseNum
(
0
);
entity
.
setSalesNum
(
0
);
mapper
.
insert
(
entity
);
}
else
{
...
...
@@ -127,14 +131,6 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
list
.
forEach
(
li
->
li
.
setVlId
(
entity
.
getId
()));
vdrMapper
.
insertList
(
list
);
}
//添加与标签的关系
if
(
form
.
getLabel
()
!=
null
&&
form
.
getLabel
().
size
()
>
0
){
List
<
VideoLibraryLabelContentDiyType
>
aldcdList
=
form
.
getLabel
().
stream
().
filter
(
f
->
f
.
getLabelId
()
!=
null
).
collect
(
Collectors
.
toList
());
aldcdList
.
stream
().
forEach
(
li
->
li
.
setVideoId
(
entity
.
getId
()));
if
(!
aldcdList
.
isEmpty
()){
alcdMapper
.
insertList
(
aldcdList
);
}
}
return
true
;
}
/**
...
...
@@ -145,38 +141,27 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
* @date: 2018年11月22日 下午2:39:13
*/
@Override
public
boolean
batchInsert
(
SaveVideoLibraryForm
form
)
{
if
(
form
.
getNames
().
size
()
!=
form
.
getVideo
().
size
())
{
throw
new
BaseException
(
"
视频数量错误
"
);
public
boolean
batchInsert
(
List
<
SaveVideoLibraryForm
>
form
)
{
if
(
form
.
isEmpty
())
{
throw
new
BaseException
(
"
请选择视频文件!
"
);
}
//循环创建视频对象
for
(
int
i
=
0
;
i
<
form
.
getNames
().
size
();
i
++)
{
VideoLibrary
obj
=
new
VideoLibrary
();
BeanUtils
.
copyProperties
(
form
,
obj
);
obj
.
setName
(
form
.
getNames
().
get
(
i
));
obj
.
setVideo
(
form
.
getVideo
().
get
(
i
));
obj
.
setVideoName
(
form
.
getVideoName
().
get
(
i
));
obj
.
setSize
(
form
.
getSize
().
get
(
i
));
obj
.
setFormats
(
form
.
getFormats
().
get
(
i
));
obj
.
setTimeLength
(
form
.
getTimeLength
().
get
(
i
));
obj
.
setUploadTime
(
new
Date
());
obj
.
setStatus
(
LibraryStatusEnum
.
STATUS_0
.
getCode
());
obj
.
setResourceType
(
AllResourceTypeEnum
.
VIDEO
.
getCode
());
obj
.
setBrowseNum
(
50
);
obj
.
setReadTextPower
(
1
);
obj
.
setClickNum
(
50
);
obj
.
setSalesNum
(
0
);
obj
.
setVideoName
(
form
.
getNames
().
get
(
i
));
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
);
form
.
forEach
(
f
->
{
VideoLibrary
videoLibrary
=
new
VideoLibrary
();
BeanUtils
.
copyProperties
(
f
,
videoLibrary
);
videoLibrary
.
setBrowseNum
(
0
);
videoLibrary
.
setSalesType
(
SalsesTypeEnum
.
STATUS_1
.
getCode
());
videoLibrary
.
setResourceType
(
AllResourceTypeEnum
.
VIDEO
.
getCode
());
videoLibrary
.
setPriceOption
(
PriceOptionEnum
.
STATUS_0
.
getCode
());
videoLibrary
.
setRealPrice
(
new
BigDecimal
(
0
));
videoLibrary
.
setSalesNum
(
0
);
videoLibrary
.
setStatus
(
LibraryStatusEnum
.
STATUS_2
.
getCode
());
videoLibrary
.
setUploadTime
(
new
Date
());
if
(
StringUtils
.
isNotBlank
(
f
.
getDefaultImg
()))
{
String
defaultImg
=
f
.
getDefaultImg
()
+
"/"
+
videoLibrary
.
getVideo
()
+
"/1.jpg"
;
videoLibrary
.
setDefaultImg
(
defaultImg
);
}
}
mapper
.
insert
(
videoLibrary
);
});
return
true
;
}
/**
...
...
@@ -246,6 +231,11 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
//暂不用自定义分类id 做in查询
form
.
setDiyTypeId
(
null
);
List
<
VideoLibraryListVO
>
list
=
mapper
.
query
(
form
);
list
.
forEach
(
f
->
{
if
(
f
.
getStatus
()
!=
null
)
{
f
.
setStatus_zh
(
LibraryStatusEnum
.
getName
(
f
.
getStatus
()));
}
});
return
new
PageInfo
<
VideoLibraryListVO
>(
list
);
}
/**
...
...
@@ -265,7 +255,7 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
List
<
VideoLibraryListVO
>
list
=
mapper
.
queryByTileAndDiyType
(
form
);
if
(!
list
.
isEmpty
()){
for
(
VideoLibraryListVO
ebookListVO
:
list
){
ebookListVO
.
setStatus_zh
(
LibraryStatusEnum
.
getName
(
Integer
.
parseInt
(
ebookListVO
.
getStatus
()
)));
ebookListVO
.
setStatus_zh
(
LibraryStatusEnum
.
getName
(
ebookListVO
.
getStatus
(
)));
}
}
return
new
PageInfo
<
VideoLibraryListVO
>(
list
);
...
...
app/resource/src/main/java/com/zrqx/resource/bg/service/videolibrary/VideoLibraryService.java
浏览文件 @
eb364cf0
...
...
@@ -30,7 +30,7 @@ public interface VideoLibraryService extends BaseService<VideoLibrary,String>{
* @author yzg
* @date: 2018年11月22日 下午2:39:13
*/
boolean
batchInsert
(
SaveVideoLibraryForm
form
);
boolean
batchInsert
(
List
<
SaveVideoLibraryForm
>
form
);
/**
* 批量删除
* @param ids
...
...
app/resource/src/main/java/com/zrqx/resource/commons/form/bg/courselibrary/BatchUpdateCourseLibraryForm.java
浏览文件 @
eb364cf0
...
...
@@ -21,4 +21,6 @@ public class BatchUpdateCourseLibraryForm {
private
BigDecimal
price
;
@ApiModelProperty
(
"售价"
)
private
BigDecimal
realPrice
;
@ApiModelProperty
(
"售价选项 0 免费,1收费"
)
private
Integer
priceOption
;
}
app/resource/src/main/java/com/zrqx/resource/commons/form/bg/courselibrary/QueryCourseAndVideoForm.java
0 → 100644
浏览文件 @
eb364cf0
package
com
.
zrqx
.
resource
.
commons
.
form
.
bg
.
courselibrary
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"QueryCourseAndVideoForm"
,
description
=
"课程库"
)
public
class
QueryCourseAndVideoForm
{
@ApiModelProperty
(
value
=
"资源名称"
)
private
String
name
;
@ApiModelProperty
(
"作者"
)
private
String
author
;
}
app/resource/src/main/java/com/zrqx/resource/commons/form/bg/courselibrary/QueryCourseLibraryForm.java
浏览文件 @
eb364cf0
...
...
@@ -11,8 +11,6 @@ import lombok.Data;
public
class
QueryCourseLibraryForm
{
@ApiModelProperty
(
value
=
"资源名称"
)
private
String
name
;
@ApiModelProperty
(
"来源"
)
private
String
source
;
@ApiModelProperty
(
"状态:0待审核,1已上架,2已下架"
)
private
String
status
;
@ApiModelProperty
(
value
=
"上传时间-开始"
)
...
...
app/resource/src/main/java/com/zrqx/resource/commons/form/bg/courselibrary/SaveUpdateCourseLibraryForm.java
浏览文件 @
eb364cf0
...
...
@@ -5,7 +5,6 @@ import java.util.Date;
import
java.util.List
;
import
com.zrqx.resource.commons.model.courcelibrary.CourseLibraryDiyType
;
import
com.zrqx.resource.commons.model.courcelibrary.CourseLibraryLabelContentDiyType
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -23,36 +22,27 @@ public class SaveUpdateCourseLibraryForm {
private
String
authorId
;
@ApiModelProperty
(
value
=
"讲师名称和id(用,隔开)"
)
private
String
authorNameAndId
;
@ApiModelProperty
(
"来源"
)
private
String
source
;
@ApiModelProperty
(
"总期数"
)
private
Integer
totalPeriods
;
@ApiModelProperty
(
"广告语"
)
private
String
adSlogan
;
@ApiModelProperty
(
value
=
"分类"
)
private
List
<
CourseLibraryDiyType
>
diyType
;
@ApiModelProperty
(
"封面"
)
private
String
cover
;
private
String
img
;
@ApiModelProperty
(
"简介"
)
private
String
synopsis
;
@ApiModelProperty
(
"定价 元"
)
private
BigDecimal
price
;
@ApiModelProperty
(
"售价 元"
)
private
BigDecimal
realPrice
;
@ApiModelProperty
(
"
关键词
"
)
private
String
keywords
;
@ApiModelProperty
(
"
售价选项 0 免费,1收费
"
)
private
Integer
priceOption
;
@ApiModelProperty
(
"状态:0待审核,1已上架,2已下架"
)
private
Integer
status
;
@ApiModelProperty
(
"资源类型"
)
private
Integer
resourceType
;
@ApiModelProperty
(
"授权时间"
)
private
Date
authorizationTime
;
@ApiModelProperty
(
"上传时间"
)
private
Date
uploadTime
;
@ApiModelProperty
(
"更新时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
"播放次数"
)
private
Integer
clickNum
;
@ApiModelProperty
(
"浏览数量"
)
private
Integer
browseNum
;
@ApiModelProperty
(
"售价选项 0 免费,1收费"
)
private
Integer
priceOption
;
@ApiModelProperty
(
value
=
"分类id"
)
private
List
<
CourseLibraryDiyType
>
diyType
;
@ApiModelProperty
(
value
=
"标签id"
)
private
List
<
CourseLibraryLabelContentDiyType
>
label
;
}
app/resource/src/main/java/com/zrqx/resource/commons/form/bg/videolibrary/BatchUpdateVideoLibraryForm.java
浏览文件 @
eb364cf0
...
...
@@ -21,6 +21,11 @@ public class BatchUpdateVideoLibraryForm {
private
BigDecimal
price
;
@ApiModelProperty
(
"售价"
)
private
BigDecimal
realPrice
;
@ApiModelProperty
(
"全文阅读权限 0 游客可见 1会员可见"
)
private
Integer
readTextPower
;
@ApiModelProperty
(
"销售方式"
)
private
Integer
saleType
;
@ApiModelProperty
(
"售价选项 0 免费,1收费"
)
private
Integer
priceOption
;
@ApiModelProperty
(
"阅读权限"
)
private
Integer
ReadTextPower
;
}
app/resource/src/main/java/com/zrqx/resource/commons/form/bg/videolibrary/QueryVideoLibraryForm.java
浏览文件 @
eb364cf0
...
...
@@ -10,8 +10,6 @@ import lombok.Data;
public
class
QueryVideoLibraryForm
{
@ApiModelProperty
(
value
=
"资源名称"
)
private
String
name
;
@ApiModelProperty
(
"所属图书"
)
private
String
bookName
;
@ApiModelProperty
(
"状态:0待审核,1已上架,2已下架"
)
private
String
status
;
@ApiModelProperty
(
value
=
"上传时间-开始"
)
...
...
@@ -22,6 +20,4 @@ public class QueryVideoLibraryForm {
private
List
<
Integer
>
diyTypeId
;
@ApiModelProperty
(
"自定义分类code"
)
private
String
diyTypeCode
;
@ApiModelProperty
(
"民族 1蒙古族 2侗族 3藏族 4朝鲜族 5土家族 6回族 7满族 8汉族"
)
private
Integer
nationsType
;
}
app/resource/src/main/java/com/zrqx/resource/commons/form/bg/videolibrary/SaveUpdateVideoLibraryForm.java
浏览文件 @
eb364cf0
...
...
@@ -4,7 +4,6 @@ import java.math.BigDecimal;
import
java.util.List
;
import
com.zrqx.resource.commons.model.videolibrary.VideoLibraryDiyType
;
import
com.zrqx.resource.commons.model.videolibrary.VideoLibraryLabelContentDiyType
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -16,40 +15,39 @@ public class SaveUpdateVideoLibraryForm {
private
String
id
;
@ApiModelProperty
(
value
=
"视频名称"
)
private
String
name
;
@ApiModelProperty
(
"来源"
)
private
String
source
;
@ApiModelProperty
(
"关键词"
)
private
String
keywords
;
@ApiModelProperty
(
"定价"
)
private
BigDecimal
price
;
@ApiModelProperty
(
"售价"
)
private
BigDecimal
realPrice
;
@ApiModelProperty
(
value
=
"作者名称和id(用,隔开)"
)
private
String
authorNameAndId
;
@ApiModelProperty
(
"作者id"
)
private
String
authorId
;
@ApiModelProperty
(
"作者"
)
private
String
author
;
@ApiModelProperty
(
"时长"
)
private
String
timeLength
;
@ApiModelProperty
(
"文件大小"
)
private
String
size
;
@ApiModelProperty
(
"广告语"
)
private
String
adSlogan
;
@ApiModelProperty
(
value
=
"分类id"
)
private
List
<
VideoLibraryDiyType
>
diyType
;
@ApiModelProperty
(
"封面"
)
private
String
img
;
@ApiModelProperty
(
"默认封面"
)
private
String
defaultImg
;
@ApiModelProperty
(
"简介"
)
private
String
synopsis
;
@ApiModelProperty
(
"文本"
)
private
String
text
;
@ApiModelProperty
(
"video"
)
private
String
video
;
@ApiModelProperty
(
"封面"
)
private
String
cover
;
@ApiModelProperty
(
value
=
"分类id"
)
private
List
<
VideoLibraryDiyType
>
diyType
;
@ApiModelProperty
(
value
=
"标签id"
)
private
List
<
VideoLibraryLabelContentDiyType
>
label
;
@ApiModelProperty
(
"民族 1蒙古族 2侗族 3藏族 4朝鲜族 5土家族 6回族 7满族 8汉族"
)
private
Integer
nationsType
;
@ApiModelProperty
(
"售价选项 0 免费,1收费"
)
private
Integer
priceOption
;
@ApiModelProperty
(
"全文阅读权限 0 游客可见 1会员可见"
)
private
Integer
readTextPower
;
@ApiModelProperty
(
"video名称"
)
private
String
videoName
;
@ApiModelProperty
(
value
=
"作者名称和id(用,隔开)"
)
private
String
authorNameAndId
;
@ApiModelProperty
(
"时长"
)
private
String
timeLength
;
@ApiModelProperty
(
"文件大小"
)
private
String
size
;
@ApiModelProperty
(
"销售方式"
)
private
Integer
salesType
;
@ApiModelProperty
(
"售价选项 0 免费,1收费"
)
private
Integer
priceOption
;
@ApiModelProperty
(
"定价"
)
private
BigDecimal
price
;
@ApiModelProperty
(
"售价"
)
private
BigDecimal
realPrice
;
}
app/resource/src/main/java/com/zrqx/resource/commons/form/bg/videolibrary/SaveVideoLibraryForm.java
浏览文件 @
eb364cf0
package
com
.
zrqx
.
resource
.
commons
.
form
.
bg
.
videolibrary
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
com.zrqx.resource.commons.model.videolibrary.VideoLibraryDiyType
;
import
com.zrqx.resource.commons.model.videolibrary.VideoLibraryLabelContentDiyType
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -13,34 +7,16 @@ import lombok.Data;
@ApiModel
(
value
=
"SaveVideoLibraryForm"
,
description
=
"添加视频库"
)
public
class
SaveVideoLibraryForm
{
@ApiModelProperty
(
value
=
"视频名称集合"
)
private
List
<
String
>
names
;
@ApiModelProperty
(
"来源"
)
private
String
source
;
@ApiModelProperty
(
"关键词"
)
private
String
keywords
;
@ApiModelProperty
(
"定价"
)
private
BigDecimal
price
;
@ApiModelProperty
(
"售价"
)
private
BigDecimal
realPrice
;
@ApiModelProperty
(
"简介"
)
private
String
synopsis
;
private
String
name
;
@ApiModelProperty
(
"video"
)
private
List
<
String
>
video
;
@ApiModelProperty
(
"封面"
)
private
String
cover
;
@ApiModelProperty
(
value
=
"分类id"
)
private
VideoLibraryDiyType
diyType
;
@ApiModelProperty
(
value
=
"标签id"
)
private
VideoLibraryLabelContentDiyType
label
;
@ApiModelProperty
(
"民族 1蒙古族 2侗族 3藏族 4朝鲜族 5土家族 6回族 7满族 8汉族"
)
private
Integer
nationsType
;
@ApiModelProperty
(
"格式"
)
private
List
<
String
>
formats
;
private
String
video
;
@ApiModelProperty
(
"文件大小"
)
private
List
<
String
>
size
;
private
String
size
;
@ApiModelProperty
(
"时长"
)
private
List
<
String
>
timeLength
;
private
String
timeLength
;
@ApiModelProperty
(
"video名称"
)
private
List
<
String
>
videoName
;
private
String
videoName
;
@ApiModelProperty
(
"默认封面"
)
private
String
defaultImg
;
}
app/resource/src/main/java/com/zrqx/resource/commons/model/courcelibrary/CourseLibrary.java
浏览文件 @
eb364cf0
package
com
.
zrqx
.
resource
.
commons
.
model
.
courcelibrary
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
value
=
"CourseLibrary"
,
description
=
"微课库"
)
...
...
@@ -26,35 +26,31 @@ public class CourseLibrary {
private
String
author
;
@ApiModelProperty
(
"讲师id"
)
private
String
authorId
;
@ApiModelProperty
(
"来源"
)
private
String
source
;
@ApiModelProperty
(
"总期数"
)
private
Integer
totalPeriods
;
@ApiModelProperty
(
"广告语"
)
private
String
adSlogan
;
@ApiModelProperty
(
"封面"
)
private
String
cover
;
private
String
img
;
@ApiModelProperty
(
"简介"
)
private
String
synopsis
;
@ApiModelProperty
(
"定价 元"
)
private
BigDecimal
price
;
@ApiModelProperty
(
"售价 元"
)
private
BigDecimal
realPrice
;
@ApiModelProperty
(
"
关键词
"
)
private
String
keywords
;
@ApiModelProperty
(
"
售价选项 0 免费,1收费
"
)
private
Integer
priceOption
;
@ApiModelProperty
(
"状态:0待审核,1已上架,2已下架"
)
private
Integer
status
;
@ApiModelProperty
(
"资源类型"
)
private
Integer
resourceType
;
@ApiModelProperty
(
"授权时间"
)
private
Date
authorizationTime
;
@ApiModelProperty
(
"上传时间"
)
private
Date
uploadTime
;
@ApiModelProperty
(
"更新时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
"播放次数"
)
private
Integer
clickNum
;
@ApiModelProperty
(
"浏览数量"
)
private
Integer
browseNum
;
@ApiModelProperty
(
"销量"
)
private
Integer
salesNum
;
@ApiModelProperty
(
"
售价选项 0 免费,1收费
"
)
private
Integer
priceOption
;
@ApiModelProperty
(
"
资源类型
"
)
private
Integer
resourceType
;
}
app/resource/src/main/java/com/zrqx/resource/commons/model/videolibrary/VideoLibrary.java
浏览文件 @
eb364cf0
...
...
@@ -23,58 +23,50 @@ public class VideoLibrary {
private
String
id
;
@ApiModelProperty
(
value
=
"视频名称"
)
private
String
name
;
@ApiModelProperty
(
"来源"
)
private
String
source
;
@ApiModelProperty
(
"关键词"
)
private
String
keywords
;
@ApiModelProperty
(
"定价"
)
private
BigDecimal
price
;
@ApiModelProperty
(
"售价"
)
private
BigDecimal
realPrice
;
@ApiModelProperty
(
"时长"
)
private
String
timeLength
;
@ApiModelProperty
(
"文件大小"
)
private
String
size
;
@ApiModelProperty
(
"作者id"
)
private
String
authorId
;
@ApiModelProperty
(
"作者"
)
private
String
author
;
@ApiModelProperty
(
"广告语"
)
private
String
adSlogan
;
@ApiModelProperty
(
"封面"
)
private
String
img
;
@ApiModelProperty
(
"默认封面"
)
private
String
defaultImg
;
@ApiModelProperty
(
"简介"
)
private
String
synopsis
;
@ApiModelProperty
(
"文本"
)
private
String
text
;
@ApiModelProperty
(
"video"
)
private
String
video
;
@ApiModelProperty
(
"正文"
)
private
String
text
;
@ApiModelProperty
(
"图书id"
)
private
Integer
bookId
;
@ApiModelProperty
(
"资源类型"
)
private
Integer
resourceType
;
@ApiModelProperty
(
"图书名称"
)
private
String
bookName
;
@ApiModelProperty
(
"状态:0已录入,1已上架,2已下架"
)
@ApiModelProperty
(
"video名称"
)
private
String
videoName
;
@ApiModelProperty
(
"时长"
)
private
String
timeLength
;
@ApiModelProperty
(
"文件大小"
)
private
String
size
;
@ApiModelProperty
(
"销售方式"
)
private
Integer
salesType
;
@ApiModelProperty
(
"售价选项 0 免费,1收费"
)
private
Integer
priceOption
;
@ApiModelProperty
(
"定价"
)
private
BigDecimal
price
;
@ApiModelProperty
(
"售价"
)
private
BigDecimal
realPrice
;
@ApiModelProperty
(
"状态:1已上架,2已下架"
)
private
Integer
status
;
@ApiModelProperty
(
"上传时间"
)
private
Date
uploadTime
;
@ApiModelProperty
(
"更新时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
"民族 1蒙古族 2侗族 3藏族 4朝鲜族 5土家族 6回族 7满族 8汉族"
)
private
Integer
nationsType
;
@ApiModelProperty
(
"课程Id"
)
private
Integer
courseId
;
@ApiModelProperty
(
"播放数"
)
private
Integer
clickNum
;
@ApiModelProperty
(
value
=
"销量"
)
private
Integer
salesNum
;
@ApiModelProperty
(
"封面"
)
private
String
cover
;
private
String
courseId
;
@ApiModelProperty
(
"浏览数量"
)
private
Integer
browseNum
;
@ApiModelProperty
(
"作者id"
)
private
String
authorId
;
@ApiModelProperty
(
"作者"
)
private
String
author
;
@ApiModelProperty
(
"全文阅读权限 0 游客可见 1会员可见"
)
private
Integer
readTextPower
;
@ApiModelProperty
(
"格式"
)
private
String
formats
;
@ApiModelProperty
(
"售价选项 0 免费,1收费"
)
private
Integer
priceOption
;
@ApiModelProperty
(
"video名称"
)
private
String
videoName
;
@ApiModelProperty
(
"销量"
)
private
Integer
salesNum
;
@ApiModelProperty
(
"排序"
)
private
Integer
sort
;
@ApiModelProperty
(
"资源类型"
)
private
Integer
resourceType
;
}
app/resource/src/main/java/com/zrqx/resource/commons/vo/bg/courselibrary/CourseLibraryListVO.java
浏览文件 @
eb364cf0
...
...
@@ -16,37 +16,19 @@ public class CourseLibraryListVO {
private
String
id
;
@ApiModelProperty
(
"资源名称"
)
private
String
name
;
@ApiModelProperty
(
"讲师"
)
private
String
author
;
@ApiModelProperty
(
"讲师id"
)
private
String
authorId
;
@ApiModelProperty
(
"来源"
)
private
String
source
;
@ApiModelProperty
(
"封面"
)
private
String
cover
;
@ApiModelProperty
(
"简介"
)
private
String
synopsis
;
@ApiModelProperty
(
"定价 元"
)
private
String
price
;
private
String
img
;
@ApiModelProperty
(
"售价 元"
)
private
String
realPrice
;
@ApiModelProperty
(
"视频数量"
)
private
Integer
videoNum
;
@ApiModelProperty
(
"上传时间"
)
private
String
uploadTime
;
@ApiModelProperty
(
"状态:0已录入,1已上架,2已下架"
)
private
Integer
status
;
@ApiModelProperty
(
"状态:0已录入,1已上架,2已下架"
)
private
String
status_zh
;
@ApiModelProperty
(
"资源类型"
)
private
Integer
resourceType
;
@ApiModelProperty
(
"授权时间"
)
private
Date
authorizationTime
;
@ApiModelProperty
(
"上传时间"
)
private
Date
uploadTime
;
@ApiModelProperty
(
"更新时间"
)
private
Date
updateTime
;
@ApiModelProperty
(
"播放次数"
)
private
Integer
clickNum
;
@ApiModelProperty
(
"浏览数量"
)
private
Integer
browseNum
;
@ApiModelProperty
(
"视频数量"
)
private
Integer
videoNum
;
}
app/resource/src/main/java/com/zrqx/resource/commons/vo/bg/courselibrary/CourseLibraryVO.java
浏览文件 @
eb364cf0
package
com
.
zrqx
.
resource
.
commons
.
vo
.
bg
.
courselibrary
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
com.zrqx.resource.commons.model.courcelibrary.CourseLibraryDiyType
;
import
com.zrqx.resource.commons.model.courcelibrary.CourseLibraryLabelContentDiyType
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -16,41 +14,35 @@ import lombok.Data;
public
class
CourseLibraryVO
{
@ApiModelProperty
(
"课程id,新增时不需要填写"
)
private
String
id
;
@ApiModelProperty
(
"
课程
名称"
)
@ApiModelProperty
(
"
资源
名称"
)
private
String
name
;
@ApiModelProperty
(
"封面"
)
private
String
cover
;
@ApiModelProperty
(
"课程简介"
)
private
String
synopsis
;
@ApiModelProperty
(
"状态 0下线,1上线"
)
private
Integer
status
;
@ApiModelProperty
(
"授权时间"
)
private
Date
authorizationTime
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@ApiModelProperty
(
"创建时间"
)
private
Date
uploadTime
;
@ApiModelProperty
(
"作者"
)
@ApiModelProperty
(
"讲师"
)
private
String
author
;
@ApiModelProperty
(
"
作者
id"
)
@ApiModelProperty
(
"
讲师
id"
)
private
String
authorId
;
@ApiModelProperty
(
value
=
"
作者
名称和id(用,隔开)"
)
@ApiModelProperty
(
value
=
"
讲师
名称和id(用,隔开)"
)
private
String
authorNameAndId
;
@ApiModelProperty
(
"浏览数量"
)
private
Integer
browseNum
;
@ApiModelProperty
(
"总期数"
)
private
Integer
totalPeriods
;
@ApiModelProperty
(
"广告语"
)
private
String
adSlogan
;
@ApiModelProperty
(
value
=
"分类"
)
private
List
<
CourseLibraryDiyType
>
diyType
;
@ApiModelProperty
(
"封面"
)
private
String
img
;
@ApiModelProperty
(
"简介"
)
private
String
synopsis
;
@ApiModelProperty
(
"定价 元"
)
private
String
price
;
@ApiModelProperty
(
"售价 元"
)
private
String
realPrice
;
@ApiModelProperty
(
"售价选项 0 免费,1收费"
)
private
Integer
priceOption
;
@ApiModelProperty
(
"关键词"
)
private
String
keywords
;
@ApiModelProperty
(
"来源"
)
private
String
source
;
@ApiModelProperty
(
value
=
"分类id"
)
private
List
<
CourseLibraryDiyType
>
diyType
;
@ApiModelProperty
(
value
=
"标签id"
)
private
List
<
CourseLibraryLabelContentDiyType
>
label
;
@ApiModelProperty
(
value
=
"标签内容id"
)
private
List
<
Integer
>
labelContentDiyTypeIds
;
@ApiModelProperty
(
"状态:0待审核,1已上架,2已下架"
)
private
Integer
status
;
@ApiModelProperty
(
"资源类型"
)
private
Integer
resourceType
;
@ApiModelProperty
(
"浏览数量"
)
private
Integer
browseNum
;
}
app/resource/src/main/java/com/zrqx/resource/commons/vo/bg/videolibrary/VideoLibraryListVO.java
浏览文件 @
eb364cf0
...
...
@@ -13,22 +13,22 @@ public class VideoLibraryListVO {
private
String
id
;
@ApiModelProperty
(
value
=
"资源名称"
)
private
String
name
;
@ApiModelProperty
(
"来源
"
)
private
String
source
;
@ApiModelProperty
(
value
=
"讲师
"
)
private
String
author
;
@ApiModelProperty
(
"售价"
)
private
String
realPrice
;
@ApiModelProperty
(
"上传时间"
)
private
Date
uploadTime
;
@ApiModelProperty
(
"时长"
)
private
String
timeLength
;
@ApiModelProperty
(
"大小"
)
private
String
size
;
@ApiModelProperty
(
"状态:0待审核,1已上架,2已下架"
)
private
String
status
;
@ApiModelProperty
(
"状态:0待审核,1已上架,2已下架"
)
private
String
uploadTime
;
@ApiModelProperty
(
"状态:1已上架,2已下架"
)
private
Integer
status
;
@ApiModelProperty
(
"状态:1已上架,2已下架"
)
private
String
status_zh
;
@ApiModelProperty
(
"作者"
)
private
String
author
;
@ApiModelProperty
(
"封面图片"
)
private
String
cover
;
private
String
img
;
@ApiModelProperty
(
"默认封面"
)
private
String
defautImg
;
@ApiModelProperty
(
value
=
"时长"
)
private
String
timeLength
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
}
app/resource/src/main/java/com/zrqx/resource/commons/vo/bg/videolibrary/VideoLibraryOneVO.java
浏览文件 @
eb364cf0
package
com
.
zrqx
.
resource
.
commons
.
vo
.
bg
.
videolibrary
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
com.zrqx.resource.commons.model.videolibrary.VideoLibraryDiyType
;
import
com.zrqx.resource.commons.model.videolibrary.VideoLibraryLabelContentDiyType
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -11,42 +11,41 @@ import lombok.Data;
@Data
@ApiModel
(
value
=
"VideoLibraryOneVO"
,
description
=
"单个查询视频返回的实体"
)
public
class
VideoLibraryOneVO
{
@ApiModelProperty
(
"视频id"
)
@ApiModelProperty
(
"视频id
,新增时不需要填写
"
)
private
String
id
;
@ApiModelProperty
(
value
=
"视频
标题
"
)
@ApiModelProperty
(
value
=
"视频
名称
"
)
private
String
name
;
@ApiModelProperty
(
"来源"
)
private
String
source
;
@ApiModelProperty
(
"关键词"
)
private
String
keywords
;
@ApiModelProperty
(
"定价"
)
private
String
price
;
@ApiModelProperty
(
"售价"
)
private
String
realPrice
;
@ApiModelProperty
(
"简介"
)
private
String
synopsis
;
@ApiModelProperty
(
"正文"
)
private
String
text
;
@ApiModelProperty
(
"video"
)
private
String
video
;
@ApiModelProperty
(
"封面"
)
private
String
cover
;
@ApiModelProperty
(
value
=
"作者名称和id(用,隔开)"
)
private
String
authorNameAndId
;
@ApiModelProperty
(
"作者id"
)
private
String
authorId
;
@ApiModelProperty
(
"作者"
)
private
String
author
;
@ApiModelProperty
(
"广告语"
)
private
String
adSlogan
;
@ApiModelProperty
(
value
=
"分类id"
)
private
List
<
VideoLibraryDiyType
>
diyType
;
@ApiModelProperty
(
value
=
"标签id
"
)
private
List
<
VideoLibraryLabelContentDiyType
>
label
;
@ApiModelProperty
(
value
=
"标签内容id
"
)
private
List
<
Integer
>
labelContentDiyTypeId
s
;
@ApiModelProperty
(
"
售价选项 0 免费,1收费
"
)
private
Integer
priceOption
;
@ApiModelProperty
(
"
全文阅读权限 0 游客可见 1会员可见
"
)
private
Integer
readTextPower
;
@ApiModelProperty
(
"封面
"
)
private
String
cover
;
@ApiModelProperty
(
"简介
"
)
private
String
synopsi
s
;
@ApiModelProperty
(
"
文本
"
)
private
String
text
;
@ApiModelProperty
(
"
video
"
)
private
String
video
;
@ApiModelProperty
(
"video名称"
)
private
String
videoName
;
@ApiModelProperty
(
value
=
"作者名称和id(用,隔开)"
)
private
String
authorNameAndId
;
@ApiModelProperty
(
"时长"
)
private
String
timeLength
;
@ApiModelProperty
(
"文件大小"
)
private
String
size
;
@ApiModelProperty
(
"销售方式"
)
private
Integer
salesType
;
@ApiModelProperty
(
"售价选项 0 免费,1收费"
)
private
Integer
priceOption
;
@ApiModelProperty
(
"定价"
)
private
String
price
;
@ApiModelProperty
(
"售价"
)
private
String
realPrice
;
}
app/resource/src/main/java/com/zrqx/resource/fg/controller/resourcelibrary/FgResourceLibraryController.java
浏览文件 @
eb364cf0
...
...
@@ -671,7 +671,7 @@ public class FgResourceLibraryController {
orderInfo
.
setPrice
(
entity
.
getPrice
());
}
orderInfo
.
setSalePrice
(
entity
.
getRealPrice
());
orderInfo
.
setCover
(
entity
.
get
Cover
());
orderInfo
.
setCover
(
entity
.
get
Img
());
//获取分类编号
VideoLibraryDiyType
alrt
=
new
VideoLibraryDiyType
();
alrt
.
setVlId
(
entity
.
getId
());
...
...
@@ -707,7 +707,7 @@ public class FgResourceLibraryController {
orderInfo
.
setPrice
(
entity
.
getPrice
());
}
orderInfo
.
setSalePrice
(
entity
.
getRealPrice
());
orderInfo
.
setCover
(
entity
.
get
Cover
());
orderInfo
.
setCover
(
entity
.
get
Img
());
//获取分类编号
CourseLibraryDiyType
alrt
=
new
CourseLibraryDiyType
();
alrt
.
setCourseLibraryId
(
entity
.
getId
());
...
...
@@ -801,8 +801,8 @@ public class FgResourceLibraryController {
VideoLibrary
entity
=
videoLibraryService
.
selectByPrimaryKey
(
id
);
vo
.
setAuthor
(
entity
.
getAuthor
());
vo
.
setAuthorId
(
entity
.
getAuthorId
());
vo
.
setCover
(
entity
.
get
Cover
());
vo
.
setSource
(
entity
.
getSource
());
vo
.
setCover
(
entity
.
get
Img
());
//
vo.setSource(entity.getSource());
vo
.
setSummary
(
removeLabel
(
entity
.
getSynopsis
()));
return
CallBack
.
success
(
vo
);
}
...
...
@@ -811,8 +811,8 @@ public class FgResourceLibraryController {
CourseLibrary
entity
=
courseLibraryService
.
selectByPrimaryKey
(
id
);
vo
.
setAuthor
(
entity
.
getAuthor
());
vo
.
setAuthorId
(
entity
.
getAuthorId
());
vo
.
setCover
(
entity
.
get
Cover
());
vo
.
setSource
(
entity
.
getSource
());
vo
.
setCover
(
entity
.
get
Img
());
//
vo.setSource(entity.getSource());
vo
.
setSummary
(
removeLabel
(
entity
.
getSynopsis
()));
return
CallBack
.
success
(
vo
);
}
...
...
app/resource/src/main/java/com/zrqx/resource/fg/controller/videolibrary/FgVideoLibraryController.java
浏览文件 @
eb364cf0
...
...
@@ -155,26 +155,6 @@ public class FgVideoLibraryController {
return
input
;
}
@ApiOperation
(
"更新播放数"
)
@PostMapping
(
"/update/video-library"
)
public
CallBack
<
Boolean
>
updateDownloadNum
(
@RequestBody
String
fileName
)
{
boolean
b
=
false
;
VideoLibrary
videoLibraryOne
=
new
VideoLibrary
();
videoLibraryOne
.
setVideo
(
fileName
);
List
<
VideoLibrary
>
video
=
service
.
select
(
videoLibraryOne
);
if
(!
video
.
isEmpty
()){
for
(
VideoLibrary
videoLibrary
:
video
)
{
if
(
videoLibrary
.
getClickNum
()
==
null
){
videoLibrary
.
setClickNum
(
1
);
}
else
{
videoLibrary
.
setClickNum
(
videoLibrary
.
getClickNum
()
+
1
);
}
b
=
service
.
updateByPrimaryKeySelective
(
videoLibrary
);
}
}
return
CallBack
.
success
(
b
);
}
@ApiOperation
(
value
=
"查询视频全部信息(跨服务调用)"
,
notes
=
"根据ID查询"
)
@GetMapping
(
value
=
"/{oid}"
)
public
CallBack
<
VideoLibrary
>
getOneById
(
@PathVariable
String
oid
)
{
...
...
app/resource/src/main/java/com/zrqx/resource/fg/manage/resourcelibrary/FgResourceManageImpl.java
浏览文件 @
eb364cf0
...
...
@@ -204,7 +204,7 @@ public class FgResourceManageImpl implements FgResourceManage{
infoVo
.
setPrice
(
entity
.
getPrice
());
}
infoVo
.
setSalePrice
(
entity
.
getRealPrice
());
infoVo
.
setCover
(
entity
.
get
Cover
());
infoVo
.
setCover
(
entity
.
get
Img
());
if
(
entity
.
getStatus
().
equals
(
LibraryStatusEnum
.
STATUS_1
.
getCode
())){
infoVo
.
setBookStatus
(
Integer
.
parseInt
(
BooleanStatusEnum
.
YES
.
getCode
()));
infoVo
.
setBookStatusZh
(
LibraryStatusEnum
.
STATUS_1
.
getName
());
...
...
app/resource/src/main/java/com/zrqx/resource/fg/service/FgResourceRelationServiceImpl.java
浏览文件 @
eb364cf0
...
...
@@ -151,7 +151,7 @@ public class FgResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelat
VideoLibrary
sc
=
videoLibraryMapper
.
selectByPrimaryKey
(
e
.
getResourceId
());
if
(
sc
!=
null
)
{
e
.
setName
(
sc
.
getName
());
e
.
setCover
(
sc
.
get
Cover
());
e
.
setCover
(
sc
.
get
Img
());
e
.
setAuthor
(
sc
.
getAuthor
());
e
.
setRealPrice
(
sc
.
getRealPrice
()
+
""
);
e
.
setTimeLength
(
sc
.
getTimeLength
());
...
...
@@ -178,7 +178,7 @@ public class FgResourceRelationServiceImpl extends BaseServiceImpl<ResourceRelat
CourseLibrary
sc
=
courseLibraryMapper
.
selectByPrimaryKey
(
e
.
getResourceId
());
if
(
sc
!=
null
)
{
e
.
setName
(
sc
.
getName
());
e
.
setCover
(
sc
.
get
Cover
());
e
.
setCover
(
sc
.
get
Img
());
e
.
setAuthor
(
sc
.
getAuthor
());
e
.
setRealPrice
(
sc
.
getRealPrice
()
+
""
);
/*if(StringUtils.isNotBlank(sc.getSynopsis())){
...
...
app/resource/src/main/java/com/zrqx/resource/fg/service/courselibrary/FgCourseLibrarySerivceImpl.java
浏览文件 @
eb364cf0
...
...
@@ -120,12 +120,12 @@ public class FgCourseLibrarySerivceImpl extends
Integer
num
=
CourseLibrary
.
getBrowseNum
();
num
+=
1
;
CourseLibrary
.
setBrowseNum
(
num
);
if
(
CourseLibrary
.
get
Click
Num
()
==
null
){
CourseLibrary
.
set
ClickNum
(
5
0
);
if
(
CourseLibrary
.
get
Browse
Num
()
==
null
){
CourseLibrary
.
set
BrowseNum
(
0
);
}
Integer
clickNum
=
CourseLibrary
.
get
Click
Num
();
Integer
clickNum
=
CourseLibrary
.
get
Browse
Num
();
clickNum
+=
1
;
CourseLibrary
.
set
Click
Num
(
clickNum
);
CourseLibrary
.
set
Browse
Num
(
clickNum
);
mapper
.
updateByPrimaryKeySelective
(
CourseLibrary
);
return
true
;
}
...
...
app/resource/src/main/java/com/zrqx/resource/fg/service/record/FgRecordServiceImpl.java
浏览文件 @
eb364cf0
...
...
@@ -171,9 +171,8 @@ public class FgRecordServiceImpl extends BaseServiceImpl<Record, Integer>
VideoLibrary
videoLibrary
=
videoLibraryMapper
.
selectByPrimaryKey
(
vo
.
getGoodsId
());
if
(
videoLibrary
!=
null
){
vo
.
setName
(
videoLibrary
.
getName
());
vo
.
setImg
(
videoLibrary
.
get
Cover
());
vo
.
setImg
(
videoLibrary
.
get
Img
());
vo
.
setText
(
videoLibrary
.
getSynopsis
());
vo
.
setSource
(
videoLibrary
.
getSource
());
}
}
//音频
...
...
@@ -204,9 +203,8 @@ public class FgRecordServiceImpl extends BaseServiceImpl<Record, Integer>
CourseLibrary
courseLibrary
=
courseLibraryMapper
.
selectByPrimaryKey
(
vo
.
getGoodsId
());
if
(
courseLibrary
!=
null
){
vo
.
setName
(
courseLibrary
.
getName
());
vo
.
setImg
(
courseLibrary
.
get
Cover
());
vo
.
setImg
(
courseLibrary
.
get
Img
());
vo
.
setText
(
courseLibrary
.
getSynopsis
());
vo
.
setSource
(
courseLibrary
.
getSource
());
vo
.
setAuthor
(
courseLibrary
.
getAuthor
());
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论