Commit 9f635dba by 阮思源

Merge branch 'feat-1002525' into 'master'

客服接入不发唤醒熔断非关键词

See merge request rays/pcloud-book!516
parents 07acfc1d 778944f9
...@@ -5,12 +5,8 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,12 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import com.pcloud.book.personalstage.biz.PersonalStageBiz; import com.pcloud.book.personalstage.biz.PersonalStageBiz;
import com.pcloud.book.personalstage.biz.PersonalStageJumpBiz; import com.pcloud.book.personalstage.biz.PersonalStageJumpBiz;
import com.pcloud.book.personalstage.constant.PersonalStageConstant; import com.pcloud.book.personalstage.constant.PersonalStageConstant;
import com.pcloud.book.personalstage.dto.WakeupDelayDTO;
import com.pcloud.common.core.mq.DelayQueueDTO; import com.pcloud.common.core.mq.DelayQueueDTO;
import com.pcloud.common.core.mq.MQQueueConstants; import com.pcloud.common.core.mq.MQQueueConstants;
import com.pcloud.common.utils.DateUtils;
import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -54,4 +50,6 @@ public class DelayReceiver { ...@@ -54,4 +50,6 @@ public class DelayReceiver {
personalStageJumpBiz.delayPaper(dto); personalStageJumpBiz.delayPaper(dto);
} }
} }
} }
...@@ -500,7 +500,16 @@ public class PersonalStageBizImpl implements PersonalStageBiz { ...@@ -500,7 +500,16 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
String userWxId=wakeupDelayDTO.getWxId(); String userWxId=wakeupDelayDTO.getWxId();
String ip=wakeupDelayDTO.getIp(); String ip=wakeupDelayDTO.getIp();
this.replacePaperUrl(replyItems, robotId, userWxId, personalStage.getPaperId(),ip); this.replacePaperUrl(replyItems, robotId, userWxId, personalStage.getPaperId(),ip);
sendReplyItems(replyItems,robotId,userWxId,ip,wakeupDelayDTO.getPersonalStageUserId()); //判断人工客服服务状态
Boolean state = false;
Integer serviceState = wechatGroupConsr.getServiceStateByRobotUser(robotId, userWxId);
if (serviceState == 1){
LOGGER.info("人工客服服务中,userWxId="+userWxId+"+robotId+"+robotId);
state = true;
}
if (!state){//客服介入不发唤醒
sendReplyItems(replyItems,robotId,userWxId,ip,wakeupDelayDTO.getPersonalStageUserId());
}
//下一个延时 //下一个延时
List<PersonalStageWakeup> wakeups = personalStageWakeupDao.getListByPersonalStageId(personalStageId); List<PersonalStageWakeup> wakeups = personalStageWakeupDao.getListByPersonalStageId(personalStageId);
int i=0; int i=0;
...@@ -579,6 +588,12 @@ public class PersonalStageBizImpl implements PersonalStageBiz { ...@@ -579,6 +588,12 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
if("重置体验".equals(userSendContent)){ if("重置体验".equals(userSendContent)){
return; return;
} }
//判断人工客服服务状态
Integer serviceState = wechatGroupConsr.getServiceStateByRobotUser(robotId, userWxId);
if (serviceState == 1){
LOGGER.info("人工客服服务中,userWxId="+userWxId+"+robotId+"+robotId);
return;
}
PersonalStageReply personalStageReply = null; PersonalStageReply personalStageReply = null;
List<Long> ids = personalStageReplyDao.getIdsByRelevance(StageReplyRelevEnum.STAGE_NOT_KEYWORD.value, personalStageId); List<Long> ids = personalStageReplyDao.getIdsByRelevance(StageReplyRelevEnum.STAGE_NOT_KEYWORD.value, personalStageId);
Long replyId = null; Long replyId = null;
...@@ -760,6 +775,12 @@ public class PersonalStageBizImpl implements PersonalStageBiz { ...@@ -760,6 +775,12 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
@ParamLog("非关键词熔断回复") @ParamLog("非关键词熔断回复")
@Override @Override
public void sendNotKeywordFusingReply(String robotId, String userWxId, String ip, Long personalStageId, Long personalStageUserId, Long paperId) { public void sendNotKeywordFusingReply(String robotId, String userWxId, String ip, Long personalStageId, Long personalStageUserId, Long paperId) {
//判断人工客服服务状态
Integer serviceState = wechatGroupConsr.getServiceStateByRobotUser(robotId, userWxId);
if (serviceState == 1){
LOGGER.info("人工客服服务中,userWxId="+userWxId+"+robotId+"+robotId);
return;
}
List<Long> ids = personalStageReplyDao.getIdsByRelevance(StageReplyRelevEnum.FUSING_NOT_KEYWORD.value, personalStageId); List<Long> ids = personalStageReplyDao.getIdsByRelevance(StageReplyRelevEnum.FUSING_NOT_KEYWORD.value, personalStageId);
if (ListUtils.isEmpty(ids)) { if (ListUtils.isEmpty(ids)) {
return; return;
......
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