Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
7eef80bd
Commit
7eef80bd
authored
Oct 18, 2023
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature: 评论用户头像
parent
8ce5d908
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
CommentController.java
...oban/manage/web/controller/content/CommentController.java
+25
-0
SaveCommentQO.java
...c/haoban/manage/web/qo/content/comment/SaveCommentQO.java
+5
-0
No files found.
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/CommentController.java
View file @
7eef80bd
...
...
@@ -15,7 +15,9 @@ import com.gic.content.api.qdto.comment.ListMobileCommentQDTO;
import
com.gic.content.api.qdto.comment.SaveCommentQDTO
;
import
com.gic.content.api.service.ContentMaterialCommentApiService
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.enums.HaobanClerkTypeEnum
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.web.qo.content.comment.CommentCountQO
;
import
com.gic.haoban.manage.web.qo.content.comment.CommentInfoVO
;
...
...
@@ -51,6 +53,8 @@ public class CommentController {
@Autowired
private
StaffClerkRelationApiService
staffClerkRelationApiService
;
@Autowired
private
StaffApiService
staffApiService
;
/**
* 评论总数(包含子评论)
...
...
@@ -140,10 +144,19 @@ public class CommentController {
clerkIds
.
add
(
saveCommentQO
.
getReplyClerkId
());
}
Map
<
String
,
StaffClerkRelationDTO
>
clerkInfoMap
=
this
.
getClerkInfoMap
(
saveCommentQO
.
getWxEnterpriseId
(),
clerkIds
);
List
<
String
>
staffIds
=
new
ArrayList
<>();
for
(
StaffClerkRelationDTO
value
:
clerkInfoMap
.
values
())
{
staffIds
.
add
(
value
.
getStaffId
());
}
Map
<
String
,
StaffDTO
>
staffDTOMap
=
this
.
queryStaffInfoMap
(
staffIds
);
StaffClerkRelationDTO
staffClerkRelationDTO
=
clerkInfoMap
.
get
(
saveCommentQO
.
getClerkId
());
saveCommentQDTO
.
setUserType
(
UserTypeEnum
.
CLERK
.
value
);
if
(
staffClerkRelationDTO
!=
null
)
{
saveCommentQDTO
.
setUserCode
(
staffClerkRelationDTO
.
getClerkCode
());
StaffDTO
staffDTO
=
staffDTOMap
.
get
(
staffClerkRelationDTO
.
getStaffId
());
if
(
staffDTO
!=
null
)
{
saveCommentQDTO
.
setUserHeadImage
(
staffDTO
.
getHeadImg
());
}
if
(
HaobanClerkTypeEnum
.
AREA_MANAGER
.
getCode
().
equals
(
staffClerkRelationDTO
.
getClerkType
()))
{
saveCommentQDTO
.
setUserType
(
UserTypeEnum
.
AREA_MANAGER
.
value
);
}
else
{
...
...
@@ -153,6 +166,10 @@ public class CommentController {
staffClerkRelationDTO
=
clerkInfoMap
.
get
(
saveCommentQO
.
getReplyClerkId
());
if
(
staffClerkRelationDTO
!=
null
)
{
saveCommentQDTO
.
setReplyUserCode
(
staffClerkRelationDTO
.
getClerkCode
());
StaffDTO
staffDTO
=
staffDTOMap
.
get
(
staffClerkRelationDTO
.
getStaffId
());
if
(
staffDTO
!=
null
)
{
saveCommentQDTO
.
setReplyUserHeadImage
(
staffDTO
.
getHeadImg
());
}
if
(
HaobanClerkTypeEnum
.
AREA_MANAGER
.
getCode
().
equals
(
staffClerkRelationDTO
.
getClerkType
()))
{
saveCommentQDTO
.
setReplyUserType
(
UserTypeEnum
.
AREA_MANAGER
.
value
);
}
else
{
...
...
@@ -177,4 +194,12 @@ public class CommentController {
.
stream
()
.
collect
(
Collectors
.
toMap
(
StaffClerkRelationDTO:
:
getClerkId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
}
public
Map
<
String
,
StaffDTO
>
queryStaffInfoMap
(
List
<
String
>
staffIds
)
{
List
<
StaffDTO
>
staffDTOS
=
staffApiService
.
listByIds
(
staffIds
);
return
staffDTOS
.
stream
()
.
collect
(
Collectors
.
toMap
(
StaffDTO:
:
getStaffId
,
Function
.
identity
(),
(
v1
,
v2
)
->
v1
));
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/content/comment/SaveCommentQO.java
View file @
7eef80bd
...
...
@@ -50,4 +50,9 @@ public class SaveCommentQO implements Serializable {
* 企业ID
*/
private
String
enterpriseId
;
/**
* 成员id
*/
private
String
staffId
;
}
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