|
@@ -819,7 +819,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//加粉深度回传逻辑.
|
|
//加粉深度回传逻辑.
|
|
|
- if(StrUtil.isNotBlank(message.getState()) && message.getState().contains(Constant.ACQUISTION_LINK_STATE_KEY)){
|
|
|
|
|
|
|
+ if (StrUtil.isNotBlank(message.getState()) && message.getState().contains(Constant.ACQUISTION_LINK_STATE_KEY)) {
|
|
|
String customer = message.getState().replaceAll("customer_", "");
|
|
String customer = message.getState().replaceAll("customer_", "");
|
|
|
saveAcqusitionCallback(customer, corpUser, message);
|
|
saveAcqusitionCallback(customer, corpUser, message);
|
|
|
isSendWelcomeMsg.set(true);
|
|
isSendWelcomeMsg.set(true);
|
|
@@ -900,7 +900,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
//备注手机号 客服跟进用户年付续费
|
|
//备注手机号 客服跟进用户年付续费
|
|
|
String description = followedUser.getDescription();
|
|
String description = followedUser.getDescription();
|
|
|
if (Validator.isMobile(description)) {
|
|
if (Validator.isMobile(description)) {
|
|
|
- THREAD_POOL.execute(() ->{
|
|
|
|
|
|
|
+ THREAD_POOL.execute(() -> {
|
|
|
CorpUserRelate corpUserRelate = corpUserRelateMapper.selectOne(Wrappers.lambdaQuery(CorpUserRelate.class)
|
|
CorpUserRelate corpUserRelate = corpUserRelateMapper.selectOne(Wrappers.lambdaQuery(CorpUserRelate.class)
|
|
|
.eq(CorpUserRelate::getCorpUserId, corpUser.getId()).last("limit 1"));
|
|
.eq(CorpUserRelate::getCorpUserId, corpUser.getId()).last("limit 1"));
|
|
|
if (corpUserRelate != null) {
|
|
if (corpUserRelate != null) {
|
|
@@ -919,6 +919,12 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ //企业微信引流
|
|
|
|
|
+ isSendWelcomeMsg.set(handleCorpWxYl(message, corpUser.getName()));
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
//若没找到规则的欢迎语 发送默认欢迎语
|
|
//若没找到规则的欢迎语 发送默认欢迎语
|
|
|
if (StrUtil.isNotEmpty(message.getWelcomeCode()) && !isSendWelcomeMsg.get()) {
|
|
if (StrUtil.isNotEmpty(message.getWelcomeCode()) && !isSendWelcomeMsg.get()) {
|
|
|
CorpWelcomeTemplate serviceWelcomeTemplate = corpWelcomeTemplateMapper.selectOne(Wrappers.lambdaQuery(CorpWelcomeTemplate.class)
|
|
CorpWelcomeTemplate serviceWelcomeTemplate = corpWelcomeTemplateMapper.selectOne(Wrappers.lambdaQuery(CorpWelcomeTemplate.class)
|
|
@@ -932,17 +938,11 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
log.info("===========找到自然流量默认欢迎语记录===========");
|
|
log.info("===========找到自然流量默认欢迎语记录===========");
|
|
|
senCorpWelcomeMsg(message, serviceWelcomeTemplate.getText(), serviceWelcomeTemplate.getAttachmentsStr());
|
|
senCorpWelcomeMsg(message, serviceWelcomeTemplate.getText(), serviceWelcomeTemplate.getAttachmentsStr());
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- //企业微信引流
|
|
|
|
|
- try {
|
|
|
|
|
- handleCorpWxYl(message, corpUser.getName());
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
return corpUser;
|
|
return corpUser;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void handleCorpWxYl(CorpXmlMessage message, String username) throws Exception {
|
|
|
|
|
|
|
+ private Boolean handleCorpWxYl(CorpXmlMessage message, String username) throws Exception {
|
|
|
String state = message.getState();
|
|
String state = message.getState();
|
|
|
String welcomeCode = message.getWelcomeCode();
|
|
String welcomeCode = message.getWelcomeCode();
|
|
|
String followId = message.getUserId();
|
|
String followId = message.getUserId();
|
|
@@ -952,7 +952,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
CorpWxYlRecord corpWxYlRecord = corpWxYlRecordMapper.selectById(ylId);
|
|
CorpWxYlRecord corpWxYlRecord = corpWxYlRecordMapper.selectById(ylId);
|
|
|
if (corpWxYlRecord == null) {
|
|
if (corpWxYlRecord == null) {
|
|
|
log.info("引流id:{}对应的记录不存在", ylId);
|
|
log.info("引流id:{}对应的记录不存在", ylId);
|
|
|
- return;
|
|
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
String json = Codec.DoBase64.custom().setData(corpWxYlRecord.getState()).decodeAsText();
|
|
String json = Codec.DoBase64.custom().setData(corpWxYlRecord.getState()).decodeAsText();
|
|
|
TempCorpFollowCodeReq re = Jsons.parseObject(json, TempCorpFollowCodeReq.class);
|
|
TempCorpFollowCodeReq re = Jsons.parseObject(json, TempCorpFollowCodeReq.class);
|
|
@@ -998,7 +998,9 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
sendCorpWxYlWelcomeMsg(followId, username, welcomeCode, msg, tilte, url, picUlr);
|
|
sendCorpWxYlWelcomeMsg(followId, username, welcomeCode, msg, tilte, url, picUlr);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
|
|
+ return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|