Commit a55a3991 by 阮思源

Revert "正向模糊匹配"

This reverts commit b8f268e0
parent 7662d10f
...@@ -625,11 +625,9 @@ public class BookKeywordBizImpl implements BookKeywordBiz { ...@@ -625,11 +625,9 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
if (bookGroupCipherUser == null || StringUtil.isEmpty(bookGroupCipherUser.getShortBookName())) { if (bookGroupCipherUser == null || StringUtil.isEmpty(bookGroupCipherUser.getShortBookName())) {
return; return;
} }
List<SelfRobotKeyword> keywordList = selfRobotKeywordDao.getListByBookGroupIdAndKeyword(bookGroupCipherUser.getBookGroupId(), content); SelfRobotKeyword selfRobotKeyword = selfRobotKeywordDao.getByBookGroupIdAndKeyword(bookGroupCipherUser.getBookGroupId(), content);
if (!ListUtils.isEmpty(keywordList)) { if (selfRobotKeyword != null) {
for (SelfRobotKeyword selfRobotKeyword : keywordList){
sendSelfKeyword(selfRobotKeyword, sendTextDTO); sendSelfKeyword(selfRobotKeyword, sendTextDTO);
}
//临时,后面要删 //临时,后面要删
String robotId = sendTextDTO.getWxId(); String robotId = sendTextDTO.getWxId();
if ("一对一".equals(content)){ if ("一对一".equals(content)){
......
...@@ -33,12 +33,4 @@ public interface SelfRobotKeywordDao extends BaseDao<SelfRobotKeyword> { ...@@ -33,12 +33,4 @@ public interface SelfRobotKeywordDao extends BaseDao<SelfRobotKeyword> {
SelfRobotKeyword getNextKeyWord(Long bookGroupId, String keyword); SelfRobotKeyword getNextKeyWord(Long bookGroupId, String keyword);
List<SelfRobotKeyword> getListByBookGroupIds(List<Long> bookGroupIds); List<SelfRobotKeyword> getListByBookGroupIds(List<Long> bookGroupIds);
/**
* 模糊匹配
* @param bookGroupId
* @param content
* @return
*/
List<SelfRobotKeyword> getListByBookGroupIdAndKeyword(Long bookGroupId, String content);
} }
...@@ -92,12 +92,4 @@ public class SelfRobotKeywordDaoImpl extends BaseDaoImpl<SelfRobotKeyword> imple ...@@ -92,12 +92,4 @@ public class SelfRobotKeywordDaoImpl extends BaseDaoImpl<SelfRobotKeyword> imple
map.put("bookGroupIds", bookGroupIds); map.put("bookGroupIds", bookGroupIds);
return this.getSqlSession().selectList(this.getStatement("getListByBookGroupIds"), map); return this.getSqlSession().selectList(this.getStatement("getListByBookGroupIds"), map);
} }
@Override
public List<SelfRobotKeyword> getListByBookGroupIdAndKeyword(Long bookGroupId, String keyword) {
Map<String, Object> map = new HashMap<>();
map.put("bookGroupId", bookGroupId);
map.put("keyword", keyword);
return getSessionTemplate().selectList(getStatement("getListByBookGroupIdAndKeyword"), map);
}
} }
...@@ -474,7 +474,7 @@ public class ReadingActivityBizImpl implements ReadingActivityBiz{ ...@@ -474,7 +474,7 @@ public class ReadingActivityBizImpl implements ReadingActivityBiz{
if (ListUtils.isEmpty(robotIdList) || robotIdList.size()<3){ if (ListUtils.isEmpty(robotIdList) || robotIdList.size()<3){
log.info("小号数量小于3个,取其他号补充"); log.info("小号数量小于3个,取其他号补充");
Integer need = 3 - robotIdList.size();//所需数量 Integer need = 3 - robotIdList.size();//所需数量
/*if ("pro".equalsIgnoreCase(envStr)){ if ("pro".equalsIgnoreCase(envStr)){
List<String> altIds = wechatGroupConsr.getSelfRobotByRobotType(null); List<String> altIds = wechatGroupConsr.getSelfRobotByRobotType(null);
altIds.removeAll(robotIdList); altIds.removeAll(robotIdList);
if (need == 1) { if (need == 1) {
...@@ -483,7 +483,7 @@ public class ReadingActivityBizImpl implements ReadingActivityBiz{ ...@@ -483,7 +483,7 @@ public class ReadingActivityBizImpl implements ReadingActivityBiz{
robotIdList.add(altIds.get(0)); robotIdList.add(altIds.get(0));
robotIdList.add(altIds.get(1)); robotIdList.add(altIds.get(1));
} }
}else {*/ }else {
String alt1="wxid_lw4vjnxjg45d22";//zyj String alt1="wxid_lw4vjnxjg45d22";//zyj
String alt2="p867263500";//dawei String alt2="p867263500";//dawei
if (need == 1){ if (need == 1){
...@@ -492,7 +492,7 @@ public class ReadingActivityBizImpl implements ReadingActivityBiz{ ...@@ -492,7 +492,7 @@ public class ReadingActivityBizImpl implements ReadingActivityBiz{
robotIdList.add(alt1); robotIdList.add(alt1);
robotIdList.add(alt2); robotIdList.add(alt2);
} }
// } }
} }
Integer groupCount = (userList.size()+robotIdList.size())/500 + 1;//每个群最多人数 Integer groupCount = (userList.size()+robotIdList.size())/500 + 1;//每个群最多人数
for (int i=1; i<=groupCount; i++){ for (int i=1; i<=groupCount; i++){
......
...@@ -114,17 +114,10 @@ ...@@ -114,17 +114,10 @@
select <include refid="Base_Column_List"/> select <include refid="Base_Column_List"/>
from self_robot_keyword from self_robot_keyword
where book_group_id=#{bookGroupId} where book_group_id=#{bookGroupId}
and keyword = #{keyword} and keyword=#{keyword}
limit 1 limit 1
</select> </select>
<select id="getListByBookGroupIdAndKeyword" parameterType="map" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from self_robot_keyword
where book_group_id=#{bookGroupId}
and keyword like concat('%', #{keyword}, '%')
</select>
<!--根据社群码id获取数量--> <!--根据社群码id获取数量-->
<select id="getCountByBookGroupId" parameterType="map" resultType="integer"> <select id="getCountByBookGroupId" parameterType="map" resultType="integer">
select count(1) select count(1)
......
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