|
@@ -1,5 +1,6 @@
|
|
|
package com.fs.app.facade;
|
|
package com.fs.app.facade;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.thread.ThreadUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
@@ -9,6 +10,8 @@ import cn.hutool.json.JSONUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.fs.common.utils.RedisUtil;
|
|
import com.fs.common.utils.RedisUtil;
|
|
|
import com.fs.common.utils.SnowflakeUtil;
|
|
import com.fs.common.utils.SnowflakeUtil;
|
|
|
|
|
+import com.fs.company.param.EntryCustomerParam;
|
|
|
|
|
+import com.fs.company.service.IGeneralCustomerEntryService;
|
|
|
import com.fs.newAdv.domain.LandingPageTemplate;
|
|
import com.fs.newAdv.domain.LandingPageTemplate;
|
|
|
import com.fs.newAdv.domain.Lead;
|
|
import com.fs.newAdv.domain.Lead;
|
|
|
import com.fs.newAdv.domain.Site;
|
|
import com.fs.newAdv.domain.Site;
|
|
@@ -69,6 +72,10 @@ public class CallbackProcessingFacadeServiceImpl implements CallbackProcessingFa
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RedisUtil redisUtil;
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ IGeneralCustomerEntryService iGeneralCustomerEntryService;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
private static final String TEMPLATE_DATA = "new-adv:template-data:";
|
|
private static final String TEMPLATE_DATA = "new-adv:template-data:";
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -332,5 +339,27 @@ public class CallbackProcessingFacadeServiceImpl implements CallbackProcessingFa
|
|
|
leadService.update(new LambdaUpdateWrapper<Lead>()
|
|
leadService.update(new LambdaUpdateWrapper<Lead>()
|
|
|
.eq(Lead::getTraceId, req.getTraceId())
|
|
.eq(Lead::getTraceId, req.getTraceId())
|
|
|
.set(Lead::getPhone, req.getPhone()));
|
|
.set(Lead::getPhone, req.getPhone()));
|
|
|
|
|
+ ThreadUtil.execute(() -> {
|
|
|
|
|
+ Lead byTraceId = leadService.getByTraceId(req.getTraceId());
|
|
|
|
|
+ EntryCustomerParam param = new EntryCustomerParam();
|
|
|
|
|
+ param.setMobile(req.getPhone());
|
|
|
|
|
+ param.setCustomerName(req.getName());
|
|
|
|
|
+ param.setSceneType(getSceneType(byTraceId.getAdvertiserId()));
|
|
|
|
|
+ Site byId = siteService.getById(byTraceId.getSiteId());
|
|
|
|
|
+ param.setCompanyId(byId.getCompanyId());
|
|
|
|
|
+ iGeneralCustomerEntryService.entryCustomer(param);
|
|
|
|
|
+ log.info("广告数据发送到ai电话: {}", param);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private Integer getSceneType(Long advertiserId) {
|
|
|
|
|
+ switch (AdvertiserTypeEnum.getByCode(advertiserId)) {
|
|
|
|
|
+ case BAIDU:
|
|
|
|
|
+ return 2;
|
|
|
|
|
+ case OCEANENGINE:
|
|
|
|
|
+ return 3;
|
|
|
|
|
+ default:
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|