Commit 11f5fe7a by 徐高华

自建

parent d4ca9679
...@@ -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());
......
...@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment