Commit 2d5f001e by 裴大威

紧急3

parent 3caeb115
...@@ -49,6 +49,7 @@ import com.pcloud.book.keywords.vo.GuideVO; ...@@ -49,6 +49,7 @@ import com.pcloud.book.keywords.vo.GuideVO;
import com.pcloud.book.keywords.vo.ReplyMessageVO; import com.pcloud.book.keywords.vo.ReplyMessageVO;
import com.pcloud.book.keywords.vo.SetGuideVO; import com.pcloud.book.keywords.vo.SetGuideVO;
import com.pcloud.book.keywords.vo.UpdateGuideVO; import com.pcloud.book.keywords.vo.UpdateGuideVO;
import com.pcloud.book.util.common.ThreadPoolUtils;
import com.pcloud.book.weixinclock.dao.WeixinClockGroupClassifyDao; import com.pcloud.book.weixinclock.dao.WeixinClockGroupClassifyDao;
import com.pcloud.book.weixinclock.dto.WeixinClockDto; import com.pcloud.book.weixinclock.dto.WeixinClockDto;
import com.pcloud.channelcenter.wechat.dto.AccountSettingDto; import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
...@@ -167,7 +168,7 @@ public class BookGuideBizImpl implements BookGuideBiz { ...@@ -167,7 +168,7 @@ public class BookGuideBizImpl implements BookGuideBiz {
List<SelfRobotKeyword> selfRobotKeywords = selfRobotKeywordDao.getListByBookGroupId(bookGroupId); List<SelfRobotKeyword> selfRobotKeywords = selfRobotKeywordDao.getListByBookGroupId(bookGroupId);
if (!ListUtils.isEmpty(selfRobotKeywords)){ if (!ListUtils.isEmpty(selfRobotKeywords)){
try { try {
String content="你可以通过以下方式唤醒我,让我知道你的学习需求"; String content="现在你试试回复我定制一套「背单词」读书计划 [ ]内关键词来唤醒我";
SendTextMessageVO voh = new SendTextMessageVO(); SendTextMessageVO voh = new SendTextMessageVO();
voh.setContent(content); voh.setContent(content);
voh.setCode(SendMessageTypeEnum.SELF.getCode()); voh.setCode(SendMessageTypeEnum.SELF.getCode());
...@@ -181,22 +182,24 @@ public class BookGuideBizImpl implements BookGuideBiz { ...@@ -181,22 +182,24 @@ public class BookGuideBizImpl implements BookGuideBiz {
} catch (InterruptedException e) { } catch (InterruptedException e) {
log.error("发消息休眠5秒出错", e); log.error("发消息休眠5秒出错", e);
} }
for (SelfRobotKeyword selfRobotKeyword:selfRobotKeywords){ ThreadPoolUtils.SEND_MESSAGE_THREAD_POOL.execute(()->{
try { for (SelfRobotKeyword selfRobotKeyword:selfRobotKeywords){
SendTextMessageVO vo = new SendTextMessageVO(); try {
vo.setContent(selfRobotKeyword.getGuide()); SendTextMessageVO vo = new SendTextMessageVO();
vo.setCode(SendMessageTypeEnum.SELF.getCode()); vo.setContent(selfRobotKeyword.getGuide());
vo.setWxId(agreeAddUserDTO.getRobotWxId()); vo.setCode(SendMessageTypeEnum.SELF.getCode());
vo.setAltId(agreeAddUserDTO.getRobotWxId()); vo.setWxId(agreeAddUserDTO.getRobotWxId());
vo.setWxGroupId(agreeAddUserDTO.getUserWxId()); vo.setAltId(agreeAddUserDTO.getRobotWxId());
vo.setIp(agreeAddUserDTO.getIp()); vo.setWxGroupId(agreeAddUserDTO.getUserWxId());
WxGroupSDK.sendTextMessage(vo); vo.setIp(agreeAddUserDTO.getIp());
log.info("临时demo发送个人号加好友信息"+vo.toString()); WxGroupSDK.sendTextMessage(vo);
Thread.sleep(5000); log.info("临时demo发送个人号加好友信息"+vo.toString());
} catch (InterruptedException e) { Thread.sleep(1000*30);
log.error("发消息休眠5秒出错", e); } catch (InterruptedException e) {
log.error("发消息休眠5秒出错", e);
}
} }
} });
} }
return; return;
} }
......
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