|
|
@@ -2310,54 +2310,54 @@ public class QwExternalContactServiceImpl extends ServiceImpl<QwExternalContactM
|
|
|
QwExternalContact contact=qwExternalContact;
|
|
|
QwUser qwUser = qwUserMapper.selectQwUserByCorpIdAndUserId(corpId, userID);
|
|
|
|
|
|
- if (state != null && state != "") {
|
|
|
- String s = "way:" + corpId + ":";
|
|
|
- if (state.contains(s)) {
|
|
|
- if (welcomeCode != null && welcomeCode != "") {
|
|
|
- String substring = state.substring(state.indexOf(s) + s.length());
|
|
|
- QwContactWay qwContactWay = qwContactWayMapper.selectQwContactWayById(Long.parseLong(substring));
|
|
|
- logger.info("qwContactWay:"+qwContactWay);
|
|
|
- if (qwContactWay != null) {
|
|
|
- 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) {
|
|
|
- QwContactWayUser qwContactWayUser = qwContactWayUserMapper.selectQwContactWayUserByUserIdAndCompanyId(userID, corpId);
|
|
|
- if (qwContactWayUser != null) {
|
|
|
- qwContactWayUser.setDayCount(qwContactWayUser.getDayCount() - 1);
|
|
|
- qwContactWayUserMapper.updateQwContactWayUser(qwContactWayUser);
|
|
|
- if (qwContactWayUser.getDayCount() <= 0) {
|
|
|
- //超过限制
|
|
|
- qwContactWayService.updateQwContactWayBYLimit(qwContactWayUser.getWayId());
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+// if (state != null && state != "") {
|
|
|
+// String s = "way:" + corpId + ":";
|
|
|
+// if (state.contains(s)) {
|
|
|
+// if (welcomeCode != null && welcomeCode != "") {
|
|
|
+// String substring = state.substring(state.indexOf(s) + s.length());
|
|
|
+// QwContactWay qwContactWay = qwContactWayMapper.selectQwContactWayById(Long.parseLong(substring));
|
|
|
+// logger.info("qwContactWay:"+qwContactWay);
|
|
|
+// if (qwContactWay != null) {
|
|
|
+// 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) {
|
|
|
+// QwContactWayUser qwContactWayUser = qwContactWayUserMapper.selectQwContactWayUserByUserIdAndCompanyId(userID, corpId);
|
|
|
+// if (qwContactWayUser != null) {
|
|
|
+// qwContactWayUser.setDayCount(qwContactWayUser.getDayCount() - 1);
|
|
|
+// qwContactWayUserMapper.updateQwContactWayUser(qwContactWayUser);
|
|
|
+// if (qwContactWayUser.getDayCount() <= 0) {
|
|
|
+// //超过限制
|
|
|
+// qwContactWayService.updateQwContactWayBYLimit(qwContactWayUser.getWayId());
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
- if (isSend && welcomeCode != null && welcomeCode != "") {
|
|
|
+ if (welcomeCode != null && welcomeCode != "") {
|
|
|
if (qwUser != null) {
|
|
|
// 查询成员的欢迎语以及欢迎图片
|
|
|
QwFriendWelcomeVO qwFriendWelcomeVO = qwFriendWelcomeMapper.selectQwFriendWelcomeByUserIdVO(qwUser.getId(), corpId);
|