master
taylor.dang 5 years ago
parent 4270218381
commit 9ff6822f57

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

Loading…
Cancel
Save