Explorar el Código

-fix : 客服自动回复修改

bilingfeng hace 8 meses
padre
commit
3e17ca288b

+ 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服务启动成功 < (客服权限额外添加兼容・・)ノ(._.`) \n" +
+        System.out.println("赞象Manage服务启动成功 < (客服自动回复修改・・)ノ(._.`) \n" +
                 "___  ___  ___   _   _   ___  _____  _____ \n" +
                 "|  \\/  | / _ \\ | \\ | | / _ \\|  __ \\|  ___|\n" +
                 "| .  . |/ /_\\ \\|  \\| |/ /_\\ \\ |  \\/| |__  \n" +

+ 21 - 1
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/service/impl/KfAppletMsgServiceImpl.java

@@ -172,7 +172,7 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
             return;
         }
         //客服休息时间, 发送自动回复
-        this.systemReplyHandle(gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(), kfRoom);
+        this.systemReplyHandleNew(gameApplet.getGameId(), kfAppletMsgDTO.getFromUserName(), kfRoom);
         //消息报警监测
         this.monitorWordHandle(gameApplet, kfAppletMsgDTO);
         //保存消息, 玩家转入接待状态
@@ -286,6 +286,26 @@ public class KfAppletMsgServiceImpl implements IKfAppletMsgService {
         gameAuthRoleService.dingTalkCustomer(gameApplet.getGameId(), gameApplet.getAppName(), textContent);
     }
 
+    private void systemReplyHandleNew(Long gameId, String openId, KfRoom kfRoom) {
+        //获取自动回复配置
+        KfSystemReply kfSystemReply = kfSystemReplyService.getById(gameId);
+        if (kfSystemReply == null) {
+            return;
+        }
+        //未开启自动回复
+        if (Objects.equals(kfSystemReply.getRechargeReplySwitch(), Boolean.FALSE)) {
+            return;
+        }
+        //发送文字消息
+        if (Strings.isNotBlank(kfSystemReply.getRechargeReplyContent())) {
+            this.sysMsgSend(gameId, openId, kfSystemReply.getRechargeReplyContent(), kfRoom);
+        }
+        //发送图片消息
+        if (Strings.isNotBlank(kfSystemReply.getRechargeReplyPicture())) {
+            this.sysImgMsgSend(gameId, openId, kfSystemReply.getRechargeReplyPicture(), kfRoom);
+        }
+    }
+
     private void systemReplyHandle(Long gameId, String openId, KfRoom kfRoom) {
         //获取自动回复配置
         KfSystemReply kfSystemReply = kfSystemReplyService.getById(gameId);