|
@@ -2,10 +2,13 @@ package com.zanxiang.game.module.sdk.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.zanxiang.game.module.base.ServerInfo;
|
|
import com.zanxiang.game.module.base.pojo.dto.H5GameConfigDTO;
|
|
import com.zanxiang.game.module.base.pojo.dto.H5GameConfigDTO;
|
|
import com.zanxiang.game.module.base.pojo.enums.HttpStatusEnum;
|
|
import com.zanxiang.game.module.base.pojo.enums.HttpStatusEnum;
|
|
import com.zanxiang.game.module.base.pojo.enums.PayDeviceEnum;
|
|
import com.zanxiang.game.module.base.pojo.enums.PayDeviceEnum;
|
|
import com.zanxiang.game.module.base.pojo.enums.PayWayEnum;
|
|
import com.zanxiang.game.module.base.pojo.enums.PayWayEnum;
|
|
|
|
+import com.zanxiang.game.module.base.rpc.IAgentRpc;
|
|
|
|
+import com.zanxiang.game.module.base.rpc.IKfMsgRpc;
|
|
import com.zanxiang.game.module.mybatis.entity.*;
|
|
import com.zanxiang.game.module.mybatis.entity.*;
|
|
import com.zanxiang.game.module.mybatis.mapper.GameAppletMapper;
|
|
import com.zanxiang.game.module.mybatis.mapper.GameAppletMapper;
|
|
import com.zanxiang.game.module.sdk.enums.OrderStateEnum;
|
|
import com.zanxiang.game.module.sdk.enums.OrderStateEnum;
|
|
@@ -20,6 +23,7 @@ import com.zanxiang.module.util.JsonUtil;
|
|
import com.zanxiang.module.util.bean.BeanUtil;
|
|
import com.zanxiang.module.util.bean.BeanUtil;
|
|
import com.zanxiang.module.util.exception.BaseException;
|
|
import com.zanxiang.module.util.exception.BaseException;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.dubbo.config.annotation.DubboReference;
|
|
import org.apache.logging.log4j.util.Strings;
|
|
import org.apache.logging.log4j.util.Strings;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -43,9 +47,6 @@ import java.util.Objects;
|
|
@Service
|
|
@Service
|
|
public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApplet> implements IGameAppletService {
|
|
public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApplet> implements IGameAppletService {
|
|
|
|
|
|
- @Autowired
|
|
|
|
- private IUserService userService;
|
|
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IOrderService orderService;
|
|
private IOrderService orderService;
|
|
|
|
|
|
@@ -73,6 +74,9 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
|
|
@Autowired
|
|
@Autowired
|
|
private IKfLinkService kfLinkService;
|
|
private IKfLinkService kfLinkService;
|
|
|
|
|
|
|
|
+ @DubboReference(providedBy = ServerInfo.SERVER_DUBBO_NAME)
|
|
|
|
+ private IKfMsgRpc kfMsgRpc;
|
|
|
|
+
|
|
@Value("${payConfig.wxPay.customH5Url}")
|
|
@Value("${payConfig.wxPay.customH5Url}")
|
|
private String customH5Url;
|
|
private String customH5Url;
|
|
|
|
|
|
@@ -115,22 +119,25 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
|
|
|
|
|
|
log.error("收到腾讯监听服务器内容, appletMsgDTO : {}", JsonUtil.toString(appletMsgDTO));
|
|
log.error("收到腾讯监听服务器内容, appletMsgDTO : {}", JsonUtil.toString(appletMsgDTO));
|
|
|
|
|
|
- //文本消息
|
|
|
|
- if (Objects.equals(appletMsgDTO.getMsgType(), AppletMsgDTO.MSG_TYPE_TEXT)) {
|
|
|
|
- //用户信息
|
|
|
|
- UserDTO userDTO = userService.getUserByOpenId(gameAppletDTO.getGameId(), appletMsgDTO.getFromUserName());
|
|
|
|
- //用户客服支付会话
|
|
|
|
- if (Objects.equals(appletMsgDTO.getContent(), AppletMsgDTO.MSG_CONTENT_PAY)) {
|
|
|
|
- return this.customPayMessage(gameAppletDTO, userDTO);
|
|
|
|
- }
|
|
|
|
- //非客服会话, 返回指定的客服链接
|
|
|
|
- return this.customLinkMessage(gameAppletDTO, userDTO);
|
|
|
|
- }
|
|
|
|
|
|
+// //文本消息
|
|
|
|
+// if (Objects.equals(appletMsgDTO.getMsgType(), AppletMsgDTO.MSG_TYPE_TEXT)) {
|
|
|
|
+// //用户信息
|
|
|
|
+// UserDTO userDTO = userService.getUserByOpenId(gameAppletDTO.getGameId(), appletMsgDTO.getFromUserName());
|
|
|
|
+// //用户客服支付会话
|
|
|
|
+// if (Objects.equals(appletMsgDTO.getContent(), AppletMsgDTO.MSG_CONTENT_PAY)) {
|
|
|
|
+// return this.customPayMessage(gameAppletDTO, userDTO);
|
|
|
|
+// }
|
|
|
|
+// //非客服会话, 返回指定的客服链接
|
|
|
|
+// return this.customLinkMessage(gameAppletDTO, userDTO);
|
|
|
|
+// }
|
|
//米大师支付回调事件
|
|
//米大师支付回调事件
|
|
if (Objects.equals(appletMsgDTO.getMsgType(), AppletMsgDTO.MSG_TYPE_EVENT)
|
|
if (Objects.equals(appletMsgDTO.getMsgType(), AppletMsgDTO.MSG_TYPE_EVENT)
|
|
&& Objects.equals(appletMsgDTO.getEvent(), AppletMsgDTO.EVENT_MI_PAY_CALL_BACK)) {
|
|
&& Objects.equals(appletMsgDTO.getEvent(), AppletMsgDTO.EVENT_MI_PAY_CALL_BACK)) {
|
|
return this.miPayMessage(appletMsgDTO, gameAppletDTO);
|
|
return this.miPayMessage(appletMsgDTO, gameAppletDTO);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ kfMsgRpc.appletMsg(postData);
|
|
|
|
+
|
|
//其他消息不处理, 直接返回成功
|
|
//其他消息不处理, 直接返回成功
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|