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
11f5fe7a
Commit
11f5fe7a
authored
Apr 19, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自建
parent
d4ca9679
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
31 deletions
+15
-31
GroupChatHmServiceImpl.java
...age/service/service/chat/impl/GroupChatHmServiceImpl.java
+5
-5
GroupChatServiceImpl.java
...anage/service/service/chat/impl/GroupChatServiceImpl.java
+10
-26
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/chat/impl/GroupChatHmServiceImpl.java
View file @
11f5fe7a
...
@@ -143,7 +143,7 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
...
@@ -143,7 +143,7 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
if
(
null
!=
secretSetting
)
{
if
(
null
!=
secretSetting
)
{
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
ServiceResponse
<
Void
>
resp
=
this
.
qywxChatApiService
.
delJoinWay
(
qwDTO
.
getDkCorpid
(),
ServiceResponse
<
Void
>
resp
=
this
.
qywxChatApiService
.
delJoinWay
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
hm
.
getWxConfigId
());
secretSetting
.
getSecretVal
(),
hm
.
getWxConfigId
()
,
qwDTO
.
getUrlHost
()
);
logger
.
info
(
"删除群活码={}"
,
JSON
.
toJSON
(
resp
));
logger
.
info
(
"删除群活码={}"
,
JSON
.
toJSON
(
resp
));
}
}
}
}
...
@@ -190,7 +190,7 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
...
@@ -190,7 +190,7 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
String
configId
=
hm
.
getWxConfigId
();
String
configId
=
hm
.
getWxConfigId
();
ServiceResponse
<
AddJoinWayDTO
>
joinResp
=
this
.
qywxChatApiService
.
getJoinWay
(
qwDTO
.
getDkCorpid
(),
secret
,
ServiceResponse
<
AddJoinWayDTO
>
joinResp
=
this
.
qywxChatApiService
.
getJoinWay
(
qwDTO
.
getDkCorpid
(),
secret
,
configId
);
configId
,
qwDTO
.
getUrlHost
()
);
logger
.
info
(
"查询群活码={}"
,
JSON
.
toJSON
(
joinResp
));
logger
.
info
(
"查询群活码={}"
,
JSON
.
toJSON
(
joinResp
));
if
(
joinResp
.
isSuccess
())
{
if
(
joinResp
.
isSuccess
())
{
AddJoinWayDTO
join
=
joinResp
.
getResult
();
AddJoinWayDTO
join
=
joinResp
.
getResult
();
...
@@ -303,7 +303,7 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
...
@@ -303,7 +303,7 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
if
(
updateFlag
)
{
if
(
updateFlag
)
{
joinDTO
.
setConfig_id
(
hm
.
getWxConfigId
());
joinDTO
.
setConfig_id
(
hm
.
getWxConfigId
());
ServiceResponse
<
Void
>
updateResp
=
this
.
qywxChatApiService
.
updateJoinWay
(
qwDTO
.
getDkCorpid
(),
ServiceResponse
<
Void
>
updateResp
=
this
.
qywxChatApiService
.
updateJoinWay
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
joinDTO
);
secretSetting
.
getSecretVal
(),
joinDTO
,
qwDTO
.
getUrlHost
()
);
if
(!
updateResp
.
isSuccess
())
{
if
(!
updateResp
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
"9999"
,
updateResp
.
getMessage
());
return
ServiceResponse
.
failure
(
"9999"
,
updateResp
.
getMessage
());
}
}
...
@@ -339,14 +339,14 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
...
@@ -339,14 +339,14 @@ public class GroupChatHmServiceImpl implements GroupChatHmService {
}
else
{
}
else
{
ServiceResponse
<
String
>
addResp
=
this
.
qywxChatApiService
.
addJoinWay
(
qwDTO
.
getDkCorpid
(),
ServiceResponse
<
String
>
addResp
=
this
.
qywxChatApiService
.
addJoinWay
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
joinDTO
);
secretSetting
.
getSecretVal
(),
joinDTO
,
qwDTO
.
getUrlHost
()
);
logger
.
info
(
"addResp={}"
,
JSON
.
toJSONString
(
addResp
));
logger
.
info
(
"addResp={}"
,
JSON
.
toJSONString
(
addResp
));
if
(!
addResp
.
isSuccess
())
{
if
(!
addResp
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
"9999"
,
addResp
.
getMessage
());
return
ServiceResponse
.
failure
(
"9999"
,
addResp
.
getMessage
());
}
}
String
configId
=
addResp
.
getResult
();
String
configId
=
addResp
.
getResult
();
ServiceResponse
<
AddJoinWayDTO
>
getResp
=
this
.
qywxChatApiService
.
getJoinWay
(
qwDTO
.
getDkCorpid
(),
ServiceResponse
<
AddJoinWayDTO
>
getResp
=
this
.
qywxChatApiService
.
getJoinWay
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
configId
);
secretSetting
.
getSecretVal
(),
configId
,
qwDTO
.
getUrlHost
()
);
logger
.
info
(
"getResp={}"
,
JSON
.
toJSONString
(
getResp
));
logger
.
info
(
"getResp={}"
,
JSON
.
toJSONString
(
getResp
));
if
(!
getResp
.
isSuccess
())
{
if
(!
getResp
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
"9999"
,
getResp
.
getMessage
());
return
ServiceResponse
.
failure
(
"9999"
,
getResp
.
getMessage
());
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/chat/impl/GroupChatServiceImpl.java
View file @
11f5fe7a
...
@@ -68,6 +68,7 @@ import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService;
...
@@ -68,6 +68,7 @@ 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.GroupChatHmService
;
import
com.gic.haoban.manage.service.service.chat.GroupChatHmService
;
import
com.gic.haoban.manage.service.service.chat.GroupChatService
;
import
com.gic.haoban.manage.service.service.chat.GroupChatService
;
import
com.gic.haoban.manage.service.util.QwUtils
;
import
com.gic.member.api.dto.MemberDTO
;
import
com.gic.member.api.dto.MemberDTO
;
import
com.gic.member.api.service.MemberService
;
import
com.gic.member.api.service.MemberService
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.mq.sdk.GicMQClient
;
...
@@ -530,14 +531,8 @@ public class GroupChatServiceImpl implements GroupChatService {
...
@@ -530,14 +531,8 @@ public class GroupChatServiceImpl implements GroupChatService {
private
void
syncGroupChatList
(
WxEnterpriseQwDTO
qwDTO
,
List
<
String
>
userIdList
,
String
cursor
,
private
void
syncGroupChatList
(
WxEnterpriseQwDTO
qwDTO
,
List
<
String
>
userIdList
,
String
cursor
,
boolean
syncDetailFlag
)
{
boolean
syncDetailFlag
)
{
logger
.
info
(
"同步群列表={},idlist={},cursor={}"
,
JSON
.
toJSONString
(
qwDTO
),
JSON
.
toJSONString
(
userIdList
),
cursor
);
logger
.
info
(
"同步群列表={},idlist={},cursor={}"
,
JSON
.
toJSONString
(
qwDTO
),
JSON
.
toJSONString
(
userIdList
),
cursor
);
ServiceResponse
<
GroupChatListDTO
>
resp
=
null
;
ServiceResponse
<
GroupChatListDTO
>
resp
=
this
.
qywxChatApiService
.
groupchatList
(
qwDTO
.
getThirdCorpid
(),
if
(
qwDTO
.
isSelf
())
{
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
())
,
userIdList
,
limit
,
cursor
,
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
());
resp
=
this
.
qywxChatApiService
.
groupchatList
(
qwDTO
.
getThirdCorpid
(),
qwDTO
.
getSelfSecret
()
,
userIdList
,
limit
,
cursor
);
}
else
{
resp
=
this
.
qywxChatApiService
.
groupchatList3th
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
userIdList
,
limit
,
cursor
);
}
if
(!
resp
.
isSuccess
())
{
if
(!
resp
.
isSuccess
())
{
logger
.
info
(
"拉取群列表异常={}"
,
JSON
.
toJSON
(
resp
));
logger
.
info
(
"拉取群列表异常={}"
,
JSON
.
toJSON
(
resp
));
return
;
return
;
...
@@ -620,14 +615,9 @@ public class GroupChatServiceImpl implements GroupChatService {
...
@@ -620,14 +615,9 @@ public class GroupChatServiceImpl implements GroupChatService {
Long
groupChatId
=
chat
.
getGroupChatId
();
Long
groupChatId
=
chat
.
getGroupChatId
();
String
wxEnterpriseId
=
chat
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
chat
.
getWxEnterpriseId
();
String
enterpriseId
=
chat
.
getEnterpriseId
();
String
enterpriseId
=
chat
.
getEnterpriseId
();
ServiceResponse
<
GroupChatDetailDTO
>
detailResp
=
null
;
ServiceResponse
<
GroupChatDetailDTO
>
detailResp
=
this
.
qywxChatApiService
if
(
qwDTO
.
isSelf
())
{
.
groupchatDetail
(
qwDTO
.
getThirdCorpid
(),
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
chat
.
getWxChatId
(),
1
,
qwDTO
.
isSelf
()
,
qwDTO
.
getUrlHost
());
detailResp
=
this
.
qywxChatApiService
.
groupchatDetail
(
qwDTO
.
getThirdCorpid
(),
qwDTO
.
getSelfSecret
(),
chat
.
getWxChatId
(),
1
);
}
else
{
detailResp
=
this
.
qywxChatApiService
.
groupchatDetail3th
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
chat
.
getWxChatId
(),
1
);
}
logger
.
info
(
"从企微获取群详情{}={}"
,
chat
.
getWxChatId
(),
JSON
.
toJSON
(
detailResp
));
logger
.
info
(
"从企微获取群详情{}={}"
,
chat
.
getWxChatId
(),
JSON
.
toJSON
(
detailResp
));
if
(!
detailResp
.
isSuccess
())
{
if
(!
detailResp
.
isSuccess
())
{
logger
.
info
(
"从企微获取群详情失败"
);
logger
.
info
(
"从企微获取群详情失败"
);
...
@@ -995,7 +985,7 @@ public class GroupChatServiceImpl implements GroupChatService {
...
@@ -995,7 +985,7 @@ public class GroupChatServiceImpl implements GroupChatService {
private
void
updateWxChatIdDk
(
WxEnterpriseQwDTO
qwDTO
,
List
<
String
>
userIdList
,
String
cursor
,
String
staffId
,
private
void
updateWxChatIdDk
(
WxEnterpriseQwDTO
qwDTO
,
List
<
String
>
userIdList
,
String
cursor
,
String
staffId
,
String
secret
)
{
String
secret
)
{
ServiceResponse
<
GroupChatListDTO
>
resp
=
this
.
qywxChatApiService
.
groupchatList
(
qwDTO
.
getDkCorpid
(),
secret
,
ServiceResponse
<
GroupChatListDTO
>
resp
=
this
.
qywxChatApiService
.
groupchatList
(
qwDTO
.
getDkCorpid
(),
secret
,
userIdList
,
limit
,
cursor
);
userIdList
,
limit
,
cursor
,
true
,
qwDTO
.
getUrlHost
()
);
if
(!
resp
.
isSuccess
())
{
if
(!
resp
.
isSuccess
())
{
logger
.
info
(
"拉取群异常={}"
,
JSON
.
toJSON
(
resp
));
logger
.
info
(
"拉取群异常={}"
,
JSON
.
toJSON
(
resp
));
return
;
return
;
...
@@ -1006,7 +996,7 @@ public class GroupChatServiceImpl implements GroupChatService {
...
@@ -1006,7 +996,7 @@ public class GroupChatServiceImpl implements GroupChatService {
for
(
GroupChatListItemDTO
item
:
list
)
{
for
(
GroupChatListItemDTO
item
:
list
)
{
String
wxChatIdDk
=
item
.
getChat_id
();
String
wxChatIdDk
=
item
.
getChat_id
();
ServiceResponse
<
GroupChatDetailDTO
>
detailResp
=
this
.
qywxChatApiService
ServiceResponse
<
GroupChatDetailDTO
>
detailResp
=
this
.
qywxChatApiService
.
groupchatDetail
(
qwDTO
.
getDkCorpid
(),
secret
,
wxChatIdDk
,
1
);
.
groupchatDetail
(
qwDTO
.
getDkCorpid
(),
secret
,
wxChatIdDk
,
1
,
true
,
qwDTO
.
getUrlHost
()
);
if
(
detailResp
.
isSuccess
())
{
if
(
detailResp
.
isSuccess
())
{
GroupChatDetailDTO
detail
=
detailResp
.
getResult
();
GroupChatDetailDTO
detail
=
detailResp
.
getResult
();
Long
createTimeLong
=
detail
.
getCreate_time
()
*
1000
;
Long
createTimeLong
=
detail
.
getCreate_time
()
*
1000
;
...
@@ -1104,14 +1094,8 @@ public class GroupChatServiceImpl implements GroupChatService {
...
@@ -1104,14 +1094,8 @@ public class GroupChatServiceImpl implements GroupChatService {
}
}
List
<
TabGroupChat
>
list
=
this
.
groupChatMapper
.
listByIdSet
(
new
HashSet
<>(
groupChatIdList
));
List
<
TabGroupChat
>
list
=
this
.
groupChatMapper
.
listByIdSet
(
new
HashSet
<>(
groupChatIdList
));
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
=
null
;
ServiceResponse
<
List
<
FailChatListDTO
>>
resp
=
this
.
qywxChatApiService
.
transfer
(
qwDTO
.
getThirdCorpid
(),
if
(
qwDTO
.
isSelf
())
{
QwUtils
.
getSecret
(
qwDTO
,
config
.
getWxSuiteid
()),
wxChatIdList
,
userid
,
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
());
resp
=
this
.
qywxChatApiService
.
transferSelf
(
qwDTO
.
getThirdCorpid
(),
qwDTO
.
getSelfSecret
(),
wxChatIdList
,
userid
);
}
else
{
resp
=
this
.
qywxChatApiService
.
transfer
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
wxChatIdList
,
userid
);
}
logger
.
info
(
"群继承,继承人={}"
,
JSON
.
toJSONString
(
resp
),
userid
);
logger
.
info
(
"群继承,继承人={}"
,
JSON
.
toJSONString
(
resp
),
userid
);
if
(!
resp
.
isSuccess
())
{
if
(!
resp
.
isSuccess
())
{
return
ServiceResponse
.
failure
(
"9999"
,
resp
.
getMessage
());
return
ServiceResponse
.
failure
(
"9999"
,
resp
.
getMessage
());
...
...
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