Browse Source

fix : 关键词监测05

bilingfeng 1 year ago
parent
commit
de6c767a08

+ 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) {
     public static void main(String[] args) {
         SpringApplication.run(ManageApplication.class, args);
         SpringApplication.run(ManageApplication.class, args);
-        System.out.println("赞象Manage服务启动成功 <客服系统新增关键词监测03> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 <客服系统新增关键词监测05> ( ´・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 4 - 15
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/KfAppletMsgServiceImpl.java

@@ -125,29 +125,18 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
         //构造房间消息
         //构造房间消息
         KfWebSocketMsgDTO.MsgContentBean msgContent = this.getMsgContent(kfAppletMsgDTO);
         KfWebSocketMsgDTO.MsgContentBean msgContent = this.getMsgContent(kfAppletMsgDTO);
         KfRoomMsg kfRoomMsg = this.transform(kfAppletMsgDTO, gameApplet, kfRoom, postData, msgContent);
         KfRoomMsg kfRoomMsg = this.transform(kfAppletMsgDTO, gameApplet, kfRoom, postData, msgContent);
-
-        log.error("构造消息成功, kfRoomMsg : {}", JsonUtil.toString(kfRoomMsg));
-
         //判断是否请求支付链接
         //判断是否请求支付链接
         String orderId = redisUtil.getCache(RedisKeyConstant.GAME_CUSTOM_PAY_SIGN + kfAppletMsgDTO.getFromUserName());
         String orderId = redisUtil.getCache(RedisKeyConstant.GAME_CUSTOM_PAY_SIGN + kfAppletMsgDTO.getFromUserName());
-
-
-        log.error("11111111111111-> ");
-
         //客服订单处理
         //客服订单处理
         if (Strings.isNotBlank(orderId) && this.orderHandle(orderId, gameApplet.getGameId(), kfAppletMsgDTO, kfRoom, kfRoomMsg)) {
         if (Strings.isNotBlank(orderId) && this.orderHandle(orderId, gameApplet.getGameId(), kfAppletMsgDTO, kfRoom, kfRoomMsg)) {
             return;
             return;
         }
         }
-        log.error("22222222222222-> ");
         //客服休息时间, 发送自动回复
         //客服休息时间, 发送自动回复
         this.systemReplyHandle(gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(), kfRoom);
         this.systemReplyHandle(gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(), kfRoom);
-        log.error("33333333333333-> ");
         //消息报警监测
         //消息报警监测
         this.monitorWordHandle(gameApplet, kfAppletMsgDTO);
         this.monitorWordHandle(gameApplet, kfAppletMsgDTO);
-        log.error("44444444444444-> ");
         //保存房间消息
         //保存房间消息
         kfRoomMsgService.save(kfRoomMsg);
         kfRoomMsgService.save(kfRoomMsg);
-        log.error("55555555555555-> ");
         //玩家状态更新为待接入状态
         //玩家状态更新为待接入状态
         if (kfRoom == null) {
         if (kfRoom == null) {
             kfSessionUserService.update(new LambdaUpdateWrapper<KfSessionUser>()
             kfSessionUserService.update(new LambdaUpdateWrapper<KfSessionUser>()
@@ -199,7 +188,7 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
         //保存消息
         //保存消息
         Map<String, Object> kfRoomMsgMap = new HashMap<>(1);
         Map<String, Object> kfRoomMsgMap = new HashMap<>(1);
         kfRoomMsgMap.put("text", kfSystemReply.getSysReply());
         kfRoomMsgMap.put("text", kfSystemReply.getSysReply());
-        kfRoomMsgService.save(this.transform(openId, gameId, kfRoom, JsonUtil.toString(kfRoomMsgMap)));
+        kfRoomMsgService.save(this.transform(openId, gameId, kfRoom, KfRoomMsgTypeEnum.KF_MSG_TYPE_TEXT, JsonUtil.toString(kfRoomMsgMap)));
     }
     }
 
 
     private boolean orderHandle(String orderId, Long gameId, KfAppletMsgDTO kfAppletMsgDTO, KfRoom kfRoom, KfRoomMsg kfRoomMsg) {
     private boolean orderHandle(String orderId, Long gameId, KfAppletMsgDTO kfAppletMsgDTO, KfRoom kfRoom, KfRoomMsg kfRoomMsg) {
@@ -413,15 +402,15 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
         kfWxApiService.sendCustomMessageApi(gameId, msgParamMap);
         kfWxApiService.sendCustomMessageApi(gameId, msgParamMap);
         //返回发送的消息内容
         //返回发送的消息内容
         log.error("客服支付, 发送支付信息 : {}", JsonUtil.toString(msgParamMap));
         log.error("客服支付, 发送支付信息 : {}", JsonUtil.toString(msgParamMap));
-        kfRoomMsgService.save(this.transform(openId, gameId, kfRoom, JsonUtil.toString(msgParamMap)));
+        kfRoomMsgService.save(this.transform(openId, gameId, kfRoom, KfRoomMsgTypeEnum.KF_MSG_TYPE_LINK, JsonUtil.toString(msgParamMap)));
         //删除待支付订单标记
         //删除待支付订单标记
         redisUtil.deleteCache(RedisKeyConstant.GAME_CUSTOM_PAY_SIGN + openId);
         redisUtil.deleteCache(RedisKeyConstant.GAME_CUSTOM_PAY_SIGN + openId);
     }
     }
 
 
-    private KfRoomMsg transform(String openId, Long gameId, KfRoom kfRoom, String msgContent) {
+    private KfRoomMsg transform(String openId, Long gameId, KfRoom kfRoom, KfRoomMsgTypeEnum kfRoomMsgTypeEnum, String msgContent) {
         return KfRoomMsg.builder()
         return KfRoomMsg.builder()
                 .msgId(UUID.randomUUID().toString().replace("-", ""))
                 .msgId(UUID.randomUUID().toString().replace("-", ""))
-                .msgType(KfRoomMsgTypeEnum.KF_MSG_TYPE_LINK.getValue())
+                .msgType(kfRoomMsgTypeEnum.getValue())
                 .gameId(gameId)
                 .gameId(gameId)
                 .openId(openId)
                 .openId(openId)
                 .userId(kfRoom == null ? null : kfRoom.getUserId())
                 .userId(kfRoom == null ? null : kfRoom.getUserId())