|
|
@@ -53,10 +53,43 @@ public class CorpCustomerAcquistionServiceImpl implements CorpCustomerAcquistion
|
|
|
CorpCustomerAcquisitionLinkPopularize corpCustomerAcquisitionLinkPopularize = corpCustomerAcquisitionLinkPopularizeMapper.selectById(linkId);
|
|
|
Long customerAcquistionLinkId = corpCustomerAcquisitionLinkPopularize.getCustomerAcquistionLinkId();
|
|
|
CorpCustomerAcquisitionLink corpCustomerAcquisitionLink = corpCustomerAcquisitionLinkMapper.selectById(customerAcquistionLinkId);
|
|
|
+ //更新值班获客链接
|
|
|
+ resetAcLinkConfigIfDuty(corpCustomerAcquisitionLink);
|
|
|
+ return corpCustomerAcquisitionLink.getUrl();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String saveClickid(String projectid, String clickid, String callback, Long linkId) {
|
|
|
+ CorpCustomerAcquisitionLinkPopularize corpCustomerAcquisitionLinkPopularize = corpCustomerAcquisitionLinkPopularizeMapper.selectById(linkId);
|
|
|
+
|
|
|
+ if (corpCustomerAcquisitionLinkPopularize == null) {
|
|
|
+ throw BusinessRuntimeException.getInstance("系统出现异常.");
|
|
|
+ }
|
|
|
+ if(StringUtils.isBlank(callback) && StringUtils.isNotBlank(clickid)){
|
|
|
+ callback = "https://nf.video" + "?clickid=" + clickid + "&projectid=" + projectid;
|
|
|
+ }
|
|
|
+ JSONObject params = new JSONObject();
|
|
|
+ params.putOpt("linkId", linkId);
|
|
|
+ params.putOpt("callback", callback);
|
|
|
+ params.putOpt("postApp", "OE");
|
|
|
+ String key = SEQUENCE.nextId().toString();
|
|
|
+ redisService.set(String.format(RedisService.key.CORP_CUSTOMER_ACQUISTION_CLICKID.getName(), key), params.toString(), corpCustomerAcquisitionLinkPopularize.getTime() * 60 * 60);
|
|
|
+
|
|
|
+ return key;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getActiveCustomerAcquistionById(Long acLinkId) throws Exception {
|
|
|
+ CorpCustomerAcquisitionLink corpCustomerAcquisitionLink = corpCustomerAcquisitionLinkMapper.selectById(acLinkId);
|
|
|
+ resetAcLinkConfigIfDuty(corpCustomerAcquisitionLink);
|
|
|
+ return corpCustomerAcquisitionLink.getUrl();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void resetAcLinkConfigIfDuty(CorpCustomerAcquisitionLink corpCustomerAcquisitionLink) throws Exception {
|
|
|
if (corpCustomerAcquisitionLink == null) {
|
|
|
throw BusinessRuntimeException.getInstance("获客链接不存在.");
|
|
|
}
|
|
|
-
|
|
|
//寻找值班客服
|
|
|
if (corpCustomerAcquisitionLink.getIsDuty()) {
|
|
|
String userList = corpCustomerAcquisitionLink.getUserList();
|
|
|
@@ -89,33 +122,10 @@ public class CorpCustomerAcquistionServiceImpl implements CorpCustomerAcquistion
|
|
|
corpOps.customerAcquisitionUpdateLink(null, wxCpLinkUpd);
|
|
|
|
|
|
corpCustomerAcquisitionLinkMapper.updateById(corpCustomerAcquisitionLink);
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return corpCustomerAcquisitionLink.getUrl();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public String saveClickid(String projectid, String clickid, String callback, Long linkId) {
|
|
|
- CorpCustomerAcquisitionLinkPopularize corpCustomerAcquisitionLinkPopularize = corpCustomerAcquisitionLinkPopularizeMapper.selectById(linkId);
|
|
|
-
|
|
|
- if (corpCustomerAcquisitionLinkPopularize == null) {
|
|
|
- throw BusinessRuntimeException.getInstance("系统出现异常.");
|
|
|
- }
|
|
|
- if(StringUtils.isBlank(callback) && StringUtils.isNotBlank(clickid)){
|
|
|
- callback = "https://nf.video" + "?clickid=" + clickid + "&projectid=" + projectid;
|
|
|
- }
|
|
|
- JSONObject params = new JSONObject();
|
|
|
- params.putOpt("linkId", linkId);
|
|
|
- params.putOpt("callback", callback);
|
|
|
- params.putOpt("postApp", "OE");
|
|
|
- String key = SEQUENCE.nextId().toString();
|
|
|
- redisService.set(String.format(RedisService.key.CORP_CUSTOMER_ACQUISTION_CLICKID.getName(), key), params.toString(), corpCustomerAcquisitionLinkPopularize.getTime() * 60 * 60);
|
|
|
-
|
|
|
- return key;
|
|
|
}
|
|
|
-
|
|
|
}
|