Commit 82681621 by huzhenkun

加IP

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