|  | @@ -119,21 +119,9 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
 | 
	
		
			
				|  |  |          KfRoomMsg kfRoomMsg = this.transform(kfAppletMsgDTO, gameApplet, kfRoom, postData, msgContent);
 | 
	
		
			
				|  |  |          //判断是否请求支付链接
 | 
	
		
			
				|  |  |          String orderId = redisUtil.getCache(RedisKeyConstant.GAME_CUSTOM_PAY_SIGN + kfAppletMsgDTO.getFromUserName());
 | 
	
		
			
				|  |  | -        //存在客服支付订单
 | 
	
		
			
				|  |  | -        if (Strings.isNotBlank(orderId)) {
 | 
	
		
			
				|  |  | -            //收到的是充值消息或者小程序消息, 回复充值链接
 | 
	
		
			
				|  |  | -            if (KfAppletMsgDTO.MSG_CONTENT_PAY.contains(kfAppletMsgDTO.getContent())
 | 
	
		
			
				|  |  | -                    || Objects.equals(kfAppletMsgDTO.getMsgType(), KfRoomMsgTypeEnum.KF_MSG_TYPE_MINI_APP.getValue())) {
 | 
	
		
			
				|  |  | -                Order order = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderId, orderId));
 | 
	
		
			
				|  |  | -                //存在待支付的客服支付订单, 判断订单状态
 | 
	
		
			
				|  |  | -                if (Objects.equals(order.getStatus(), OrderStatusEnum.READY_PAY.getValue())
 | 
	
		
			
				|  |  | -                        || Objects.equals(order.getStatus(), OrderStatusEnum.WAIT_PAY.getValue())) {
 | 
	
		
			
				|  |  | -                    this.sendCustomPayMessage(gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(), kfRoom, order);
 | 
	
		
			
				|  |  | -                    kfRoomMsg.setReadStatus(Boolean.TRUE);
 | 
	
		
			
				|  |  | -                    kfRoomMsgService.save(kfRoomMsg);
 | 
	
		
			
				|  |  | -                    return;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | +        //客服订单处理
 | 
	
		
			
				|  |  | +        if (Strings.isNotBlank(orderId) && this.orderHandle(orderId, gameApplet.getGameId(), kfAppletMsgDTO, kfRoom, kfRoomMsg)) {
 | 
	
		
			
				|  |  | +            return;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          //保存房间消息
 | 
	
		
			
				|  |  |          kfRoomMsgService.save(kfRoomMsg);
 | 
	
	
		
			
				|  | @@ -149,6 +137,26 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
 | 
	
		
			
				|  |  |          this.pushMessage(this.transform(kfRoom, gameApplet.getGameId(), kfRoomMsg, msgContent));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    private boolean orderHandle(String orderId, Long gameId, KfAppletMsgDTO kfAppletMsgDTO, KfRoom kfRoom, KfRoomMsg kfRoomMsg) {
 | 
	
		
			
				|  |  | +        //判断收到的消息是否为充值消息或者小程序消息
 | 
	
		
			
				|  |  | +        if (!KfAppletMsgDTO.MSG_CONTENT_PAY.contains(kfAppletMsgDTO.getContent())
 | 
	
		
			
				|  |  | +                && !Objects.equals(kfAppletMsgDTO.getMsgType(), KfRoomMsgTypeEnum.KF_MSG_TYPE_MINI_APP.getValue())) {
 | 
	
		
			
				|  |  | +            return Boolean.FALSE;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        //查询订单
 | 
	
		
			
				|  |  | +        Order order = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderId, orderId));
 | 
	
		
			
				|  |  | +        //判断订单是否为预下单和待支付状态
 | 
	
		
			
				|  |  | +        if (!Objects.equals(order.getStatus(), OrderStatusEnum.READY_PAY.getValue())
 | 
	
		
			
				|  |  | +                && !Objects.equals(order.getStatus(), OrderStatusEnum.WAIT_PAY.getValue())) {
 | 
	
		
			
				|  |  | +            return Boolean.FALSE;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        //发送客服支付消息
 | 
	
		
			
				|  |  | +        this.sendCustomPayMessage(gameId, kfAppletMsgDTO.getFromUserName(), kfRoom, order);
 | 
	
		
			
				|  |  | +        kfRoomMsg.setReadStatus(Boolean.TRUE);
 | 
	
		
			
				|  |  | +        kfRoomMsgService.save(kfRoomMsg);
 | 
	
		
			
				|  |  | +        return Boolean.TRUE;
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      private void eventMsgHandle(GameApplet gameApplet, KfAppletMsgDTO kfAppletMsgDTO) {
 | 
	
		
			
				|  |  |          //事件类型
 | 
	
		
			
				|  |  |          String event = kfAppletMsgDTO.getEvent();
 | 
	
	
		
			
				|  | @@ -341,6 +349,8 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
 | 
	
		
			
				|  |  |          //返回发送的消息内容
 | 
	
		
			
				|  |  |          log.error("客服支付, 发送支付信息 : {}", JsonUtil.toString(msgParamMap));
 | 
	
		
			
				|  |  |          kfRoomMsgService.save(this.transform(openId, gameId, kfRoom, JsonUtil.toString(msgParamMap)));
 | 
	
		
			
				|  |  | +        //删除待支付订单标记
 | 
	
		
			
				|  |  | +        redisUtil.deleteCache(RedisKeyConstant.GAME_CUSTOM_PAY_SIGN + openId);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      private KfRoomMsg transform(String openId, Long gameId, KfRoom kfRoom, String msgContent) {
 |