|
|
|
@ -1813,8 +1813,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getBankAccountByClientId(int client_id) {
|
|
|
|
|
List<JSONObject> list = clientBankAccountMapper.clientBankAccounts(client_id);
|
|
|
|
|
public JSONObject getBankAccountByClientId(int clientId) {
|
|
|
|
|
List<JSONObject> list = clientBankAccountMapper.clientBankAccounts(clientId);
|
|
|
|
|
return list.isEmpty() ? new JSONObject() : list.get(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2169,11 +2169,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void validateClients(int client_id, JSONObject params) throws Exception {
|
|
|
|
|
public void validateClients(int clientId, JSONObject params) throws Exception {
|
|
|
|
|
if (params.containsKey("client_ids") && params.getString("client_ids") != null) {
|
|
|
|
|
String[] client_ids = (String[]) params.get("client_ids");
|
|
|
|
|
if (client_ids.length == 1) {
|
|
|
|
|
if (client_ids[0].equals(String.valueOf(client_id))) {
|
|
|
|
|
if (client_ids[0].equals(String.valueOf(clientId))) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2181,7 +2181,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
JSONObject clientInfo = getClientInfo(Integer.parseInt(currentClientId));
|
|
|
|
|
if (clientInfo.containsKey("parent_client_id")) {
|
|
|
|
|
int parentClientId = clientInfo.getIntValue("parent_client_id");
|
|
|
|
|
if (parentClientId != client_id && client_id != Integer.parseInt(currentClientId) && !listLevel3Client(client_id).contains(parentClientId)) {
|
|
|
|
|
if (parentClientId != clientId && clientId != Integer.parseInt(currentClientId) && !listLevel3Client(clientId).contains(parentClientId)) {
|
|
|
|
|
throw new Exception("partner has no permission");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2617,7 +2617,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject listClientDevices(JSONObject manager, String clientMoniker, String remark, int page, int limit, String client_type, String[] client_ids) {
|
|
|
|
|
public JSONObject listClientDevices(JSONObject manager, String clientMoniker, String remark, int page, int limit, String clientType, String[] clientIds) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
@ -2632,11 +2632,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (remark != null) {
|
|
|
|
|
params.put("remark", remark);
|
|
|
|
|
}
|
|
|
|
|
if (client_type != null) {
|
|
|
|
|
params.put("client_type", client_type);
|
|
|
|
|
if (clientType != null) {
|
|
|
|
|
params.put("client_type", clientType);
|
|
|
|
|
}
|
|
|
|
|
if (client_ids != null) {
|
|
|
|
|
params.put("client_ids", Arrays.asList(client_ids));
|
|
|
|
|
if (clientIds != null) {
|
|
|
|
|
params.put("client_ids", Arrays.asList(clientIds));
|
|
|
|
|
params.remove("client_id");
|
|
|
|
|
} else {
|
|
|
|
|
queryModifyClientIds(client.getIntValue("client_id"), params);
|
|
|
|
@ -2646,7 +2646,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject listClientDeviceIds(String clientMoniker, String client_type, String[] client_ids) {
|
|
|
|
|
public JSONObject listClientDeviceIds(String clientMoniker, String clientType, String[] clientIds) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
@ -2660,8 +2660,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
|
sdf.setTimeZone(TimeZone.getTimeZone(client.getString("timezone") != null ? client.getString("timezone") : "Australia/Melbourne"));
|
|
|
|
|
params.put("client_id", client.getIntValue("client_id"));
|
|
|
|
|
if (client_ids != null) {
|
|
|
|
|
params.put("client_ids", Arrays.asList(client_ids));
|
|
|
|
|
if (clientIds != null) {
|
|
|
|
|
params.put("client_ids", Arrays.asList(clientIds));
|
|
|
|
|
params.remove("client_id");
|
|
|
|
|
} else {
|
|
|
|
|
queryModifyClientIds(client.getIntValue("client_id"), params);
|
|
|
|
@ -2792,7 +2792,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JSONObject getBankInfo(JSONObject manager, String clientMoniker, String bsb_no) {
|
|
|
|
|
public JSONObject getBankInfo(JSONObject manager, String clientMoniker, String bsbNo) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
@ -2800,7 +2800,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
// bd451cc3e3ad66c75165dc852507e8f0
|
|
|
|
|
// 收费 ab9379cfdab559509bbdcdd11923489f
|
|
|
|
|
String url = "https://api.bank.codes/au-bsb/json/ab9379cfdab559509bbdcdd11923489f/" + bsb_no;
|
|
|
|
|
String url = "https://api.bank.codes/au-bsb/json/ab9379cfdab559509bbdcdd11923489f/" + bsbNo;
|
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
|
try {
|
|
|
|
|
HttpRequestResult result = new HttpRequestGenerator(url, RequestMethod.GET).execute();
|
|
|
|
@ -2823,21 +2823,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void setCustomerSurchargeRate(JSONObject account, String clientMoniker, BigDecimal customer_surcharge_rate) {
|
|
|
|
|
public void setCustomerSurchargeRate(JSONObject account, String clientMoniker, BigDecimal customerSurchargeRate) {
|
|
|
|
|
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
if (customer_surcharge_rate == null) {
|
|
|
|
|
if (customerSurchargeRate == null) {
|
|
|
|
|
clientModifySupport.processClientConfigModify(new CustomerSurchargeRateModify(account, clientMoniker, null));
|
|
|
|
|
} else {
|
|
|
|
|
BigDecimal rate_value = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat").getBigDecimal("rate_value");
|
|
|
|
|
if (customer_surcharge_rate.compareTo(PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()) > 0
|
|
|
|
|
|| customer_surcharge_rate.compareTo(rate_value) <= 0) {
|
|
|
|
|
if (customerSurchargeRate.compareTo(PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()) > 0
|
|
|
|
|
|| customerSurchargeRate.compareTo(rate_value) <= 0) {
|
|
|
|
|
throw new ForbiddenException("Invalid Range");
|
|
|
|
|
}
|
|
|
|
|
clientModifySupport.processClientConfigModify(new CustomerSurchargeRateModify(account, clientMoniker, customer_surcharge_rate));
|
|
|
|
|
clientModifySupport.processClientConfigModify(new CustomerSurchargeRateModify(account, clientMoniker, customerSurchargeRate));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3319,16 +3319,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void configMasterMerchant(JSONObject manager, String clientMoniker, String master_merchant) {
|
|
|
|
|
public void configMasterMerchant(JSONObject manager, String clientMoniker, String masterMerchant) {
|
|
|
|
|
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
if (StringUtils.isNotBlank(master_merchant)) {
|
|
|
|
|
if (StringUtils.isNotBlank(masterMerchant)) {
|
|
|
|
|
// throw new NotFoundException("Invalid Input");
|
|
|
|
|
JSONObject master_client = getClientInfoByMoniker(master_merchant);
|
|
|
|
|
JSONObject master_client = getClientInfoByMoniker(masterMerchant);
|
|
|
|
|
if (master_client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
@ -3455,8 +3455,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateClientEmail(int clientId, String contact_email) {
|
|
|
|
|
clientMapper.updateClientEmail(clientId, contact_email);
|
|
|
|
|
public void updateClientEmail(int clientId, String contactEmail) {
|
|
|
|
|
clientMapper.updateClientEmail(clientId, contactEmail);
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4635,31 +4635,31 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void changePaymentPage(JSONObject manager, String clientMoniker, String paypad_version) {
|
|
|
|
|
public void changePaymentPage(JSONObject manager, String clientMoniker, String paypadVersion) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new PaypadVersionModify(manager, clientMoniker, paypad_version));
|
|
|
|
|
clientModifySupport.processClientConfigModify(new PaypadVersionModify(manager, clientMoniker, paypadVersion));
|
|
|
|
|
clientInfoCacheSupport.clearClientMonikerConfigCache(clientMoniker);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void changeCBBankPaymentPage(JSONObject manager, String clientMoniker, String paypad_version) {
|
|
|
|
|
public void changeCBBankPaymentPage(JSONObject manager, String clientMoniker, String paypadVersion) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
JSONObject clientConfig = clientConfigMapper.find(client.getIntValue("client_id"));
|
|
|
|
|
clientConfig.put("cbbank_paypad_version", paypad_version);
|
|
|
|
|
clientConfig.put("cbbank_paypad_version", paypadVersion);
|
|
|
|
|
clientConfigMapper.update(clientConfig);
|
|
|
|
|
clientInfoCacheSupport.clearClientMonikerConfigCache(clientMoniker);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void changeGatewayVersion(JSONObject account, boolean enable_gateway_v2) {
|
|
|
|
|
public void changeGatewayVersion(JSONObject account, boolean enableV2) {
|
|
|
|
|
int clientId = account.getIntValue("client_id");
|
|
|
|
|
JSONObject client = getClientInfo(clientId);
|
|
|
|
|
if (client == null) {
|
|
|
|
@ -4679,17 +4679,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
gatewaySignInfo.put("last_update_date", new Date());
|
|
|
|
|
merchantSignInfoMapper.insert(gatewaySignInfo);
|
|
|
|
|
}
|
|
|
|
|
clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"), "is_valid", enable_gateway_v2));
|
|
|
|
|
clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"), "is_valid", enableV2));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void changeVerifyIp(JSONObject account, boolean verify_ip) {
|
|
|
|
|
public void changeVerifyIp(JSONObject account, boolean enableV2) {
|
|
|
|
|
int clientId = account.getIntValue("client_id");
|
|
|
|
|
JSONObject client = getClientInfo(clientId);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"), "verify_ip", verify_ip));
|
|
|
|
|
clientModifySupport.processClientGatewaySignModify(new SwitchGatewaySignPermissionModify(account, client.getString("client_moniker"), "verify_ip", enableV2));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -4724,21 +4724,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
JSONObject update = new JSONObject();
|
|
|
|
|
update.put("client_id", client.getIntValue("client_id"));
|
|
|
|
|
if (StringUtils.isNotBlank(publicKey)) {
|
|
|
|
|
clientModifySupport.processClientGatewaySignModify(new GatewayInfoModify(account, client.getString("client_moniker"), "mch_public_key", publicKey, "重新设置商户公钥"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void changePaymentSuccessPage(JSONObject manager, String clientMoniker, String paysuccess_version) {
|
|
|
|
|
public void changePaymentSuccessPage(JSONObject manager, String clientMoniker, String paysuccessVersion) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
client.put("paysuccess_version", paysuccess_version);
|
|
|
|
|
client.put("paysuccess_version", paysuccessVersion);
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4756,40 +4754,40 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void changePaymentPage(JSONObject account, String paypad_version) {
|
|
|
|
|
public void changePaymentPage(JSONObject account, String paypadVersion) {
|
|
|
|
|
int clientId = account.getIntValue("client_id");
|
|
|
|
|
JSONObject client = getClientInfo(clientId);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
clientModifySupport.processClientConfigModify(new PaypadVersionModify(account, client.getString("client_moniker"), paypad_version));
|
|
|
|
|
clientModifySupport.processClientConfigModify(new PaypadVersionModify(account, client.getString("client_moniker"), paypadVersion));
|
|
|
|
|
clientInfoCacheSupport.clearClientMonikerConfigCache(client.getString("client_moniker"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void changeCBBankPaymentPage(JSONObject account, String paypad_version) {
|
|
|
|
|
public void changeCBBankPaymentPage(JSONObject account, String paypadVersion) {
|
|
|
|
|
int clientId = account.getIntValue("client_id");
|
|
|
|
|
JSONObject client = getClientInfo(clientId);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
JSONObject clientConfig = clientConfigMapper.find(client.getIntValue("client_id"));
|
|
|
|
|
clientConfig.put("cbbank_paypad_version", paypad_version);
|
|
|
|
|
clientConfig.put("cbbank_paypad_version", paypadVersion);
|
|
|
|
|
clientConfigMapper.update(clientConfig);
|
|
|
|
|
clientInfoCacheSupport.clearClientMonikerConfigCache(client.getString("client_moniker"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void changeManualSettle(JSONObject account, int client_id, boolean manual_settle, String operator_id, int type, String operation) {
|
|
|
|
|
JSONObject client = getClientInfo(client_id);
|
|
|
|
|
public void changeManualSettle(JSONObject account, int clientId, boolean manualSettle, String operatorId, int type, String operation) {
|
|
|
|
|
JSONObject client = getClientInfo(clientId);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new BadRequestException("merchant not found");
|
|
|
|
|
}
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "manual_settle", manual_settle));
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, client.getString("client_moniker"), "manual_settle", manualSettle));
|
|
|
|
|
JSONObject actClientLog = new JSONObject();
|
|
|
|
|
actClientLog.put("client_id", client_id);
|
|
|
|
|
actClientLog.put("operator_id", operator_id);
|
|
|
|
|
actClientLog.put("client_id", clientId);
|
|
|
|
|
actClientLog.put("operator_id", operatorId);
|
|
|
|
|
actClientLog.put("operation", operation);
|
|
|
|
|
actClientLog.put("create_time", new Date());
|
|
|
|
|
actClientLog.put("operator_type", type);
|
|
|
|
@ -4895,18 +4893,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void refusePartner(String clientMoniker, JSONObject manager, String refuse_remark) {
|
|
|
|
|
public void refusePartner(String clientMoniker, JSONObject manager, String refuseRemark) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
int open_status = client.getIntValue("open_status");
|
|
|
|
|
int openStatus = client.getIntValue("open_status");
|
|
|
|
|
|
|
|
|
|
AuditModify auditModify = new AuditModify(manager, clientMoniker, client.getInteger("approve_result"), manager.getString("manager_id"), new Date());
|
|
|
|
|
if (open_status == 1) {
|
|
|
|
|
if (openStatus == 1) {
|
|
|
|
|
auditModify.setOpen_status(null);
|
|
|
|
|
} else {
|
|
|
|
|
auditModify.setOpen_status(open_status - 1);
|
|
|
|
|
auditModify.setOpen_status(openStatus - 1);
|
|
|
|
|
}
|
|
|
|
|
if (client.getInteger("approve_result") == null || client.getIntValue("approve_result") == 4) {
|
|
|
|
|
auditModify.setApprove_result(5);
|
|
|
|
@ -4914,23 +4912,22 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (client.getIntValue("source") == 4) {
|
|
|
|
|
auditModify.setApprove_result(5);
|
|
|
|
|
}
|
|
|
|
|
if (refuse_remark != null && !refuse_remark.isEmpty()) {
|
|
|
|
|
auditModify.setRefuse_remark(refuse_remark);
|
|
|
|
|
if (refuseRemark != null && !refuseRemark.isEmpty()) {
|
|
|
|
|
auditModify.setRefuse_remark(refuseRemark);
|
|
|
|
|
}
|
|
|
|
|
saveClientAuditProcess(client.getIntValue("client_id"), open_status, client.getInteger("open_status"), "打回," + refuse_remark, manager, 1);
|
|
|
|
|
saveClientAuditProcess(client.getIntValue("client_id"), openStatus, client.getInteger("open_status"), "打回," + refuseRemark, manager, 1);
|
|
|
|
|
clientModifySupport.processClientModify(auditModify);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
// sendMessageToBD(client, refuse_remark);
|
|
|
|
|
if (client.getIntValue("source") == 4) {
|
|
|
|
|
String contact_phone = client.getString("contact_phone");
|
|
|
|
|
if (contact_phone.startsWith("+61")) {
|
|
|
|
|
String contactPhone = client.getString("contact_phone");
|
|
|
|
|
if (contactPhone.startsWith("+61")) {
|
|
|
|
|
ArrayList<String> param = new ArrayList<>();
|
|
|
|
|
param.add(refuse_remark);
|
|
|
|
|
param.add(refuseRemark);
|
|
|
|
|
try {
|
|
|
|
|
smsSender.getSender().sendWithParam("61", contact_phone.replace("+61", ""), REFUSE_CLIENT_TEMPLID, param, "RoyalPay", "", "");
|
|
|
|
|
smsSender.getSender().sendWithParam("61", contactPhone.replace("+61", ""), REFUSE_CLIENT_TEMPLID, param, "RoyalPay", "", "");
|
|
|
|
|
} catch (Exception ignore) {
|
|
|
|
|
throw new ServerErrorException("Phone number is wrong :" + contact_phone);
|
|
|
|
|
throw new ServerErrorException("Phone number is wrong :" + contactPhone);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -4938,48 +4935,46 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
gatewayMerchantApply.notifyOrgMerchantStatus(client);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("RefusePartnerError=======:" + clientMoniker + "," + e.getMessage());
|
|
|
|
|
logger.error("RefusePartnerError=======:{},{}", clientMoniker, e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void cardRefusePartner(String clientMoniker, JSONObject manager, String refuse_remark) {
|
|
|
|
|
public void cardRefusePartner(String clientMoniker, JSONObject manager, String refuseRemark) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
Integer clientId = client.getInteger("client_id");
|
|
|
|
|
JSONObject cardFlowInfo = sysClientUpayProfileMapper.findInfo(clientId);
|
|
|
|
|
Integer open_status = null;
|
|
|
|
|
Integer openStatus = null;
|
|
|
|
|
if (null != cardFlowInfo) {
|
|
|
|
|
open_status = cardFlowInfo.getIntValue("upay_open_status");
|
|
|
|
|
if (open_status == 1) {
|
|
|
|
|
openStatus = cardFlowInfo.getIntValue("upay_open_status");
|
|
|
|
|
if (openStatus == 1) {
|
|
|
|
|
cardFlowInfo.put("upay_open_status", null);
|
|
|
|
|
} else {
|
|
|
|
|
cardFlowInfo.put("upay_open_status", open_status - 1);
|
|
|
|
|
cardFlowInfo.put("upay_open_status", openStatus - 1);
|
|
|
|
|
}
|
|
|
|
|
if (cardFlowInfo.getIntValue("upay_approve_result") == 4 || client.getIntValue("source") == 4) {
|
|
|
|
|
cardFlowInfo.put("upay_approve_result", 5);
|
|
|
|
|
}
|
|
|
|
|
if (refuse_remark != null && !refuse_remark.isEmpty()) {
|
|
|
|
|
cardFlowInfo.put("upay_refuse_remark", refuse_remark);
|
|
|
|
|
if (refuseRemark != null && !refuseRemark.isEmpty()) {
|
|
|
|
|
cardFlowInfo.put("upay_refuse_remark", refuseRemark);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
cardFlowInfo.put("upay_open_status", null);
|
|
|
|
|
saveClientAuditProcess(client.getIntValue("client_id"), openStatus, cardFlowInfo.getIntValue("open_status"), "打回," + refuseRemark, manager, 2);
|
|
|
|
|
sysClientUpayProfileMapper.update(cardFlowInfo);
|
|
|
|
|
}
|
|
|
|
|
saveClientAuditProcess(client.getIntValue("client_id"), open_status, cardFlowInfo.getIntValue("open_status"), "打回," + refuse_remark, manager, 2);
|
|
|
|
|
sysClientUpayProfileMapper.update(cardFlowInfo);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (client.getIntValue("source") == 4) {
|
|
|
|
|
String contact_phone = client.getString("contact_phone");
|
|
|
|
|
if (contact_phone.startsWith("+61")) {
|
|
|
|
|
String contactPhone = client.getString("contact_phone");
|
|
|
|
|
if (contactPhone.startsWith("+61")) {
|
|
|
|
|
ArrayList<String> param = new ArrayList<>();
|
|
|
|
|
param.add(refuse_remark);
|
|
|
|
|
param.add(refuseRemark);
|
|
|
|
|
try {
|
|
|
|
|
smsSender.getSender().sendWithParam("61", contact_phone.replace("+61", ""), REFUSE_CLIENT_TEMPLID, param, "RoyalPay", "", "");
|
|
|
|
|
smsSender.getSender().sendWithParam("61", contactPhone.replace("+61", ""), REFUSE_CLIENT_TEMPLID, param, "RoyalPay", "", "");
|
|
|
|
|
} catch (Exception ignore) {
|
|
|
|
|
throw new ServerErrorException("Phone number is wrong :" + contact_phone);
|
|
|
|
|
throw new ServerErrorException("Phone number is wrong :" + contactPhone);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -4987,36 +4982,36 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
gatewayMerchantApply.notifyOrgMerchantStatus(client);
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("RefusePartnerError=======:" + clientMoniker + "," + e.getMessage());
|
|
|
|
|
logger.error("RefusePartnerError=======:{},{}", clientMoniker, e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Cacheable(value = ":all_clients:", key = "''+#clientId")
|
|
|
|
|
public JSONArray getAllClientIds(int clientId) {
|
|
|
|
|
JSONArray client_ids = new JSONArray();
|
|
|
|
|
JSONArray clientIds = new JSONArray();
|
|
|
|
|
List<JSONObject> children = clientMapper.listChildClients(clientId);
|
|
|
|
|
client_ids.add(String.valueOf(clientId));
|
|
|
|
|
clientIds.add(String.valueOf(clientId));
|
|
|
|
|
if (!children.isEmpty()) {
|
|
|
|
|
for (JSONObject client : children) {
|
|
|
|
|
client_ids.add(client.getString("client_id"));
|
|
|
|
|
clientIds.add(client.getString("client_id"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return client_ids;
|
|
|
|
|
return clientIds;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateAppClient(JSONObject account, int client_id, AppClientBean appClientBean) {
|
|
|
|
|
JSONObject client = getClientInfo(client_id);
|
|
|
|
|
public void updateAppClient(JSONObject account, int clientId, AppClientBean appClientBean) {
|
|
|
|
|
JSONObject client = getClientInfo(clientId);
|
|
|
|
|
JSONObject updateObj = appClientBean.updateObject();
|
|
|
|
|
if (updateObj.size() > 0) {
|
|
|
|
|
updateObj.put("client_id", client_id);
|
|
|
|
|
updateObj.put("client_id", clientId);
|
|
|
|
|
clientMapper.update(updateObj);
|
|
|
|
|
}
|
|
|
|
|
JSONObject clientLegal = appClientBean.legalObject();
|
|
|
|
|
if (clientLegal.size() > 0) {
|
|
|
|
|
clientLegal.put("client_id", client_id);
|
|
|
|
|
JSONObject oldClienetLegal = sysClientLegalPersonMapper.findRepresentativeInfo(client_id);
|
|
|
|
|
clientLegal.put("client_id", clientId);
|
|
|
|
|
JSONObject oldClienetLegal = sysClientLegalPersonMapper.findRepresentativeInfo(clientId);
|
|
|
|
|
if (oldClienetLegal == null) {
|
|
|
|
|
sysClientLegalPersonMapper.save(clientLegal);
|
|
|
|
|
} else {
|
|
|
|
@ -5024,7 +5019,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (appClientBean.getCustomerSurchargeRate() != null) {
|
|
|
|
|
BigDecimal customerSurchargeRate = new BigDecimal(appClientBean.getCustomerSurchargeRate()).setScale(2, RoundingMode.HALF_DOWN);
|
|
|
|
|
BigDecimal customerSurchargeRate = BigDecimal.valueOf(appClientBean.getCustomerSurchargeRate()).setScale(2, RoundingMode.HALF_DOWN);
|
|
|
|
|
BigDecimal rateValue = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat").getBigDecimal("rate_value");
|
|
|
|
|
if (customerSurchargeRate.compareTo(PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()) > 0
|
|
|
|
|
|| customerSurchargeRate.compareTo(rateValue) <= 0) {
|
|
|
|
@ -5032,19 +5027,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
setCustomerSurchargeRate(account, client.getString("client_moniker"), customerSurchargeRate);
|
|
|
|
|
}
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(client_id);
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void setSkipClearing(JSONObject account, String clientMoniker, Boolean skip_clearing, String remark) {
|
|
|
|
|
public void setSkipClearing(JSONObject account, String clientMoniker, Boolean skipClearing, String remark) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "skip_clearing", skip_clearing));
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "skip_clearing", skipClearing));
|
|
|
|
|
|
|
|
|
|
if (!skip_clearing) {
|
|
|
|
|
if (Boolean.TRUE.equals(skipClearing)) {
|
|
|
|
|
if ("".equals(remark) || remark == null) {
|
|
|
|
|
throw new ServerErrorException("请填写关闭清算原因");
|
|
|
|
|
}
|
|
|
|
@ -5054,22 +5049,28 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
client.put("skip_clearing", skip_clearing);
|
|
|
|
|
// if (client.getString("rpay_enterprise_id") != null) {
|
|
|
|
|
// rpayApi.switchMerchantSettle(client);
|
|
|
|
|
// }
|
|
|
|
|
client.put("skip_clearing", skipClearing);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void modifyMinSettle(JSONObject manager, String clientMoniker, BigDecimal minSettle) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
clientModifySupport.processClientConfigModify(new ClientMinSettleModify(manager, clientMoniker, minSettle));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void setSurchargeMode(JSONObject account, String clientMoniker, String surcharge_mode) {
|
|
|
|
|
public void setSurchargeMode(JSONObject account, String clientMoniker, String surchargeMode) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
clientModifySupport.processClientModify(new SurchargeModeModify(account, clientMoniker, surcharge_mode));
|
|
|
|
|
clientModifySupport.processClientModify(new SurchargeModeModify(account, clientMoniker, surchargeMode));
|
|
|
|
|
|
|
|
|
|
if ("distributed".equals(surcharge_mode)) {
|
|
|
|
|
if ("distributed".equals(surchargeMode)) {
|
|
|
|
|
JSONObject surchargeAccount = clientsSurchargeAccountsMapper.find(client.getIntValue("client_id"));
|
|
|
|
|
|
|
|
|
|
if (surchargeAccount == null) {
|
|
|
|
@ -5094,12 +5095,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public void setAllowSurchargeCredit(JSONObject account, String clientMoniker, Boolean allow_surcharge_credit) {
|
|
|
|
|
public void setAllowSurchargeCredit(JSONObject account, String clientMoniker, Boolean allowSurchargeCredit) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
clientModifySupport.processClientModify(new SwitchAllowSurchargeCreditModify(account, clientMoniker, "allow_surcharge_credit", allow_surcharge_credit));
|
|
|
|
|
clientModifySupport.processClientModify(new SwitchAllowSurchargeCreditModify(account, clientMoniker, "allow_surcharge_credit", allowSurchargeCredit));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -7053,10 +7054,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
info.put("annual_rate", cardAnnualRate);//年费率
|
|
|
|
|
info.put("cost_per_transaction", clientRate.getString("transaction_fee"));//每次交易成本
|
|
|
|
|
String domesticRateValue = cardRate.getString("domestic_rate_value");
|
|
|
|
|
info.put("domestic_fee", domesticRateValue.indexOf("rate")!= -1?JSONObject.parseObject(domesticRateValue).getString("rate"):cardRate.getString("domestic_rate_value"));//国内服务费
|
|
|
|
|
info.put("domestic_fee", domesticRateValue.indexOf("rate")!= -1?JSONObject.parseObject(domesticRateValue).getString("rate"): cardRate.getString("domestic_rate_value"));//国内服务费
|
|
|
|
|
String overseasRateValue = cardRate.getString("overseas_rate_value");
|
|
|
|
|
info.put("international_fee", upayProfileInfo.getBoolean("enable_international_card") ?
|
|
|
|
|
overseasRateValue.indexOf("rate")!=-1?JSONObject.parseObject(overseasRateValue).getString("rate"):cardRate.getString("overseas_rate_value") : "-");//国际服务费
|
|
|
|
|
overseasRateValue.indexOf("rate")!=-1?JSONObject.parseObject(overseasRateValue).getString("rate"): cardRate.getString("overseas_rate_value") : "-");//国际服务费
|
|
|
|
|
BigDecimal reserve = (upayProfileInfo.getBigDecimal("expected_card_revenue").multiply(new BigDecimal(0.005)).setScale(0, RoundingMode.HALF_UP));
|
|
|
|
|
info.put("account_reserve", reserve.compareTo(new BigDecimal(200)) <= 0 ? new BigDecimal(200).toPlainString() : reserve.toPlainString());//账户储备金
|
|
|
|
|
//银行账号信息
|
|
|
|
|