|
|
|
@ -246,6 +246,21 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void applyerToClient(String username) {
|
|
|
|
|
JSONObject sysConfig = sysConfigManager.getSysConfig();
|
|
|
|
|
String arr[] = sysConfig.getString("temp_sub_mch_id").split(",");
|
|
|
|
|
String tempSubMerchantId = arr[new Random().nextInt(arr.length)];
|
|
|
|
|
WeChatPayConfig.Merchant availableMerchant = null;
|
|
|
|
|
int errorReCounts = 6;
|
|
|
|
|
for (int i = 0; i < errorReCounts; i++) {
|
|
|
|
|
try{
|
|
|
|
|
availableMerchant = mpPaymentApi.determineMerchant(tempSubMerchantId);
|
|
|
|
|
i=errorReCounts;
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(availableMerchant==null){
|
|
|
|
|
throw new BadRequestException("System is busy Please try again");
|
|
|
|
|
}
|
|
|
|
|
Date now = new Date();
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
param.put("begin_time", DateFormatUtils.format(now, "YYYYMMdd"));
|
|
|
|
@ -256,12 +271,6 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
|
|
|
|
|
throw new BadRequestException("New merchant over limit,Please contact us");
|
|
|
|
|
}
|
|
|
|
|
JSONObject apply = sysClientPreMapperMapper.findByUserName(username);
|
|
|
|
|
|
|
|
|
|
JSONObject sysConfig = sysConfigManager.getSysConfig();
|
|
|
|
|
|
|
|
|
|
String arr[] = sysConfig.getString("temp_sub_mch_id").split(",");
|
|
|
|
|
String tempSubMerchantId = arr[new Random().nextInt(arr.length)];
|
|
|
|
|
WeChatPayConfig.Merchant availableMerchant = mpPaymentApi.determineMerchant(tempSubMerchantId);
|
|
|
|
|
String clientMoniker = generateClientMoniker();
|
|
|
|
|
JSONObject sysClient = new JSONObject();
|
|
|
|
|
sysClient.put("company_name", apply.getString("company_name"));
|
|
|
|
|