Commit 621f5510 by 徐高华

Merge branch 'feature-canvas' into 'developer'

Feature canvas

See merge request !2326
parents 654ad660 517ace26
......@@ -713,8 +713,8 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
private String getQwMsgId(String staffId , Date sendTime, GroupMessageServiceImpl.GroupMsgChatType groupMsgChatType) {
Date startTime = DateUtil.addNumForMinute(sendTime,-5) ;
Date endTime = DateUtil.addNumForMinute(sendTime,5) ;
Date startTime = DateUtil.addNumForMinute(sendTime,-1) ;
Date endTime = DateUtil.addNumForMinute(sendTime,1) ;
TabHaobanStaff staff = this.staffMapper.selectByPrimaryKey(staffId) ;
String wxEnterpriseId = staff.getWxEnterpriseId() ;
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ;
......@@ -723,9 +723,7 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
wxUserId = staff.getWxOpenUseId() ;
}
// 发送到群
List<QywxGroupMessageInfoDTO> msgList = this.queryGroupMsg(GroupMessageServiceImpl.GroupMsgChatType.single,
startTime, endTime, qwDTO, wxUserId);
System.out.println("查询到={}"+JSONObject.toJSONString(msgList));
List<QywxGroupMessageInfoDTO> msgList = this.queryGroupMsg(groupMsgChatType,startTime, endTime, qwDTO, wxUserId);
if(CollectionUtils.isNotEmpty(msgList)) {
return msgList.get(0).getMsgId() ;
}
......@@ -733,7 +731,6 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
}
private List<QywxGroupMessageInfoDTO> queryGroupMsg(GroupMessageServiceImpl.GroupMsgChatType groupMsgChatType, Date startTime, Date endTime , WxEnterpriseQwDTO qwDTO , String qwUserId) {
List<QywxGroupMessageInfoDTO> groupMessageInfos = new ArrayList<>();
QywxGroupMessageQDTO qdto = new QywxGroupMessageQDTO();
qdto.setCorpid(qwDTO.getThirdCorpid());
qdto.setCreator(qwUserId);
......@@ -742,16 +739,11 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
qdto.setSuiteid(qwDTO.getSelf3thSecret());
qdto.setChatType(groupMsgChatType.getCode());
qdto.setPageSize(100);
ServiceResponse<QywxGroupMsgResp> serviceResponse =
qywxSuiteApiService.queryQywxGroupMessageList(qdto,qwDTO.isSelf(),qwDTO.getUrlHost());
logger.info("{},{}",JSONObject.toJSONString(qdto),JSONObject.toJSONString(serviceResponse));
if (!serviceResponse.isSuccess() || CollectionUtils.isEmpty(serviceResponse.getResult().getGroupMessageInfos())) {
logger.info("获取群发任务记录异常 {}", JSON.toJSONString(serviceResponse));
ServiceResponse<QywxGroupMsgResp> resp = this.qywxSuiteApiService.queryQywxGroupMessageList(qdto,qwDTO.isSelf(),qwDTO.getUrlHost());
logger.info("查询msgid,企微返回={},{}",JSONObject.toJSONString(qdto),JSONObject.toJSONString(resp));
if (!resp.isSuccess() || CollectionUtils.isEmpty(resp.getResult().getGroupMessageInfos())) {
return Collections.emptyList();
}
QywxGroupMsgResp groupMsgResp = serviceResponse.getResult();
List<QywxGroupMessageInfoDTO> tempMessageInfos = groupMsgResp.getGroupMessageInfos();
groupMessageInfos.addAll(tempMessageInfos);
return groupMessageInfos;
return resp.getResult().getGroupMessageInfos();
}
}
\ No newline at end of file
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