|
|
|
@ -55,13 +55,12 @@ import au.com.royalpay.payment.manage.mappers.redpack.ActClientInvitationCodeMap
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.risk.RiskAttentionMerchantsMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.*;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.beans.*;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientInfoCacheSupport;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientModifySupport;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.*;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.bank.AustraliaBank;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.bank.AustraliaBankClientNullException;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.bank.AustraliaBankInfo;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.descriptor.ApsConfigDescriptor;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.ApsConfigData;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.entity.impls.*;
|
|
|
|
|
import au.com.royalpay.payment.manage.merchants.enums.UPayAuthFileEnum;
|
|
|
|
|
import au.com.royalpay.payment.manage.notice.core.MailService;
|
|
|
|
@ -329,6 +328,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
private PaymentApi paymentApi;
|
|
|
|
|
@Resource
|
|
|
|
|
private MerchantChannelPermissionManager merchantChannelPermissionManager;
|
|
|
|
|
@Resource
|
|
|
|
|
private ApsConfigService apsConfigService;
|
|
|
|
|
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormat.forPattern("dd MMM yyyy");
|
|
|
|
|
|
|
|
|
@ -356,7 +357,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
private String agreetemplatePdfPath;
|
|
|
|
|
@Value("${app.agreetemplate.aggregate.path}")
|
|
|
|
|
private String aggregateAgreetemplatePdfPath;
|
|
|
|
|
// private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2020/04/08/1586313342533_41vI3w9R8OHrhAVYWvdv7S2IyQra4z.pdf";
|
|
|
|
|
// private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2020/04/08/1586313342533_41vI3w9R8OHrhAVYWvdv7S2IyQra4z.pdf";
|
|
|
|
|
private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2021/09/07/1630997571126_fqWcLQ5Rx0wFm8pVwpKuI1gjf6FmwX.pdf";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -554,7 +555,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
resolver.newOrderEnabled(client, null, PlatformEnvironment.getEnv().getForeignCurrency())) {
|
|
|
|
|
client.put("enable_alipayplus", true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ApsConfigData apsConfig = apsConfigService.getApsConfigByClientId(client.getString("client_id"));
|
|
|
|
|
if (apsConfig == null) {
|
|
|
|
|
apsConfig = apsConfigService.saveApsConfigClientId(manager.getString("manager_id"), client.getString("client_id"), new ApsConfigDescriptor());
|
|
|
|
|
}
|
|
|
|
|
client.put("aps_config_id", apsConfig.getId());
|
|
|
|
|
client.put("enable_alipayaps", apsConfig.getEnableAlipayAps());
|
|
|
|
|
client.put("alipay_cn_switch", apsConfig.getAlipayCnSwitch());
|
|
|
|
|
return client;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1583,12 +1590,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
if (client == null) {
|
|
|
|
|
throw new NotFoundException("Client Not Exists");
|
|
|
|
|
}
|
|
|
|
|
if (channelApi.channel().equalsIgnoreCase("alipayaps")) {
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
jsonObject.put("enableAlipayAps", allow);
|
|
|
|
|
apsConfigService.updateApsConfigClientId(manager.getString("manager_id"), client.getString("client_id"), jsonObject);
|
|
|
|
|
} else {
|
|
|
|
|
merchantChannelPermissionManager.switchMerchantChannelPermission(channelApi.getMetadata().payChannel(), client.getIntValue("client_id"), allow);
|
|
|
|
|
try {
|
|
|
|
|
clientModifySupport.processModify(new SwitchPermissionModify(manager, clientMoniker, "enable_" + channel.toLowerCase(), allow));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("Failed to change channel switch:{}", channel);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
logger.info("{}({}) switched client {} channel {} to {}", manager.getString("display_name"), manager.getString("manager_id"), clientMoniker, channel, allow);
|
|
|
|
|
if (allow && (StringUtils.equalsAnyIgnoreCase("Wechat", channel) || StringUtils.equalsAnyIgnoreCase("Alipay", channel))) {
|
|
|
|
|
int clientId = client.getIntValue("client_id");
|
|
|
|
@ -2980,21 +2993,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
throw new BadRequestException("The Partner's Rate is not config!");
|
|
|
|
|
}
|
|
|
|
|
client.put("wechat_rate", weChatRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN));
|
|
|
|
|
client.put("clean", "T+"+weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean", "T+" + weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean_days", weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("located_country", "Australia");
|
|
|
|
|
if("1".equalsIgnoreCase(weChatRate.getString("clean_days"))){
|
|
|
|
|
if ("1".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
|
|
|
|
|
// clean_1 clean_1_friday clean_1_saturday
|
|
|
|
|
// second, third or fourth
|
|
|
|
|
client.put("clean_1", weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean_1_friday", "first");
|
|
|
|
|
client.put("clean_1_saturday", "second");
|
|
|
|
|
}else if("2".equalsIgnoreCase(weChatRate.getString("clean_days"))){
|
|
|
|
|
} else if ("2".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
|
|
|
|
|
client.put("clean_1", weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean_1_friday", "second");
|
|
|
|
|
client.put("clean_1_saturday", "third");
|
|
|
|
|
|
|
|
|
|
}else if("3".equalsIgnoreCase(weChatRate.getString("clean_days"))){
|
|
|
|
|
} else if ("3".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
|
|
|
|
|
client.put("clean_1", weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean_1_friday", "third");
|
|
|
|
|
client.put("clean_1_saturday", "fourth");
|
|
|
|
@ -3116,16 +3129,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
client.put("wechat_rate", p.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN));
|
|
|
|
|
client.put("clean", "T+" + p.getString("clean_days"));
|
|
|
|
|
client.put("clean_days", p.getString("clean_days"));
|
|
|
|
|
if("1".equalsIgnoreCase(p.getString("clean_days"))){
|
|
|
|
|
if ("1".equalsIgnoreCase(p.getString("clean_days"))) {
|
|
|
|
|
client.put("clean_1", p.getString("clean_days"));
|
|
|
|
|
client.put("clean_1_friday", "first");
|
|
|
|
|
client.put("clean_1_saturday", "second");
|
|
|
|
|
}else if("2".equalsIgnoreCase(p.getString("clean_days"))){
|
|
|
|
|
} else if ("2".equalsIgnoreCase(p.getString("clean_days"))) {
|
|
|
|
|
client.put("clean_1", p.getString("clean_days"));
|
|
|
|
|
client.put("clean_1_friday", "second");
|
|
|
|
|
client.put("clean_1_saturday", "third");
|
|
|
|
|
|
|
|
|
|
}else if("3".equalsIgnoreCase(p.getString("clean_days"))){
|
|
|
|
|
} else if ("3".equalsIgnoreCase(p.getString("clean_days"))) {
|
|
|
|
|
client.put("clean_1", p.getString("clean_days"));
|
|
|
|
|
client.put("clean_1_friday", "third");
|
|
|
|
|
client.put("clean_1_saturday", "fourth");
|
|
|
|
@ -3205,18 +3218,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
client.put("clean", "T+" + weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean_days", weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("located_country", "Australia");
|
|
|
|
|
if("1".equalsIgnoreCase(weChatRate.getString("clean_days"))){
|
|
|
|
|
if ("1".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
|
|
|
|
|
// clean_1 clean_1_friday clean_1_saturday
|
|
|
|
|
// second, third or fourth
|
|
|
|
|
client.put("clean_1", weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean_1_friday", "first");
|
|
|
|
|
client.put("clean_1_saturday", "second");
|
|
|
|
|
}else if("2".equalsIgnoreCase(weChatRate.getString("clean_days"))){
|
|
|
|
|
} else if ("2".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
|
|
|
|
|
client.put("clean_1", weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean_1_friday", "second");
|
|
|
|
|
client.put("clean_1_saturday", "third");
|
|
|
|
|
|
|
|
|
|
}else if("3".equalsIgnoreCase(weChatRate.getString("clean_days"))){
|
|
|
|
|
} else if ("3".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
|
|
|
|
|
client.put("clean_1", weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean_1_friday", "third");
|
|
|
|
|
client.put("clean_1_saturday", "fourth");
|
|
|
|
@ -4106,18 +4119,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
client.put("clean", "T+" + weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean_days", weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("located_country", "Australia");
|
|
|
|
|
if("1".equalsIgnoreCase(weChatRate.getString("clean_days"))){
|
|
|
|
|
if ("1".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
|
|
|
|
|
// clean_1 clean_1_friday clean_1_saturday
|
|
|
|
|
// second, third or fourth
|
|
|
|
|
client.put("clean_1", weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean_1_friday", "first");
|
|
|
|
|
client.put("clean_1_saturday", "second");
|
|
|
|
|
}else if("2".equalsIgnoreCase(weChatRate.getString("clean_days"))){
|
|
|
|
|
} else if ("2".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
|
|
|
|
|
client.put("clean_1", weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean_1_friday", "second");
|
|
|
|
|
client.put("clean_1_saturday", "third");
|
|
|
|
|
|
|
|
|
|
}else if("3".equalsIgnoreCase(weChatRate.getString("clean_days"))){
|
|
|
|
|
} else if ("3".equalsIgnoreCase(weChatRate.getString("clean_days"))) {
|
|
|
|
|
client.put("clean_1", weChatRate.getString("clean_days"));
|
|
|
|
|
client.put("clean_1_friday", "third");
|
|
|
|
|
client.put("clean_1_saturday", "fourth");
|
|
|
|
@ -4201,7 +4214,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc")));
|
|
|
|
|
logs.forEach(log -> log.put("padding", log.getBooleanValue("editable")));
|
|
|
|
|
JSONObject result = PageListUtils.buildPageListResult(logs);
|
|
|
|
|
result.put("padding", logs.stream().anyMatch(log->log.getBooleanValue("editable")));
|
|
|
|
|
result.put("padding", logs.stream().anyMatch(log -> log.getBooleanValue("editable")));
|
|
|
|
|
logger.info("##editable{}", result.getBooleanValue("padding"));
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|