Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
8577e00c
Commit
8577e00c
authored
Feb 27, 2022
by
刘基明
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v2.3.1' of 47.100.44.39:tp-backend/tanpu-community into v2.3.1
parents
2ff9e636
51896947
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
6 deletions
+42
-6
CreateThemeReq.java
...m/tanpu/community/api/beans/req/theme/CreateThemeReq.java
+6
-6
CommentManager.java
...main/java/com/tanpu/community/manager/CommentManager.java
+9
-0
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+9
-0
TopicService.java
...c/main/java/com/tanpu/community/service/TopicService.java
+4
-0
TopicReportService.java
...om/tanpu/community/service/quartz/TopicReportService.java
+14
-0
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/req/theme/CreateThemeReq.java
View file @
8577e00c
...
...
@@ -13,24 +13,24 @@ public class CreateThemeReq {
@NotNull
(
message
=
"类型不能为空"
)
@ApiModelProperty
(
value
=
"类型 1:讨论无标题 2:长文有标题"
)
p
rivate
Integer
themeType
;
p
ublic
Integer
themeType
;
@ApiModelProperty
(
value
=
"标题"
)
p
rivate
String
title
;
p
ublic
String
title
;
@NotEmpty
(
message
=
"内容不能为空"
)
@ApiModelProperty
(
value
=
"文本内容"
)
p
rivate
List
<
ThemeContentReq
>
content
;
p
ublic
List
<
ThemeContentReq
>
content
;
@ApiModelProperty
(
value
=
"所属的话题id"
)
p
rivate
String
topicId
=
""
;
p
ublic
String
topicId
=
""
;
@ApiModelProperty
(
value
=
"修改,则传入正在编辑的ThemeId"
)
p
rivate
String
editThemeId
=
""
;
p
ublic
String
editThemeId
=
""
;
@ApiModelProperty
(
"是否同步到社区 0为不同步 1为同步 默认不同步"
)
p
rivate
Integer
syncToNewComm
=
0
;
p
ublic
Integer
syncToNewComm
=
0
;
}
community-service/src/main/java/com/tanpu/community/manager/CommentManager.java
View file @
8577e00c
...
...
@@ -26,6 +26,7 @@ import com.tanpu.community.service.NotificationService;
import
com.tanpu.community.service.ReportLogService
;
import
com.tanpu.community.service.ThemeService
;
import
com.tanpu.community.service.TopicService
;
import
com.tanpu.community.service.quartz.TopicReportService
;
import
com.tanpu.community.util.ConvertUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -65,11 +66,16 @@ public class CommentManager {
@Autowired
private
ThemeService
themeService
;
@Resource
private
TopicService
topicService
;
@Resource
private
FeignService
feignService
;
@Autowired
private
TopicReportService
topicReportService
;
// 评论(对主题)
// 发表评论(对主题)
public
CommentQo
comment
(
CreateCommentReq
req
,
String
userId
)
{
...
...
@@ -125,6 +131,9 @@ public class CommentManager {
notificationService
.
putNotifyCache
(
commentTheme
.
getAuthorId
(),
userId
,
NotificationTypeEnum
.
FORWARD
);
}
if
(
StringUtils
.
isNotBlank
(
themeEntity
.
getTopicId
()))
{
topicReportService
.
reportTopicOnTime
(
themeEntity
.
getTopicId
());
}
return
commentQo
;
}
...
...
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
8577e00c
...
...
@@ -50,6 +50,7 @@ import com.tanpu.community.feign.community.FeignClientForCommunity;
import
com.tanpu.community.feign.fatools.FeignClientForFatools
;
import
com.tanpu.community.service.*
;
import
com.tanpu.community.service.base.ESService
;
import
com.tanpu.community.service.quartz.TopicReportService
;
import
com.tanpu.community.util.BizUtils
;
import
com.tanpu.community.util.ConvertUtil
;
import
com.tanpu.community.util.OtherUtil
;
...
...
@@ -144,9 +145,13 @@ public class ThemeManager {
@Resource
private
ThemeTextCheckService
themeTextCheckService
;
@Resource
private
TopicService
topicService
;
@Autowired
private
TopicReportService
topicReportService
;
@PostConstruct
public
void
init
()
throws
IOException
{
File
f
=
new
File
(
tmpDir
);
...
...
@@ -273,6 +278,10 @@ public class ThemeManager {
}
if
(
StringUtils
.
isNotBlank
(
req
.
topicId
))
{
topicReportService
.
reportTopicOnTime
(
req
.
topicId
);
}
return
CommonResp
.
success
(
themeResp
);
...
...
community-service/src/main/java/com/tanpu/community/service/TopicService.java
View file @
8577e00c
...
...
@@ -103,6 +103,10 @@ public class TopicService {
return
topicMapper
.
selectList
(
new
LambdaQueryWrapper
<
TopicEntity
>().
in
(
TopicEntity:
:
getTopicId
,
topicIds
));
}
public
TopicEntity
queryById
(
String
topicId
)
{
return
topicMapper
.
selectOne
(
new
LambdaQueryWrapper
<
TopicEntity
>().
eq
(
TopicEntity:
:
getTopicId
,
topicId
));
}
/**
* CRUD Topic_Follow
...
...
community-service/src/main/java/com/tanpu/community/service/quartz/TopicReportService.java
View file @
8577e00c
...
...
@@ -13,6 +13,7 @@ import com.tanpu.community.service.ThemeService;
import
com.tanpu.community.service.TopicService
;
import
com.tanpu.community.service.VisitLogService
;
import
lombok.extern.log4j.Log4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
...
...
@@ -20,6 +21,7 @@ import org.springframework.stereotype.Service;
import
java.util.*
;
@Service
@Slf4j
public
class
TopicReportService
{
@Value
(
"${wxcp.topicreport.agentId}"
)
...
...
@@ -47,6 +49,17 @@ public class TopicReportService {
private
FeignClientForFatools
feignClientForFatools
;
public
static
String
content_report_topic_ontime
=
"话题(%s) 有一个新的讨论/评论"
;
public
void
reportTopicOnTime
(
String
topicId
)
{
TopicEntity
topic
=
topicService
.
queryById
(
topicId
);
if
(
topic
==
null
||
topic
.
getSyncCorpWechat
()
==
0
)
return
;
String
content
=
String
.
format
(
content_report_topic_ontime
,
topic
.
getTopicTitle
());
List
<
String
>
wxcpIds
=
getTopicManagerWxcpIds
(
topic
.
getTopicId
());
sendReportMessage
(
content
,
wxcpIds
);
}
// 每个工作日早上09:30汇报
public
static
String
content_report_topic_weekday
=
"话题(%s) 当前总成员: %s, 当前总阅读: %s, 当前总讨论: %s, 昨日新增成员: %s, 昨日新增讨论"
;
public
void
reportTopicWeekday
()
{
...
...
@@ -137,6 +150,7 @@ public class TopicReportService {
parmMap
.
put
(
"content"
,
content
);
parmMap
.
put
(
"list"
,
wxcpIds
);
log
.
info
(
"sendTopicReportMessage wxcpIds: {}, content: {}"
,
JSON
.
toJSONString
(
wxcpIds
),
content
);
feignClientForWxcp
.
sendMessage
(
agentId
,
corpId
,
JSON
.
toJSONString
(
parmMap
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment