Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
涂亚平
/
subsidy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 99ef83c5
authored
Aug 04, 2022
by
邓敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
websocket发送班级配置
1 parent
f1aff5ff
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
276 additions
and
43 deletions
src/main/java/com/subsidy/controller/BusinessScopeDictController.java
src/main/java/com/subsidy/controller/ContentVodMappingController.java
src/main/java/com/subsidy/controller/VodDictController.java
src/main/java/com/subsidy/dto/businessScope/AddBusinessScopeDTO.java
src/main/java/com/subsidy/dto/businessScope/EditBusinessScopeDTO.java
src/main/java/com/subsidy/dto/contentVod/AddContentVod.java → src/main/java/com/subsidy/dto/contentVod/AddContentVodDTO.java
src/main/java/com/subsidy/dto/contentVod/ContentVodDTO.java
src/main/java/com/subsidy/dto/vod/AddVodDictDTO.java
src/main/java/com/subsidy/dto/vod/VodDictPageDTO.java
src/main/java/com/subsidy/mapper/BusinessScopeDictMapper.java
src/main/java/com/subsidy/model/BusinessScopeDictDO.java
src/main/java/com/subsidy/model/ContentVodMappingDO.java
src/main/java/com/subsidy/service/BusinessScopeDictService.java
src/main/java/com/subsidy/service/ContentVodMappingService.java
src/main/java/com/subsidy/service/VodDictService.java
src/main/java/com/subsidy/service/impl/BusinessScopeDictServiceImpl.java
src/main/java/com/subsidy/service/impl/ContentVodMappingServiceImpl.java
src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java
src/main/java/com/subsidy/util/websocket/WebSocketUtil.java
src/main/java/com/subsidy/vo/businessScope/BusinessScopeDictVO.java
src/main/java/com/subsidy/vo/classdict/ClassSettingsVO.java
src/main/resources/mapper/BusinessScopeDictMapper.xml
src/main/resources/mapper/ContentVodMappingMapper.xml
src/main/resources/mapper/VodDictMapper.xml
src/main/java/com/subsidy/controller/BusinessScopeDictController.java
View file @
99ef83c
...
...
@@ -3,7 +3,9 @@ package com.subsidy.controller;
import
com.subsidy.common.ResponseData
;
import
com.subsidy.common.ResponseVO
;
import
com.subsidy.common.interceptor.LoginRequired
;
import
com.subsidy.dto.businessScope.AddBusinessScopeDTO
;
import
com.subsidy.dto.businessScope.BusinessScopeDTO
;
import
com.subsidy.dto.businessScope.EditBusinessScopeDTO
;
import
com.subsidy.model.BusinessScopeDictDO
;
import
com.subsidy.service.BusinessScopeDictService
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -31,18 +33,18 @@ public class BusinessScopeDictController {
private
BusinessScopeDictService
businessScopeDictService
;
@PostMapping
(
"addBusinessScope"
)
@ApiOperation
(
"添加经营范围:businessScopeName/经营范围名称"
)
@ApiOperation
(
"添加经营范围:businessScopeName/经营范围名称
, businessScopeItems[]/经营范围类目
"
)
@LoginRequired
public
ResponseVO
addBusinessScope
(
@RequestBody
BusinessScopeDictDO
businessScopeDictD
O
)
{
businessScopeDictService
.
save
(
businessScopeDictD
O
);
public
ResponseVO
addBusinessScope
(
@RequestBody
AddBusinessScopeDTO
addBusinessScopeDT
O
)
{
businessScopeDictService
.
addBusinessScope
(
addBusinessScopeDT
O
);
return
ResponseData
.
generateCreatedResponse
(
0
);
}
@PostMapping
(
"updateBusinessScope"
)
@ApiOperation
(
"修改经营范围:id/ID、businessScopeName/经营范围名称"
)
@ApiOperation
(
"修改经营范围:id/ID、businessScopeName/经营范围名称
, businessScopeItems[]/经营范围类目
"
)
@LoginRequired
public
ResponseVO
updateBusinessScope
(
@RequestBody
BusinessScopeDictDO
businessScopeDictD
O
)
{
businessScopeDictService
.
updateB
yId
(
businessScopeDictD
O
);
public
ResponseVO
updateBusinessScope
(
@RequestBody
EditBusinessScopeDTO
editBusinessScopeDT
O
)
{
businessScopeDictService
.
updateB
usinessScope
(
editBusinessScopeDT
O
);
return
ResponseData
.
generateCreatedResponse
(
0
);
}
...
...
@@ -50,7 +52,7 @@ public class BusinessScopeDictController {
@ApiOperation
(
"删除经营范围:id/ID"
)
@LoginRequired
public
ResponseVO
deleteBusinessScope
(
@RequestBody
BusinessScopeDictDO
businessScopeDictDO
)
{
businessScopeDictService
.
removeById
(
businessScopeDictDO
.
getId
());
businessScopeDictService
.
deleteBusinessScope
(
businessScopeDictDO
.
getId
());
return
ResponseData
.
generateCreatedResponse
(
0
);
}
...
...
src/main/java/com/subsidy/controller/ContentVodMappingController.java
View file @
99ef83c
...
...
@@ -4,7 +4,7 @@ import com.subsidy.common.ResponseData;
import
com.subsidy.common.ResponseVO
;
import
com.subsidy.common.interceptor.LoginRequired
;
import
com.subsidy.dto.content.GetContendVodsDTO
;
import
com.subsidy.dto.contentVod.AddContentVod
;
import
com.subsidy.dto.contentVod.AddContentVod
DTO
;
import
com.subsidy.dto.contentVod.ContentVodDTO
;
import
com.subsidy.dto.vod.ChangeOrdersDTO
;
import
com.subsidy.service.ContentVodMappingService
;
...
...
@@ -40,16 +40,16 @@ public class ContentVodMappingController {
}
@PostMapping
(
"changeContentVodOrders"
)
@ApiOperation
(
"课程内容视频排序 contentId/内容ID vodIds []
视频的id
"
)
@ApiOperation
(
"课程内容视频排序 contentId/内容ID vodIds []"
)
public
ResponseVO
changeContentVodOrders
(
@RequestBody
ChangeOrdersDTO
changeOrdersDTO
){
contentVodMappingService
.
changeContentVodOrders
(
changeOrdersDTO
);
return
ResponseData
.
generateCreatedResponse
(
0
);
}
@PostMapping
(
"addContentVod"
)
@ApiOperation
(
"添加课程内容视频:contentId/内容ID、vodIds [
] /视频ID
"
)
@ApiOperation
(
"添加课程内容视频:contentId/内容ID、vodIds [
vodId, vodAliasName]
"
)
@LoginRequired
public
ResponseVO
addContentVod
(
@RequestBody
AddContentVod
addContentVod
)
{
public
ResponseVO
addContentVod
(
@RequestBody
AddContentVod
DTO
addContentVod
)
{
contentVodMappingService
.
addContentVod
(
addContentVod
);
return
ResponseData
.
generateCreatedResponse
(
0
);
}
...
...
src/main/java/com/subsidy/controller/VodDictController.java
View file @
99ef83c
...
...
@@ -3,7 +3,9 @@ package com.subsidy.controller;
import
com.subsidy.common.ResponseData
;
import
com.subsidy.common.ResponseVO
;
import
com.subsidy.common.interceptor.LoginRequired
;
import
com.subsidy.dto.vod.AddVodDictDTO
;
import
com.subsidy.dto.vod.ChangeOrdersDTO
;
import
com.subsidy.dto.vod.VodDictPageDTO
;
import
com.subsidy.model.VodDictDO
;
import
com.subsidy.service.VodDictService
;
import
com.subsidy.util.ConstantUtils
;
...
...
@@ -46,10 +48,10 @@ public class VodDictController {
}
@PostMapping
(
"addVod"
)
@ApiOperation
(
"新增视频 labelId
vodName vodLength vodType vodSize vodUrl vodCod
e"
)
@ApiOperation
(
"新增视频 labelId
contentId vodName vodLength vodType vodSize vodUrl vodCode coverPag
e"
)
@LoginRequired
public
ResponseVO
addVod
(
@RequestBody
VodDictDO
vodDictD
O
)
{
vodDictService
.
addVod
(
vodDictD
O
);
public
ResponseVO
addVod
(
@RequestBody
AddVodDictDTO
addVodDictDT
O
)
{
vodDictService
.
addVod
(
addVodDictDT
O
);
return
ResponseData
.
generateCreatedResponse
(
0
,
ConstantUtils
.
ADD_SUCCESS
);
}
...
...
@@ -68,4 +70,11 @@ public class VodDictController {
return
ResponseData
.
generateCreatedResponse
(
0
,
ConstantUtils
.
SET_SUCCESS
);
}
@PostMapping
(
value
=
"queryVodPage"
)
@ApiOperation
(
"根据类目ID查询视频: pageNum, pageSize, labelId/类目ID, vodName/视频名称"
)
@LoginRequired
public
ResponseVO
queryVodPage
(
@RequestBody
VodDictPageDTO
vodDictPageDTO
)
{
return
ResponseData
.
generateCreatedResponse
(
0
,
vodDictService
.
queryVodPage
(
vodDictPageDTO
));
}
}
src/main/java/com/subsidy/dto/businessScope/AddBusinessScopeDTO.java
0 → 100644
View file @
99ef83c
package
com
.
subsidy
.
dto
.
businessScope
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
AddBusinessScopeDTO
{
/**
* 经营范围名称
*/
private
String
businessScopeName
;
/**
* 经营范围类目
*/
private
List
<
String
>
businessScopeItems
;
}
src/main/java/com/subsidy/dto/businessScope/EditBusinessScopeDTO.java
0 → 100644
View file @
99ef83c
package
com
.
subsidy
.
dto
.
businessScope
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
EditBusinessScopeDTO
{
private
Long
id
;
/**
* 经营范围名称
*/
private
String
businessScopeName
;
/**
* 经营范围类目
*/
private
List
<
String
>
businessScopeItems
;
}
src/main/java/com/subsidy/dto/contentVod/AddContentVod.java
→
src/main/java/com/subsidy/dto/contentVod/AddContentVod
DTO
.java
View file @
99ef83c
...
...
@@ -5,9 +5,9 @@ import lombok.Data;
import
java.util.List
;
@Data
public
class
AddContentVod
{
public
class
AddContentVod
DTO
{
private
List
<
Long
>
vodIds
;
private
List
<
ContentVodDTO
>
vodIds
;
private
Long
contentId
;
}
src/main/java/com/subsidy/dto/contentVod/ContentVodDTO.java
View file @
99ef83c
...
...
@@ -8,4 +8,6 @@ public class ContentVodDTO {
private
Long
contentId
;
private
Long
vodId
;
private
String
vodAliasName
;
}
src/main/java/com/subsidy/dto/vod/AddVodDictDTO.java
0 → 100644
View file @
99ef83c
package
com
.
subsidy
.
dto
.
vod
;
import
com.subsidy.model.VodDictDO
;
import
lombok.Data
;
@Data
public
class
AddVodDictDTO
extends
VodDictDO
{
private
Long
contentId
;
}
src/main/java/com/subsidy/dto/vod/VodDictPageDTO.java
0 → 100644
View file @
99ef83c
package
com
.
subsidy
.
dto
.
vod
;
import
lombok.Data
;
@Data
public
class
VodDictPageDTO
{
private
Integer
pageNum
;
private
Integer
pageSize
;
private
Long
labelId
;
private
String
vodName
;
}
src/main/java/com/subsidy/mapper/BusinessScopeDictMapper.java
View file @
99ef83c
package
com
.
subsidy
.
mapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.subsidy.model.BusinessScopeDictDO
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.subsidy.vo.businessScope.BusinessScopeDictVO
;
import
org.springframework.stereotype.Repository
;
/**
...
...
@@ -15,4 +18,5 @@ import org.springframework.stereotype.Repository;
@Repository
public
interface
BusinessScopeDictMapper
extends
BaseMapper
<
BusinessScopeDictDO
>
{
IPage
<
BusinessScopeDictVO
>
queryBusinessScopePage
(
Page
page
,
String
businessScopeName
);
}
src/main/java/com/subsidy/model/BusinessScopeDictDO.java
View file @
99ef83c
...
...
@@ -25,10 +25,11 @@ public class BusinessScopeDictDO extends BaseModel {
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
private
Long
parentId
;
/**
* 经营范围名称
*/
private
String
businessScopeName
;
}
src/main/java/com/subsidy/model/ContentVodMappingDO.java
View file @
99ef83c
...
...
@@ -40,5 +40,10 @@ public class ContentVodMappingDO extends BaseModel {
*/
private
Integer
orderNo
;
/**
* 视频别名
*/
private
String
vodAliasName
;
}
src/main/java/com/subsidy/service/BusinessScopeDictService.java
View file @
99ef83c
package
com
.
subsidy
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.subsidy.dto.businessScope.AddBusinessScopeDTO
;
import
com.subsidy.dto.businessScope.BusinessScopeDTO
;
import
com.subsidy.dto.businessScope.EditBusinessScopeDTO
;
import
com.subsidy.model.BusinessScopeDictDO
;
import
com.baomidou.mybatisplus.extension.service.IService
;
...
...
@@ -16,4 +18,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
public
interface
BusinessScopeDictService
extends
IService
<
BusinessScopeDictDO
>
{
IPage
queryBusinessScopePage
(
BusinessScopeDTO
businessScopeDictDO
);
void
addBusinessScope
(
AddBusinessScopeDTO
addBusinessScopeDTO
);
void
updateBusinessScope
(
EditBusinessScopeDTO
editBusinessScopeDTO
);
void
deleteBusinessScope
(
Long
id
);
}
src/main/java/com/subsidy/service/ContentVodMappingService.java
View file @
99ef83c
package
com
.
subsidy
.
service
;
import
com.subsidy.dto.content.GetContendVodsDTO
;
import
com.subsidy.dto.contentVod.AddContentVod
;
import
com.subsidy.dto.contentVod.AddContentVod
DTO
;
import
com.subsidy.dto.contentVod.ContentVodDTO
;
import
com.subsidy.dto.vod.ChangeOrdersDTO
;
import
com.subsidy.model.ContentVodMappingDO
;
...
...
@@ -26,5 +26,5 @@ public interface ContentVodMappingService extends IService<ContentVodMappingDO>
void
deleteContentVod
(
ContentVodDTO
contentVodDTO
);
void
addContentVod
(
AddContentVod
addContentVod
);
void
addContentVod
(
AddContentVod
DTO
addContentVod
);
}
src/main/java/com/subsidy/service/VodDictService.java
View file @
99ef83c
package
com
.
subsidy
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.subsidy.dto.vod.AddVodDictDTO
;
import
com.subsidy.dto.vod.ChangeOrdersDTO
;
import
com.subsidy.dto.vod.VodDictPageDTO
;
import
com.subsidy.model.VodDictDO
;
import
com.subsidy.vo.vod.SignatureVO
;
...
...
@@ -19,9 +22,11 @@ public interface VodDictService extends IService<VodDictDO> {
void
deleteVod
(
VodDictDO
vodDictDO
);
void
addVod
(
VodDictDO
vodDictD
O
);
void
addVod
(
AddVodDictDTO
addVodDictDT
O
);
void
updateVod
(
VodDictDO
vodDictDO
);
void
changeOrders
(
ChangeOrdersDTO
changeOrdersDTO
);
IPage
queryVodPage
(
VodDictPageDTO
vodDictPageDTO
);
}
src/main/java/com/subsidy/service/impl/BusinessScopeDictServiceImpl.java
View file @
99ef83c
...
...
@@ -3,13 +3,22 @@ package com.subsidy.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.subsidy.dto.businessScope.AddBusinessScopeDTO
;
import
com.subsidy.dto.businessScope.BusinessScopeDTO
;
import
com.subsidy.dto.businessScope.EditBusinessScopeDTO
;
import
com.subsidy.model.BusinessScopeDictDO
;
import
com.subsidy.mapper.BusinessScopeDictMapper
;
import
com.subsidy.service.BusinessScopeDictService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.subsidy.vo.businessScope.BusinessScopeDictVO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* <p>
...
...
@@ -25,8 +34,74 @@ public class BusinessScopeDictServiceImpl extends ServiceImpl<BusinessScopeDictM
@Override
public
IPage
queryBusinessScopePage
(
BusinessScopeDTO
businessScopeDictDO
)
{
Page
page
=
new
Page
(
businessScopeDictDO
.
getPageNum
(),
businessScopeDictDO
.
getPageSize
());
return
this
.
baseMapper
.
selectPage
(
page
,
new
QueryWrapper
<
BusinessScopeDictDO
>()
IPage
<
BusinessScopeDictVO
>
iPage
=
this
.
baseMapper
.
queryBusinessScopePage
(
page
,
businessScopeDictDO
.
getBusinessScopeName
());
iPage
.
getRecords
().
forEach
(
businessScopeDictVO
->
{
iPage
.
getRecords
().
forEach
(
bs
->
{
if
(
bs
.
getParentId
().
equals
(
businessScopeDictVO
.
getId
()))
{
if
(
businessScopeDictVO
.
getChildNode
()
==
null
)
{
businessScopeDictVO
.
setChildNode
(
new
ArrayList
<>());
}
businessScopeDictVO
.
getChildNode
().
add
(
bs
);
}
});
});
return
iPage
;
}
@Override
public
void
addBusinessScope
(
AddBusinessScopeDTO
addBusinessScopeDTO
)
{
if
(
addBusinessScopeDTO
!=
null
)
{
BusinessScopeDictDO
businessScopeDictDO
=
new
BusinessScopeDictDO
();
businessScopeDictDO
.
setBusinessScopeName
(
addBusinessScopeDTO
.
getBusinessScopeName
());
this
.
baseMapper
.
insert
(
businessScopeDictDO
);
if
(
CollectionUtils
.
isNotEmpty
(
addBusinessScopeDTO
.
getBusinessScopeItems
()))
{
for
(
String
businessScopeName
:
addBusinessScopeDTO
.
getBusinessScopeItems
())
{
BusinessScopeDictDO
childNode
=
new
BusinessScopeDictDO
();
childNode
.
setParentId
(
businessScopeDictDO
.
getId
());
childNode
.
setBusinessScopeName
(
businessScopeName
);
this
.
baseMapper
.
insert
(
childNode
);
}
}
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateBusinessScope
(
EditBusinessScopeDTO
editBusinessScopeDTO
)
{
if
(
CollectionUtils
.
isNotEmpty
(
editBusinessScopeDTO
.
getBusinessScopeItems
()))
{
List
<
BusinessScopeDictDO
>
list
=
this
.
baseMapper
.
selectList
(
new
QueryWrapper
<
BusinessScopeDictDO
>()
.
lambda
()
.
eq
(
BusinessScopeDictDO:
:
getParentId
,
editBusinessScopeDTO
.
getId
()));
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
this
.
baseMapper
.
deleteBatchIds
(
list
.
stream
().
map
(
BusinessScopeDictDO:
:
getId
).
collect
(
Collectors
.
toList
()));
}
for
(
String
businessScopeName
:
editBusinessScopeDTO
.
getBusinessScopeItems
())
{
BusinessScopeDictDO
childNode
=
new
BusinessScopeDictDO
();
childNode
.
setParentId
(
editBusinessScopeDTO
.
getId
());
childNode
.
setBusinessScopeName
(
businessScopeName
);
this
.
baseMapper
.
insert
(
childNode
);
}
}
/* 只更新经营范围名称 */
BusinessScopeDictDO
businessScopeDictDO
=
new
BusinessScopeDictDO
();
businessScopeDictDO
.
setBusinessScopeName
(
editBusinessScopeDTO
.
getBusinessScopeName
());
businessScopeDictDO
.
setId
(
editBusinessScopeDTO
.
getId
());
this
.
baseMapper
.
updateById
(
businessScopeDictDO
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
deleteBusinessScope
(
Long
id
)
{
List
<
BusinessScopeDictDO
>
list
=
this
.
baseMapper
.
selectList
(
new
QueryWrapper
<
BusinessScopeDictDO
>()
.
lambda
()
.
like
(
StringUtils
.
isNotBlank
(
businessScopeDictDO
.
getBusinessScopeName
()),
BusinessScopeDictDO:
:
getBusinessScopeName
,
businessScopeDictDO
.
getBusinessScopeName
()));
.
eq
(
BusinessScopeDictDO:
:
getParentId
,
id
));
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
this
.
baseMapper
.
deleteBatchIds
(
list
.
stream
().
map
(
BusinessScopeDictDO:
:
getId
).
collect
(
Collectors
.
toList
()));
}
this
.
baseMapper
.
deleteById
(
id
);
}
}
src/main/java/com/subsidy/service/impl/ContentVodMappingServiceImpl.java
View file @
99ef83c
...
...
@@ -3,7 +3,7 @@ package com.subsidy.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.subsidy.common.exception.HttpException
;
import
com.subsidy.dto.content.GetContendVodsDTO
;
import
com.subsidy.dto.contentVod.AddContentVod
;
import
com.subsidy.dto.contentVod.AddContentVod
DTO
;
import
com.subsidy.dto.contentVod.ContentVodDTO
;
import
com.subsidy.dto.vod.ChangeOrdersDTO
;
import
com.subsidy.mapper.VodDictMapper
;
...
...
@@ -67,7 +67,7 @@ public class ContentVodMappingServiceImpl extends ServiceImpl<ContentVodMappingM
}
@Override
public
void
addContentVod
(
AddContentVod
addContentVod
)
{
public
void
addContentVod
(
AddContentVod
DTO
addContentVod
)
{
if
(
CollectionUtils
.
isNotEmpty
(
addContentVod
.
getVodIds
()))
{
List
<
ContentVodMappingDO
>
list
=
this
.
baseMapper
.
selectList
(
new
QueryWrapper
<
ContentVodMappingDO
>()
.
lambda
()
...
...
@@ -79,7 +79,8 @@ public class ContentVodMappingServiceImpl extends ServiceImpl<ContentVodMappingM
for
(
int
i
=
0
;
i
<
addContentVod
.
getVodIds
().
size
();
i
++)
{
ContentVodMappingDO
contentVodMappingDO
=
new
ContentVodMappingDO
();
contentVodMappingDO
.
setContentId
(
addContentVod
.
getContentId
());
contentVodMappingDO
.
setVodId
(
addContentVod
.
getVodIds
().
get
(
i
));
contentVodMappingDO
.
setVodId
(
addContentVod
.
getVodIds
().
get
(
i
).
getVodId
());
contentVodMappingDO
.
setVodAliasName
(
addContentVod
.
getVodIds
().
get
(
i
).
getVodAliasName
());
contentVodMappingDO
.
setOrderNo
(
i
+
1
);
this
.
baseMapper
.
insert
(
contentVodMappingDO
);
}
...
...
src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java
View file @
99ef83c
package
com
.
subsidy
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.subsidy.common.configure.VODConfig
;
import
com.subsidy.common.exception.HttpException
;
import
com.subsidy.dto.content.GetContendVodsDTO
;
import
com.subsidy.dto.vod.AddVodDictDTO
;
import
com.subsidy.dto.vod.ChangeOrdersDTO
;
import
com.subsidy.dto.vod.VodDictPageDTO
;
import
com.subsidy.mapper.ContentVodMappingMapper
;
import
com.subsidy.mapper.VodDictMapper
;
import
com.subsidy.model.ContentVodMappingDO
;
import
com.subsidy.model.VodDictDO
;
import
com.subsidy.service.VodDictService
;
import
com.subsidy.util.Signature
;
...
...
@@ -38,6 +45,9 @@ public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> im
@Value
(
"${spring.profiles.active}"
)
private
String
env
;
@Autowired
private
ContentVodMappingMapper
contentVodMappingMapper
;
@Override
public
SignatureVO
signature
()
{
SignatureVO
signatureVO
=
new
SignatureVO
();
...
...
@@ -67,16 +77,19 @@ public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> im
throw
new
HttpException
(
18000
);
}
if
(
vodDictDO
.
getVodCode
()
!=
null
)
{
VodUtil
.
deleteMedia
(
vodConfig
,
vodDictDO
.
getVodCode
());
}
this
.
baseMapper
.
deleteById
(
vodDictDO
.
getId
());
VodUtil
.
deleteMedia
(
vodConfig
,
vodDictDO
.
getVodCode
());
}
@Override
public
void
addVod
(
VodDictDO
vodDictD
O
)
{
public
void
addVod
(
AddVodDictDTO
addVodDictDT
O
)
{
int
orderNo
=
1
;
//排序
List
<
VodDictDO
>
vodDictDOS
=
this
.
baseMapper
.
selectList
(
new
QueryWrapper
<
VodDictDO
>()
.
lambda
()
.
eq
(
VodDictDO:
:
getLabelId
,
vodDictD
O
.
getLabelId
())
.
eq
(
VodDictDO:
:
getLabelId
,
addVodDictDT
O
.
getLabelId
())
.
orderByDesc
(
VodDictDO:
:
getOrderNo
));
if
(
CollectionUtils
.
isNotEmpty
(
vodDictDOS
)){
...
...
@@ -86,12 +99,19 @@ public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> im
}
}
vodDictDO
.
setOrderNo
(
orderNo
);
this
.
baseMapper
.
insert
(
vodDictDO
);
addVodDictDTO
.
setOrderNo
(
orderNo
);
this
.
baseMapper
.
insert
(
addVodDictDTO
);
if
(
addVodDictDTO
.
getContentId
()
!=
null
)
{
ContentVodMappingDO
contentVodMappingDO
=
new
ContentVodMappingDO
();
contentVodMappingDO
.
setVodId
(
addVodDictDTO
.
getId
());
contentVodMappingDO
.
setContentId
(
addVodDictDTO
.
getContentId
());
contentVodMappingMapper
.
insert
(
contentVodMappingDO
);
}
//测试环境就不转码了
if
(
env
.
equals
(
"prod"
)){
VodUtil
.
processMedia
(
vodConfig
,
vodDictD
O
.
getVodCode
());
VodUtil
.
processMedia
(
vodConfig
,
addVodDictDT
O
.
getVodCode
());
}
}
...
...
@@ -109,4 +129,13 @@ public class VodDictServiceImpl extends ServiceImpl<VodDictMapper, VodDictDO> im
}
}
@Override
public
IPage
<
VodDictDO
>
queryVodPage
(
VodDictPageDTO
vodDictPageDTO
)
{
Page
page
=
new
Page
(
vodDictPageDTO
.
getPageNum
(),
vodDictPageDTO
.
getPageSize
());
return
this
.
baseMapper
.
selectPage
(
page
,
new
QueryWrapper
<
VodDictDO
>()
.
lambda
()
.
eq
(
VodDictDO:
:
getLabelId
,
vodDictPageDTO
.
getLabelId
())
.
like
(
StringUtils
.
isNotBlank
(
vodDictPageDTO
.
getVodName
()),
VodDictDO:
:
getVodName
,
vodDictPageDTO
.
getVodName
()));
}
}
src/main/java/com/subsidy/util/websocket/WebSocketUtil.java
View file @
99ef83c
package
com
.
subsidy
.
util
.
websocket
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.subsidy.common.ResponseData
;
import
com.subsidy.mapper.ClassDictMapper
;
...
...
@@ -99,9 +101,11 @@ public class WebSocketUtil implements WebSocketHandler {
}
webSocketMap
.
put
(
id
,
session
);
List
<
ClassSettingsVO
>
list
=
classDictMapper
.
getClassSettings
(
id
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
webSocketMap
.
get
(
id
).
sendMessage
(
new
TextMessage
(
JSONObject
.
toJSONString
(
ResponseData
.
generateCreatedResponse
(
0
,
list
))));
/* 班级配置信息 */
List
<
ClassSettingsVO
>
classSettings
=
classDictMapper
.
getClassSettings
(
id
);
if
(
CollectionUtils
.
isNotEmpty
(
classSettings
))
{
String
data
=
JSONObject
.
toJSONString
(
ResponseData
.
generateCreatedResponse
(
0
,
classSettings
),
SerializerFeature
.
WriteMapNullValue
);
webSocketMap
.
get
(
id
).
sendMessage
(
new
TextMessage
(
data
));
}
String
httpSessionId
=
session
.
getId
();
...
...
src/main/java/com/subsidy/vo/businessScope/BusinessScopeDictVO.java
0 → 100644
View file @
99ef83c
package
com
.
subsidy
.
vo
.
businessScope
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
BusinessScopeDictVO
{
private
Long
id
;
private
Long
parentId
;
private
String
businessScopeName
;
private
List
<
BusinessScopeDictVO
>
childNode
;
}
src/main/java/com/subsidy/vo/classdict/ClassSettingsVO.java
View file @
99ef83c
...
...
@@ -5,6 +5,8 @@ import lombok.Data;
@Data
public
class
ClassSettingsVO
{
private
Long
id
;
/**
* 是否按照顺序播放
*/
...
...
@@ -60,13 +62,7 @@ public class ClassSettingsVO {
*/
private
Integer
playSnap
;
/**
*
*/
private
Integer
ipAddressRecord
;
/**
*
*/
private
Integer
deviceNoRecord
;
}
src/main/resources/mapper/BusinessScopeDictMapper.xml
View file @
99ef83c
...
...
@@ -8,6 +8,7 @@
<result
column=
"create_date"
property=
"createDate"
/>
<result
column=
"update_date"
property=
"updateDate"
/>
<result
column=
"delete_date"
property=
"deleteDate"
/>
<result
column=
"parent_id"
property=
"parentId"
/>
<result
column=
"business_scope_name"
property=
"businessScopeName"
/>
</resultMap>
...
...
@@ -16,7 +17,17 @@
create_date,
update_date,
delete_date,
id, business_scope_name
id,
parent_id,
business_scope_name
</sql>
<select
id=
"queryBusinessScopePage"
resultType=
"com.subsidy.vo.businessScope.BusinessScopeDictVO"
>
select * from business_scope_dict
<where>
<if
test=
"businessScopeName != null"
>
business_scope_name like concat('%', #{businessScopeName} ,'%')
</if>
delete_date is null
</where>
</select>
</mapper>
src/main/resources/mapper/ContentVodMappingMapper.xml
View file @
99ef83c
...
...
@@ -18,7 +18,7 @@
create_date,
update_date,
delete_date,
id, content_id, vod_id, order_no
id, content_id, vod_id,
vod_alias_name,
order_no
</sql>
</mapper>
src/main/resources/mapper/VodDictMapper.xml
View file @
99ef83c
...
...
@@ -47,7 +47,7 @@
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t3.delete_date IS NULL
AND t.content_id = #{contentId}
AND t
3
.content_id = #{contentId}
<if
test=
"vodName != null and vodName !=''"
>
and vod_name like concat('%',#{vodName} ,'%')
</if>
...
...
Write
Preview
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