自主进件更新

master
james.zhao 6 years ago
parent 9812fef948
commit d2b5923c95

@ -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;
}
}

@ -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);

@ -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");

@ -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)

@ -323,6 +323,27 @@
minlength="6" maxlength="12" name="rePassword">
</div>
<div class="row">
<div class="col-xs-12 margin-bottom">
<div class="form-group has-feedback" ng-class="{'has-error':companyForm.customerchannel.$invalid && companyForm.customerchannel.$dirty}">
<div class="dropdown">
<input id="channel" data-toggle="dropdown" data-target="#" class="form-control"
ng-model="channelLable" placeholder="What channel did you learn about RoyaPay?" required
maxlength="50" name="customerchannel" readonly="readonly">
<ul class="dropdown-menu multi-level" role="menu" aria-labelledby="dropdownMenu">
<li class="dropdown-submenu" ng-repeat="channel in customerchannel">
<a tabindex="-1" ng-if="channel.children" ng-model="channel.mccCode">{{channel.label}}</a>
<ul class="dropdown-menu" ng-if="channel.children">
<li><a tabindex="-1" href="javascript:;" ng-repeat="child in channel.children" ng-click="chooseChannel(child)">{{child.label}}</a></li>
</ul>
<a ng-if="!channel.children" ng-model="channel.mccCode" ng-click="chooseChannel(channel)">{{channel.label}}</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 margin-bottom">
<button type="button" class="btn btn-success btn-block btn-flat"

@ -0,0 +1,49 @@
[
{
"children": [
{
"children": [],
"label": "谷歌|Google",
"mccCode": "10001"
},
{
"children": [],
"label": "领英|LinkedIn",
"mccCode": "10002"
},
{
"children": [],
"label": "微信|Wechat",
"mccCode": "10003"
},
{
"children": [],
"label": "传单手册|Flyer Manual",
"mccCode": "10004"
},
{
"children": [],
"label": "其他媒体|Other Media",
"mccCode": "10005"
}
],
"label": "媒体宣传|Media",
"mccCode": "1"
},
{
"label": "线下使用体验|Offline Experience",
"mccCode": "2"
},
{
"label": "朋友介绍|Friend Introduction",
"mccCode": "3"
},
{
"label": "商户推荐|Merchant Recommendation",
"mccCode": "4"
},
{
"label": "销售推荐|Sales Recommendation",
"mccCode": "5"
}
]

@ -3,187 +3,187 @@
"children": [
{
"children": [],
"label": "机票",
"label": "机票|Air Tickets",
"mccCode": "10001"
},
{
"children": [],
"label": "旅游行业",
"label": "旅游行业|Tourism Industry",
"mccCode": "10002"
},
{
"children": [],
"label": "私人定制旅游",
"label": "私人定制旅游|Private Custom Tour",
"mccCode": "10003"
},
{
"children": [],
"label": "租车",
"label": "租车|Car rental",
"mccCode": "10004"
},
{
"children": [],
"label": "巴士",
"label": "巴士|Bus",
"mccCode": "10005"
}
],
"label": "旅游出行",
"label": "旅游出行|Travel",
"mccCode": "1"
},
{
"children": [
{
"children": [],
"label": "饭店",
"label": "饭店|Restaurant",
"mccCode": "20001"
},
{
"children": [],
"label": "奶茶店",
"label": "奶茶店|Tea Shop",
"mccCode": "20002"
},
{
"children": [],
"label": "烧烤",
"label": "烧烤|Barbecue",
"mccCode": "20003"
},
{
"children": [],
"label": "火锅",
"label": "火锅|Hot Pot",
"mccCode": "20004"
},
{
"children": [],
"label": "Coffee",
"label": "咖啡|Coffee",
"mccCode": "20005"
},
{
"children": [],
"label": "酒吧",
"label": "酒吧|Bar",
"mccCode": "20006"
}
],
"label": "餐饮",
"label": "餐饮|Food",
"mccCode": "2"
},
{
"children": [
{
"children": [],
"label": "公众号服务商",
"label": "公众号服务商|Public Service Provider",
"mccCode": "50001"
},
{
"children": [],
"label": "各种媒体类宣传",
"label": "各种媒体类宣传|Various Media Promotion",
"mccCode": "50002"
}
],
"label": "传媒",
"label": "传媒|Media",
"mccCode": "5",
"value": "{\"category\":\"SERVICE\",\"code\":\"7542\",\"description\":\"Car Washes\",\"parentCode\":\"S10\"}"
},
{
"children": [
{
"label": "超市",
"label": "超市|Supermarket",
"mccCode": "70001"
},
{
"children": [],
"label": "服装店",
"label": "服装店|Clothing Store",
"mccCode": "70002"
},
{
"children": [],
"label": "鞋店",
"label": "鞋店|Shoe Store",
"mccCode": "70003"
},{
"children": [],
"label": "箱包",
"label": "箱包|Luggage",
"mccCode": "70005"
}
],
"label": "零售",
"label": "零售|Retail",
"mccCode": "7"
},
{
"children": [
{
"children": [],
"label": "桌游吧",
"label": "桌游吧|Board Game",
"mccCode": "80001"
},
{
"children": [],
"label": "网吧",
"label": "网吧|Internet Cafe",
"mccCode": "80007"
}
],
"label": "休闲娱乐",
"label": "休闲娱乐|Leisure and entertainment",
"mccCode": "8"
},
{
"children": [
{
"children": [],
"label": "摄影",
"label": "摄影|Photography",
"mccCode": "90001"
},
{
"children": [],
"label": "通讯运营商",
"label": "通讯运营商|Communication Carrier",
"mccCode": "90003"
},
{
"children:":[],
"label":"软件服务",
"label":"软件服务|Software Service",
"mccCode":"90005"
}
],
"label": "其他服务类",
"label": "其他服务类|Other Service Classes",
"mccCode": "9"
},
{
"children": [
{
"children": [],
"label": "Hotel",
"label": "旅馆|Hotel",
"mccCode": "100001"
},
{
"children": [],
"label": "Motel",
"label": "汽车旅馆|Motel",
"mccCode": "100002"
}
],
"label": "酒店",
"label": "酒店|Hotel",
"mccCode": "10"
},
{
"children": [
{
"children": [],
"label": "代购",
"label": "代购|Purchasing",
"mccCode": "110001"
},
{
"children": [],
"label": "物流(大宗出口贸易)",
"label": "物流(大宗出口贸易)|Logistics (Bulk Export Trade)",
"mccCode": "110002"
},
{
"children": [],
"label": "红酒出口",
"label": "红酒出口|Wine Export",
"mccCode": "110003"
},
{
"children": [],
"label": "综合电商",
"label": "综合电商|Integrated E-Commerce",
"mccCode": "110004"
}
],
"label": "出口贸易",
"label": "出口贸易|Export Trade",
"mccCode": "11"
}
]

@ -71,6 +71,13 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
};
$scope.loadRoyalpayindustry();
$scope.loadCustomerChannel = function () {
$http.get('/static/data/rp_customer_channel.json').then(function (resp) {
$scope.customerchannel = resp.data;
})
};
$scope.loadCustomerChannel();
$scope.checkParams = function () {
if($scope.partner.contact_phone && $scope.partner.nation_code){
@ -173,6 +180,12 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl',
$scope.partner.industry = industry.mccCode;
$scope.industryLable = industry.label;
};
$scope.chooseChannel = function (channel) {
$scope.partner.channel = channel.mccCode;
$scope.channelLable = channel.label;
};
$scope.searchBankInfo = function (bsb_no) {
$scope.initErrorMsg();
if (bsb_no != null && bsb_no != "") {

@ -33,7 +33,7 @@ public class SimpleClientApplyServiceImplTest {
@Test
public void getAndSendSmsCode() {
simpleClientApplyService.getAndSendSmsCode("0451120326","61");
simpleClientApplyService.getAndSendSmsCode("0451120326","61",null);
}
@Test

Loading…
Cancel
Save