Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zynrgl
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
zynrgl
Commits
73059c86
提交
73059c86
authored
6月 19, 2019
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
a8d0bf20
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
32 行增加
和
38 行删除
+32
-38
ContentController.java
...zrqx/content/bg/controller/content/ContentController.java
+30
-36
ContentSourceController.java
.../bg/controller/contentSource/ContentSourceController.java
+2
-2
没有找到文件。
com.zrqx.content/src/main/java/com/zrqx/content/bg/controller/content/ContentController.java
浏览文件 @
73059c86
...
@@ -3,15 +3,13 @@
...
@@ -3,15 +3,13 @@
*/
*/
package
com
.
zrqx
.
content
.
bg
.
controller
.
content
;
package
com
.
zrqx
.
content
.
bg
.
controller
.
content
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.catalina.startup.Catalina
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -119,15 +117,14 @@ public class ContentController {
...
@@ -119,15 +117,14 @@ public class ContentController {
@ApiOperation
(
value
=
"单条更新"
,
notes
=
"更新内容"
)
@ApiOperation
(
value
=
"单条更新"
,
notes
=
"更新内容"
)
@PostMapping
(
value
=
ContentRequestPath
.
UPDATE_OID
)
@PostMapping
(
value
=
ContentRequestPath
.
UPDATE_OID
)
public
CallBack
<
Boolean
>
update
(
@RequestBody
SaveUpdateContentForm
form
)
{
public
CallBack
<
Boolean
>
update
(
@RequestBody
SaveUpdateContentForm
form
)
{
Content
content
=
new
Content
(
);
Content
content
=
service
.
selectByPrimaryKey
(
form
.
getId
()
);
BeanUtils
.
copyProperties
(
form
,
content
);
BeanUtils
.
copyProperties
(
form
,
content
);
// 所属栏目
// 所属栏目
if
(
content
.
getColumnId
()
==
null
)
{
if
(
form
.
getColumnId
()
==
null
)
{
throw
new
BaseException
(
7
,
"请选择所属栏目"
);
throw
new
BaseException
(
7
,
"请选择所属栏目"
);
}
}
Content
content2
=
service
.
selectByPrimaryKey
(
form
.
getId
());
if
(!
content
.
getColumnId
().
equals
(
form
.
getColumnId
())){
if
(!
content2
.
getColumnId
().
equals
(
form
.
getColumnId
())){
ContentColumn
column1
=
contentColumnService
.
selectByPrimaryKey
(
content
.
getColumnId
());
ContentColumn
column1
=
contentColumnService
.
selectByPrimaryKey
(
content2
.
getColumnId
());
if
(
column1
!=
null
){
if
(
column1
!=
null
){
if
(
column1
.
getContentNum
()>
0
){
if
(
column1
.
getContentNum
()>
0
){
column1
.
setContentNum
(
column1
.
getContentNum
()-
1
);
column1
.
setContentNum
(
column1
.
getContentNum
()-
1
);
...
@@ -145,16 +142,18 @@ public class ContentController {
...
@@ -145,16 +142,18 @@ public class ContentController {
ContentSource
source
=
new
ContentSource
();
ContentSource
source
=
new
ContentSource
();
source
.
setSourceName
(
content
.
getSource
());
source
.
setSourceName
(
content
.
getSource
());
if
(
content
.
getSourceId
()
==
null
)
{
if
(
content
.
getSourceId
()
==
null
)
{
ContentSource
cs
=
sourceService
.
selectOne
(
source
);
if
(
content
.
getSourceState
().
equals
(
1
)){
if
(
cs
==
null
||
cs
.
getId
()
==
null
)
{
ContentSource
cs
=
sourceService
.
selectOne
(
source
);
source
.
setWebsite
(
content
.
getWebsite
());
if
(
cs
==
null
||
cs
.
getId
()
==
null
)
{
Integer
maxSort
=
sourceService
.
getMaxSort
();
source
.
setWebsite
(
content
.
getWebsite
());
source
.
setSort
(
maxSort
+
1
);
Integer
maxSort
=
sourceService
.
getMaxSort
();
source
.
setCreateTime
(
new
Date
());
source
.
setSort
(
maxSort
+
1
);
sourceService
.
insert
(
source
);
source
.
setCreateTime
(
new
Date
());
cs
.
setId
(
source
.
getId
());
sourceService
.
insert
(
source
);
cs
.
setId
(
source
.
getId
());
}
content
.
setSourceId
(
cs
.
getId
());
}
}
content
.
setSourceId
(
cs
.
getId
());
}
}
}
}
content
.
setUpdateTime
(
new
Date
());
content
.
setUpdateTime
(
new
Date
());
...
@@ -195,17 +194,18 @@ public class ContentController {
...
@@ -195,17 +194,18 @@ public class ContentController {
if
(
form
.
getIds
().
length
==
0
)
{
if
(
form
.
getIds
().
length
==
0
)
{
throw
new
BaseException
(
"没有选中任何数据,请重新选择"
);
throw
new
BaseException
(
"没有选中任何数据,请重新选择"
);
}
}
Criteria
cr
=
service
.
createCriteria
();
for
(
Integer
str
:
form
.
getIds
())
{
cr
.
andIn
(
"id"
,
Arrays
.
asList
(
form
.
getIds
()));
Content
content
=
service
.
selectByPrimaryKey
(
str
);
Content
content
=
new
Content
();
if
(
form
.
getStatus
()
!=
null
)
{
if
(
form
.
getStatus
()
!=
null
)
{
content
.
setStatus
(
form
.
getStatus
());
content
.
setStatus
(
form
.
getStatus
());
}
}
if
(
form
.
getIsDelete
()
==
1
)
{
if
(
form
.
getIsDelete
()
==
1
)
{
content
.
setDeleteTime
(
new
Date
());
content
.
setDeleteTime
(
new
Date
());
}
content
.
setIsDelete
(
form
.
getIsDelete
());
service
.
updateByPrimaryKey
(
content
);
}
}
content
.
setIsDelete
(
form
.
getIsDelete
());
return
CallBack
.
success
();
return
CallBack
.
success
(
service
.
updateByCriteriaSelective
(
content
));
}
}
@ApiOperation
(
value
=
"批量彻底删除"
,
notes
=
"批量彻底删除,回收站彻底删除才调用"
)
@ApiOperation
(
value
=
"批量彻底删除"
,
notes
=
"批量彻底删除,回收站彻底删除才调用"
)
...
@@ -232,7 +232,7 @@ public class ContentController {
...
@@ -232,7 +232,7 @@ public class ContentController {
@PostMapping
(
value
=
ContentRequestPath
.
DELETE_ALL
)
@PostMapping
(
value
=
ContentRequestPath
.
DELETE_ALL
)
public
CallBack
<
Integer
>
deleteAll
()
{
public
CallBack
<
Integer
>
deleteAll
()
{
int
num
=
service
.
count
();
int
num
=
service
.
count
();
if
(
num
==
0
)
{
if
(
num
<
1
)
{
throw
new
BaseException
(
"回收站也没有余粮了"
);
throw
new
BaseException
(
"回收站也没有余粮了"
);
}
}
List
<
Integer
>
list
=
service
.
selectAllId
();
List
<
Integer
>
list
=
service
.
selectAllId
();
...
@@ -278,12 +278,6 @@ public class ContentController {
...
@@ -278,12 +278,6 @@ public class ContentController {
@ApiOperation
(
value
=
"分页查询"
,
notes
=
"分页查询"
)
@ApiOperation
(
value
=
"分页查询"
,
notes
=
"分页查询"
)
@GetMapping
(
value
=
ContentRequestPath
.
PAGE
)
@GetMapping
(
value
=
ContentRequestPath
.
PAGE
)
public
CallBack
<
PageInfo
<
ContentVo
>>
page
(
ContentSelectForm
form
,
PageParam
pageParam
)
{
public
CallBack
<
PageInfo
<
ContentVo
>>
page
(
ContentSelectForm
form
,
PageParam
pageParam
)
{
if
(
form
.
getIsDelete
()
==
0
)
{
pageParam
.
setOrderBy
(
"uploadTime desc"
);
}
if
(
form
.
getIsDelete
()
==
1
)
{
pageParam
.
setOrderBy
(
"deleteTime desc"
);
}
return
CallBack
.
success
(
service
.
page
(
form
,
pageParam
));
return
CallBack
.
success
(
service
.
page
(
form
,
pageParam
));
}
}
...
...
com.zrqx.content/src/main/java/com/zrqx/content/bg/controller/contentSource/ContentSourceController.java
浏览文件 @
73059c86
/**
/**
* @author niguanghui
1
* @author niguanghui
* @date 2018年12月24日 下午4:58:44
* @date 2018年12月24日 下午4:58:44
*/
*/
package
com
.
zrqx
.
content
.
bg
.
controller
.
contentSource
;
package
com
.
zrqx
.
content
.
bg
.
controller
.
contentSource
;
...
@@ -90,7 +90,7 @@ public class ContentSourceController {
...
@@ -90,7 +90,7 @@ public class ContentSourceController {
}
}
@ApiOperation
(
value
=
"按来源名称模糊查找"
,
notes
=
"按来源名称模糊查找"
)
@ApiOperation
(
value
=
"按来源名称模糊查找"
,
notes
=
"按来源名称模糊查找"
)
@GetMapping
(
ContentRequestPath
.
PAGE
+
ContentRequestPath
.
NAME
)
@GetMapping
(
ContentRequestPath
.
PAGE
)
public
CallBack
<
PageInfo
<
ContentSource
>>
selectByCondition
(
String
sourceName
,
PageParam
pageParam
)
{
public
CallBack
<
PageInfo
<
ContentSource
>>
selectByCondition
(
String
sourceName
,
PageParam
pageParam
)
{
if
(
null
!=
pageParam
&&
StringUtils
.
isBlank
(
pageParam
.
getOrderBy
()))
{
if
(
null
!=
pageParam
&&
StringUtils
.
isBlank
(
pageParam
.
getOrderBy
()))
{
pageParam
.
setOrderBy
(
"createTime desc"
);
pageParam
.
setOrderBy
(
"createTime desc"
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论