Jelajahi Sumber

fix : 头条投放虚拟游戏小程序改版03

bilingfeng 11 bulan lalu
induk
melakukan
2fc35dec7e

+ 1 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/ManageApplication.java

@@ -23,7 +23,7 @@ public class ManageApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 < (头条投放虚拟游戏小程序改版02´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 < (头条投放虚拟游戏小程序改版03´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 10 - 5
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/KfAppletMsgServiceImpl.java

@@ -144,6 +144,15 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
         //构造房间消息
         KfWebSocketMsgDTO.MsgContentBean msgContent = this.getMsgContent(kfAppletMsgDTO);
         KfRoomMsg kfRoomMsg = this.transform(kfAppletMsgDTO, gameApplet, kfRoom, postData, msgContent);
+        //虚拟游戏小程序, 单独逻辑
+        if (Objects.equals(gameApplet.getType(), 3)) {
+            //小程序自动回复
+            this.appletReplyHandle(gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(), kfRoom, gameApplet.getAppId());
+            //保存房间消息
+            kfRoomMsgService.save(kfRoomMsg);
+            //直接结束
+            return;
+        }
         //判断是否请求支付链接
         String orderId = redisUtil.getCache(RedisKeyConstant.GAME_CUSTOM_PAY_SIGN + kfAppletMsgDTO.getFromUserName());
         //客服订单处理
@@ -158,8 +167,6 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
         }
         //客服休息时间, 发送自动回复
         this.systemReplyHandle(gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(), kfRoom);
-        //小程序自动回复
-        this.appletReplyHandle(gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(), kfRoom, gameApplet.getAppId());
         //消息报警监测
         this.monitorWordHandle(gameApplet, kfAppletMsgDTO);
         //保存房间消息
@@ -170,10 +177,8 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
                     .set(KfSessionUser::getIsWait, Boolean.TRUE)
                     .set(KfSessionUser::getWaitStartTime, LocalDateTime.now())
                     .set(KfSessionUser::getUpdateTime, LocalDateTime.now())
-                    .isNull(KfSessionUser::getSessionFrom)
                     .eq(KfSessionUser::getOpenId, kfAppletMsgDTO.getFromUserName())
-                    .eq(KfSessionUser::getGameId, gameApplet.getGameId())
-            );
+                    .eq(KfSessionUser::getGameId, gameApplet.getGameId()));
         }
         //消息转发到redis频道
         this.pushMessage(this.transform(kfRoom, gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(), kfRoomMsg, msgContent));

+ 1 - 1
game-module/game-module-mybatis/src/main/java/com/zanxiang/game/module/mybatis/entity/GameApplet.java

@@ -56,7 +56,7 @@ public class GameApplet implements Serializable {
     private String appSecret;
 
     /**
-     * 类型,1 : 小游戏, 2 : 公众号
+     * 类型,1 : 小游戏, 2 : 公众号, 3 : 小程序
      */
     private Integer type;