Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
fea014c1
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fea014c1
编写于
4月 09, 2020
作者:
liyi_hz2008
提交者:
liyi_hz2008
4月 09, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增两个配置适应对回帖的排序和对回帖删除的方式控制
上级
31748319
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
140 addition
and
51 deletion
+140
-51
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/factory/BBSReplyInfoFactory.java
...m/x/bbs/assemble/control/factory/BBSReplyInfoFactory.java
+33
-7
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionDelete.java
.../x/bbs/assemble/control/jaxrs/replyinfo/ActionDelete.java
+35
-16
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionGet.java
...com/x/bbs/assemble/control/jaxrs/replyinfo/ActionGet.java
+6
-6
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionListWithReply.java
...assemble/control/jaxrs/replyinfo/ActionListWithReply.java
+3
-2
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionListWithSubjectForPage.java
...control/jaxrs/replyinfo/ActionListWithSubjectForPage.java
+6
-7
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/BaseAction.java
...om/x/bbs/assemble/control/jaxrs/replyinfo/BaseAction.java
+2
-7
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSConfigSettingService.java
...bbs/assemble/control/service/BBSConfigSettingService.java
+24
-0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSReplyInfoService.java
...m/x/bbs/assemble/control/service/BBSReplyInfoService.java
+30
-5
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSSubjectInfoService.java
...x/bbs/assemble/control/service/BBSSubjectInfoService.java
+1
-1
未找到文件。
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/factory/BBSReplyInfoFactory.java
浏览文件 @
fea014c1
...
...
@@ -106,7 +106,7 @@ public class BBSReplyInfoFactory extends AbstractFactory {
* @return
* @throws Exception
*/
public
List
<
BBSReplyInfo
>
listWithSubjectForPage
(
String
subjectId
,
Boolean
showSubReply
,
Integer
maxCount
)
throws
Exception
{
public
List
<
BBSReplyInfo
>
listWithSubjectForPage
(
String
subjectId
,
Boolean
showSubReply
,
Integer
maxCount
,
String
orderType
)
throws
Exception
{
if
(
subjectId
==
null
){
throw
new
Exception
(
"subjectId can not null."
);
}
...
...
@@ -120,13 +120,14 @@ public class BBSReplyInfoFactory extends AbstractFactory {
p_showSubReply
=
cb
.
or
(
p_showSubReply
,
cb
.
equal
(
root
.
get
(
BBSReplyInfo_
.
parentId
),
""
));
p
=
cb
.
and
(
p
,
p_showSubReply
);
}
cq
.
orderBy
(
cb
.
desc
(
root
.
get
(
BBSReplyInfo_
.
createTime
)
)
);
if
(
StringUtils
.
equalsIgnoreCase
(
orderType
,
"DESC"
)){
cq
.
orderBy
(
cb
.
desc
(
root
.
get
(
BBSReplyInfo_
.
createTime
)
)
);
}
else
{
cq
.
orderBy
(
cb
.
asc
(
root
.
get
(
BBSReplyInfo_
.
createTime
)
)
);
}
if
(
maxCount
==
null
){
// System.out.println( ">>>>>SQL:" + em.createQuery(cq.where(p)).toString() );
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
2000
).
getResultList
();
}
else
{
// System.out.println( ">>>>>SQL:" + em.createQuery(cq.where(p)).setMaxResults( maxCount ).toString() );
return
em
.
createQuery
(
cq
.
where
(
p
)).
setMaxResults
(
maxCount
).
getResultList
();
}
}
...
...
@@ -422,7 +423,7 @@ public class BBSReplyInfoFactory extends AbstractFactory {
* @param replyId
* @return
*/
public
List
<
BBSReplyInfo
>
listReplyWithReplyId
(
String
replyId
)
throws
Exception
{
public
List
<
BBSReplyInfo
>
listReplyWithReplyId
(
String
replyId
,
String
orderType
)
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
replyId
)
){
throw
new
Exception
(
"replyId is empty!"
);
}
...
...
@@ -435,6 +436,31 @@ public class BBSReplyInfoFactory extends AbstractFactory {
cb
.
equal
(
root
.
get
(
BBSReplyInfo_
.
replyAuditStatus
),
"无审核"
),
cb
.
equal
(
root
.
get
(
BBSReplyInfo_
.
replyAuditStatus
),
"审核通过"
)
));
if
(
StringUtils
.
equalsIgnoreCase
(
orderType
,
"DESC"
)){
cq
.
orderBy
(
cb
.
desc
(
root
.
get
(
BBSReplyInfo_
.
createTime
)
)
);
}
else
{
cq
.
orderBy
(
cb
.
asc
(
root
.
get
(
BBSReplyInfo_
.
createTime
)
)
);
}
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
}
/**
* 根据回复ID,查询二级回复列表,状态:无审核|审核通过
*
* @param replyId
* @return
*/
public
List
<
String
>
listSubReplyIdsWithReplyId
(
String
replyId
)
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
replyId
)
){
return
null
;
}
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
BBSReplyInfo
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
BBSReplyInfo
>
root
=
cq
.
from
(
BBSReplyInfo
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
BBSReplyInfo_
.
parentId
),
replyId
);
cq
.
select
(
root
.
get
(
BBSReplyInfo_
.
id
)
);
return
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
}
}
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionDelete.java
浏览文件 @
fea014c1
...
...
@@ -2,12 +2,14 @@ package com.x.bbs.assemble.control.jaxrs.replyinfo;
import
javax.servlet.http.HttpServletRequest
;
import
com.alibaba.druid.util.StringUtils
;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.bbs.assemble.control.jaxrs.replyinfo.exception.ExceptionReplyIdEmpty
;
import
com.x.bbs.assemble.control.jaxrs.replyinfo.exception.ExceptionReplyInfoProcess
;
import
com.x.bbs.assemble.control.jaxrs.replyinfo.exception.ExceptionReplyNotExists
;
...
...
@@ -15,6 +17,8 @@ import com.x.bbs.entity.BBSReplyInfo;
import
com.x.bbs.entity.BBSSectionInfo
;
import
com.x.bbs.entity.BBSSubjectInfo
;
import
java.util.List
;
public
class
ActionDelete
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionDelete
.
class
);
...
...
@@ -50,23 +54,38 @@ public class ActionDelete extends BaseAction {
result
.
error
(
exception
);
}
}
try
{
replyInfoService
.
delete
(
id
);
if
(
check
)
{
try
{
String
config_BBS_REPLY_DELETETYPE
=
configSettingService
.
getValueWithConfigCode
(
"BBS_REPLY_DELETETYPE"
);
if
(
StringUtils
.
equals
(
"Recursively"
,
config_BBS_REPLY_DELETETYPE
)){
//递归删除
List
<
String
>
subIds
=
replyInfoService
.
listAllSubReplyIds
(
id
,
null
);
if
(
ListTools
.
isNotEmpty
(
subIds
))
{
for
(
String
replyId
:
subIds
)
{
logger
.
debug
(
"删除下级回复信息,ID="
+
replyId
);
replyInfoService
.
delete
(
replyId
);
}
}
}
replyInfoService
.
delete
(
id
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
id
);
result
.
setData
(
wo
);
Wo
wo
=
new
Wo
();
wo
.
setId
(
id
);
result
.
setData
(
wo
);
ApplicationCache
.
notify
(
BBSSubjectInfo
.
class
);
ApplicationCache
.
notify
(
BBSReplyInfo
.
class
);
ApplicationCache
.
notify
(
BBSSectionInfo
.
class
);
operationRecordService
.
replyOperation
(
effectivePerson
.
getDistinguishedName
(),
replyInfo
,
"DELETE"
,
hostIp
,
hostName
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionReplyInfoProcess
(
e
,
"根据指定ID删除回复信息时发生异常.ID:"
+
id
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
ApplicationCache
.
notify
(
BBSSubjectInfo
.
class
);
ApplicationCache
.
notify
(
BBSReplyInfo
.
class
);
ApplicationCache
.
notify
(
BBSSectionInfo
.
class
);
operationRecordService
.
replyOperation
(
effectivePerson
.
getDistinguishedName
(),
replyInfo
,
"DELETE"
,
hostIp
,
hostName
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionReplyInfoProcess
(
e
,
"根据指定ID删除回复信息时发生异常.ID:"
+
id
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
return
result
;
}
...
...
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionGet.java
浏览文件 @
fea014c1
...
...
@@ -58,17 +58,17 @@ public class ActionGet extends BaseAction {
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
if
(
wrap
!=
null
&&
StringUtils
.
isNotEmpty
(
wrap
.
getCreatorName
()
)
)
{
wrap
.
setCreatorNameShort
(
wrap
.
getCreatorName
().
split
(
"@"
)[
0
]);
}
if
(
wrap
!=
null
&&
StringUtils
.
isNotEmpty
(
wrap
.
getAuditorName
()
)
)
{
wrap
.
setAuditorNameShort
(
wrap
.
getAuditorName
().
split
(
"@"
)[
0
]);
}
}
else
{
Exception
exception
=
new
ExceptionReplyNotExists
(
id
);
result
.
error
(
exception
);
}
}
if
(
StringUtils
.
isNotEmpty
(
wrap
.
getCreatorName
()
)
)
{
wrap
.
setCreatorNameShort
(
wrap
.
getCreatorName
().
split
(
"@"
)[
0
]);
}
if
(
StringUtils
.
isNotEmpty
(
wrap
.
getAuditorName
()
)
)
{
wrap
.
setAuditorNameShort
(
wrap
.
getAuditorName
().
split
(
"@"
)[
0
]);
}
result
.
setData
(
wrap
);
return
result
;
}
...
...
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionListWithReply.java
浏览文件 @
fea014c1
...
...
@@ -69,10 +69,11 @@ public class ActionListWithReply extends BaseAction {
List
<
BBSReplyInfo
>
replyInfoList_out
=
new
ArrayList
<
BBSReplyInfo
>();
Long
total
=
0L
;
Boolean
check
=
true
;
String
config_BBS_REPLY_SORTTYPE
=
configSettingService
.
getValueWithConfigCode
(
"BBS_REPLY_SORTTYPE"
);
if
(
check
)
{
try
{
replyInfoList
=
replyInfoService
.
listRelysWithRelyId
(
replyId
);
replyInfoList
=
replyInfoService
.
listRelysWithRelyId
(
replyId
,
config_BBS_REPLY_SORTTYPE
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionReplyInfoProcess
(
e
,
"根据回复ID查询针对该回复所有的二级回复数量时发生异常。replyId:"
+
replyId
);
...
...
@@ -102,7 +103,7 @@ public class ActionListWithReply extends BaseAction {
wo
.
setAuditorNameShort
(
wo
.
getAuditorName
().
split
(
"@"
)[
0
]);
}
}
SortTools
.
desc
(
wraps
,
"createTime"
);
//
SortTools.desc(wraps, "createTime" );
result
.
setCount
(
Long
.
parseLong
(
wraps
.
size
()+
""
)
);
}
}
...
...
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionListWithSubjectForPage.java
浏览文件 @
fea014c1
...
...
@@ -77,6 +77,7 @@ public class ActionListWithSubjectForPage extends BaseAction {
List
<
BBSReplyInfo
>
replyInfoList_out
=
new
ArrayList
<
BBSReplyInfo
>();
Long
total
=
0L
;
Boolean
check
=
true
;
String
config_BBS_REPLY_SORTTYPE
=
configSettingService
.
getValueWithConfigCode
(
"BBS_REPLY_SORTTYPE"
);
if
(
check
)
{
if
(
page
==
null
)
{
...
...
@@ -105,7 +106,7 @@ public class ActionListWithSubjectForPage extends BaseAction {
if
(
check
)
{
if
(
total
>
0
)
{
try
{
replyInfoList
=
replyInfoService
.
listWithSubjectForPage
(
wrapIn
.
getSubjectId
(),
wrapIn
.
getShowSubReply
(),
page
*
count
);
replyInfoList
=
replyInfoService
.
listWithSubjectForPage
(
wrapIn
.
getSubjectId
(),
wrapIn
.
getShowSubReply
(),
page
*
count
,
config_BBS_REPLY_SORTTYPE
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionReplyInfoProcess
(
e
,
"根据主题ID查询主题内所有的回复列表时发生异常。Subject:"
+
wrapIn
.
getSubjectId
());
...
...
@@ -123,12 +124,12 @@ public class ActionListWithSubjectForPage extends BaseAction {
}
int
startIndex
=
(
page
-
1
)
*
count
;
int
endIndex
=
page
*
count
;
for
(
int
i
=
0
;
replyInfoList
!=
null
&&
i
<
replyInfoList
.
size
();
i
++
)
{
for
(
int
i
=
0
;
replyInfoList
!=
null
&&
i
<
replyInfoList
.
size
();
i
++
)
{
if
(
i
<
replyInfoList
.
size
()
&&
i
>=
startIndex
&&
i
<
endIndex
)
{
replyInfoList_out
.
add
(
replyInfoList
.
get
(
i
)
);
}
}
if
(
ListTools
.
isNotEmpty
(
replyInfoList_out
))
{
if
(
ListTools
.
isNotEmpty
(
replyInfoList_out
))
{
try
{
wraps
=
Wo
.
copier
.
copy
(
replyInfoList_out
);
}
catch
(
Exception
e
)
{
...
...
@@ -141,7 +142,6 @@ public class ActionListWithSubjectForPage extends BaseAction {
}
if
(
check
)
{
if
(
ListTools
.
isNotEmpty
(
wraps
))
{
List
<
BBSReplyInfo
>
subReplies
=
null
;
for
(
Wo
wo
:
wraps
)
{
if
(
StringUtils
.
isNotEmpty
(
wo
.
getCreatorName
()))
{
...
...
@@ -152,10 +152,9 @@ public class ActionListWithSubjectForPage extends BaseAction {
}
//查询一下该回复是否存在下级回复,以及下级回复的数量,除了第一条,其他的都去掉内容,避免大量的网络传输
subReplies
=
replyInfoService
.
listRelysWithRelyId
(
wo
.
getId
()
);
subReplies
=
replyInfoService
.
listRelysWithRelyId
(
wo
.
getId
()
,
config_BBS_REPLY_SORTTYPE
);
if
(
ListTools
.
isNotEmpty
(
subReplies
)){
wrapSubReplies
=
Wo
.
copier
.
copy
(
subReplies
);
SortTools
.
desc
(
wrapSubReplies
,
"createTime"
);
for
(
int
i
=
0
;
i
<
wrapSubReplies
.
size
();
i
++
){
if
(
i
>
0
){
wrapSubReplies
.
get
(
i
).
setContent
(
null
);
...
...
@@ -166,7 +165,7 @@ public class ActionListWithSubjectForPage extends BaseAction {
}
}
result
.
setCount
(
total
);
SortTools
.
desc
(
wraps
,
"createTime"
);
}
}
result
.
setData
(
wraps
);
...
...
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/BaseAction.java
浏览文件 @
fea014c1
...
...
@@ -5,13 +5,7 @@ import java.util.List;
import
com.x.base.core.project.cache.ApplicationCache
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.bbs.assemble.control.service.BBSForumInfoServiceAdv
;
import
com.x.bbs.assemble.control.service.BBSOperationRecordService
;
import
com.x.bbs.assemble.control.service.BBSReplyInfoService
;
import
com.x.bbs.assemble.control.service.BBSSectionInfoServiceAdv
;
import
com.x.bbs.assemble.control.service.BBSSubjectInfoService
;
import
com.x.bbs.assemble.control.service.UserManagerService
;
import
com.x.bbs.assemble.control.service.UserPermissionService
;
import
com.x.bbs.assemble.control.service.*
;
import
com.x.bbs.entity.BBSSubjectInfo
;
import
net.sf.ehcache.Ehcache
;
...
...
@@ -24,6 +18,7 @@ public class BaseAction extends StandardJaxrsAction{
protected
BBSSectionInfoServiceAdv
sectionInfoServiceAdv
=
new
BBSSectionInfoServiceAdv
();
protected
BBSForumInfoServiceAdv
forumInfoServiceAdv
=
new
BBSForumInfoServiceAdv
();
protected
BBSOperationRecordService
operationRecordService
=
new
BBSOperationRecordService
();
protected
BBSConfigSettingService
configSettingService
=
new
BBSConfigSettingService
();
protected
UserManagerService
userManagerService
=
new
UserManagerService
();
protected
Boolean
checkUserPermission
(
String
checkPermissionCode
,
List
<
String
>
permissionInfoList
)
{
...
...
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSConfigSettingService.java
浏览文件 @
fea014c1
...
...
@@ -281,5 +281,29 @@ public class BBSConfigSettingService{
logger
.
warn
(
"system init system config 'BBS_SUBJECT_TYPECATAGORY' got an exception."
);
logger
.
error
(
e
);
}
value
=
"Recursively"
;
type
=
"select"
;
selectContent
=
"Single|Recursively"
;
isMultiple
=
false
;
description
=
"回复删除模式:可选值:Single|Recursively,单选。"
;
try
{
checkAndInitSystemConfig
(
"BBS_REPLY_DELETETYPE"
,
"回复删除模式"
,
value
,
description
,
type
,
selectContent
,
isMultiple
,
++
ordernumber
);
}
catch
(
Exception
e
)
{
logger
.
warn
(
"system init system config 'BBS_REPLY_DELETETYPE' got an exception."
);
logger
.
error
(
e
);
}
value
=
"ASC"
;
type
=
"select"
;
selectContent
=
"ASC|DESC"
;
isMultiple
=
false
;
description
=
"回贴排序模式:可选值:ASC|DESC, 按创建时间正序|倒序,单选。"
;
try
{
checkAndInitSystemConfig
(
"BBS_REPLY_SORTTYPE"
,
"回贴排序模式"
,
value
,
description
,
type
,
selectContent
,
isMultiple
,
++
ordernumber
);
}
catch
(
Exception
e
)
{
logger
.
warn
(
"system init system config 'BBS_REPLY_SORTTYPE' got an exception."
);
logger
.
error
(
e
);
}
}
}
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSReplyInfoService.java
浏览文件 @
fea014c1
package
com.x.bbs.assemble.control.service
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -10,6 +11,7 @@ import com.x.base.core.entity.annotation.CheckPersistType;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.bbs.assemble.control.Business
;
import
com.x.bbs.entity.BBSForumInfo
;
import
com.x.bbs.entity.BBSReplyInfo
;
...
...
@@ -129,7 +131,7 @@ public class BBSReplyInfoService {
BBSSectionInfo
_mainSectoinInfo
=
null
;
BBSForumInfo
_forumInfo
=
null
;
if
(
id
==
null
||
id
.
isEmpty
()
){
throw
new
Exception
(
"id is null, system can not delete any object."
)
;
return
;
}
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
//先判断需要操作的应用信息是否存在,根据ID进行一次查询,如果不存在不允许继续操作
...
...
@@ -185,14 +187,14 @@ public class BBSReplyInfoService {
}
}
public
List
<
BBSReplyInfo
>
listWithSubjectForPage
(
String
subjectId
,
Boolean
showSubReply
,
int
maxCount
)
throws
Exception
{
public
List
<
BBSReplyInfo
>
listWithSubjectForPage
(
String
subjectId
,
Boolean
showSubReply
,
int
maxCount
,
String
orderType
)
throws
Exception
{
if
(
subjectId
==
null
){
throw
new
Exception
(
"subjectId can not null."
);
}
Business
business
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
()
)
{
business
=
new
Business
(
emc
);
return
business
.
replyInfoFactory
().
listWithSubjectForPage
(
subjectId
,
showSubReply
,
maxCount
);
return
business
.
replyInfoFactory
().
listWithSubjectForPage
(
subjectId
,
showSubReply
,
maxCount
,
orderType
);
}
catch
(
Exception
e
){
throw
e
;
}
...
...
@@ -255,16 +257,39 @@ public class BBSReplyInfoService {
* @param replyId
* @return
*/
public
List
<
BBSReplyInfo
>
listRelysWithRelyId
(
String
replyId
)
throws
Exception
{
public
List
<
BBSReplyInfo
>
listRelysWithRelyId
(
String
replyId
,
String
orderType
)
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
replyId
)
){
throw
new
Exception
(
"replyId can not null."
);
}
Business
business
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
()
)
{
business
=
new
Business
(
emc
);
return
business
.
replyInfoFactory
().
listReplyWithReplyId
(
replyId
);
return
business
.
replyInfoFactory
().
listReplyWithReplyId
(
replyId
,
orderType
);
}
catch
(
Exception
e
){
throw
e
;
}
}
public
List
<
String
>
listAllSubReplyIds
(
String
replyId
,
List
<
String
>
allIds
)
throws
Exception
{
if
(
allIds
==
null
){
allIds
=
new
ArrayList
<>();
}
if
(
StringUtils
.
isEmpty
(
replyId
)
){
return
allIds
;
}
Business
business
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
()
)
{
business
=
new
Business
(
emc
);
List
<
String
>
subIds
=
business
.
replyInfoFactory
().
listSubReplyIdsWithReplyId
(
replyId
);
if
(
ListTools
.
isNotEmpty
(
subIds
)){
for
(
String
id
:
subIds
){
if
(
!
allIds
.
contains
(
id
)){
allIds
.
add
(
id
);
listAllSubReplyIds
(
id
,
allIds
);
}
}
}
}
return
allIds
;
}
}
\ No newline at end of file
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/BBSSubjectInfoService.java
浏览文件 @
fea014c1
...
...
@@ -256,7 +256,7 @@ public class BBSSubjectInfoService {
//先判断需要操作的应用信息是否存在,根据ID进行一次查询,如果不存在不允许继续操作
subjectInfo
=
emc
.
find
(
subjectId
,
BBSSubjectInfo
.
class
);
subjectContent
=
emc
.
find
(
subjectId
,
BBSSubjectContent
.
class
);
replyInfoList
=
business
.
replyInfoFactory
().
listWithSubjectForPage
(
subjectId
,
true
,
null
);
replyInfoList
=
business
.
replyInfoFactory
().
listWithSubjectForPage
(
subjectId
,
true
,
null
,
"ASC"
);
voteOptionList
=
business
.
voteOptionFactory
().
listVoteOptionBySubject
(
subjectId
);
voteOptionGroupList
=
business
.
voteOptionFactory
().
listVoteOptionGroupBySubject
(
subjectId
);
voteRecordList
=
business
.
voteRecordFactory
().
listVoteRecordBySubject
(
subjectId
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录