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