Commit 92b46606 by 孙喜旺

会话存档定时任务修改

1 parent 14131f86
......@@ -32,21 +32,22 @@ public class ConversationArchiveTask {
@Autowired
private IWeChatContactMsgService weChatContactMsgService;
public void FinanceTask(String corpId, String secret, String privateKey){
log.info("执行有参方法: params:{},{}", corpId, secret);
public void FinanceTask(){
log.info("会话存档定时任务执行----------------->");
Long seqLong = 0L;
log.info(">>>>>>>seq:{}", seqLong);
if(StringUtils.isEmpty(privateKey)){
WeCorpAccount validWeCorpAccount = weCorpAccountService.findValidWeCorpAccount();
privateKey = validWeCorpAccount.getFinancePrivateKey();
WeCorpAccount corpAccount = weCorpAccountService.findValidWeCorpAccount();
if(corpAccount == null){
log.info("无有效企业----------------->");
return;
}
LambdaQueryWrapper<WeChatContactMsg> wrapper = new LambdaQueryWrapper<WeChatContactMsg>().orderByDesc(WeChatContactMsg::getSeq).last("limit 1");
WeChatContactMsg weChatContactMsg = weChatContactMsgService.getOne(wrapper);
if(weChatContactMsg != null){
seqLong = weChatContactMsg.getSeq();
}
FinanceService financeService = new FinanceService(corpId,secret,privateKey);
FinanceService financeService = new FinanceService(corpAccount.getCorpId(),corpAccount.getChatSecret(),corpAccount.getFinancePrivateKey());
financeService.getChatData(seqLong,(data) -> redisCache.convertAndSend(WeConstans.CONVERSATION_MSG_CHANNEL,data));
log.info("会话存档定时任务执行完成----------------->");
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!