|
|
@ -29,6 +29,7 @@ import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientsContractMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientsContractMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.CommoditiesMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.CommoditiesMapper;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.MailSendMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.SysWxMerchantApplyMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.SysWxMerchantApplyMapper;
|
|
|
@ -69,6 +70,7 @@ import au.com.royalpay.payment.manage.signin.beans.TodoNotice;
|
|
|
|
import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider;
|
|
|
|
import au.com.royalpay.payment.manage.signin.core.ManagerTodoNoticeProvider;
|
|
|
|
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
|
|
|
|
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
|
|
|
|
import au.com.royalpay.payment.manage.system.core.ClientContractService;
|
|
|
|
import au.com.royalpay.payment.manage.system.core.ClientContractService;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.system.core.MailGunService;
|
|
|
|
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
|
|
|
|
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
|
|
|
|
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
|
|
|
|
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
|
|
|
@ -83,6 +85,7 @@ import au.com.royalpay.payment.tools.exceptions.NotFoundException;
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.event.WechatExceptionEvent;
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.event.WechatExceptionEvent;
|
|
|
|
import au.com.royalpay.payment.tools.locale.LocaleSupport;
|
|
|
|
import au.com.royalpay.payment.tools.locale.LocaleSupport;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.tools.mail.SendMail;
|
|
|
|
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
|
|
|
|
import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig;
|
|
|
|
import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO;
|
|
|
|
import au.com.royalpay.payment.tools.merchants.beans.UpdateSurchargeDTO;
|
|
|
|
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
|
|
|
|
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
|
|
|
@ -145,8 +148,10 @@ import java.net.URL;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
@ -260,6 +265,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
private ClientInfoCacheSupport clientInfoCacheSupport;
|
|
|
|
private ClientInfoCacheSupport clientInfoCacheSupport;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private MongoTemplate mongoTemplate;
|
|
|
|
private MongoTemplate mongoTemplate;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private MailGunService mailGunService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private MailSendMapper mailSendMapper;
|
|
|
|
|
|
|
|
|
|
|
|
private static final String SOURCE_AGREE_FILE = "source_agree_file";
|
|
|
|
private static final String SOURCE_AGREE_FILE = "source_agree_file";
|
|
|
|
private static final String CLIENT_BANK_FILE = "client_bank_file";
|
|
|
|
private static final String CLIENT_BANK_FILE = "client_bank_file";
|
|
|
@ -572,6 +581,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
clientApplyMapper.updatePartnerApplication(apply);
|
|
|
|
clientApplyMapper.updatePartnerApplication(apply);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
mailGunService.addClientToMailList(partner);
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
|
|
|
logger.error("邮件列表添加成员失败",e);
|
|
|
|
|
|
|
|
}
|
|
|
|
return partner;
|
|
|
|
return partner;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -607,6 +621,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clientMapper.update(updateInfo);
|
|
|
|
clientMapper.update(updateInfo);
|
|
|
|
|
|
|
|
if(client.getString("contact_email").equals(updateInfo.getString("contact_email"))){
|
|
|
|
|
|
|
|
mailGunService.updateClientOfMailList(updateInfo,client);
|
|
|
|
|
|
|
|
}
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
clientInfoCacheSupport.clearClientCache(clientId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -790,7 +807,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
if (StringUtils.isEmpty(mailTo)) {
|
|
|
|
if (StringUtils.isEmpty(mailTo)) {
|
|
|
|
throw new EmailException("Client Contact Email is invalid");
|
|
|
|
throw new EmailException("Client Contact Email is invalid");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
final List<String> emails = new ArrayList<>();
|
|
|
|
final Set<String> emails = new HashSet<>();
|
|
|
|
for (JSONObject bd : bds) {
|
|
|
|
for (JSONObject bd : bds) {
|
|
|
|
String email = bd.getString("email");
|
|
|
|
String email = bd.getString("email");
|
|
|
|
if (StringUtils.isNotEmpty(email)) {
|
|
|
|
if (StringUtils.isNotEmpty(email)) {
|
|
|
@ -801,9 +818,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String emailId = mailService.sendEmail("Your RoyalPay Cross-border Payment has been set up", mailTo,
|
|
|
|
SendMail sendMail = new SendMail();
|
|
|
|
emails.isEmpty() ? "" : StringUtils.join(emails, ","), content);
|
|
|
|
Set<String> to = new HashSet<>();
|
|
|
|
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 3, emailId));
|
|
|
|
to.add(mailTo);
|
|
|
|
|
|
|
|
sendMail.setFrom("postmaster@mail.royalpay.com.au");
|
|
|
|
|
|
|
|
sendMail.setMailTos(to);
|
|
|
|
|
|
|
|
sendMail.setMailCcs(emails);
|
|
|
|
|
|
|
|
sendMail.setTitle("Your RoyalPay Cross-border Payment has been set up");
|
|
|
|
|
|
|
|
sendMail.setContent(content);
|
|
|
|
|
|
|
|
JSONObject mailResult = mailGunService.sendMail(sendMail);
|
|
|
|
|
|
|
|
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 3, mailResult.getString("mail_id")));
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 0, null));
|
|
|
|
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 0, null));
|
|
|
|
throw new EmailException("Email Sending Failed", e);
|
|
|
|
throw new EmailException("Email Sending Failed", e);
|
|
|
@ -837,7 +861,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<JSONObject> bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date());
|
|
|
|
List<JSONObject> bds = clientBDMapper.listClientBDInfoAvailable(client.getIntValue("client_id"), new Date());
|
|
|
|
|
|
|
|
|
|
|
|
final List<String> emails = new ArrayList<>();
|
|
|
|
final Set<String> emails = new HashSet<>();
|
|
|
|
for (JSONObject bd : bds) {
|
|
|
|
for (JSONObject bd : bds) {
|
|
|
|
String email = bd.getString("email");
|
|
|
|
String email = bd.getString("email");
|
|
|
|
if (StringUtils.isNotEmpty(email)) {
|
|
|
|
if (StringUtils.isNotEmpty(email)) {
|
|
|
@ -848,9 +872,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void run() {
|
|
|
|
public void run() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String emailId = mailService.sendEmail("Your Partner Account Has Been Authenticated Successfully", mailTo,
|
|
|
|
SendMail sendMail = new SendMail();
|
|
|
|
emails.isEmpty() ? "" : StringUtils.join(emails, ","), content);
|
|
|
|
Set<String> to = new HashSet<>();
|
|
|
|
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 3, emailId));
|
|
|
|
to.add(mailTo);
|
|
|
|
|
|
|
|
sendMail.setMailTos(to);
|
|
|
|
|
|
|
|
sendMail.setFrom("postmaster@mail.royalpay.com.au");
|
|
|
|
|
|
|
|
sendMail.setMailCcs(emails);
|
|
|
|
|
|
|
|
sendMail.setTitle("Your Partner Account Has Been Authenticated Successfully");
|
|
|
|
|
|
|
|
sendMail.setContent(content);
|
|
|
|
|
|
|
|
JSONObject mailResult = mailGunService.sendMail(sendMail);
|
|
|
|
|
|
|
|
clientModifySupport.processClientModify(new EmailModify(account, client.getString("client_moniker"), 3, mailResult.getString("mail_id")));
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new EmailException("Email Sending Failed", e);
|
|
|
|
throw new EmailException("Email Sending Failed", e);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -907,6 +938,37 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void newCheckEmailStatus() {
|
|
|
|
|
|
|
|
List<JSONObject> clients = clientMapper.listClientsWithEmailNotVerify();
|
|
|
|
|
|
|
|
for (JSONObject client : clients) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
String emailId = client.getString("approve_email_id");
|
|
|
|
|
|
|
|
JSONObject status = mailSendMapper.find(emailId,client.getString("contact_email"));
|
|
|
|
|
|
|
|
if (status!=null) {
|
|
|
|
|
|
|
|
int statusNo = status.getIntValue("status");
|
|
|
|
|
|
|
|
logger.debug("get mail status:" + emailId + "--" + statusNo);
|
|
|
|
|
|
|
|
int mailStatus = 3;
|
|
|
|
|
|
|
|
switch (statusNo) {
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
mailStatus = 1;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
mailStatus = 2;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
updateClientApproveEmailStatus(mailStatus, null, client.getString("client_moniker"));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
logger.debug("get mail status:" + emailId + "-- none");
|
|
|
|
|
|
|
|
// updateClientApproveEmailStatus(client.getIntValue("client_id"), 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
logger.error("check email status failed", e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void switchPermission(JSONObject manager, String clientMoniker, String permissionKey, boolean allow) {
|
|
|
|
public void switchPermission(JSONObject manager, String clientMoniker, String permissionKey, boolean allow) {
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|
JSONObject client = getClientInfoByMoniker(clientMoniker);
|
|
|
|