Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jgjy
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
jgjy
Commits
2d6f3226
提交
2d6f3226
authored
5月 15, 2019
作者:
chaoyanjun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
243a3044
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
63 行增加
和
7 行删除
+63
-7
BulletinContentController.java
...ysuser/controller/bulletin/BulletinContentController.java
+25
-7
BulletinColumnMapper.java
...zrqx/bg/sysuser/mapper/bulletin/BulletinColumnMapper.java
+18
-0
BulletinColumnService.java
...qx/bg/sysuser/service/bulletin/BulletinColumnService.java
+8
-0
BulletinColumnServiceImpl.java
...g/sysuser/service/bulletin/BulletinColumnServiceImpl.java
+12
-0
没有找到文件。
com.zrqx.bg.sysuser/src/main/java/com/zrqx/bg/sysuser/controller/bulletin/BulletinContentController.java
浏览文件 @
2d6f3226
...
...
@@ -5,7 +5,9 @@ import io.swagger.annotations.ApiOperation;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -15,15 +17,19 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example.Criteria
;
import
com.zrqx.bg.sysuser.service.bulletin.BulletinColumnService
;
import
com.zrqx.bg.sysuser.service.bulletin.BulletinContentService
;
import
com.zrqx.core.constant.sysuser.SysUserRequestPath
;
import
com.zrqx.core.enums.ResponseCodeEnum
;
import
com.zrqx.core.exception.BusinessValidateException
;
import
com.zrqx.core.exception.ParameterValidateException
;
import
com.zrqx.core.form.sysuser.bg.bulletin.BulletinContentForm
;
import
com.zrqx.core.form.sysuser.bg.bulletin.BulletinContentStatusForm
;
import
com.zrqx.core.form.sysuser.bg.bulletin.QueryBulletinContentForm
;
import
com.zrqx.core.form.sysuser.bg.bulletin.UpdateBulletinContentForm
;
import
com.zrqx.core.model.sysuser.bulletin.BulletinColumn
;
import
com.zrqx.core.model.sysuser.bulletin.BulletinContent
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
...
...
@@ -40,12 +46,18 @@ public class BulletinContentController {
@Autowired
private
BulletinContentService
service
;
@Autowired
private
BulletinColumnService
bulletinColumnService
;
@ApiOperation
(
value
=
"新增"
,
notes
=
"新增一个"
)
@PostMapping
(
value
=
SysUserRequestPath
.
SAVE
)
public
CallBack
<
Boolean
>
saveAdsign
(
@RequestBody
BulletinContent
entity
)
{
entity
.
setTopStatus
(
0
);
entity
.
setCreateTime
(
new
Date
());
if
(!
service
.
insert
(
entity
))
{
public
CallBack
<
Boolean
>
saveAdsign
(
@RequestBody
BulletinContentForm
entity
)
{
BulletinContent
record
=
new
BulletinContent
();
record
.
setTopStatus
(
0
);
record
.
setCreateTime
(
new
Date
());
int
columnId
=
bulletinColumnService
.
getIdByName
(
entity
.
getColumnName
());
record
.
setColumnId
(
columnId
);
BeanUtils
.
copyProperties
(
entity
,
record
);
if
(!
service
.
insert
(
record
))
{
throw
new
BusinessValidateException
(
"操作失败"
);
}
return
CallBack
.
success
(
true
);
...
...
@@ -89,10 +101,14 @@ public class BulletinContentController {
@ApiOperation
(
value
=
"修改"
,
notes
=
"修改"
)
@PostMapping
(
value
=
SysUserRequestPath
.
UPDATE
)
public
CallBack
<
Boolean
>
update
(
@RequestBody
BulletinContent
entity
)
{
public
CallBack
<
Boolean
>
update
(
@RequestBody
BulletinContentForm
entity
)
{
BulletinContent
record
=
new
BulletinContent
();
BulletinContent
old
=
service
.
selectByPrimaryKey
(
entity
.
getId
());
entity
.
setUpdateTime
(
new
Date
());
entity
.
setCreateTime
(
old
.
getCreateTime
());
record
.
setUpdateTime
(
new
Date
());
record
.
setCreateTime
(
old
.
getCreateTime
());
int
columnId
=
bulletinColumnService
.
getIdByName
(
entity
.
getColumnName
());
record
.
setColumnId
(
columnId
);
BeanUtils
.
copyProperties
(
entity
,
record
);
if
(!
service
.
updateByPrimaryKey
(
entity
))
{
throw
new
BusinessValidateException
(
"操作失败"
);
}
...
...
@@ -122,6 +138,8 @@ public class BulletinContentController {
* CallBack.success(service.queryExample(page));
*/
pageParam
.
setOrderBy
(
"t.topStatus desc, t.releaseTime desc"
);
int
columnId
=
bulletinColumnService
.
getIdByName
(
form
.
getColumnName
());
form
.
setColumnId
(
columnId
);
return
CallBack
.
success
(
service
.
page
(
form
,
pageParam
));
}
...
...
com.zrqx.bg.sysuser/src/main/java/com/zrqx/bg/sysuser/mapper/bulletin/BulletinColumnMapper.java
浏览文件 @
2d6f3226
package
com
.
zrqx
.
bg
.
sysuser
.
mapper
.
bulletin
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.model.sysuser.bulletin.BulletinColumn
;
/**
...
...
@@ -7,4 +10,19 @@ import com.zrqx.core.model.sysuser.bulletin.BulletinColumn;
*/
public
interface
BulletinColumnMapper
extends
BaseMapper
<
BulletinColumn
>
{
/**
* 根据栏目名称查id
* @param name
* @return
* @author chyj
* @date: 2019年5月15日 下午4:36:49
*/
@Select
(
" <script> "
+
" select id from sys_bulletin_column where 1=1 "
+
" <if test='name != null'> "
+
" and name = #{name} "
+
" </if> "
+
" </script> "
)
Integer
getIdByName
(
@Param
(
"name"
)
String
name
);
}
com.zrqx.bg.sysuser/src/main/java/com/zrqx/bg/sysuser/service/bulletin/BulletinColumnService.java
浏览文件 @
2d6f3226
...
...
@@ -7,4 +7,12 @@ import com.zrqx.core.service.BaseService;
*/
public
interface
BulletinColumnService
extends
BaseService
<
BulletinColumn
,
Integer
>
{
/**
* 根据栏目名称查id
* @param name
* @return
* @author chyj
* @date: 2019年5月15日 下午4:35:26
*/
Integer
getIdByName
(
String
name
);
}
com.zrqx.bg.sysuser/src/main/java/com/zrqx/bg/sysuser/service/bulletin/BulletinColumnServiceImpl.java
浏览文件 @
2d6f3226
...
...
@@ -21,4 +21,16 @@ public class BulletinColumnServiceImpl extends BaseServiceImpl<BulletinColumn,In
return
mapper
;
}
/**
* 根据栏目名称查id
* @param name
* @return
* @author chyj
* @date: 2019年5月15日 下午4:35:26
*/
@Override
public
Integer
getIdByName
(
String
name
)
{
return
mapper
.
getIdByName
(
name
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论