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
1
Merge Requests
1
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
1bc2f213
Commit
1bc2f213
authored
Dec 06, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
群
parent
85243ab8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletions
+30
-1
GroupChatServiceImpl.java
...anage/service/service/chat/impl/GroupChatServiceImpl.java
+29
-0
GroupChatMapper.xml
...ervice/src/main/resources/mapper/chat/GroupChatMapper.xml
+1
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/chat/impl/GroupChatServiceImpl.java
View file @
1bc2f213
...
...
@@ -44,6 +44,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import
com.gic.haoban.manage.service.entity.chat.TabChatNotice
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChat
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatOwner
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatOwnerHistory
;
import
com.gic.haoban.manage.service.entity.chat.TabGroupChatUser
;
import
com.gic.haoban.manage.service.pojo.bo.chat.GroupChatBO
;
import
com.gic.haoban.manage.service.service.SecretSettingService
;
...
...
@@ -394,10 +395,14 @@ public class GroupChatServiceImpl implements GroupChatService {
// 处理群主
String
owner
=
detail
.
getOwner
();
TabHaobanStaff
staff
=
this
.
staffMapper
.
selectByUserIdAndEnterpriseId
(
owner
,
wxEnterpriseId
);
String
newStaffId
=
null
;
String
oldStaffId
=
chat
.
getStaffId
();
if
(
null
!=
staff
)
{
// 更新staff
newStaffId
=
staff
.
getStaffId
();
chat
.
setStaffId
(
staff
.
getStaffId
());
}
else
{
chat
.
setStaffId
(
null
);
logger
.
info
(
"群主未关联好办,不同步群成员,userid={}"
,
owner
);
}
if
(
StringUtils
.
isBlank
(
enterpriseId
)
&&
null
!=
staff
)
{
...
...
@@ -418,6 +423,9 @@ public class GroupChatServiceImpl implements GroupChatService {
if
(
StringUtils
.
isNotEmpty
(
chat
.
getEnterpriseId
()))
{
chat
.
setGicFlag
(
1
);
}
// 判断是否更新群主
this
.
saveOwnerHistory
(
wxEnterpriseId
,
groupChatId
,
newStaffId
,
oldStaffId
);
chat
.
setOriginalStaffId
(
oldStaffId
);
this
.
groupChatMapper
.
update
(
chat
);
if
(
null
==
staff
)
{
logger
.
info
(
"不同步群成员信息,群主未关联好办,owner={}"
,
owner
);
...
...
@@ -487,6 +495,27 @@ public class GroupChatServiceImpl implements GroupChatService {
// this.groupChatMapper.updateData();
}
private
void
saveOwnerHistory
(
String
wxEnterpriseId
,
Long
groupChatId
,
String
newStaffId
,
String
oldStaffId
)
{
if
(
null
==
newStaffId
&&
null
==
oldStaffId
)
{
return
;
}
if
(
null
!=
newStaffId
&&
null
!=
oldStaffId
&&
newStaffId
.
equals
(
oldStaffId
))
{
return
;
}
if
(
null
!=
newStaffId
)
{
TabGroupChatOwnerHistory
entity
=
new
TabGroupChatOwnerHistory
();
entity
.
setOwnerHistoryId
(
UniqueIdUtils
.
uniqueLong
());
entity
.
setWxEnterpriseId
(
wxEnterpriseId
);
entity
.
setGroupChatId
(
groupChatId
);
entity
.
setStaffId
(
newStaffId
);
entity
.
setCreateTime
(
new
Date
());
this
.
groupChatOwnerHistoryMapper
.
insert
(
entity
);
}
if
(
null
!=
oldStaffId
)
{
this
.
groupChatOwnerHistoryMapper
.
updateOwnerEnd
(
groupChatId
,
oldStaffId
);
}
}
// 初始化群信息-不包括群状态
private
void
updateGroupChatDetail
(
WxEnterpriseQwDTO
qwDTO
,
Long
groupChatId
,
boolean
syncMember
)
{
TabGroupChat
chat
=
this
.
groupChatMapper
.
selectById
(
groupChatId
);
...
...
haoban-manage3-service/src/main/resources/mapper/chat/GroupChatMapper.xml
View file @
1bc2f213
...
...
@@ -74,7 +74,7 @@
quit_count,
quit_member_count,
enterprise_id,
gic_flag , init_flag , original_staff_id
,
gic_flag , init_flag , original_staff_id
)VALUES(
#{groupChatId},
#{wxEnterpriseId},
...
...
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