Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
skz
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
skz
Commits
f369ba1a
提交
f369ba1a
authored
4月 03, 2020
作者:
yucaiwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
2b903670
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
46 行增加
和
6 行删除
+46
-6
ForumMapper.java
...in/java/com/zrqx/sysuser/bg/mapper/Forum/ForumMapper.java
+2
-2
ForumServiceImpl.java
...a/com/zrqx/sysuser/bg/service/forum/ForumServiceImpl.java
+3
-2
FgForumController.java
...m/zrqx/sysuser/fg/controller/forum/FgForumController.java
+2
-0
FgForumMapper.java
.../java/com/zrqx/sysuser/fg/mapper/forum/FgForumMapper.java
+2
-2
FgForumService.java
...ava/com/zrqx/sysuser/fg/service/forum/FgForumService.java
+9
-0
FgForumServiceImpl.java
...com/zrqx/sysuser/fg/service/forum/FgForumServiceImpl.java
+28
-0
没有找到文件。
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/bg/mapper/Forum/ForumMapper.java
浏览文件 @
f369ba1a
...
...
@@ -44,8 +44,8 @@ public interface ForumMapper extends BaseMapper<Forum> {
+
"<if test = 'isOnLine != null'>"
+
" AND s1.isOnLine = #{isOnLine} "
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(b
i
ginTime)'>"
+
"and DATE_FORMAT(s1.releaseTime,'%Y-%m-%d') >= #{b
i
ginTime} "
+
"<if test = '"
+
NOTBLANK
+
"(b
e
ginTime)'>"
+
"and DATE_FORMAT(s1.releaseTime,'%Y-%m-%d') >= #{b
e
ginTime} "
+
"</if>"
+
"<if test = '"
+
NOTBLANK
+
"(endTime)'>"
+
"and DATE_FORMAT(s1.releaseTime,'%Y-%m-%d') <= #{endTime} "
...
...
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/bg/service/forum/ForumServiceImpl.java
浏览文件 @
f369ba1a
...
...
@@ -51,6 +51,7 @@ public class ForumServiceImpl extends BaseServiceImpl<Forum, Integer> implements
throw
new
ParameterValidateException
(
6
,
"必填参数不能为空"
);
}
BeanUtils
.
copyProperties
(
form
,
forum
);
forum
.
setImgs
(
StringUtils
.
join
(
form
.
getImgList
(),
","
));
forum
.
setUserId
(
user
.
getUserId
());
forum
.
setPhone
(
user
.
getPhone
());
forum
.
setReleaseTime
(
new
Date
());
...
...
@@ -70,9 +71,9 @@ public class ForumServiceImpl extends BaseServiceImpl<Forum, Integer> implements
}
forum
.
setId
(
form
.
getId
());
forum
.
setTitle
(
form
.
getTitle
());
form
.
setContent
(
form
.
getContent
());
for
u
m
.
setContent
(
form
.
getContent
());
forum
.
setType
(
form
.
getType
());
forum
.
setImgs
(
form
.
getImgs
(
));
forum
.
setImgs
(
StringUtils
.
join
(
form
.
getImgList
(),
","
));
return
mapper
.
updateByPrimaryKeySelective
(
forum
)
>
0
;
}
}
...
...
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/fg/controller/forum/FgForumController.java
浏览文件 @
f369ba1a
...
...
@@ -57,6 +57,8 @@ public class FgForumController {
@ApiOperation
(
value
=
"查看帖子详情及回复分页"
,
notes
=
"查看评论详情及回复"
)
@GetMapping
(
value
=
SysUserRequestPath
.
GET
)
public
CallBack
<
FgForumDetailsVo
>
getById
(
Integer
oid
,
PageParam
pageParam
)
{
// 更新浏览量
service
.
updateBrowseNum
(
oid
);
return
CallBack
.
success
(
service
.
getById
(
oid
,
pageParam
));
}
...
...
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/fg/mapper/forum/FgForumMapper.java
浏览文件 @
f369ba1a
...
...
@@ -20,7 +20,7 @@ public interface FgForumMapper extends BaseMapper<Forum> {
* @date: 2019年4月10日 下午7:26:07
*/
@Select
(
"<script>"
+
"select id,userId,title,content,type,DATE_FORMAT(releaseTime,'%Y-%m-%d %H:%i') releaseTime,status,isOnLine,topStatus,fabulousNum,browseNum,imgs "
+
"select id,userId,title,content,type,DATE_FORMAT(releaseTime,'%Y-%m-%d %H:%i
:%s
') releaseTime,status,isOnLine,topStatus,fabulousNum,browseNum,imgs "
+
"FROM sys_Forum "
+
"where 1 = 1 and fatherId = 0 "
+
"<if test = 'type != null' >"
...
...
@@ -43,7 +43,7 @@ public interface FgForumMapper extends BaseMapper<Forum> {
* @date: 2019年4月10日 下午6:24:21
*/
@Select
(
"<script>"
+
"select id,userId,userName,userImg,title,content,type,DATE_FORMAT(releaseTime,'%Y-%m-%d %H:%i') releaseTime,status,isOnLine,topStatus,name,fabulousNum,browseNum,userClass,fatherId,fatherName,mainId "
+
"select id,userId,userName,userImg,title,content,type,DATE_FORMAT(releaseTime,'%Y-%m-%d %H:%i
:%s
') releaseTime,status,isOnLine,topStatus,name,fabulousNum,browseNum,userClass,fatherId,fatherName,mainId "
+
"FROM sys_Forum "
+
"where 1 = 1 and mainId = #{mainId} "
+
"<if test = 'userId == null' >"
...
...
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/fg/service/forum/FgForumService.java
浏览文件 @
f369ba1a
...
...
@@ -38,4 +38,13 @@ public interface FgForumService extends BaseService<Forum, Integer> {
* @date: 2019年1月22日 下午6:45:48
*/
FgForumDetailsVo
getById
(
Integer
oid
,
PageParam
pageParam
);
/**
* 更新浏览量
* @param oid
* @return
* @author ycw
* @date: 2019年1月30日 下午3:19:54
*/
boolean
updateBrowseNum
(
Integer
oid
);
}
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/fg/service/forum/FgForumServiceImpl.java
浏览文件 @
f369ba1a
...
...
@@ -17,11 +17,13 @@ import com.zrqx.core.enums.OnOffLineStatusEnum;
import
com.zrqx.core.enums.sysuser.comment.CommentEnum
;
import
com.zrqx.core.enums.sysuser.comment.UserTypeEnum
;
import
com.zrqx.core.enums.sysuser.forum.ForumTypeEnum
;
import
com.zrqx.core.exception.BusinessValidateException
;
import
com.zrqx.core.exception.LoginValidateException
;
import
com.zrqx.core.exception.ParameterValidateException
;
import
com.zrqx.core.form.member.fg.permissions.LoginMemberInfo
;
import
com.zrqx.core.form.sysuser.fg.forum.FgSaveForumForm
;
import
com.zrqx.core.mapper.BaseMapper
;
import
com.zrqx.core.model.resource.articlelibrary.ArticleLibrary
;
import
com.zrqx.core.model.sysuser.forum.Forum
;
import
com.zrqx.core.model.sysuser.forum.ForumAgree
;
import
com.zrqx.core.service.BaseServiceImpl
;
...
...
@@ -64,6 +66,8 @@ public class FgForumServiceImpl extends BaseServiceImpl<Forum, Integer>
startPage
(
pageParam
);
List
<
FgForumListVo
>
list
=
mapper
.
pageForum
(
type
,
userId
);
list
.
forEach
(
l
->
{
// 时间截取
l
.
setReleaseTime
(
StringUtils
.
substring
(
l
.
getReleaseTime
(),
0
,
16
));
// 设置回复数量
String
u
=
null
;
if
(
redisManage
.
isExistMember
()){
...
...
@@ -222,6 +226,8 @@ public class FgForumServiceImpl extends BaseServiceImpl<Forum, Integer>
});
}
vos
.
forEach
(
l
->
{
// 时间截取
l
.
setReleaseTime
(
StringUtils
.
substring
(
l
.
getReleaseTime
(),
0
,
16
));
//对每条评论,判断是否已点赞
l
.
setIsAgree
(
Integer
.
parseInt
(
BooleanStatusEnum
.
NO
.
getCode
()));
// 评论或者回复是否是发布人
...
...
@@ -325,4 +331,26 @@ public class FgForumServiceImpl extends BaseServiceImpl<Forum, Integer>
return
respage
;
}
/**
* 更新浏览量
* @param oid
* @return
* @author ycw
* @date: 2019年1月30日 下午3:19:54
*/
@Override
public
boolean
updateBrowseNum
(
Integer
oid
){
Forum
forum
=
mapper
.
selectByPrimaryKey
(
oid
);
if
(
forum
==
null
){
throw
new
BusinessValidateException
(
"此帖子不存在"
);
}
if
(
forum
.
getBrowseNum
()
==
null
){
forum
.
setBrowseNum
(
50
);
}
Integer
num
=
forum
.
getBrowseNum
();
num
+=
1
;
forum
.
setBrowseNum
(
num
);
mapper
.
updateByPrimaryKeySelective
(
forum
);
return
true
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论