diff --git a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyStep1Bean.java b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyStep1Bean.java index 9d1dfd0c1..ca14416cc 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyStep1Bean.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyStep1Bean.java @@ -22,6 +22,7 @@ public class ClientPreApplyStep1Bean { @NotEmpty(message = "phoneCodeKey can't be null") private String phoneCodeKey; private String apply_source = "pc"; + private int channel; public JSONObject insertObject() { @@ -84,4 +85,12 @@ public class ClientPreApplyStep1Bean { public void setApply_source(String apply_source) { this.apply_source = apply_source; } + + public int getChannel() { + return channel; + } + + public void setChannel(int channel) { + this.channel = channel; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java b/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java index e47105ef4..d3a877528 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java @@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.application.core; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import com.alibaba.fastjson.JSONObject; +import org.apache.catalina.servlet4preview.http.HttpServletRequest; public interface SimpleClientApplyService { void verifyRegisterSMSCode(String codeKey, String phoneNumber); @@ -11,7 +12,7 @@ public interface SimpleClientApplyService { String partnerSignIn(JSONObject account); - String getAndSendSmsCode(String phoneNumber, String nationCode); + String getAndSendSmsCode(String phoneNumber, String nationCode, HttpServletRequest request); String checkOrGenerateRegisterProcessKey(String accountName, String codeKey); diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index e61854e5f..2abaa88ee 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -28,6 +28,7 @@ import au.com.royalpay.payment.tools.utils.PasswordUtils; import com.alibaba.fastjson.JSONObject; import com.github.qcloudsms.SmsSingleSender; +import org.apache.catalina.servlet4preview.http.HttpServletRequest; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; @@ -43,10 +44,7 @@ import org.thymeleaf.spring4.SpringTemplateEngine; import java.io.IOException; import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Random; +import java.util.*; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; @@ -103,6 +101,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { @Resource private StringRedisTemplate stringRedisTemplate; private final int REGISTER_CLIENT_TEMPLID = 126978; + private final int REGISTER_CLIENT_TEMPLID_ENGLISH = 346078; private final String REGISTER_CLIENT_PREFIX = "REGISTER_CLIENT"; private final String REGISTER_CLIENT_PROCESS_PREFIX = "REGISTER_CLIENT_PROCESS"; private final String VERIFY_MAIL_PREFIX = "VERIFY_MAIL"; @@ -134,7 +133,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { } @Override - public String getAndSendSmsCode(String phoneNumber, String nationCode) { + public String getAndSendSmsCode(String phoneNumber, String nationCode, HttpServletRequest request) { String reidsCheckCodeKey = getRegisterClientRedisKey(phoneNumber); String value = stringRedisTemplate.boundValueOps(reidsCheckCodeKey).get(); if (StringUtils.isNotEmpty(value)) { @@ -147,7 +146,11 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { String expireMin = "3"; param.add(expireMin); try { - smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID, param, "RoyalPay", "", ""); + if(request.getLocales().nextElement().equals(Locale.CHINESE)|| request.getLocales().nextElement().equals(Locale.SIMPLIFIED_CHINESE)){ + smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID, param, "RoyalPay", "", ""); + }else{ + smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID_ENGLISH, param, "RoyalPay", "", ""); + } } catch (Exception e) { e.printStackTrace(); throw new ServerErrorException("Phone number is wrong Please try again"); diff --git a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java index 339c1fd20..354ee5d21 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java @@ -7,6 +7,7 @@ import au.com.royalpay.payment.tools.env.SysConfigManager; import com.alibaba.fastjson.JSONObject; +import org.apache.catalina.servlet4preview.http.HttpServletRequest; import org.apache.commons.lang3.StringUtils; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; @@ -64,8 +65,8 @@ public class SimpleClientApplyController { @RequestMapping(value = "/info/phone/{phone_number}/verify", method = RequestMethod.POST) @ResponseBody - public void getAndSendSmsCode(@PathVariable String phone_number, @RequestParam String nation_code) { - simpleClientApplyService.getAndSendSmsCode(phone_number, nation_code); + public void getAndSendSmsCode(@PathVariable String phone_number, @RequestParam String nation_code, HttpServletRequest request) { + simpleClientApplyService.getAndSendSmsCode(phone_number, nation_code, request); } @RequestMapping(value = "/info/update/{username}", method = RequestMethod.POST) diff --git a/src/main/ui/merchant_application.html b/src/main/ui/merchant_application.html index 6842c7812..fada2f2b6 100644 --- a/src/main/ui/merchant_application.html +++ b/src/main/ui/merchant_application.html @@ -323,6 +323,27 @@ minlength="6" maxlength="12" name="rePassword"> +