|
|
@ -176,30 +176,35 @@ public class AliforexcelServiceImpl implements AliforexcelService {
|
|
|
|
royalThreadPoolExecutor.execute(() -> {
|
|
|
|
royalThreadPoolExecutor.execute(() -> {
|
|
|
|
List<JSONObject> apClients = clientMapper.findApClient();
|
|
|
|
List<JSONObject> apClients = clientMapper.findApClient();
|
|
|
|
apClients.forEach(client -> {
|
|
|
|
apClients.forEach(client -> {
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
try {
|
|
|
|
params.put("merchant_name", client.getString("company_name"));
|
|
|
|
|
|
|
|
params.put("merchant_shortname", client.getString("short_name"));
|
|
|
|
JSONObject params = new JSONObject();
|
|
|
|
params.put("office_phone", client.getString("contact_phone"));
|
|
|
|
params.put("merchant_name", client.getString("company_name"));
|
|
|
|
params.put("contact_phone", client.getString("contact_phone"));
|
|
|
|
params.put("merchant_shortname", StringUtils.substring(client.getString("short_name"), 0, 20));
|
|
|
|
params.put("contact_email", client.getString("contact_email"));
|
|
|
|
params.put("office_phone", client.getString("contact_phone"));
|
|
|
|
params.put("business_category", "484");
|
|
|
|
params.put("contact_phone", client.getString("contact_phone"));
|
|
|
|
params.put("merchant_remark", client.getString("client_moniker"));
|
|
|
|
params.put("contact_email", client.getString("contact_email"));
|
|
|
|
params.put("website", client.getString("website"));
|
|
|
|
params.put("business_category", "484");
|
|
|
|
params.put("merchant_introduction", client.getString("short_name"));
|
|
|
|
params.put("merchant_remark", client.getString("client_moniker"));
|
|
|
|
SubMerchantInfo subMerchantInfo = JSONObject.toJavaObject(params, SubMerchantInfo.class);
|
|
|
|
params.put("website", client.getString("website"));
|
|
|
|
params.put("merchant_id", client.getString("merchant_id"));
|
|
|
|
params.put("merchant_introduction", client.getString("short_name"));
|
|
|
|
params.put("client_id", client.getString("client_id"));
|
|
|
|
SubMerchantInfo subMerchantInfo = JSONObject.toJavaObject(params, SubMerchantInfo.class);
|
|
|
|
params.put("create_time", new Date());
|
|
|
|
params.put("merchant_id", client.getString("merchant_id"));
|
|
|
|
params.put("operator", "System");
|
|
|
|
params.put("client_id", client.getString("client_id"));
|
|
|
|
Element elem = wxPayClient.subMerchantApplication(client.getString("merchant_id"), subMerchantInfo);
|
|
|
|
params.put("create_time", new Date());
|
|
|
|
String sub_merchant_id = elem.elementText("sub_mch_id");
|
|
|
|
params.put("operator", "System");
|
|
|
|
if (StringUtils.isNotEmpty(sub_merchant_id)) {
|
|
|
|
Element elem = wxPayClient.subMerchantApplication(client.getString("merchant_id"), subMerchantInfo);
|
|
|
|
params.put("sub_merchant_id", sub_merchant_id);
|
|
|
|
String sub_merchant_id = elem.elementText("sub_mch_id");
|
|
|
|
sysWxMerchantApplyMapper.insertWxMerchantApply(params);
|
|
|
|
if (StringUtils.isNotEmpty(sub_merchant_id)) {
|
|
|
|
client.put("sub_merchant_id", sub_merchant_id);
|
|
|
|
params.put("sub_merchant_id", sub_merchant_id);
|
|
|
|
clientMapper.update(client);
|
|
|
|
sysWxMerchantApplyMapper.insertWxMerchantApply(params);
|
|
|
|
} else {
|
|
|
|
client.put("sub_merchant_id", sub_merchant_id);
|
|
|
|
throw new BadRequestException(elem.elementText("return_msg"));
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
throw new BadRequestException(elem.elementText("return_msg"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|