Commit febe78b0 by 宋祥

Merge branch 'hzk' into 'master'

加IP

See merge request rays/pcloud-book!74
parents 9daec4bd 82681621
...@@ -54,6 +54,9 @@ public class PushBookClockKeywordDTO implements Serializable { ...@@ -54,6 +54,9 @@ public class PushBookClockKeywordDTO implements Serializable {
@ApiModelProperty("编辑ID") @ApiModelProperty("编辑ID")
private Long adviserId; private Long adviserId;
@ApiModelProperty("IP")
private String ip;
public Long getBookClockInfoId() { public Long getBookClockInfoId() {
return bookClockInfoId; return bookClockInfoId;
...@@ -166,7 +169,15 @@ public class PushBookClockKeywordDTO implements Serializable { ...@@ -166,7 +169,15 @@ public class PushBookClockKeywordDTO implements Serializable {
public void setGroupQrcodeId(Long groupQrcodeId) { public void setGroupQrcodeId(Long groupQrcodeId) {
this.groupQrcodeId = groupQrcodeId; this.groupQrcodeId = groupQrcodeId;
} }
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
@Override @Override
public String toString() { public String toString() {
return "PushBookClockKeywordDTO{" + return "PushBookClockKeywordDTO{" +
...@@ -180,10 +191,11 @@ public class PushBookClockKeywordDTO implements Serializable { ...@@ -180,10 +191,11 @@ public class PushBookClockKeywordDTO implements Serializable {
", userWxId='" + userWxId + '\'' + ", userWxId='" + userWxId + '\'' +
", wechatUserId=" + wechatUserId + ", wechatUserId=" + wechatUserId +
", wechatGroupId='" + wechatGroupId + '\'' + ", wechatGroupId='" + wechatGroupId + '\'' +
", groupQrcodeId=" + groupQrcodeId +
", classifyId=" + classifyId + ", classifyId=" + classifyId +
", groupQrcodeId='" + groupQrcodeId + '\'' +
", bookGroupId=" + bookGroupId + ", bookGroupId=" + bookGroupId +
", adviserId=" + adviserId + ", adviserId=" + adviserId +
", ip='" + ip + '\'' +
'}'; '}';
} }
} }
...@@ -27,7 +27,7 @@ public interface BookClockKeywordBiz { ...@@ -27,7 +27,7 @@ public interface BookClockKeywordBiz {
* @param userWxId * @param userWxId
* @return * @return
*/ */
Boolean sendKeywordMessage(BookClockInfoDTO bookClockInfoDTO, String userWxId, String wechatGroupId, String wxId); Boolean sendKeywordMessage(BookClockInfoDTO bookClockInfoDTO, String userWxId, String wechatGroupId,String wxId, String ip);
/** /**
* 获取微信群某一动作动作关键词 * 获取微信群某一动作动作关键词
......
...@@ -366,6 +366,8 @@ public class BookClockBizImpl implements BookClockBiz { ...@@ -366,6 +366,8 @@ public class BookClockBizImpl implements BookClockBiz {
//获取所有的微信群ID //获取所有的微信群ID
List<String> weixinGroupIds = groupQrcodeDao.getWeixinGroupIdsByClassifyIdList(allClassifyIds); List<String> weixinGroupIds = groupQrcodeDao.getWeixinGroupIdsByClassifyIdList(allClassifyIds);
if(!ListUtils.isEmpty(weixinGroupIds)){ if(!ListUtils.isEmpty(weixinGroupIds)){
Map<String, BookWxQrcodeDTO> wxQrcodeDTOMap = weixinQrcodeDao
.listByWxGroupIds(weixinGroupIds);
for (String weixinGroupId:weixinGroupIds) { for (String weixinGroupId:weixinGroupIds) {
//获取机器人微信号 //获取机器人微信号
String altId = wechatGroupConsr.getRobotIdByGroupId(weixinGroupId); String altId = wechatGroupConsr.getRobotIdByGroupId(weixinGroupId);
...@@ -373,6 +375,9 @@ public class BookClockBizImpl implements BookClockBiz { ...@@ -373,6 +375,9 @@ public class BookClockBizImpl implements BookClockBiz {
sendTextMessageVO.setGroupId(weixinGroupId); sendTextMessageVO.setGroupId(weixinGroupId);
sendTextMessageVO.setAltId(altId); sendTextMessageVO.setAltId(altId);
sendTextMessageVO.setContent(bookClockInfoDTO.getNoticeContent()); sendTextMessageVO.setContent(bookClockInfoDTO.getNoticeContent());
if(!MapUtils.isEmpty(wxQrcodeDTOMap) && wxQrcodeDTOMap.containsKey(weixinGroupId)){
sendTextMessageVO.setIp(wxQrcodeDTOMap.getOrDefault(weixinGroupId,new BookWxQrcodeDTO()).getWechatGroupIp());
}
WxGroupSDK.sendTextMessage(sendTextMessageVO); WxGroupSDK.sendTextMessage(sendTextMessageVO);
} }
} }
......
...@@ -154,8 +154,7 @@ public class BookClockKeywordBizImpl implements BookClockKeywordBiz { ...@@ -154,8 +154,7 @@ public class BookClockKeywordBizImpl implements BookClockKeywordBiz {
*/ */
@Override @Override
@ParamLog("为微信群打卡关键词,发送关键词信息") @ParamLog("为微信群打卡关键词,发送关键词信息")
public Boolean sendKeywordMessage(BookClockInfoDTO bookClockInfoDTO, String userWxId, String wechatGroupId, public Boolean sendKeywordMessage(BookClockInfoDTO bookClockInfoDTO, String userWxId,String wechatGroupId, String wxId, String ip) {
String wxId) {
//发送TOPIC进行相关操作 //发送TOPIC进行相关操作
Long originId = bookClockInfoDTO.getOriginId(); Long originId = bookClockInfoDTO.getOriginId();
String originType = bookClockInfoDTO.getOriginType(); String originType = bookClockInfoDTO.getOriginType();
...@@ -171,6 +170,7 @@ public class BookClockKeywordBizImpl implements BookClockKeywordBiz { ...@@ -171,6 +170,7 @@ public class BookClockKeywordBizImpl implements BookClockKeywordBiz {
pushBookClockKeywordDTO.setClassifyId(bookClockInfoDTO.getClassifyId()); pushBookClockKeywordDTO.setClassifyId(bookClockInfoDTO.getClassifyId());
pushBookClockKeywordDTO.setAdviserId(bookClockInfoDTO.getCreateUser()); pushBookClockKeywordDTO.setAdviserId(bookClockInfoDTO.getCreateUser());
pushBookClockKeywordDTO.setBookClockInfoId(bookClockInfoDTO.getBookClockInfoId()); pushBookClockKeywordDTO.setBookClockInfoId(bookClockInfoDTO.getBookClockInfoId());
pushBookClockKeywordDTO.setIp(ip);
// 收发一体--20190716-HZK // 收发一体--20190716-HZK
//String robotId = wechatGroupConsr.getRobotIdByGroupId(wechatGroupId); //String robotId = wechatGroupConsr.getRobotIdByGroupId(wechatGroupId);
......
...@@ -58,9 +58,7 @@ public class WxGroupSendTextListener { ...@@ -58,9 +58,7 @@ public class WxGroupSendTextListener {
if (!ListUtils.isEmpty(allRobotWxIds) && !allRobotWxIds.contains(wechatUserId) && !StringUtil.isEmpty(sendTextDTO.getTextContent())) { if (!ListUtils.isEmpty(allRobotWxIds) && !allRobotWxIds.contains(wechatUserId) && !StringUtil.isEmpty(sendTextDTO.getTextContent())) {
BookClockInfoDTO bookClockInfoDTO = bookClockCheck.checkKeywordIsClock(sendTextDTO.getTextContent().trim(), sendTextDTO.getWechatGroupId()); BookClockInfoDTO bookClockInfoDTO = bookClockCheck.checkKeywordIsClock(sendTextDTO.getTextContent().trim(), sendTextDTO.getWechatGroupId());
if(null != bookClockInfoDTO){ if(null != bookClockInfoDTO){
bookClockKeywordBiz bookClockKeywordBiz.sendKeywordMessage(bookClockInfoDTO, wechatUserId,sendTextDTO.getWechatGroupId(),sendTextDTO.getWxId(),sendTextDTO.getIp());
.sendKeywordMessage(bookClockInfoDTO, wechatUserId, sendTextDTO.getWechatGroupId(),
sendTextDTO.getWxId());
}else{ }else{
final long l = System.currentTimeMillis(); final long l = System.currentTimeMillis();
bookKeywordBiz.sendKeywordMessage(sendTextDTO.getTextContent().trim(), sendTextDTO.getWechatGroupId(), wechatUserId, sendTextDTO.getWxId()); bookKeywordBiz.sendKeywordMessage(sendTextDTO.getTextContent().trim(), sendTextDTO.getWechatGroupId(), wechatUserId, sendTextDTO.getWxId());
......
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