Commit df1b231e by 徐高华

群-自建

parent 28d41b70
...@@ -128,8 +128,13 @@ public class GroupChatDataServiceImpl implements GroupChatDataService { ...@@ -128,8 +128,13 @@ public class GroupChatDataServiceImpl implements GroupChatDataService {
Date date = DateUtil.addDay(DateUtil.getStartTimeOfDay(), -1); Date date = DateUtil.addDay(DateUtil.getStartTimeOfDay(), -1);
Long time = date.getTime() / 1000; Long time = date.getTime() / 1000;
ServiceResponse<List<GroupChatQwDataDTO>> resp = this.qywxChatApiService.statistic(qwDTO.getThirdCorpid(), ServiceResponse<List<GroupChatQwDataDTO>> resp = null ;
config.getWxSuiteid(), userIdList, time, time); if(qwDTO.isSelf()) {
resp = this.qywxChatApiService.statisticSelf(qwDTO.getThirdCorpid(), qwDTO.getSelfSecret(), userIdList, time, time);
}else{
resp = this.qywxChatApiService.statistic(qwDTO.getThirdCorpid(), config.getWxSuiteid(), userIdList, time, time);
}
List<GroupChatQwDataDTO> dataList = resp.getResult(); List<GroupChatQwDataDTO> dataList = resp.getResult();
if (CollectionUtils.isEmpty(dataList)) { if (CollectionUtils.isEmpty(dataList)) {
if (list.size() < pageSize) { if (list.size() < pageSize) {
......
...@@ -307,8 +307,14 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService { ...@@ -307,8 +307,14 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
if (qwDTO.needOpenUserId3th()) { if (qwDTO.needOpenUserId3th()) {
userid = staff.getWxOpenUseId(); userid = staff.getWxOpenUseId();
} }
JSONResponse respon = qywxSuiteApiService.resultExternalMessage(qwDTO.getThirdCorpid(), config.getWxSuiteid(), JSONResponse respon = null ;
msgid, null, userid); if(qwDTO.isSelf()) {
respon = qywxSuiteApiService.resultExternalMessageSelf(qwDTO.getThirdCorpid(), qwDTO.getSelfSecret(),
msgid, null, userid);
}else {
respon = qywxSuiteApiService.resultExternalMessage(qwDTO.getThirdCorpid(), config.getWxSuiteid(),
msgid, null, userid);
}
logger.info("统计企微返回={}", JSON.toJSONString(respon)); logger.info("统计企微返回={}", JSON.toJSONString(respon));
if (respon.getErrorCode() != 0) { if (respon.getErrorCode() != 0) {
return; return;
......
...@@ -530,8 +530,14 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -530,8 +530,14 @@ 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 = this.qywxChatApiService.groupchatList3th(qwDTO.getThirdCorpid(), ServiceResponse<GroupChatListDTO> resp = null ;
config.getWxSuiteid(), userIdList, limit, cursor); if(qwDTO.isSelf()) {
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;
...@@ -614,8 +620,14 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -614,8 +620,14 @@ 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 = this.qywxChatApiService ServiceResponse<GroupChatDetailDTO> detailResp = null ;
.groupchatDetail3th(qwDTO.getThirdCorpid(), config.getWxSuiteid(), chat.getWxChatId(), 1); if(qwDTO.isSelf()) {
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("从企微获取群详情失败");
...@@ -1092,8 +1104,14 @@ public class GroupChatServiceImpl implements GroupChatService { ...@@ -1092,8 +1104,14 @@ 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 = this.qywxChatApiService.transfer(qwDTO.getThirdCorpid(), ServiceResponse<List<FailChatListDTO>> resp = null ;
config.getWxSuiteid(), wxChatIdList, userid); if(qwDTO.isSelf()) {
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());
......
...@@ -107,8 +107,14 @@ public class QywxSendServiceImpl implements QywxSendService { ...@@ -107,8 +107,14 @@ public class QywxSendServiceImpl implements QywxSendService {
messageDTO.setSenderUserId(tabHaobanStaff.getWxUserId()); messageDTO.setSenderUserId(tabHaobanStaff.getWxUserId());
} }
// 调接口执行创建群发 // 调接口执行创建群发
JSONResponse respon = qywxSuiteApiService.sendExternalMessage(qwDTO.getThirdCorpid(), config.getWxSuiteid(), JSONResponse respon = null ;
messageDTO); if(qwDTO.isSelf()) {
respon = qywxSuiteApiService.sendExternalMessageSelf(qwDTO.getThirdCorpid(), qwDTO.getSelfSecret(),
messageDTO);
}else {
respon = qywxSuiteApiService.sendExternalMessage(qwDTO.getThirdCorpid(), config.getWxSuiteid(),
messageDTO);
}
log.info("群发返回={}", JSON.toJSONString(respon)); log.info("群发返回={}", JSON.toJSONString(respon));
Map<String, Object> returnMap = respon.getReturnMap(); Map<String, Object> returnMap = respon.getReturnMap();
String msgIdKey = "msgid"; String msgIdKey = "msgid";
......
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