Commit fed7045b by 阮思源

Merge branch 'feat-jinji' into 'master'

紧急加推名片

See merge request rays/pcloud-book!323
parents 4f44dde8 06388642
......@@ -142,7 +142,7 @@ public class BookGuideBizImpl implements BookGuideBiz {
dto = bookGroupDao.getDTOById(449L);
}
if (envStr.toUpperCase().equals("PRO")&&agreeAddUserDTO.getRobotWxId().equals("wxid_x8i897ryabo722")){
dto = bookGroupDao.getDTOById(23718L);
dto = bookGroupDao.getDTOById(23735L);
}
if (dto!=null){
Long bookGroupId=dto.getId();
......@@ -166,20 +166,36 @@ public class BookGuideBizImpl implements BookGuideBiz {
//回复关键词引导语
List<SelfRobotKeyword> selfRobotKeywords = selfRobotKeywordDao.getListByBookGroupId(bookGroupId);
if (!ListUtils.isEmpty(selfRobotKeywords)){
String content="你可以通过以下方式唤醒我,让我知道你的学习需求:\n";
for (SelfRobotKeyword selfRobotKeyword:selfRobotKeywords){
content=content+"●"+selfRobotKeyword.getGuide()+"\n";
try {
String content="你可以通过一下方式唤醒我,让我知道你的学习需求";
SendTextMessageVO voh = new SendTextMessageVO();
voh.setContent(content);
voh.setCode(SendMessageTypeEnum.SELF.getCode());
voh.setWxId(agreeAddUserDTO.getRobotWxId());
voh.setAltId(agreeAddUserDTO.getRobotWxId());
voh.setWxGroupId(agreeAddUserDTO.getUserWxId());
voh.setIp(agreeAddUserDTO.getIp());
WxGroupSDK.sendTextMessage(voh);
log.info("临时demo发送个人号加好友信息唤醒"+voh.toString());
Thread.sleep(5000);
} catch (InterruptedException e) {
log.error("发消息休眠5秒出错", e);
}
if (!StringUtil.isEmpty(content)){
SendTextMessageVO vo = new SendTextMessageVO();
vo.setContent(content);
vo.setCode(SendMessageTypeEnum.SELF.getCode());
vo.setWxId(agreeAddUserDTO.getRobotWxId());
vo.setAltId(agreeAddUserDTO.getRobotWxId());
vo.setWxGroupId(agreeAddUserDTO.getUserWxId());
vo.setIp(agreeAddUserDTO.getIp());
WxGroupSDK.sendTextMessage(vo);
log.info("临时demo发送个人号加好友信息"+vo.toString());
for (SelfRobotKeyword selfRobotKeyword:selfRobotKeywords){
try {
SendTextMessageVO vo = new SendTextMessageVO();
vo.setContent(selfRobotKeyword.getGuide());
vo.setCode(SendMessageTypeEnum.SELF.getCode());
vo.setWxId(agreeAddUserDTO.getRobotWxId());
vo.setAltId(agreeAddUserDTO.getRobotWxId());
vo.setWxGroupId(agreeAddUserDTO.getUserWxId());
vo.setIp(agreeAddUserDTO.getIp());
WxGroupSDK.sendTextMessage(vo);
log.info("临时demo发送个人号加好友信息"+vo.toString());
Thread.sleep(5000);
} catch (InterruptedException e) {
log.error("发消息休眠5秒出错", e);
}
}
}
return;
......
......@@ -96,11 +96,13 @@ import com.sdk.wxgroup.SendGroupInviteVO;
import com.sdk.wxgroup.SendMessageTypeEnum;
import com.sdk.wxgroup.SendPicMessageVO;
import com.sdk.wxgroup.SendTextMessageVO;
import com.sdk.wxgroup.SendXmlCardVO;
import com.sdk.wxgroup.WxGroupSDK;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
......@@ -178,6 +180,8 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
private SelfRobotKeywordDao selfRobotKeywordDao;
@Autowired
private ResourceConsr resourceConsr;
@Value("${system.env}")
private String envStr;
/**
* 字符串切割长度
*/
......@@ -531,6 +535,58 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
SelfRobotKeyword selfRobotKeyword = selfRobotKeywordDao.getByBookGroupIdAndKeyword(bookGroupCipherUser.getBookGroupId(), content);
if (selfRobotKeyword != null) {
sendSelfKeyword(selfRobotKeyword, sendTextDTO);
//临时,后面要删
String robotId = sendTextDTO.getWxId();
if ("一对一".equals(content)){
Boolean pushIdCard=false;
if (envStr.toUpperCase().equals("TEST")&&robotId.equals("wxid_zus32xb5ukjn22")
&&new Long(1621L).equals(bookGroupCipherUser.getBookGroupId())){
pushIdCard=true;
}
if (envStr.toUpperCase().equals("UAT")&&robotId.equals("wxid_51ff9f099l9a22")
&&new Long(449L).equals(bookGroupCipherUser.getBookGroupId())){
pushIdCard=true;
}
if (envStr.toUpperCase().equals("PRO")&&robotId.equals("wxid_x8i897ryabo722")
&&new Long(23735L).equals(bookGroupCipherUser.getBookGroupId())){
pushIdCard=true;
}
if (pushIdCard){
SendPicMessageVO sendPicMessageVO = new SendPicMessageVO();
sendPicMessageVO.setWxGroupId(sendTextDTO.getWechatUserId());
sendPicMessageVO.setAltId(robotId);
sendPicMessageVO.setPicUrl("https://oss.5rs.me/oss/uploadfe/jpg/ed67ad219eab128dcd404844ee966483.jpg");
sendPicMessageVO.setIp(sendTextDTO.getIp());
sendPicMessageVO.setCode(sendTextDTO.getCode());
sendPicMessageVO.setWxId(sendTextDTO.getWechatUserId());
WxGroupSDK.sendPicMessage(sendPicMessageVO);
log.info("发送特殊名片"+sendPicMessageVO.toString());
}
}
if ("学前".equals(content)){
String wxGroupId="";
if (envStr.toUpperCase().equals("TEST")&&robotId.equals("wxid_zus32xb5ukjn22")
&&new Long(1621L).equals(bookGroupCipherUser.getBookGroupId())){
wxGroupId="19066199642@chatroom";
}
if (envStr.toUpperCase().equals("UAT")&&robotId.equals("wxid_51ff9f099l9a22")
&&new Long(449L).equals(bookGroupCipherUser.getBookGroupId())){
wxGroupId="";
}
if (envStr.toUpperCase().equals("PRO")&&robotId.equals("wxid_x8i897ryabo722")
&&new Long(23735L).equals(bookGroupCipherUser.getBookGroupId())){
wxGroupId="23084048866@chatroom";
}
if (!StringUtil.isEmpty(wxGroupId)){
SendGroupInviteVO sendGroupInviteVO = new SendGroupInviteVO();
sendGroupInviteVO.setAltId(sendTextDTO.getWxId());
sendGroupInviteVO.setWxId(sendTextDTO.getWechatUserId());
sendGroupInviteVO.setWxGroupId(wxGroupId);
sendGroupInviteVO.setIp(sendTextDTO.getIp());
WxGroupSDK.sendGroupInvite(sendGroupInviteVO);
log.info("临时发送入群连接 sendGroupInviteVO:{}", sendGroupInviteVO);
}
}
} else {
BookGroup bookGroup = bookGroupDao.getByShortBookName(content);
if (bookGroup == null) {
......
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