Browse Source

fix : 取消自动客服消息

bilingfeng 1 năm trước cách đây
mục cha
commit
3ca549c6f6

+ 1 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java

@@ -23,7 +23,7 @@ public class SDKApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(SDKApplication.class, args);
-        System.out.println("赞象SDK服务启动成功 <dubbo升级3.0, 回调CP异常处理> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功 <dubbo升级3.0, 取消自动客服消息> ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +

+ 14 - 9
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameAppletServiceImpl.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 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.PayDeviceEnum;
+import com.zanxiang.game.module.base.pojo.enums.PayWayEnum;
 import com.zanxiang.game.module.mybatis.entity.Game;
 import com.zanxiang.game.module.mybatis.entity.GameApplet;
 import com.zanxiang.game.module.mybatis.entity.GameExt;
@@ -110,10 +112,12 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
         UserDTO userDTO = userService.getUserByOpenId(gameAppletDTO.getGameId(), appletMsgDTO.getFromUserName());
         //客服支付
         if (Objects.equals(appletMsgDTO.getMsgType(), "text") && Objects.equals(appletMsgDTO.getContent(), "2")) {
-            //查询用户最新订单
+            //查询用户最新客服支付订单
             Order order = orderService.getOne(new LambdaQueryWrapper<Order>()
                     .eq(Order::getUserId, userDTO.getId())
                     .eq(Order::getStatus, OrderStateEnum.READY_PAY.getCode())
+                    .eq(Order::getPayWayId, PayWayEnum.WX_PAY.getPayWayId())
+                    .eq(Order::getPayDeviceId, PayDeviceEnum.CUSTOM_PAY.getPayDeviceId())
                     .orderByDesc(Order::getCreateTime)
                     .last("limit 1"));
             if (order != null) {
@@ -121,14 +125,15 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
                 return this.sendCustomMessage(gameAppletDTO, userDTO.getOpenId(), order);
             }
         }
-        //非客服支付, 回复通用消息
-        GameExt gameExt = gameExtService.getByGameId(userDTO.getGameId());
-        String text = "尊敬的玩家您好,请您用QQ添加:" + gameExt.getCustomerQq()
-                + ",联系官方客服哦,客服目前排队比较多,请您耐心等待,请您备注好区服角色,方便客服第一时间为您处理问题";
-        //客服消息参数构造
-        Map<String, Object> textMap = new HashMap<>(1);
-        textMap.put("content", text);
-        return this.sendCustomMessageApi(gameAppletDTO, userDTO.getOpenId(), "text", textMap);
+        return result;
+//        //非客服支付, 回复通用消息
+//        GameExt gameExt = gameExtService.getByGameId(userDTO.getGameId());
+//        String text = "尊敬的玩家您好,请您用QQ添加:" + gameExt.getCustomerQq()
+//                + ",联系官方客服哦,客服目前排队比较多,请您耐心等待,请您备注好区服角色,方便客服第一时间为您处理问题";
+//        //客服消息参数构造
+//        Map<String, Object> textMap = new HashMap<>(1);
+//        textMap.put("content", text);
+//        return this.sendCustomMessageApi(gameAppletDTO, userDTO.getOpenId(), "text", textMap);
     }
 
     private String sendCustomMessage(GameAppletDTO gameAppletDTO, String openId, Order order) {