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
45e3478d
Commit
45e3478d
authored
Dec 22, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
群主离职处理
parent
d06f43e8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
16 deletions
+59
-16
HaobanTimerApiService.java
.../gic/haoban/manage/api/service/HaobanTimerApiService.java
+11
-0
GroupChatService.java
.../haoban/manage/service/service/chat/GroupChatService.java
+12
-0
GroupChatServiceImpl.java
...anage/service/service/chat/impl/GroupChatServiceImpl.java
+25
-16
HaobanTimerApiServiceImpl.java
...e/service/service/out/impl/HaobanTimerApiServiceImpl.java
+6
-0
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+5
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/HaobanTimerApiService.java
View file @
45e3478d
...
@@ -88,5 +88,16 @@ public interface HaobanTimerApiService {
...
@@ -88,5 +88,16 @@ public interface HaobanTimerApiService {
* @throws
* @throws
*/
*/
public
ServiceResponse
<
Void
>
initHaobaonGroupChat
(
String
params
);
public
ServiceResponse
<
Void
>
initHaobaonGroupChat
(
String
params
);
/**
*
* @Title: ownerDimission
* @Description: 群主离职(每日刷新)
* @author xugh
* @param params
* @return
* @throws
*/
public
ServiceResponse
<
Void
>
ownerDimission
(
String
params
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/chat/GroupChatService.java
View file @
45e3478d
...
@@ -129,5 +129,16 @@ public interface GroupChatService {
...
@@ -129,5 +129,16 @@ public interface GroupChatService {
* @throws
* @throws
*/
*/
public
void
handleHmChatFull
(
String
params
);
public
void
handleHmChatFull
(
String
params
);
public
void
ownerDimission
(
String
staffId
)
;
/**
*
* @Title: ownerDimission
* @Description: 群主离职
* @author xugh
* @throws
*/
public
void
ownerDimission
()
;
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/chat/impl/GroupChatServiceImpl.java
View file @
45e3478d
...
@@ -143,7 +143,7 @@ public class GroupChatServiceImpl implements GroupChatService {
...
@@ -143,7 +143,7 @@ public class GroupChatServiceImpl implements GroupChatService {
@Override
@Override
public
void
createChat
(
String
corpid
,
String
wxChatId
)
{
public
void
createChat
(
String
corpid
,
String
wxChatId
)
{
logger
.
info
(
"创建群,id={}"
,
wxChatId
);
logger
.
info
(
"创建群,id={}"
,
wxChatId
);
String
wxEnterpriseId
=
this
.
getWxEnterpriesId
(
corpid
);
String
wxEnterpriseId
=
this
.
getWxEnterpriesId
(
corpid
);
if
(
null
==
wxEnterpriseId
)
{
if
(
null
==
wxEnterpriseId
)
{
return
;
return
;
...
@@ -313,6 +313,7 @@ public class GroupChatServiceImpl implements GroupChatService {
...
@@ -313,6 +313,7 @@ public class GroupChatServiceImpl implements GroupChatService {
// 更新群状态
// 更新群状态
public
void
updateChatStatus
(
WxEnterpriseQwDTO
qwDTO
,
Long
groupChatId
)
{
public
void
updateChatStatus
(
WxEnterpriseQwDTO
qwDTO
,
Long
groupChatId
)
{
logger
.
info
(
"更新群状态,groupchatId={}"
,
groupChatId
);
TabGroupChat
chat
=
this
.
groupChatMapper
.
selectById
(
groupChatId
);
TabGroupChat
chat
=
this
.
groupChatMapper
.
selectById
(
groupChatId
);
if
(
null
==
chat
)
{
if
(
null
==
chat
)
{
logger
.
info
(
"群主变更事件,群不存在"
);
logger
.
info
(
"群主变更事件,群不存在"
);
...
@@ -364,19 +365,27 @@ public class GroupChatServiceImpl implements GroupChatService {
...
@@ -364,19 +365,27 @@ public class GroupChatServiceImpl implements GroupChatService {
}
finally
{
}
finally
{
RedisUtil
.
delCache
(
key
);
RedisUtil
.
delCache
(
key
);
}
}
}
// 群主离职列表
List
<
GroupChatOwnerDTO
>
dimissionOwnerList
=
this
.
groupChatOwnerMapper
.
dimissionOwnerList
()
;
@Override
for
(
GroupChatOwnerDTO
dto
:
dimissionOwnerList
)
{
public
void
ownerDimission
(
String
staffId
)
{
logger
.
info
(
"群主离职,群状态处理={}"
,
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"群主离职,刷新群状态,staffId={}"
,
staffId
);
this
.
dimissionOwner
(
dto
);
if
(
null
!=
this
.
groupChatOwnerMapper
.
selectByStaffId
(
staffId
))
{
TabHaobanStaff
staff
=
this
.
staffMapper
.
selectByPrimaryKey
(
staffId
);
this
.
dimissionOwner
(
staff
.
getWxEnterpriseId
(),
staff
.
getWxUserId
(),
staff
.
getWxOpenUseId
());
}
}
// 群主离职列表
public
void
ownerDimission
()
{
List
<
GroupChatOwnerDTO
>
dimissionOwnerList
=
this
.
groupChatOwnerMapper
.
dimissionOwnerList
();
for
(
GroupChatOwnerDTO
dto
:
dimissionOwnerList
)
{
logger
.
info
(
"群主离职,群状态处理={}"
,
JSON
.
toJSONString
(
dto
));
this
.
dimissionOwner
(
dto
.
getWxEnterpriseId
(),
dto
.
getWxUserId
(),
dto
.
getWxOpenUserId
());
}
}
}
}
private
void
dimissionOwner
(
String
wxEnterpriseId
,
String
wxUserId
,
String
wxOpenUserId
)
{
private
void
dimissionOwner
(
GroupChatOwnerDTO
dto
)
{
String
wxEnterpriseId
=
dto
.
getWxEnterpriseId
()
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
if
(
null
==
qwDTO
)
{
if
(
null
==
qwDTO
)
{
logger
.
info
(
"wxEnterpriseId不存在,id={}"
,
wxEnterpriseId
);
logger
.
info
(
"wxEnterpriseId不存在,id={}"
,
wxEnterpriseId
);
...
@@ -384,15 +393,15 @@ public class GroupChatServiceImpl implements GroupChatService {
...
@@ -384,15 +393,15 @@ public class GroupChatServiceImpl implements GroupChatService {
}
}
List
<
String
>
userIdList
=
null
;
List
<
String
>
userIdList
=
null
;
if
(
qwDTO
.
needOpenUserIdDk
())
{
if
(
qwDTO
.
needOpenUserIdDk
())
{
userIdList
=
Arrays
.
asList
(
dto
.
getWxOpenUserId
()
);
userIdList
=
Arrays
.
asList
(
wxOpenUserId
);
}
else
{
}
else
{
userIdList
=
Arrays
.
asList
(
dto
.
getWxUserId
()
);
userIdList
=
Arrays
.
asList
(
wxUserId
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
userIdList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
userIdList
))
{
this
.
syncGroupChatList
(
qwDTO
,
userIdList
,
null
,
false
);
this
.
syncGroupChatList
(
qwDTO
,
userIdList
,
null
,
false
);
}
}
}
}
/**
/**
* 初始化整个群数据,拉取所有成员的所有群,并立即获取群信息、群成员、同时也会匹配客户标识
* 初始化整个群数据,拉取所有成员的所有群,并立即获取群信息、群成员、同时也会匹配客户标识
*/
*/
...
@@ -895,7 +904,7 @@ public class GroupChatServiceImpl implements GroupChatService {
...
@@ -895,7 +904,7 @@ public class GroupChatServiceImpl implements GroupChatService {
List
<
String
>
wxChatIdList
=
list
.
stream
().
map
(
dto
->
dto
.
getWxChatId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
wxChatIdList
=
list
.
stream
().
map
(
dto
->
dto
.
getWxChatId
()).
collect
(
Collectors
.
toList
());
ServiceResponse
<
List
<
FailChatListDTO
>>
resp
=
this
.
qywxChatApiService
.
transfer
(
qwDTO
.
getThirdCorpid
(),
ServiceResponse
<
List
<
FailChatListDTO
>>
resp
=
this
.
qywxChatApiService
.
transfer
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
wxChatIdList
,
userid
);
config
.
getWxSuiteid
(),
wxChatIdList
,
userid
);
logger
.
info
(
"群继承
={}"
,
JSON
.
toJSONString
(
resp
)
);
logger
.
info
(
"群继承
,继承人={}"
,
JSON
.
toJSONString
(
resp
),
userid
);
if
(!
resp
.
isSuccess
())
{
if
(!
resp
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
"9999"
,
resp
.
getMessage
());
return
ServiceResponse
.
failure
(
"9999"
,
resp
.
getMessage
());
}
else
{
}
else
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/HaobanTimerApiServiceImpl.java
View file @
45e3478d
...
@@ -63,4 +63,10 @@ public class HaobanTimerApiServiceImpl implements HaobanTimerApiService {
...
@@ -63,4 +63,10 @@ public class HaobanTimerApiServiceImpl implements HaobanTimerApiService {
this
.
groupChatService
.
handleHmChatFull
(
params
);
this
.
groupChatService
.
handleHmChatFull
(
params
);
return
ServiceResponse
.
success
();
return
ServiceResponse
.
success
();
}
}
@Override
public
ServiceResponse
<
Void
>
ownerDimission
(
String
params
)
{
this
.
groupChatService
.
ownerDimission
();
return
ServiceResponse
.
success
();
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
45e3478d
...
@@ -62,6 +62,7 @@ import com.gic.haoban.manage.service.service.StaffService;
...
@@ -62,6 +62,7 @@ import com.gic.haoban.manage.service.service.StaffService;
import
com.gic.haoban.manage.service.service.WxApplicationService
;
import
com.gic.haoban.manage.service.service.WxApplicationService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseRelatedService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseRelatedService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.chat.GroupChatService
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.thirdparty.api.dto.PicUploadResDTO
;
import
com.gic.thirdparty.api.dto.PicUploadResDTO
;
...
@@ -123,6 +124,8 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -123,6 +124,8 @@ public class MessageApiServiceImpl implements MessageApiService {
private
QywxUserApiService
qywxUserApiService
;
private
QywxUserApiService
qywxUserApiService
;
@Autowired
@Autowired
private
HaobanCommonMQApiService
haobanCommonMQApiService
;
private
HaobanCommonMQApiService
haobanCommonMQApiService
;
@Autowired
private
GroupChatService
groupChatService
;
@Override
@Override
public
void
wxMessageReceive
(
QywxCallBackDTO
qywxCallBackDTO
)
{
public
void
wxMessageReceive
(
QywxCallBackDTO
qywxCallBackDTO
)
{
...
@@ -344,6 +347,8 @@ public class MessageApiServiceImpl implements MessageApiService {
...
@@ -344,6 +347,8 @@ public class MessageApiServiceImpl implements MessageApiService {
staffClerkRelationApiService
.
unbindByStaffAndClerkId
(
staffId
,
staffClerkRelationDTO
.
getClerkId
(),
ChannelCodeEnum
.
ADMIN_UNBIND
.
getCode
(),
wxEnterpriseId
);
staffClerkRelationApiService
.
unbindByStaffAndClerkId
(
staffId
,
staffClerkRelationDTO
.
getClerkId
(),
ChannelCodeEnum
.
ADMIN_UNBIND
.
getCode
(),
wxEnterpriseId
);
}
}
}
}
//群状态刷新
this
.
groupChatService
.
ownerDimission
(
staffId
);
//删除员工表-注意顺序
//删除员工表-注意顺序
this
.
staffService
.
delByStaffId
(
staffId
);
this
.
staffService
.
delByStaffId
(
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