Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
rszt
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
rszt
Commits
ca0dd345
提交
ca0dd345
authored
12月 15, 2020
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
9c1a0640
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
22 行增加
和
72 行删除
+22
-72
SaveUpdateVideoLibraryForm.java
.../resource/bg/videolibrary/SaveUpdateVideoLibraryForm.java
+2
-9
SaveVideoLibraryForm.java
...e/form/resource/bg/videolibrary/SaveVideoLibraryForm.java
+2
-0
DiyType.java
...in/java/com/zrqx/core/model/resource/diytype/DiyType.java
+2
-0
DiyTypeController.java
...rqx/resource/bg/controller/diytype/DiyTypeController.java
+15
-56
VideoLibrarySerivceImpl.java
...urce/bg/service/videolibrary/VideoLibrarySerivceImpl.java
+1
-7
没有找到文件。
com.zrqx.core/src/main/java/com/zrqx/core/form/resource/bg/videolibrary/SaveUpdateVideoLibraryForm.java
浏览文件 @
ca0dd345
package
com
.
zrqx
.
core
.
form
.
resource
.
bg
.
videolibrary
;
import
java.util.List
;
import
com.zrqx.core.model.resource.videolibrary.VideoLibraryDiyType
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -16,12 +12,8 @@ public class SaveUpdateVideoLibraryForm {
private
String
name
;
@ApiModelProperty
(
"来源"
)
private
String
source
;
@ApiModelProperty
(
value
=
"分类id"
)
private
List
<
VideoLibraryDiyType
>
diyType
;
@ApiModelProperty
(
"封面"
)
private
String
img
;
@ApiModelProperty
(
"默认封面"
)
private
String
defaultImg
;
@ApiModelProperty
(
"简介"
)
private
String
synopsis
;
@ApiModelProperty
(
"video"
)
...
...
@@ -32,5 +24,6 @@ public class SaveUpdateVideoLibraryForm {
private
String
timeLength
;
@ApiModelProperty
(
"文件大小"
)
private
String
size
;
@ApiModelProperty
(
"排序"
)
private
String
sort
;
}
com.zrqx.core/src/main/java/com/zrqx/core/form/resource/bg/videolibrary/SaveVideoLibraryForm.java
浏览文件 @
ca0dd345
...
...
@@ -28,4 +28,6 @@ public class SaveVideoLibraryForm {
private
List
<
String
>
timeLength
;
@ApiModelProperty
(
"video名称"
)
private
List
<
String
>
videoName
;
@ApiModelProperty
(
"排序"
)
private
String
sort
;
}
com.zrqx.core/src/main/java/com/zrqx/core/model/resource/diytype/DiyType.java
浏览文件 @
ca0dd345
...
...
@@ -37,4 +37,6 @@ public class DiyType {
private
Integer
status
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"封面"
)
private
String
cover
;
}
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/controller/diytype/DiyTypeController.java
浏览文件 @
ca0dd345
...
...
@@ -54,7 +54,7 @@ import tk.mybatis.mapper.entity.Example.Criteria;
*/
@RestController
@RequestMapping
(
ResourceRequestPath
.
BG
+
ResourceRequestPath
.
DIYTYPE
)
@Api
(
description
=
"网站管理-
自定义分类
"
)
@Api
(
description
=
"网站管理-
赛程回顾
"
)
public
class
DiyTypeController
{
@Autowired
...
...
@@ -72,75 +72,34 @@ public class DiyTypeController {
@PostMapping
(
value
=
ResourceRequestPath
.
SAVE
)
public
CallBack
<
Boolean
>
save
(
@RequestBody
DiyType
entity
)
{
Example
example
=
service
.
createExample
();
example
.
createCriteria
().
andEqualTo
(
"typeName"
,
entity
.
getTypeName
()).
andEqualTo
(
"parentId"
,
entity
.
getParentId
());
if
(
service
.
selectOneByExample
(
example
)
!=
null
)
{
throw
new
BusinessValidateException
(
"同级已存在"
+
entity
.
getTypeName
());
example
.
createCriteria
().
andEqualTo
(
"typeName"
,
entity
.
getTypeName
()).
andEqualTo
(
"parentId"
,
entity
.
getParentId
());
if
(
service
.
selectOneByExample
(
example
)
!=
null
){
throw
new
BusinessValidateException
(
"同级已存在"
+
entity
.
getTypeName
());
}
/*
* if(entity.getParentId().equals(0) &&
* AllResourceTypeEnum.getCode(entity.getTypeName()) == null){ throw new
* BusinessValidateException("分类名称错误"); }
*/
// 分页排序查询当前子分类最大code值
//分页排序查询当前子分类最大code值
example
=
service
.
createExample
();
example
.
createCriteria
().
andEqualTo
(
"parentId"
,
entity
.
getParentId
());
PageParam
pageParam
=
new
PageParam
();
pageParam
.
setPageSize
(
1
);
pageParam
.
setOrderBy
(
"code desc"
);
PageInfo
<
DiyType
>
page
=
service
.
queryExample
(
pageParam
,
example
);
if
(
page
.
getList
()
!=
null
&&
page
.
getList
().
size
()
>
0
)
{
//
查询到子分类,获取最大code生成新的code
String
code
=
page
.
getList
().
get
(
0
).
getCode
()
.
toString
()
;
PageInfo
<
DiyType
>
page
=
service
.
queryExample
(
pageParam
,
example
);
if
(
page
.
getList
()
!=
null
&&
page
.
getList
().
size
()
>
0
)
{
//查询到子分类,获取最大code生成新的code
String
code
=
page
.
getList
().
get
(
0
).
getCode
();
entity
.
setCode
(
UUIDUtil
.
newCode
(
code
));
}
else
{
//
没有查询到子分类,获取父类code 拼接 01
if
(
entity
.
getParentId
()
!=
0
)
{
entity
.
setCode
(
service
.
selectByPrimaryKey
(
entity
.
getParentId
()).
getCode
()
+
"01"
);
}
else
{
}
else
{
//没有查询到子分类,获取父类code 拼接 01
if
(
entity
.
getParentId
()!=
0
)
{
entity
.
setCode
(
service
.
selectByPrimaryKey
(
entity
.
getParentId
()).
getCode
()+
"01"
);
}
else
{
entity
.
setCode
(
"01"
);
}
}
entity
.
setStatus
(
DiyTypeStatusEnum
.
STATUS_1
.
getCode
());
entity
.
setCreateTime
(
new
Date
());
if
(!
service
.
insert
(
entity
))
{
if
(!
service
.
insert
(
entity
))
{
throw
new
BusinessValidateException
(
"操作失败"
);
}
System
.
out
.
println
(
entity
.
getCode
().
length
());
if
(
entity
.
getCode
().
contains
(
"0003"
))
{
if
(
entity
.
getCode
().
length
()
==
6
)
{
for
(
int
i
=
1
;
i
<=
24
;
i
++)
{
DiyType
diytype
=
new
DiyType
();
diytype
.
setParentId
(
entity
.
getId
());
diytype
.
setTypeName
(
entity
.
getShowName
().
substring
(
0
,
4
)
+
"年第"
+
i
+
"期"
);
diytype
.
setShowName
(
entity
.
getShowName
().
substring
(
0
,
4
)
+
"年第"
+
i
+
"期"
);
diytype
.
setSort
(
i
);
example
=
service
.
createExample
();
System
.
out
.
println
(
entity
.
getId
());
example
.
createCriteria
().
andEqualTo
(
"parentId"
,
entity
.
getId
());
pageParam
.
setPageSize
(
1
);
pageParam
.
setOrderBy
(
"code desc"
);
page
=
service
.
queryExample
(
pageParam
,
example
);
if
(
page
.
getList
()
!=
null
&&
page
.
getList
().
size
()
>
0
)
{
// 查询到子分类,获取最大code生成新的code
String
code
=
page
.
getList
().
get
(
0
).
getCode
().
toString
();
diytype
.
setCode
(
UUIDUtil
.
newCode
(
code
));
}
else
{
// 没有查询到子分类,获取父类code 拼接 01
if
(
entity
.
getParentId
()
!=
0
)
{
diytype
.
setCode
(
service
.
selectByPrimaryKey
(
diytype
.
getParentId
()).
getCode
()
+
"01"
);
}
else
{
diytype
.
setCode
(
"01"
);
}
}
diytype
.
setStatus
(
DiyTypeStatusEnum
.
STATUS_1
.
getCode
());
diytype
.
setCreateTime
(
new
Date
());
if
(!
service
.
insert
(
diytype
))
{
throw
new
BusinessValidateException
(
"操作失败"
);
}
}
}
}
return
CallBack
.
success
(
true
);
}
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/service/videolibrary/VideoLibrarySerivceImpl.java
浏览文件 @
ca0dd345
...
...
@@ -55,10 +55,6 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
public
boolean
saveOrUpdate
(
SaveUpdateVideoLibraryForm
form
)
{
VideoLibrary
entity
=
new
VideoLibrary
();
BeanUtils
.
copyProperties
(
form
,
entity
);
if
(
StringUtils
.
isNotBlank
(
entity
.
getDefaultImg
()))
{
String
defaultImg
=
entity
.
getDefaultImg
()
+
"/"
+
entity
.
getVideo
()
+
"/1.jpg"
;
entity
.
setDefaultImg
(
defaultImg
);
}
if
(
StringUtils
.
isBlank
(
entity
.
getId
())){
//添加
entity
.
setStatus
(
LibraryStatusEnum
.
STATUS_0
.
getCode
());
...
...
@@ -72,8 +68,6 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
mapper
.
insert
(
entity
);
}
else
{
//修改
/* entity = mapper.selectByPrimaryKey(form.getId());
BeanUtils.copyProperties(form, entity);*/
entity
.
setUpdateTime
(
new
Date
());
entity
.
setAdSlogan
(
form
.
getSource
());
mapper
.
updateByPrimaryKeySelective
(
entity
);
...
...
@@ -111,9 +105,9 @@ public class VideoLibrarySerivceImpl extends BaseServiceImpl<VideoLibrary,String
obj
.
setSalesNum
(
0
);
obj
.
setVideoName
(
form
.
getNames
().
get
(
i
));
obj
.
setAdSlogan
(
form
.
getSource
());
obj
.
setSort
(
this
.
getMaxSort
());
mapper
.
insert
(
obj
);
}
return
true
;
}
/**
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论