Parcourir la source

渠道活码-欢迎语

三七 il y a 2 jours
Parent
commit
71c63fd657

+ 26 - 0
fs-service/src/main/java/com/fs/qw/service/impl/QwExternalContactServiceImpl.java

@@ -2331,6 +2331,32 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
                 String substring = state.substring(state.indexOf(s) + s.length());
                 QwContactWay qwContactWay = qwContactWayMapper.selectQwContactWayById(Long.parseLong(substring));
                 if (qwContactWay != null) {
+                    if (welcomeCode != null && welcomeCode != "") {
+                            isWay = true;
+                            wayId = qwContactWay;
+                            if (qwContactWay.getIsWelcome() != null && qwContactWay.getIsWelcome() == 1) {
+                                Boolean isClose = true;
+                                if (wayId.getIsSpanWelcome() == 1) {
+                                    ExternalContact externalContact = externalContactResult.getExternal_contact();
+                                    String name = externalContact.getName();
+                                    String closeWelcomeWord = wayId.getCloseWelcomeWord();
+                                    if (closeWelcomeWord != null && closeWelcomeWord.length() > 0) {
+                                        List<String> strings = JSON.parseArray(closeWelcomeWord, String.class);
+                                        for (String string : strings) {
+                                            if (name.contains(string)) {
+                                                isClose = false;
+                                                break;
+                                            }
+                                        }
+                                    }
+                                }
+                                if (qwContactWay.getIsWelcome() == 1 && isClose) {
+                                    isSend = qwContactWayService.sendWelcomeMsg(qwContactWay, corpId, welcomeCode, qwUser, contact.getId());
+                                }
+                            }
+
+                    }
+
                     if (qwContactWay.getUserType() == 1 && qwContactWay.getIsUserLimit() == 1) {
 
                         String userLimitJson = qwContactWay.getUserLimitJson();