|
|
|
@ -25,24 +25,7 @@ import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.risk.RiskAttentionMerchantsMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientApplyMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientAuditProcessMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientBankAccountMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientConfigMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientDeviceMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientsContractMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.CommoditiesMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.MailSendMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.MailUnsubMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.PermissionPartnerModuleMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.SysWxMerchantApplyMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.*;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.beans.ActivityPosterBuilder;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.beans.BankAccountInfo;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo;
|
|
|
|
@ -262,6 +245,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
@Resource
|
|
|
|
|
private SysWxMerchantApplyMapper sysWxMerchantApplyMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private SysRpayMerchantApplyMapper sysRpayMerchantApplyMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private SpringTemplateEngine thymeleaf;
|
|
|
|
|
@Resource
|
|
|
|
|
private DeviceManager deviceManager;
|
|
|
|
@ -770,6 +755,40 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateClientRpayPaymentConfig(JSONObject manager, String clientMoniker, JSONObject rpaySubMerchantInfo) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
JSONObject update = new JSONObject();
|
|
|
|
|
int clientId = client.getIntValue("client_id");
|
|
|
|
|
String originSubMerchantId = client.getString("rpay_enterprise_id");
|
|
|
|
|
update.put("client_id", clientId);
|
|
|
|
|
String subMerchantId = rpaySubMerchantInfo.getString("rpay_enterprise_id");
|
|
|
|
|
update.put("rpay_enterprise_id", subMerchantId);
|
|
|
|
|
try {
|
|
|
|
|
recordSubMerchantLog(client, rpaySubMerchantInfo, manager);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("记录log_client_sub_merchant_id失败", e);
|
|
|
|
|
}
|
|
|
|
|
clientMapper.update(update);
|
|
|
|
|
List<JSONObject> children = clientMapper.listChildClients(clientId);
|
|
|
|
|
for (JSONObject child : children) {
|
|
|
|
|
if (Objects.equals(child.getString("rpay_enterprise_id"), originSubMerchantId)) {
|
|
|
|
|
update.put("client_id", child.getIntValue("client_id"));
|
|
|
|
|
try {
|
|
|
|
|
recordSubMerchantLog(child, rpaySubMerchantInfo, manager);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("记录log_client_sub_merchant_id失败", e);
|
|
|
|
|
}
|
|
|
|
|
clientMapper.update(update);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateAliSubMerchantId(JSONObject manager, String clientMoniker, JSONObject aliSubMerchantInfo) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
@ -3513,6 +3532,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<JSONObject> listRpaySubMerchantIdApplys(JSONObject manager, String clientMoniker) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
List<JSONObject> applices = sysRpayMerchantApplyMapper.listRpayMerchantApplices(client.getInteger("client_id"),
|
|
|
|
|
new PageBounds(Order.formString("create_time.desc")));
|
|
|
|
|
if (!applices.isEmpty()) {
|
|
|
|
|
return applices;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@CacheEvict(value = ":all_sub_merchant_id_applices:", key = "#clientMoniker")
|
|
|
|
|
public String subMerchantApplication(String clientMoniker, SubMerchantIdApply subMerchantApply, JSONObject manager) {
|
|
|
|
@ -3548,22 +3582,30 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
|
|
|
|
|
SubRpayMerchantInfo subRpayMerchantInfo = JSONObject.toJavaObject(client, SubRpayMerchantInfo.class);
|
|
|
|
|
subRpayMerchantInfo.CheckEmpty();
|
|
|
|
|
rpayApi.registerMerchant(client.getIntValue("client_id"), subRpayMerchantInfo);
|
|
|
|
|
|
|
|
|
|
logger.debug("访问成功,返回的信息是: " );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// String sub_merchant_id = elem.elementText("sub_mch_id");
|
|
|
|
|
/* if (StringUtils.isNotEmpty(sub_merchant_id)) {
|
|
|
|
|
|
|
|
|
|
List<JSONObject> selectByshortName = sysRpayMerchantApplyMapper.selectByShortName(client.getIntValue("client_id"),client.getString("short_name"));
|
|
|
|
|
|
|
|
|
|
if (selectByshortName.size()>0) {
|
|
|
|
|
throw new BadRequestException("请修改【" + clientMoniker + "】的Company shortName信息(请避免和Rpay+商务号列表内的Company Short Name重复)");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
SubRpayMerchantInfo subRpayMerchantInfo = JSONObject.toJavaObject(client, SubRpayMerchantInfo.class);
|
|
|
|
|
subRpayMerchantInfo.CheckEmpty();
|
|
|
|
|
JSONObject rpayMerchantInfo = rpayApi.registerMerchant(client.getIntValue("client_id"), subRpayMerchantInfo);
|
|
|
|
|
|
|
|
|
|
if (rpayMerchantInfo != null) {
|
|
|
|
|
JSONObject merchantApply = new JSONObject();
|
|
|
|
|
merchantApply.put("merchant_id", rpayMerchantInfo.getString("rpay_order_id"));
|
|
|
|
|
merchantApply.put("client_id", client.getString("client_id"));
|
|
|
|
|
merchantApply.put("create_time", new Date());
|
|
|
|
|
merchantApply.put("operator", manager.getString("display_name"));
|
|
|
|
|
merchantApply.put("sub_merchant_id", rpayMerchantInfo.getString("merchantId"));
|
|
|
|
|
merchantApply.put("business_category", client.getString("royalpayindustry"));
|
|
|
|
|
merchantApply.put("merchant_shortname", client.getString("short_name"));
|
|
|
|
|
sysRpayMerchantApplyMapper.insertRpayMerchantApply(merchantApply);
|
|
|
|
|
}else {
|
|
|
|
|
throw new BadRequestException("请求失败");
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|