|
@@ -147,9 +147,15 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
|
|
//虚拟游戏小程序, 单独逻辑
|
|
//虚拟游戏小程序, 单独逻辑
|
|
if (Objects.equals(gameApplet.getType(), 3)) {
|
|
if (Objects.equals(gameApplet.getType(), 3)) {
|
|
//小程序自动回复
|
|
//小程序自动回复
|
|
- this.appletReplyHandle(gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(), kfRoom, gameApplet.getAppId());
|
|
|
|
- //保存消息, 玩家转入接待状态
|
|
|
|
- this.saveMsgAndChangeWait(kfRoom, kfRoomMsg, gameApplet, kfAppletMsgDTO, msgContent);
|
|
|
|
|
|
+ Boolean customerSwitch = this.appletReplyHandle(gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(),
|
|
|
|
+ kfRoom, gameApplet.getAppId());
|
|
|
|
+ if (Objects.equals(Boolean.TRUE, customerSwitch)) {
|
|
|
|
+ //保存消息, 玩家转入接待状态
|
|
|
|
+ this.saveMsgAndChangeWait(kfRoom, kfRoomMsg, gameApplet, kfAppletMsgDTO, msgContent);
|
|
|
|
+ } else {
|
|
|
|
+ //保存房间消息
|
|
|
|
+ kfRoomMsgService.save(kfRoomMsg);
|
|
|
|
+ }
|
|
//直接结束
|
|
//直接结束
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -190,13 +196,13 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
|
|
this.pushMessage(this.transform(kfRoom, gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(), kfRoomMsg, msgContent));
|
|
this.pushMessage(this.transform(kfRoom, gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(), kfRoomMsg, msgContent));
|
|
}
|
|
}
|
|
|
|
|
|
- private void appletReplyHandle(Long gameId, String openId, KfRoom kfRoom, String appId) {
|
|
|
|
|
|
+ private Boolean appletReplyHandle(Long gameId, String openId, KfRoom kfRoom, String appId) {
|
|
//玩家信息
|
|
//玩家信息
|
|
KfSessionUser kfSessionUser = kfSessionUserService.getById(openId, gameId);
|
|
KfSessionUser kfSessionUser = kfSessionUserService.getById(openId, gameId);
|
|
//来源类型
|
|
//来源类型
|
|
KfSessionFromEnum kfSessionFrom = KfSessionFromEnum.getKfSessionFrom(kfSessionUser.getSessionFrom());
|
|
KfSessionFromEnum kfSessionFrom = KfSessionFromEnum.getKfSessionFrom(kfSessionUser.getSessionFrom());
|
|
if (kfSessionFrom == null) {
|
|
if (kfSessionFrom == null) {
|
|
- return;
|
|
|
|
|
|
+ return Boolean.TRUE;
|
|
}
|
|
}
|
|
//查询玩家访问信息
|
|
//查询玩家访问信息
|
|
UserApplet userApplet = userAppletService.getOne(new LambdaQueryWrapper<UserApplet>()
|
|
UserApplet userApplet = userAppletService.getOne(new LambdaQueryWrapper<UserApplet>()
|
|
@@ -206,7 +212,7 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
|
|
.last("limit 1"));
|
|
.last("limit 1"));
|
|
//不存在访问信息, 不处理
|
|
//不存在访问信息, 不处理
|
|
if (userApplet == null) {
|
|
if (userApplet == null) {
|
|
- return;
|
|
|
|
|
|
+ return Boolean.TRUE;
|
|
}
|
|
}
|
|
Map<String, String> channelMap = JsonUtil.toMap(userApplet.getChannel(), Map.class, String.class);
|
|
Map<String, String> channelMap = JsonUtil.toMap(userApplet.getChannel(), Map.class, String.class);
|
|
String pageSign = channelMap.get(KfAppletReply.PAGE_SIGN);
|
|
String pageSign = channelMap.get(KfAppletReply.PAGE_SIGN);
|
|
@@ -218,7 +224,7 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
|
|
.orderByDesc(KfAppletReply::getCreateTime)
|
|
.orderByDesc(KfAppletReply::getCreateTime)
|
|
.last("limit 1"));
|
|
.last("limit 1"));
|
|
if (kfAppletReply == null) {
|
|
if (kfAppletReply == null) {
|
|
- return;
|
|
|
|
|
|
+ return Boolean.TRUE;
|
|
}
|
|
}
|
|
//存在文本消息发送
|
|
//存在文本消息发送
|
|
if (Strings.isNotBlank(kfAppletReply.getReplyText())) {
|
|
if (Strings.isNotBlank(kfAppletReply.getReplyText())) {
|
|
@@ -239,6 +245,7 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
|
|
}
|
|
}
|
|
this.sysLinkMsgSend(gameId, openId, kfRoom, linkMap);
|
|
this.sysLinkMsgSend(gameId, openId, kfRoom, linkMap);
|
|
}
|
|
}
|
|
|
|
+ return kfAppletReply.getCustomerSwitch();
|
|
}
|
|
}
|
|
|
|
|
|
private void sysLinkMsgSend(Long gameId, String openId, KfRoom kfRoom, Map<String, String> linkMap) {
|
|
private void sysLinkMsgSend(Long gameId, String openId, KfRoom kfRoom, Map<String, String> linkMap) {
|