|
|
|
@ -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.setCertificat_expire_date("PERMANENT");
|
|
|
|
|
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");
|
|
|
|
|
if (!TextUtils.isEmpty(clientJson.getString("certificat_expire_date"))) {
|
|
|
|
|
newSubMerchantIdApply.setCertificat_expire_date(clientJson.getString("certificat_expire_date"));
|
|
|
|
|
} else {
|
|
|
|
|
newSubMerchantIdApply.setCertificat_expire_date("PERMANENT");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
if("BOTH".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress()))||
|
|
|
|
|
TextUtils.isEmpty(newSubMerchantIdApply.getWebsite())){
|
|
|
|
|
logger.error("=======>公司类型为BOTH:网址或地址为空:clientid:"+jsonObject.getInteger("client_id"));
|
|
|
|
|
if("BOTH".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&(TextUtils.isEmpty(newSubMerchantIdApply.getAddress())||
|
|
|
|
|
TextUtils.isEmpty(newSubMerchantIdApply.getWebsite()))){
|
|
|
|
|
logger.error("=======>公司类型为BOTH:网址或地址为空:clientid:"+clientJson.getInteger("client_id")+":"+clientJson.getString("client_moniker"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
else if("ONLINE".equalsIgnoreCase(newSubMerchantIdApply.getBusiness_type())&&
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
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))
|
|
|
|
|
.orElseThrow(() -> new ServerErrorException("No Register found for wechat"));
|
|
|
|
|
|
|
|
|
@ -617,7 +622,7 @@ public class TestController {
|
|
|
|
|
manager.put("display_name","System");
|
|
|
|
|
register.modifyForBatch(jsonObject.getString("merchant_app_id"), clientJson, subMerchantInfo, manager);
|
|
|
|
|
try {
|
|
|
|
|
Thread.sleep(20);
|
|
|
|
|
Thread.sleep(500);
|
|
|
|
|
} catch (InterruptedException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|