master
wangning 7 years ago
parent 92ab3b61f4
commit 0489cbf660

@ -48,6 +48,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct;
@ -56,11 +58,9 @@ import javax.annotation.Resource;
import cn.yixblog.platform.http.HttpRequestGenerator;
import cn.yixblog.platform.http.HttpRequestResult;
@Service
public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
@Value("${royalpay.sms.appid:1400094878}")
private int appId;
@Value("${royalpay.sms.appkey:43390d81e20c5191c278fbf4cd275be2}")
@ -97,6 +97,8 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
private ClientConfigMapper clientConfigMapper;
@Resource
private PmtSubMerchantIdMapper pmtSubMerchantIdMapper;
private ThreadPoolExecutor pool = new ThreadPoolExecutor(1, 10, 5, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
@Resource
private StringRedisTemplate stringRedisTemplate;
@ -140,7 +142,6 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
if (StringUtils.isNotEmpty(value)) {
throw new BadRequestException("SMS has been sentPlease check your messages or try again in 3 minutes.");
}
JSONObject sysConfig = sysConfigManager.getSysConfig();
ArrayList<String> param = new ArrayList<>();
String registerClientCode = RandomStringUtils.random(6, false, true);
param.add("RoyalPay");
@ -369,10 +370,13 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
configNewClientRate(sysRate, clientId, "AlipayOnline", "AlipayOnline");
configNewClientRate(sysRate, clientId, "Bestpay", "Bestpay");
configNewClientRate(sysRate, clientId, "jd", "JDpay");
Runnable task2 = () -> {
try {
clientManager.getNewAggregateAgreeFile(clientMoniker, null, false);
} catch (Exception ignore) {
}
};
pool.execute(task2);
}
@ -385,7 +389,6 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
return clientMoniker;
}
private void configNewClientRate(JSONObject config, int clientId, String channel, String rateKey) {
if (config.containsKey(rateKey)) {
JSONObject newConfig = new JSONObject();

Loading…
Cancel
Save