|
@@ -6,6 +6,8 @@ import com.uas.message.common.domain.SimpleMessage;
|
|
|
import com.uas.message.sms.domain.SmsLog;
|
|
import com.uas.message.sms.domain.SmsLog;
|
|
|
import com.uas.message.sms.service.SmsService;
|
|
import com.uas.message.sms.service.SmsService;
|
|
|
import com.uas.platform.b2c.core.utils.FastjsonUtils;
|
|
import com.uas.platform.b2c.core.utils.FastjsonUtils;
|
|
|
|
|
+import com.uas.platform.b2c.fa.settlement.service.ExchangeRateService;
|
|
|
|
|
+import com.uas.platform.b2c.trade.util.BoundedExecutor;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.http.HttpEntity;
|
|
import org.springframework.http.HttpEntity;
|
|
@@ -20,6 +22,8 @@ import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
|
|
+import java.util.concurrent.ExecutorService;
|
|
|
|
|
+import java.util.concurrent.Executors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 基于RestTemplate实现的短信息发送接口
|
|
* 基于RestTemplate实现的短信息发送接口
|
|
@@ -31,6 +35,8 @@ public class RestSmsServiceImpl implements SmsService {
|
|
|
|
|
|
|
|
private RestTemplate restTemplate;
|
|
private RestTemplate restTemplate;
|
|
|
|
|
|
|
|
|
|
+ private final BoundedExecutor executor;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 短信服务主机地址
|
|
* 短信服务主机地址
|
|
|
*/
|
|
*/
|
|
@@ -48,8 +54,10 @@ public class RestSmsServiceImpl implements SmsService {
|
|
|
private static final String SMS_SEND_MANY_URL = "sms/send/o2m";
|
|
private static final String SMS_SEND_MANY_URL = "sms/send/o2m";
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- public RestSmsServiceImpl(RestTemplate restTemplate) {
|
|
|
|
|
|
|
+ public RestSmsServiceImpl(RestTemplate restTemplate, ExchangeRateService exchangeRateService) {
|
|
|
this.restTemplate = restTemplate;
|
|
this.restTemplate = restTemplate;
|
|
|
|
|
+ ExecutorService executorService = Executors.newCachedThreadPool();
|
|
|
|
|
+ executor = new BoundedExecutor(executorService, 1600);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|