|
|
@@ -131,6 +131,8 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
|
|
|
private final OrderDonPostService orderDonPostService;
|
|
|
|
|
|
+ private final CorpWelcomeTemplateMapper corpWelcomeTemplateMapper;
|
|
|
+
|
|
|
private static final String DEFAULT_MSG = "您好,欢迎加入银河录像局";
|
|
|
|
|
|
/**
|
|
|
@@ -684,22 +686,16 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
if (corpUser.getId() == null) {
|
|
|
corpUser.setAcId(acId);
|
|
|
}
|
|
|
- String welcomeContent = corpFollowActiveCode.getText();
|
|
|
- String attachmentsStr = corpFollowActiveCode.getAttachmentsStr();
|
|
|
- //发送对应欢迎语
|
|
|
- if (StrUtil.isNotBlank(welcomeContent) && StrUtil.isNotBlank(attachmentsStr)) {
|
|
|
- THREAD_POOL.execute(() -> {
|
|
|
- sendCorpFollowActiveCode(message, welcomeContent, attachmentsStr);
|
|
|
- });
|
|
|
+ //欢迎语模板id
|
|
|
+ Long msgId = corpFollowActiveCode.getMsgId();
|
|
|
+ sendWelcomeMsg(msgId, message);
|
|
|
+ try {
|
|
|
+ //对客户进行标记
|
|
|
+ markAddUserTag(corpFollowActiveCode.getMarkTag(), message);
|
|
|
+ state = corpFollowActiveCode.getMarkTag();
|
|
|
+ } catch (Exception e) {
|
|
|
}
|
|
|
}
|
|
|
- try {
|
|
|
- //对客户进行标记
|
|
|
- markAddUserTag(corpFollowActiveCode.getMarkTag(), message);
|
|
|
- state = corpFollowActiveCode.getMarkTag();
|
|
|
- } catch (Exception e) {
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -707,7 +703,7 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
if(StrUtil.isNotBlank(message.getState()) && message.getState().contains(Constant.ACQUISTION_LINK_STATE_KEY)){
|
|
|
String customer = message.getState().replaceAll("customer_", "");
|
|
|
THREAD_POOL.execute(()->{
|
|
|
- saveAcqusitionCallback(customer, corpUser, message.getExternalUserId(), message.getUserId());
|
|
|
+ saveAcqusitionCallback(customer, corpUser, message);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -980,7 +976,9 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void saveAcqusitionCallback(String customer, CorpUser corpUser,String externalUserid ,String userId) {
|
|
|
+ private void saveAcqusitionCallback(String customer, CorpUser corpUser,CorpXmlMessage message) {
|
|
|
+ String externalUserid = message.getExternalUserId() ;
|
|
|
+ String userId = message.getUserId();
|
|
|
//获客链接
|
|
|
Long linkId = customerAcquisitionSaveClickId(customer, corpUser.getUnionid());
|
|
|
CorpCustomerAcquisitionLink customerAcquisitionLink = corpCustomerAcquisitionLinkMapper.getByLinkPopularizeId(linkId);
|
|
|
@@ -998,6 +996,9 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
wxCorpOps.markTag(externalUserid, userId, tagList.stream().map(CorpTag::getTagId).toArray(String[]::new), null);
|
|
|
}
|
|
|
}
|
|
|
+ //发送欢迎语
|
|
|
+ Long msgId = customerAcquisitionLink.getMsgId();
|
|
|
+ sendWelcomeMsg(msgId, message);
|
|
|
} catch (Exception e) {
|
|
|
log.error("处理获客链接解析标签id出错了,内容{},获客链接id: {}", customerAcquisitionLink.getTags(), customerAcquisitionLink.getId());
|
|
|
}
|
|
|
@@ -1049,4 +1050,24 @@ public class CorpEventActionServiceImpl implements CorpEventActionService {
|
|
|
throw BusinessRuntimeException.getInstance("加粉回传出错. error:" + StringUtil.getErrorText(e));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 发送欢迎语
|
|
|
+ * @param msgId 模板id
|
|
|
+ * @param message
|
|
|
+ */
|
|
|
+ public void sendWelcomeMsg(Long msgId,CorpXmlMessage message) {
|
|
|
+ CorpWelcomeTemplate corpWelcomeTemplate = corpWelcomeTemplateMapper.selectById(msgId);
|
|
|
+ if (corpWelcomeTemplate != null) {
|
|
|
+ String welcomeContent = corpWelcomeTemplate.getText();
|
|
|
+ String attachmentsStr = corpWelcomeTemplate.getAttachmentsStr();
|
|
|
+ //发送对应欢迎语
|
|
|
+ if (StrUtil.isNotBlank(welcomeContent) && StrUtil.isNotBlank(attachmentsStr)) {
|
|
|
+ THREAD_POOL.execute(() -> {
|
|
|
+ sendCorpFollowActiveCode(message, welcomeContent, attachmentsStr);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|