|
|
@ -46,7 +46,8 @@ import au.com.royalpay.payment.manage.riskbusiness.enums.RiskResultTypeEnum;
|
|
|
|
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
|
|
|
|
import au.com.royalpay.payment.manage.signin.beans.ChangePwdBean;
|
|
|
|
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
|
|
|
|
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
|
|
|
|
import au.com.royalpay.payment.manage.signin.core.impls.SignInAccountServiceImpl;
|
|
|
|
import au.com.royalpay.payment.manage.signin.core.impls.SignInAccountServiceImpl;
|
|
|
|
import au.com.royalpay.payment.manage.support.sms.SmsSenderQcloudImpl;
|
|
|
|
import au.com.royalpay.payment.manage.support.sms.SmsSender;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.manage.support.sms.msg.AuthCodeMessage;
|
|
|
|
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
|
|
|
|
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
|
|
|
|
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
|
|
|
|
import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
|
|
|
|
import au.com.royalpay.payment.manage.tradelog.refund.RefundService;
|
|
|
|
import au.com.royalpay.payment.manage.tradelog.refund.RefundService;
|
|
|
@ -106,6 +107,7 @@ import java.math.RoundingMode;
|
|
|
|
import java.text.DateFormat;
|
|
|
|
import java.text.DateFormat;
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
|
|
|
import java.time.Duration;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
|
@ -234,11 +236,10 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
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";
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private SmsSenderQcloudImpl smsSender;
|
|
|
|
private SmsSender smsSender;
|
|
|
|
private final String BIND_ACCOUNT_EMAIL_PREFIX = "BIND_ACCOUNT_EMAIL";
|
|
|
|
private final String BIND_ACCOUNT_EMAIL_PREFIX = "BIND_ACCOUNT_EMAIL";
|
|
|
|
private final String BIND_ACCOUNT_PHONE_PREFIX = "BIND_ACCOUNT_PHONE";
|
|
|
|
private final String BIND_ACCOUNT_PHONE_PREFIX = "BIND_ACCOUNT_PHONE";
|
|
|
|
private final String UNBIND_ACCOUNT_PHONE_PREFIX = "UHBIND_ACCOUNT_PHONE";
|
|
|
|
private final String UNBIND_ACCOUNT_PHONE_PREFIX = "UHBIND_ACCOUNT_PHONE";
|
|
|
|
private final int BIND_PHONE_TEMPLID = 126978;
|
|
|
|
|
|
|
|
private Map<String, AppMsgSender> senderMap = new HashMap<>();
|
|
|
|
private Map<String, AppMsgSender> senderMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
private final String fileName[] = {"client_bank_file", "client_id_file", "client_company_file"};
|
|
|
|
private final String fileName[] = {"client_bank_file", "client_id_file", "client_company_file"};
|
|
|
@ -2234,18 +2235,13 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
logger.debug("send sms code : {} ", codeKeyValue);
|
|
|
|
logger.debug("send sms code : {} ", codeKeyValue);
|
|
|
|
String nationCode = phone.getString("nation_code").contains("+") ? phone.getString("nation_code").substring(1) : phone.getString("nation_code");
|
|
|
|
String nationCode = phone.getString("nation_code").contains("+") ? phone.getString("nation_code").substring(1) : phone.getString("nation_code");
|
|
|
|
String phoneNumber = phone.getString("contact_phone");
|
|
|
|
String phoneNumber = phone.getString("contact_phone");
|
|
|
|
ArrayList<String> param = new ArrayList<>();
|
|
|
|
|
|
|
|
param.add("绑定手机号");
|
|
|
|
|
|
|
|
param.add(codeKeyValue);
|
|
|
|
|
|
|
|
String expireMin = "1";
|
|
|
|
|
|
|
|
param.add(expireMin);
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, BIND_PHONE_TEMPLID, param, "RoyalPay", "", "");
|
|
|
|
smsSender.sendAuthCodeMessage(nationCode.trim(), phoneNumber, Locale.ENGLISH, new AuthCodeMessage("绑定手机号", codeKeyValue, 1));
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error(e.getMessage(), e);
|
|
|
|
logger.error(e.getMessage(), e);
|
|
|
|
throw new BadRequestException("Phone number is wrong.Please try again.");
|
|
|
|
throw new BadRequestException("Phone number is wrong.Please try again.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).set(codeKeyValue + "&" + nationCode + "&" + phoneNumber, Long.parseLong(expireMin), TimeUnit.MINUTES);
|
|
|
|
stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).set(codeKeyValue + "&" + nationCode + "&" + phoneNumber, Duration.ofMinutes(1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -2259,18 +2255,13 @@ public class RetailAppServiceImp implements RetailAppService {
|
|
|
|
String codeKeyValue = RandomStringUtils.random(6, false, true);
|
|
|
|
String codeKeyValue = RandomStringUtils.random(6, false, true);
|
|
|
|
String nationCode = client.getString("nation_code").contains("+") ? client.getString("nation_code").substring(1) : client.getString("nation_code");
|
|
|
|
String nationCode = client.getString("nation_code").contains("+") ? client.getString("nation_code").substring(1) : client.getString("nation_code");
|
|
|
|
String phoneNumber = client.getString("contact_phone");
|
|
|
|
String phoneNumber = client.getString("contact_phone");
|
|
|
|
ArrayList<String> param = new ArrayList<>();
|
|
|
|
|
|
|
|
param.add("解綁绑定手机号");
|
|
|
|
|
|
|
|
param.add(codeKeyValue);
|
|
|
|
|
|
|
|
String expireMin = "1";
|
|
|
|
|
|
|
|
param.add(expireMin);
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, BIND_PHONE_TEMPLID, param, "RoyalPay", "", "");
|
|
|
|
smsSender.sendAuthCodeMessage(nationCode.trim(), phoneNumber, Locale.ENGLISH, new AuthCodeMessage("解綁绑定手机号", codeKeyValue, 1));
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error(e.getMessage(), e);
|
|
|
|
logger.error(e.getMessage(), e);
|
|
|
|
throw new BadRequestException("Phone number is wrong.Please try again.");
|
|
|
|
throw new BadRequestException("Phone number is wrong.Please try again.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).set(codeKeyValue + "&" + nationCode + "&" + phoneNumber, Long.parseLong(expireMin), TimeUnit.MINUTES);
|
|
|
|
stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).set(codeKeyValue + "&" + nationCode + "&" + phoneNumber, Duration.ofMinutes(1));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|