|
|
@@ -2,6 +2,7 @@ package com.fs.qw.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.redis.RedisCache;
|
|
|
import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.service.ISmsService;
|
|
|
@@ -10,6 +11,7 @@ import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.company.domain.CompanySmsTemp;
|
|
|
import com.fs.company.service.ICompanySmsTempService;
|
|
|
import com.fs.fastgptApi.util.HttpUtil;
|
|
|
+import com.fs.his.dto.SendResultDetailDTO;
|
|
|
import com.fs.qw.domain.QwAcquisitionAssistant;
|
|
|
import com.fs.qw.domain.QwCompany;
|
|
|
import com.fs.qw.dto.acquisition.*;
|
|
|
@@ -256,7 +258,7 @@ public class QwAcquisitionAssistantServiceImpl implements IQwAcquisitionAssistan
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void sendMessageAcquisition(String phone,Long qwAcquisitionId) {
|
|
|
+ public SendResultDetailDTO sendMessageAcquisition(String phone,Long qwAcquisitionId) {
|
|
|
log.info("发送获客链接短信,号码:{}", phone);
|
|
|
CompanySmsTemp temp = smsTempService.selectCompanySmsTempByCode(SOP_SMS_TEMPLATE_CODE);
|
|
|
if (temp == null) {
|
|
|
@@ -272,8 +274,20 @@ public class QwAcquisitionAssistantServiceImpl implements IQwAcquisitionAssistan
|
|
|
String replaceText=LINK_DOMAIN+acquisitionAssistant.getPageParam();
|
|
|
String content = originalContent
|
|
|
.replace("${sms.friendLink}", replaceText);
|
|
|
- log.info("短信内容替换完成,原模板:{},替换后:{}", originalContent, content);
|
|
|
- smsService.sendAcquisitionMessage(phone,content,temp);
|
|
|
+ try {
|
|
|
+ R r = smsService.sendAcquisitionMessage(phone, content, temp);
|
|
|
+
|
|
|
+ if (r != null && "200".equals(String.valueOf(r.get("code")))) {
|
|
|
+ return new SendResultDetailDTO(true, null, null);
|
|
|
+ } else {
|
|
|
+ String msg = r != null && r.get("msg") != null ? r.get("msg").toString() : "未知错误";
|
|
|
+ log.warn("短信发送失败 获客链接id={}, phone={}, msg={}", qwAcquisitionId, phone, msg);
|
|
|
+ return new SendResultDetailDTO(false, msg, qwAcquisitionId);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("发送异常 获客链接id=" + qwAcquisitionId, e);
|
|
|
+ return new SendResultDetailDTO(false, e.getMessage(), qwAcquisitionId);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|