批量更新微信子商户号

master
dalong306 3 years ago
parent 48107d720b
commit f197922247

@ -585,31 +585,36 @@ public class TestController {
} }
newSubMerchantIdApply.setCompany_register_no(cutLength(TextUtils.isEmpty(clientJson.getString("acn"))?clientJson.getString("abn"):clientJson.getString("acn"),50)); newSubMerchantIdApply.setCompany_register_no(cutLength(TextUtils.isEmpty(clientJson.getString("acn"))?clientJson.getString("abn"):clientJson.getString("acn"),50));
newSubMerchantIdApply.setCertificat_expire_date("PERMANENT"); if (!TextUtils.isEmpty(clientJson.getString("certificat_expire_date"))) {
JSONObject params = newSubMerchantIdApply.insertObject(clientJson); newSubMerchantIdApply.setCertificat_expire_date(clientJson.getString("certificat_expire_date"));
params.put("merchant_app_id", jsonObject.getString("merchant_app_id")); } else {
SubMerchantInfoInheritance subMerchantInfo = JSON.toJavaObject(params, SubMerchantInfoInheritance.class); newSubMerchantIdApply.setCertificat_expire_date("PERMANENT");
params.put("operator","System"); }
if("ENTERPRISE".equalsIgnoreCase(newSubMerchantIdApply.getMerchant_type())&&TextUtils.isEmpty(newSubMerchantIdApply.getCompany_register_no())){ if("ENTERPRISE".equalsIgnoreCase(newSubMerchantIdApply.getMerchant_type())&&TextUtils.isEmpty(newSubMerchantIdApply.getCompany_register_no())){
logger.error("=======>公司注册号为空clientid"+jsonObject.getInteger("client_id")); logger.error("=======>公司注册号为空clientid"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker"));
return; return;
} }
if("BOTH".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress()))|| if("BOTH".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress())||
TextUtils.isEmpty(newSubMerchantIdApply.getWebsite())){ TextUtils.isEmpty(newSubMerchantIdApply.getWebsite()))){
logger.error("=======>公司类型为BOTH网址或地址为空clientid:"+jsonObject.getInteger("client_id")); logger.error("=======>公司类型为BOTH网址或地址为空clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker"));
return; return;
} }
else if("OFFLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress()))){ else if("OFFLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress()))){
logger.error("=======>公司类型为OFFLINE地址为空clientid:"+jsonObject.getInteger("client_id")); logger.error("=======>公司类型为OFFLINE地址为空clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker"));
return; return;
} }
else if("ONLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&& else if("ONLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&
TextUtils.isEmpty(newSubMerchantIdApply.getWebsite())){ TextUtils.isEmpty(newSubMerchantIdApply.getWebsite())){
logger.error("=======>公司类型为ONLINE网址为空clientid:"+jsonObject.getInteger("client_id")); logger.error("=======>公司类型为ONLINE网址为空clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker"));
return; return;
} }
JSONObject params = newSubMerchantIdApply.insertObject(clientJson);
params.put("merchant_app_id", jsonObject.getString("merchant_app_id"));
SubMerchantInfoInheritance subMerchantInfo = JSON.toJavaObject(params, SubMerchantInfoInheritance.class);
params.put("operator","System");
WxPayMerchantRegister register = Optional.ofNullable(merchantChannelApplicationManager.getRegister(WxPayMerchantRegister.class)) WxPayMerchantRegister register = Optional.ofNullable(merchantChannelApplicationManager.getRegister(WxPayMerchantRegister.class))
.orElseThrow(() -> new ServerErrorException("No Register found for wechat")); .orElseThrow(() -> new ServerErrorException("No Register found for wechat"));
@ -617,7 +622,7 @@ public class TestController {
manager.put("display_name","System"); manager.put("display_name","System");
register.modifyForBatch(jsonObject.getString("merchant_app_id"), clientJson, subMerchantInfo, manager); register.modifyForBatch(jsonObject.getString("merchant_app_id"), clientJson, subMerchantInfo, manager);
try { try {
Thread.sleep(20); Thread.sleep(500);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }

Loading…
Cancel
Save