master
wangning 6 years ago
parent 92ab3b61f4
commit 0489cbf660

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

Loading…
Cancel
Save