Commit 03943e1a by 徐高华

社群群发-失效处理

parent caa87e95
......@@ -696,18 +696,27 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
List<GroupChatPlanOwnerLogDTO> list = this.groupChatPlanOwnerLogMapper.listForCancelSend();
if(CollectionUtils.isNotEmpty(list)) {
for(GroupChatPlanOwnerLogDTO dto : list) {
String wxEnterpriseId = dto.getWxEnterpriseId() ;
String msgid = dto.getMsgid() ;
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ;
String secret = config.getWxSuiteid() ;
if(qwDTO.isSelf()) {
secret = qwDTO.getSelfSecret() ;
}
ServiceResponse<Void> resp = this.qywxSuiteApiService.cancelGroupmsgSend(qwDTO.getThirdCorpid(),secret,msgid,qwDTO.isSelf(),qwDTO.getUrlHost()) ;
if(resp.isSuccess()) {
this.groupChatPlanOwnerLogMapper.giveUp(dto.getOwnerLogId()) ;
}
this.cancelSend(dto);
}
}
}
private void cancelSend(GroupChatPlanOwnerLogDTO dto) {
try {
String wxEnterpriseId = dto.getWxEnterpriseId();
String msgid = dto.getMsgid();
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
String secret = config.getWxSuiteid();
if (qwDTO.isSelf()) {
secret = qwDTO.getSelfSecret();
}
ServiceResponse<Void> resp = this.qywxSuiteApiService.cancelGroupmsgSend(qwDTO.getThirdCorpid(), secret, msgid, qwDTO.isSelf(), qwDTO.getUrlHost());
if (resp.isSuccess()) {
this.groupChatPlanOwnerLogMapper.giveUp(dto.getOwnerLogId());
}
}catch (Exception e) {
logger.info("异常",e);
}
}
......@@ -723,13 +732,17 @@ public class GroupChatPlanServiceImpl implements GroupChatPlanService {
}
private void updateMsgid(GroupChatPlanOwnerLogDTO dto) {
Long ownerLogId = dto.getOwnerLogId() ;
String staffId = dto.getStaffId() ;
Date sendTime = dto.getSendTime() ;
String msgid = this.getQwMsgId(staffId,sendTime,GroupMessageServiceImpl.GroupMsgChatType.group) ;
if(null != msgid) {
logger.info("获取msgid={},{}",ownerLogId,msgid);
this.groupChatPlanOwnerLogMapper.updateMsgid(ownerLogId,msgid);
try{
Long ownerLogId = dto.getOwnerLogId() ;
String staffId = dto.getStaffId() ;
Date sendTime = dto.getSendTime() ;
String msgid = this.getQwMsgId(staffId,sendTime,GroupMessageServiceImpl.GroupMsgChatType.group) ;
if(null != msgid) {
logger.info("获取msgid={},{}",ownerLogId,msgid);
this.groupChatPlanOwnerLogMapper.updateMsgid(ownerLogId,msgid);
}
}catch (Exception e) {
logger.info("异常",e);
}
}
......
......@@ -105,7 +105,7 @@
</update>
<update id="giveUp" parameterType="java.lang.Long">
update tab_haoban_group_chat_plan_owner_log set status_flag = 3 where owner_log_id = #{id}
update tab_haoban_group_chat_plan_owner_log set send_status = 3 where owner_log_id = #{id}
</update>
<!-- ============ 查询=============-->
......
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