|
|
|
@ -46,10 +46,17 @@ import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.ApproveEmailModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.BDUserModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.ClearDaysModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.CredentialCodeModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.CustomerSurchargeRateModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.EmailModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.GreenChannelModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.LogoModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.MaxOrderAmountModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.MerchantIdModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.OpenStatusModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.OrderExpiryModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.ParentIdModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.PaypadVersionModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.RefundAuditModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.SettleHourModify;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.SwitchPermissionModify;
|
|
|
|
@ -553,20 +560,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
Assert.notNull(client);
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
JSONObject updateInfo = info.updateObject();
|
|
|
|
|
int clientId = client.getIntValue("client_id");
|
|
|
|
|
LogoModify clientModify = new LogoModify(manager,clientMoniker,null,null);
|
|
|
|
|
List<JSONObject> clients = clientMapper.listChildClients(clientId);
|
|
|
|
|
if (StringUtils.isNotEmpty(info.getLogoId())) {
|
|
|
|
|
String fileUrl = attachmentClient.getFileUrl(info.getLogoId());
|
|
|
|
|
updateInfo.put("logo_url", fileUrl);
|
|
|
|
|
clientModify.setLogo_url(fileUrl);
|
|
|
|
|
String thumbnail = attachmentClient.getThumbnail(info.getLogoId(), 600).getString("url");
|
|
|
|
|
updateInfo.put("logo_thumbnail", thumbnail);
|
|
|
|
|
clientModify.setLogo_thumbnail(thumbnail);
|
|
|
|
|
for (JSONObject subClient : clients) {
|
|
|
|
|
subClient.put("logo_url", fileUrl);
|
|
|
|
|
subClient.put("logo_thumbnail", thumbnail);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
updateInfo.put("client_id", clientId);
|
|
|
|
|
|
|
|
|
|
int originReferrerId = client.getIntValue("referrer_id");
|
|
|
|
|
int updateReferrerId = Integer.parseInt(info.getReferrer_id() == null ? "0" : info.getReferrer_id());
|
|
|
|
@ -578,8 +584,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
clientBDMapper.update(clientBDInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
clientMapper.update(updateInfo);
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
clientModifySupport.processClientModify(clientModify);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -632,7 +637,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
client.put("skip_clearing", 0);
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
if (client.getIntValue("source") == 4) {
|
|
|
|
|
sendAuthInitEmail(client);
|
|
|
|
|
sendAuthInitEmail(manager,client);
|
|
|
|
|
} else if (checkGreenChannel && client.getIntValue("open_status") == 5) {
|
|
|
|
|
// 绿色通道通过后不发邮件
|
|
|
|
|
logger.info("PASS 绿色通道:" + clientMoniker);
|
|
|
|
@ -682,7 +687,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
username += "1";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sendInitEmail(client, username, pwd);
|
|
|
|
|
sendInitEmail(manager,client, username, pwd);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -695,12 +700,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (sendStatus >= 3) {
|
|
|
|
|
throw new BadRequestException("Email validating... Wait for a moment");
|
|
|
|
|
}
|
|
|
|
|
JSONObject clientUpdate = new JSONObject();
|
|
|
|
|
int clientId = client.getIntValue("client_id");
|
|
|
|
|
clientUpdate.put("client_id", clientId);
|
|
|
|
|
clientUpdate.put("approve_email_send", 4);
|
|
|
|
|
clientUpdate.put("approve_email_id", null);
|
|
|
|
|
clientMapper.update(clientUpdate);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new EmailModify(manager,clientMoniker,4,null));
|
|
|
|
|
if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {
|
|
|
|
|
int checkBDPermission = clientBDMapper.checkBDPermission(clientId, manager.getString("manager_id"));
|
|
|
|
|
if (checkBDPermission <= 0) {
|
|
|
|
@ -709,7 +710,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
List<JSONObject> accounts = clientAccountMapper.listAdminAccounts(clientId);
|
|
|
|
|
if (client.getIntValue("source") == 4) {
|
|
|
|
|
sendAuthInitEmail(client);
|
|
|
|
|
sendAuthInitEmail(manager,client);
|
|
|
|
|
} else {
|
|
|
|
|
if (accounts.size() == 0) {
|
|
|
|
|
initAdminUserAndSendEmail(manager, clientMoniker, client);
|
|
|
|
@ -717,14 +718,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
JSONObject account = accounts.get(0);
|
|
|
|
|
String pwd = RandomStringUtils.random(8, true, true);
|
|
|
|
|
resetAccountPwd(manager, clientMoniker, account.getString("account_id"), pwd);
|
|
|
|
|
sendInitEmail(client, account.getString("username"), pwd);
|
|
|
|
|
sendInitEmail(manager,client, account.getString("username"), pwd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void sendInitEmail(final JSONObject client, String username, String pwd) {
|
|
|
|
|
public void sendInitEmail(JSONObject account,final JSONObject client, String username, String pwd) {
|
|
|
|
|
logger.debug("sending email after comply");
|
|
|
|
|
JSONObject model = new JSONObject();
|
|
|
|
|
model.put("username", username);
|
|
|
|
@ -762,24 +762,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
try {
|
|
|
|
|
String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", mailTo,
|
|
|
|
|
emails.isEmpty() ? "" : StringUtils.join(emails, ","), content);
|
|
|
|
|
JSONObject clientUpdate = new JSONObject();
|
|
|
|
|
clientUpdate.put("client_id", client.getIntValue("client_id"));
|
|
|
|
|
clientUpdate.put("approve_email_send", 3);
|
|
|
|
|
clientUpdate.put("approve_email_id", emailId);
|
|
|
|
|
clientMapper.update(clientUpdate);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new EmailModify(account,client.getString("client_moniker"),3,emailId));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
JSONObject clientUpdate = new JSONObject();
|
|
|
|
|
clientUpdate.put("client_id", client.getIntValue("client_id"));
|
|
|
|
|
clientUpdate.put("approve_email_send", 0);
|
|
|
|
|
clientUpdate.put("approve_email_id", null);
|
|
|
|
|
clientMapper.update(clientUpdate);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new EmailModify(account,client.getString("client_moniker"),0,null));
|
|
|
|
|
throw new EmailException("Email Sending Failed", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}.start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void sendAuthInitEmail(final JSONObject client) {
|
|
|
|
|
public void sendAuthInitEmail(JSONObject account ,final JSONObject client) {
|
|
|
|
|
logger.debug("sending email after comply about a new partner opening by quick access");
|
|
|
|
|
JSONObject model = new JSONObject();
|
|
|
|
|
model.put("client_moniker", client.getString("client_moniker"));
|
|
|
|
@ -817,11 +809,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
try {
|
|
|
|
|
String emailId = mailService.sendEmail("Your Partner Account Has Been Authenticated Successfully", mailTo,
|
|
|
|
|
emails.isEmpty() ? "" : StringUtils.join(emails, ","), content);
|
|
|
|
|
JSONObject clientUpdate = new JSONObject();
|
|
|
|
|
clientUpdate.put("client_id", client.getIntValue("client_id"));
|
|
|
|
|
clientUpdate.put("approve_email_send", 3);
|
|
|
|
|
clientUpdate.put("approve_email_id", emailId);
|
|
|
|
|
clientMapper.update(clientUpdate);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new EmailModify(account,client.getString("client_moniker"),3,emailId));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new EmailException("Email Sending Failed", e);
|
|
|
|
|
}
|
|
|
|
@ -1066,8 +1054,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
public void togglePayNotice(JSONObject account, String clientMoniker, boolean enable) {
|
|
|
|
|
JSONObject partner = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
Assert.notNull(partner);
|
|
|
|
|
partner.put("enable_pay_notice", enable);
|
|
|
|
|
clientMapper.update(partner);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account, clientMoniker, "enable_pay_notice", enable));
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(partner.getIntValue("client_id"));
|
|
|
|
|
}
|
|
|
|
@ -1116,19 +1102,17 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void updateClientBDUser(String clientMoniker, int managerId) {
|
|
|
|
|
public void updateClientBDUser(JSONObject account,String clientMoniker, int managerId) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
client.put("bd_user", managerId);
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
clientModifySupport.processClientModify(new BDUserModify(account,clientMoniker,String.valueOf(managerId),null));
|
|
|
|
|
List<JSONObject> subClients = clientMapper.listChildClients(client.getIntValue("client_id"));
|
|
|
|
|
for (JSONObject subClient : subClients) {
|
|
|
|
|
subClient.put("bd_user", managerId);
|
|
|
|
|
clientMapper.update(subClient);
|
|
|
|
|
clientModifySupport.processClientModify(new BDUserModify(account,subClient.getString("client_moniker"),String.valueOf(managerId),null));
|
|
|
|
|
}
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -1138,9 +1122,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
client.put("credential_code", RandomStringUtils.random(32, true, true));
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
|
|
|
|
|
clientModifySupport.processClientConfigModify(new CredentialCodeModify(manager,clientMoniker, RandomStringUtils.random(32, true, true)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -1793,7 +1775,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void setOrderExpiryConfig(String clientMoniker, String orderExpiryConfig) {
|
|
|
|
|
public void setOrderExpiryConfig(JSONObject account ,String clientMoniker, String orderExpiryConfig) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
@ -1802,8 +1784,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
update.put("client_id", client.getIntValue("client_id"));
|
|
|
|
|
if (orderExpiryConfig != null) {
|
|
|
|
|
OrderExpiryRuleResolver.resolveExpiryTime(orderExpiryConfig, new Date());
|
|
|
|
|
update.put("order_expiry_config", orderExpiryConfig);
|
|
|
|
|
clientMapper.update(update);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new OrderExpiryModify(account,clientMoniker,orderExpiryConfig));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2140,8 +2121,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
clientFilesMapper.update(file);
|
|
|
|
|
}
|
|
|
|
|
if (!renewal) {
|
|
|
|
|
client.put("open_status", 2);
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
clientModifySupport.processClientModify(new OpenStatusModify(manager,clientMoniker,2));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (manager != null) {
|
|
|
|
@ -2160,8 +2140,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (CollectionUtils.isEmpty(existFiles)) {
|
|
|
|
|
throw new BadRequestException("The Agree File is not Complete!");
|
|
|
|
|
}
|
|
|
|
|
client.put("open_status", 3);
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
clientModifySupport.processClientModify(new OpenStatusModify(manager,clientMoniker,3));
|
|
|
|
|
saveClientAuditProcess(client.getIntValue("client_id"), 2, 3, "合同制作完成,等待BD处理", manager);
|
|
|
|
|
// sendAgreeFileMsgToBD(client,null);
|
|
|
|
|
sendCommissionWechatMessage(client);
|
|
|
|
@ -2224,11 +2203,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (StringUtils.isNotBlank(master_client.getString("parent_client_id"))) {
|
|
|
|
|
throw new BadRequestException("Master Merchant is not valid");
|
|
|
|
|
}
|
|
|
|
|
client.put("parent_client_id", master_client.getIntValue("client_id"));
|
|
|
|
|
clientModifySupport.processClientModify(new ParentIdModify(manager,clientMoniker,master_client.getIntValue("client_id")));
|
|
|
|
|
} else {
|
|
|
|
|
client.put("parent_client_id", null);
|
|
|
|
|
clientModifySupport.processClientModify(new ParentIdModify(manager,clientMoniker,null));
|
|
|
|
|
}
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -2257,67 +2235,47 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void setWeekendDelay(int clientId, boolean delay) {
|
|
|
|
|
JSONObject record = new JSONObject();
|
|
|
|
|
record.put("client_id", clientId);
|
|
|
|
|
record.put("weekend_delay", delay);
|
|
|
|
|
clientConfigService.update(record);
|
|
|
|
|
public void setWeekendDelay(JSONObject account,String clientMoniker,int clientId, boolean delay) {
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,clientMoniker,"weekend_delay",delay));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void setClientQRCodePaySurCharge(String clientMoniker, boolean paySurcharge) {
|
|
|
|
|
public void setClientQRCodePaySurCharge(JSONObject account,String clientMoniker, boolean paySurcharge) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
JSONObject update = new JSONObject();
|
|
|
|
|
int clientId = client.getIntValue("client_id");
|
|
|
|
|
update.put("client_id", clientId);
|
|
|
|
|
update.put("qrcode_surcharge", paySurcharge);
|
|
|
|
|
clientMapper.update(update);
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,clientMoniker,"qrcode_surcharge",paySurcharge));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void setClientApiPaySurCharge(String clientMoniker, boolean enableApiSurcharge) {
|
|
|
|
|
public void setClientApiPaySurCharge(JSONObject account,String clientMoniker, boolean enableApiSurcharge) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
JSONObject update = new JSONObject();
|
|
|
|
|
int clientId = client.getIntValue("client_id");
|
|
|
|
|
update.put("client_id", clientId);
|
|
|
|
|
update.put("api_surcharge", enableApiSurcharge);
|
|
|
|
|
clientMapper.update(update);
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,clientMoniker,"api_surcharge",enableApiSurcharge));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void setClientRetailPaySurCharge(String clientMoniker, boolean paySurcharge) {
|
|
|
|
|
public void setClientRetailPaySurCharge(JSONObject account,String clientMoniker, boolean paySurcharge) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
JSONObject update = new JSONObject();
|
|
|
|
|
int clientId = client.getIntValue("client_id");
|
|
|
|
|
update.put("client_id", clientId);
|
|
|
|
|
update.put("retail_surcharge", paySurcharge);
|
|
|
|
|
clientMapper.update(update);
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,clientMoniker,"retail_surcharge",paySurcharge));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void setClientTaxInSurcharge(String clientMoniker, boolean taxInSurcharge) {
|
|
|
|
|
public void setClientTaxInSurcharge(JSONObject account , String clientMoniker, boolean taxInSurcharge) {
|
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
JSONObject update = new JSONObject();
|
|
|
|
|
int clientId = client.getIntValue("client_id");
|
|
|
|
|
update.put("client_id", clientId);
|
|
|
|
|
update.put("tax_in_surcharge", taxInSurcharge);
|
|
|
|
|
clientMapper.update(update);
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,clientMoniker,"tax_in_surcharge",taxInSurcharge));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -2515,16 +2473,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
throw new BadRequestException("The Partner's Bank Account is not config!");
|
|
|
|
|
}
|
|
|
|
|
int open_status_from = client.getIntValue("open_status");
|
|
|
|
|
OpenStatusModify openStatusModify = new OpenStatusModify(manager,clientMoniker,4);
|
|
|
|
|
if ((client.getIntValue("source") == 1 || client.getIntValue("source") == 2) && client.getIntValue("approve_result") == 2) {
|
|
|
|
|
client.put("open_status", 4);
|
|
|
|
|
client.put("approve_time", new Date());
|
|
|
|
|
openStatusModify.setApprove_time(new Date());
|
|
|
|
|
} else {
|
|
|
|
|
openStatusModify.setApprove_time(new Date());
|
|
|
|
|
openStatusModify.setApprove_result(4);
|
|
|
|
|
|
|
|
|
|
client.put("approve_result", 4);
|
|
|
|
|
client.put("open_status", 4);
|
|
|
|
|
client.put("approve_time", new Date());
|
|
|
|
|
}
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
clientModifySupport.processClientModify(openStatusModify);
|
|
|
|
|
saveClientAuditProcess(client.getIntValue("client_id"), open_status_from, 4, "BD完成签字提交compliance审核", manager);
|
|
|
|
|
if (manager != null) {
|
|
|
|
|
// sendMessagetoCompliance(client, manager.getString("display_name"));
|
|
|
|
@ -2581,10 +2538,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (account == null || account.size() <= 0) {
|
|
|
|
|
throw new BadRequestException("The Partner's Bank Account is not config!");
|
|
|
|
|
}
|
|
|
|
|
client.put("approve_result", 4);
|
|
|
|
|
client.put("approve_time", new Date());
|
|
|
|
|
client.put("open_status", 1);
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
OpenStatusModify openStatusModify = new OpenStatusModify(manager,clientMoniker,1);
|
|
|
|
|
openStatusModify.setApprove_result(4);
|
|
|
|
|
openStatusModify.setApprove_time(new Date());
|
|
|
|
|
clientModifySupport.processClientModify(openStatusModify);
|
|
|
|
|
saveClientAuditProcess(client.getIntValue("client_id"), null, 1, "提交Compliance制作合同", manager);
|
|
|
|
|
if (manager != null) {
|
|
|
|
|
// sendAgreeFileMsgtoCompliance(client, manager.getString("display_name"));
|
|
|
|
@ -2623,10 +2580,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
throw new BadRequestException("The Partner's Bank Account is not config!");
|
|
|
|
|
}
|
|
|
|
|
Integer open_status_from = client.getInteger("open_status");
|
|
|
|
|
client.put("approve_result", 4);
|
|
|
|
|
client.put("open_status", 10);
|
|
|
|
|
client.put("approve_time", new Date());
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
OpenStatusModify openStatusModify = new OpenStatusModify(manager,clientMoniker,10);
|
|
|
|
|
openStatusModify.setApprove_result(4);
|
|
|
|
|
openStatusModify.setApprove_time(new Date());
|
|
|
|
|
clientModifySupport.processClientModify(openStatusModify);
|
|
|
|
|
saveClientAuditProcess(client.getIntValue("client_id"), open_status_from, 10, "提交绿色通道申请Compliance审核", manager);
|
|
|
|
|
if (manager != null) {
|
|
|
|
|
// sendGreenChannelMessagetoCompliance(client, manager.getString("display_name"));
|
|
|
|
@ -2641,9 +2598,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
client.put("paypad_version", paypad_version);
|
|
|
|
|
clientMapper.update(client);
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(client.getIntValue("client_id"));
|
|
|
|
|
clientModifySupport.processClientConfigModify(new PaypadVersionModify(manager,clientMoniker,paypad_version));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -2653,10 +2608,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
JSONObject updateObj = new JSONObject();
|
|
|
|
|
updateObj.put("client_id", client.getIntValue("client_id"));
|
|
|
|
|
updateObj.put("paypad_version", paypad_version);
|
|
|
|
|
clientConfigService.update(updateObj);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new PaypadVersionModify(account,client.getString("client_moniker"),paypad_version));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -2688,10 +2641,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
JSONObject updateObj = new JSONObject();
|
|
|
|
|
updateObj.put("client_id", client.getIntValue("client_id"));
|
|
|
|
|
updateObj.put("qrcode_surcharge", paySurcharge);
|
|
|
|
|
clientConfigService.update(updateObj);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,client.getString("client_moniker"),"qrcode_surcharge",paySurcharge));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -2701,10 +2652,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new InvalidShortIdException();
|
|
|
|
|
}
|
|
|
|
|
JSONObject updateObj = new JSONObject();
|
|
|
|
|
updateObj.put("client_id", client.getIntValue("client_id"));
|
|
|
|
|
updateObj.put("api_surcharge", enableApiSurcharge);
|
|
|
|
|
clientConfigService.update(updateObj);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,client.getString("client_moniker"),"api_surcharge",enableApiSurcharge));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -2718,38 +2667,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
// cashier cannot change this config
|
|
|
|
|
throw new ForbiddenException("Cashier has no permission to switch retail surcharge");
|
|
|
|
|
}
|
|
|
|
|
JSONObject updateObj = new JSONObject();
|
|
|
|
|
updateObj.put("client_id", client.getIntValue("client_id"));
|
|
|
|
|
updateObj.put("retail_surcharge", paySurcharge);
|
|
|
|
|
clientConfigService.update(updateObj);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,client.getString("client_moniker"),"retail_surcharge",paySurcharge));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void changeSurcharge(JSONObject device, UpdateSurchargeDTO updateSurchargeDTO) {
|
|
|
|
|
public void changeSurcharge(JSONObject account,JSONObject device, UpdateSurchargeDTO updateSurchargeDTO) {
|
|
|
|
|
JSONObject client = clientMapper.findClient(device.getIntValue("client_id"));
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new NotFoundException("Client not found, please check");
|
|
|
|
|
}
|
|
|
|
|
int clientId = client.getIntValue("client_id");
|
|
|
|
|
if (updateSurchargeDTO.getApiSurcharge() != null) {
|
|
|
|
|
JSONObject updateObj = new JSONObject();
|
|
|
|
|
updateObj.put("client_id", clientId);
|
|
|
|
|
updateObj.put("api_surcharge", updateSurchargeDTO.getApiSurcharge());
|
|
|
|
|
clientMapper.update(updateObj);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,client.getString("client_moniker"),"api_surcharge",updateSurchargeDTO.getApiSurcharge()));
|
|
|
|
|
}
|
|
|
|
|
if (updateSurchargeDTO.getQrcodeSurcharge() != null) {
|
|
|
|
|
JSONObject updateObj = new JSONObject();
|
|
|
|
|
updateObj.put("client_id", clientId);
|
|
|
|
|
updateObj.put("qrcode_surcharge", updateSurchargeDTO.getQrcodeSurcharge());
|
|
|
|
|
clientMapper.update(updateObj);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,client.getString("client_moniker"),"qrcode_surcharge",updateSurchargeDTO.getQrcodeSurcharge()));
|
|
|
|
|
}
|
|
|
|
|
if (updateSurchargeDTO.getRetailSurcharge() != null) {
|
|
|
|
|
JSONObject updateObj = new JSONObject();
|
|
|
|
|
updateObj.put("client_id", client.getIntValue("client_id"));
|
|
|
|
|
updateObj.put("retail_surcharge", updateSurchargeDTO.getRetailSurcharge());
|
|
|
|
|
clientMapper.update(updateObj);
|
|
|
|
|
clientModifySupport.processClientConfigModify(new SwitchPermissionModify(account,client.getString("client_moniker"),"retail_surcharge",updateSurchargeDTO.getRetailSurcharge()));
|
|
|
|
|
}
|
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|