Commit 1746440b by 裴大威

fix 1009053

parent b9d3af3c
......@@ -34,6 +34,7 @@ import com.pcloud.book.keywords.vo.ListKeywordVO;
import com.pcloud.book.keywords.vo.SetKeywordVO;
import com.pcloud.book.keywords.vo.SetRankVO;
import com.pcloud.book.keywords.vo.UpdateKeywordVO;
import com.pcloud.book.util.properties.BookProps;
import com.pcloud.channelcenter.base.constants.ChannelEnum;
import com.pcloud.channelcenter.wechat.dto.AccountSettingDto;
import com.pcloud.common.core.aspect.ParamLog;
......@@ -271,8 +272,18 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
log.info("[关键词消息回复] classifyQrcodeInfo is null");
return;
}
ReplyKeywordDTO replyKeywordDTO ;
final boolean equals = "群主,来个抽奖".equals(content);
if (equals){
final long l1 = System.currentTimeMillis();
replyKeywordDTO = keywordDao.getByKeyword("群主,来个抽奖");
log.info("[接收用户发送文本消息] keywordDao.getByKeyword耗时:{}ms ", System.currentTimeMillis() - l1);
} else {
//获取匹配关键词
ReplyKeywordDTO replyKeywordDTO = bookKeywordDao.getKeywordId(classifyQrcodeInfo.getClassifyId(), classifyQrcodeInfo.getBookGroupId(), content);
final long l1 = System.currentTimeMillis();
replyKeywordDTO = bookKeywordDao.getKeywordId(classifyQrcodeInfo.getClassifyId(), classifyQrcodeInfo.getBookGroupId(), content);
log.info("[接收用户发送文本消息] keywordDao.getByKeyword耗时:{}ms ", System.currentTimeMillis() - l1);
}
if (replyKeywordDTO == null) {
log.info("[关键词消息回复] classifyQrcodeInfo is null");
return;
......
package com.pcloud.book.keywords.dao;
import com.pcloud.book.keywords.dto.ReplyKeywordDTO;
import com.pcloud.book.keywords.entity.Keyword;
import com.pcloud.common.core.dao.BaseDao;
......@@ -21,4 +22,6 @@ public interface KeywordDao extends BaseDao<Keyword> {
* @Date:2019/6/6 11:17
*/
void updateServeInfo(Long serveId, String serveType, String title, String squareImg);
ReplyKeywordDTO getByKeyword(String keyword);
}
package com.pcloud.book.keywords.dao.impl;
import com.pcloud.book.keywords.dao.KeywordDao;
import com.pcloud.book.keywords.dto.ReplyKeywordDTO;
import com.pcloud.book.keywords.entity.Keyword;
import com.pcloud.common.core.dao.BaseDaoImpl;
......@@ -32,4 +33,9 @@ public class KeywordDaoImpl extends BaseDaoImpl<Keyword> implements KeywordDao {
paramMap.put("picUrl", squareImg);
this.getSqlSession().update(this.getStatement("updateServeInfo"), paramMap);
}
@Override
public ReplyKeywordDTO getByKeyword(String keyword) {
return this.getSqlSession().selectOne("getByKeyword", keyword);
}
}
......@@ -34,6 +34,9 @@ public class BookProps {
*/
private static String jisuAppKey;
@Value("group.luck.url")
private String groupLuckUrl;
public static String getJisuAppKey() {
return jisuAppKey;
}
......@@ -69,4 +72,12 @@ public class BookProps {
public void setAppCode(String appCode) {
BookProps.appCode = appCode;
}
public String getGroupLuckUrl() {
return groupLuckUrl;
}
public void setGroupLuckUrl(String groupLuckUrl) {
this.groupLuckUrl = groupLuckUrl;
}
}
......@@ -89,6 +89,25 @@
and id=#{id}
</select>
<select id="getByKeyword" resultType="com.pcloud.book.keywords.dto.ReplyKeywordDTO" parameterType="map">
SELECT
k.id keywordId,
k.keywords,
k.reply_type replyType,
k.content,
k.description,
k.link_url linkUrl,
k.pic_url picUrl,
k.reply_type replyType
FROM
keyword k
WHERE
k.is_delete = 0
and k.keywords = #{keyword}
order BY id asc
limit 1
</select>
<update id="updateServeInfo" parameterType="map">
update
keyword
......
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