feat:客服聊天bug
This commit is contained in:
1 parent
ebbe954e87
commit
5785786f21
3 files changed
+20
-1
No files matched your search
+4
@@ -1,6 +1,9 @@
|
||||
package cn.iocoder.yudao.module.member.client.constant;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public final class ChatConstant {
|
||||
|
||||
/**
|
||||
@@ -17,4 +20,5 @@ public final class ChatConstant {
|
||||
public static final String COM_SERVICE_USER_NAME = "荷塘月色客服";
|
||||
public static final String COM_SERVICE_USER_AVATAR = "https://chatapi.zianxin.com/admin-api/infra/file/4/get/b85e0bc2e4338c9919ac13e1f12cb3ac40dc7ba807a0e65ef83c822ef7d2f1a2.png";
|
||||
|
||||
public static final List<Long> IGNORE_USER_IDS = Arrays.asList(0L, COM_MESSAGE_USER_ID, COM_SERVICE_USER_ID);
|
||||
}
|
||||
+12
@@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.member.client.vo.chat.privatemsg;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ChatPrivateTotalMessageTotalReqVO {
|
||||
|
||||
@@ -15,6 +17,16 @@ public class ChatPrivateTotalMessageTotalReqVO {
|
||||
*/
|
||||
private Long receiveId;
|
||||
|
||||
/**
|
||||
* 排除发送人id
|
||||
*/
|
||||
private List<Long> excludeSendIds;
|
||||
|
||||
/**
|
||||
* 排除接收人id
|
||||
*/
|
||||
private List<Long> excludeReceiveIds;
|
||||
|
||||
/**
|
||||
* 发送时间范围
|
||||
*/
|
||||
|
||||
+4
-1
@@ -4,6 +4,7 @@ import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.client.constant.ChatConstant;
|
||||
import cn.iocoder.yudao.module.member.client.service.ChatApi;
|
||||
import cn.iocoder.yudao.module.member.client.vo.chat.privatemsg.ChatPrivateTotalMessageTotalReqVO;
|
||||
import cn.iocoder.yudao.module.member.client.vo.chat.privatemsg.ChatPrivateTotalMessageTotalResVO;
|
||||
@@ -123,7 +124,7 @@ public class OpenTypeServiceImpl implements OpenTypeService {
|
||||
// 新增会员开通表
|
||||
openTypeUserMapper.insert(openTypeUserObj);
|
||||
// 添加会员tag
|
||||
memberRecentTagService.createOrUpdateVipTag(openTypeUserDO.getMemberId());
|
||||
memberRecentTagService.createOrUpdateVipTag(dto.getMemberId());
|
||||
String message = String.format("已赠送您%d天的会员,有效期至%s", dto.getDayCount(), LocalDateTimeUtil.format(openTypeUserObj.getEndTime(), DatePattern.NORM_DATETIME_PATTERN));
|
||||
this.chatApi.messageUserSendText(dto.getMemberId(), message);
|
||||
return true;
|
||||
@@ -324,6 +325,8 @@ public class OpenTypeServiceImpl implements OpenTypeService {
|
||||
LocalDateTimeUtil.format(startDate, DatePattern.NORM_DATETIME_PATTERN),
|
||||
LocalDateTimeUtil.format(endDate, DatePattern.NORM_DATETIME_PATTERN),
|
||||
});
|
||||
dto.setExcludeSendIds(ChatConstant.IGNORE_USER_IDS);
|
||||
dto.setExcludeReceiveIds(ChatConstant.IGNORE_USER_IDS);
|
||||
try {
|
||||
List<ChatPrivateTotalMessageTotalResVO> msgList = chatApi.privateTotal(dto);
|
||||
if (ObjectUtil.isEmpty(msgList)) return true;
|
||||
|
||||
Reference in new issue
Block a user