From a4fb42ef4b9d9b7f0f13feb64922261db941fb45 Mon Sep 17 00:00:00 2001 From: "eason.qian" Date: Tue, 22 May 2018 17:15:19 +0800 Subject: [PATCH 01/49] fix --- .../core/SimpleClientApplyService.java | 14 ++++++++ .../web/SimpleClientApplyController.java | 33 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java create mode 100644 src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java 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 new file mode 100644 index 000000000..008d754c4 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/SimpleClientApplyService.java @@ -0,0 +1,14 @@ +package au.com.royalpay.payment.manage.application.core; + +import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; +import com.alibaba.fastjson.JSONObject; + +public interface SimpleClientApplyService { + String getSMSVerifyCode(String codeKey); + + JSONObject newAccount(NewAccountBean accountBean); + + void deleteSMSVerifyCodeKey(String codeKey); + + String partnerSignIn(JSONObject account); +} 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 new file mode 100644 index 000000000..1a8a47e00 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/application/web/SimpleClientApplyController.java @@ -0,0 +1,33 @@ +package au.com.royalpay.payment.manage.application.web; + +import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; +import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; +import au.com.royalpay.payment.tools.CommonConsts; +import au.com.royalpay.payment.tools.http.HttpUtils; +import com.alibaba.fastjson.JSONObject; +import org.springframework.validation.Errors; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +@RestController +@RequestMapping("/register") +public class SimpleClientApplyController { + @Resource + private SimpleClientApplyService simpleClientApplyService; + + @RequestMapping(value = "/account/{codeKey}", method = RequestMethod.POST) + public void registerAccount(@PathVariable String codeKey, @RequestBody @Valid NewAccountBean accountBean, Errors errors, HttpServletResponse response) throws Exception { + HttpUtils.handleValidErrors(errors); + String codeValue = simpleClientApplyService.getSMSVerifyCode(codeKey); + if (codeValue == null || !codeValue.equals(accountBean.getUsername())) { + throw new Exception("Verification code has expired or is not correct"); + } + JSONObject account = simpleClientApplyService.newAccount(accountBean); + simpleClientApplyService.deleteSMSVerifyCodeKey(codeKey); + String statusKey = simpleClientApplyService.partnerSignIn(account); + HttpUtils.setCookie(response, CommonConsts.CODE_KEY, statusKey); + } +} From de98a7c279500c9bd171e043aa953dd1f21faad7 Mon Sep 17 00:00:00 2001 From: yuan <1551130722@qq.com> Date: Wed, 23 May 2018 09:59:32 +0800 Subject: [PATCH 02/49] add --- src/main/ui/merchant_application.html | 929 ++++++++++++++++++ .../ui/static/css/merchant_application.css | 422 ++++++++ src/main/ui/static/images/step/gou.png | Bin 0 -> 2689 bytes src/main/ui/static/images/step/num1_1.png | Bin 0 -> 2413 bytes src/main/ui/static/images/step/num1_2.png | Bin 0 -> 2845 bytes src/main/ui/static/images/step/num1_3.png | Bin 0 -> 3172 bytes src/main/ui/static/images/step/num1_4.png | Bin 0 -> 2607 bytes src/main/ui/static/images/step/num1_5.png | Bin 0 -> 2946 bytes src/main/ui/static/images/step/send_code.png | Bin 0 -> 3582 bytes .../merchant_application.js | 204 ++++ 10 files changed, 1555 insertions(+) create mode 100644 src/main/ui/merchant_application.html create mode 100644 src/main/ui/static/css/merchant_application.css create mode 100644 src/main/ui/static/images/step/gou.png create mode 100644 src/main/ui/static/images/step/num1_1.png create mode 100644 src/main/ui/static/images/step/num1_2.png create mode 100644 src/main/ui/static/images/step/num1_3.png create mode 100644 src/main/ui/static/images/step/num1_4.png create mode 100644 src/main/ui/static/images/step/num1_5.png create mode 100644 src/main/ui/static/images/step/send_code.png create mode 100644 src/main/ui/static/merchantapplication/merchant_application.js diff --git a/src/main/ui/merchant_application.html b/src/main/ui/merchant_application.html new file mode 100644 index 000000000..2006536b9 --- /dev/null +++ b/src/main/ui/merchant_application.html @@ -0,0 +1,929 @@ + + + + + + + RoyalPay | Merchant Application + + + + + + + + + + + + + + + + Partner Register + + + + + + + + + + + + +
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ + + + + +
+
+
+ +
+ +
+
+
+
+ + Account Information +
+
+ + Company Information +
+
+ + Bank Account +
+
+ + Submit Materials +
+
+ + Success +
+
+
+
+ +
+
+ + + +
+
+ + Required Field +
+ +
+ + Required Field +
+ +
+ + Required Field +
+ +
+ + Required Field +
+
+
+ + +
+

Required Field

+
+
+
+ +
+ + Required Field +
+ +
+
+ +
+

{{resError}}

+
+
+
+
+
+
+ + + +
+
+ + Required Field +
+
+ + + +
+
+ + Required Field +
+ +
+ + Required Field +
+
+ + Required Field +
+
+ + Required Field +
+
+ + Required Field +
+ +
+
+ +
+

{{resError}}

+
+
+
+
+
+
+ + Required Field +
+ +
+ + Required Field +
+ +
+ + Required Field +
+ +
+ + Required Field +
+
+ + Required Field +
+
+ + Required Field +
+
+ + Required Field +
+
+ + Required Field +
+
+ + Required Field +
+
+ + Required Field +
+ +
+
+ +
+

{{resError}}

+
+
+
+
+
+
+ +
{{rateConfig}}
+ Required Field +
+ +
+
+ +
%
+
+ Required Field +
+ +
+
+ +
%
+
+ Required Field +
+ +
+
+ +
%
+
+ Required Field +
+
+
+ +
%
+
+ Required Field +
+
+
+ +
%
+
+ Required Field +
+
+
+ +
+
+
+
+ +
+

{{resError}}

+
+
+
+
+ +
+
+
+ +
+
+
恭喜注册成功
+
欢迎使用RoyalPay收单服务
+
+
+
+
+
注意事项:
+

1、需要完成 合规材料的提交,具体请查看appxx菜单xx功能;

+

2、在完成合规认证之前,不会对交易进行清算;

+

3、账户名和密码以及相关信息已发送至账户邮箱,请妥善保护自己的密码,及时进行修改。

+
+
+
+ +
+

{{resError}}

+
+
+
+
+
+
+
+ + + +
+ +
+
+ + +
+
+ + \ No newline at end of file diff --git a/src/main/ui/static/css/merchant_application.css b/src/main/ui/static/css/merchant_application.css new file mode 100644 index 000000000..49d16a26c --- /dev/null +++ b/src/main/ui/static/css/merchant_application.css @@ -0,0 +1,422 @@ +body .progress_inner #step-5:checked + div + div + div + div > .box_base, body .progress_inner #step-4:checked + input + div + div + div + div > .box_base, body .progress_inner #step-2:checked + input + input + input + div + div + div + div > .box_base, body .progress_inner #step-3:checked + input + input + div + div + div + div > .box_base, body .progress_inner #step-1:checked + input + input + input + input + div + div + div + div > .box_base { + top: 50%; + left: 0px; + opacity: 1; +} +body .progress_inner #step-5:checked + div + div + div + div > .box_item, body .progress_inner #step-4:checked + input + div + div + div + div > .box_item, body .progress_inner #step-2:checked + input + input + input + div + div + div + div > .box_item, body .progress_inner #step-3:checked + input + input + div + div + div + div > .box_item, body .progress_inner #step-1:checked + input + input + input + input + div + div + div + div > .box_item { + top: -30px; + left: 0px; + opacity: 0; +} + +body .progress_inner #step-5:checked + div + div + div + div > .box_lid, body .progress_inner #step-4:checked + input + div + div + div + div > .box_lid, body .progress_inner #step-2:checked + input + input + input + div + div + div + div > .box_lid { + top: -20px; + left: 0px; + opacity: 0; +} +body .progress_inner #step-5:checked + div + div + div + div > .box_item, body .progress_inner #step-4:checked + input + div + div + div + div > .box_item, body .progress_inner #step-2:checked + input + input + input + div + div + div + div > .box_item { + top: -10px; + left: 0px; + opacity: 1; +} + +body .progress_inner #step-5:checked + div + div + div + div > .box_item, body .progress_inner #step-4:checked + input + div + div + div + div > .box_item, body .progress_inner #step-3:checked + input + input + div + div + div + div > .box_item { + top: 10px; + left: 0px; + opacity: 1; +} +body .progress_inner #step-5:checked + div + div + div + div > .box_lid, body .progress_inner #step-4:checked + input + div + div + div + div > .box_lid, body .progress_inner #step-3:checked + input + input + div + div + div + div > .box_lid { + top: -1px; + left: 0px; + opacity: 1; +} +body .progress_inner #step-5:checked + div + div + div + div > .box_ribbon, body .progress_inner #step-4:checked + input + div + div + div + div > .box_ribbon, body .progress_inner #step-3:checked + input + input + div + div + div + div > .box_ribbon { + top: 70%; + left: 0px; + opacity: 0; +} +body .progress_inner #step-5:checked + div + div + div + div > .box_bow, body .progress_inner #step-4:checked + input + div + div + div + div > .box_bow, body .progress_inner #step-3:checked + input + input + div + div + div + div > .box_bow { + top: 0px; + left: 0px; + opacity: 0; +} + +body .progress_inner #step-5:checked + div + div + div + div > .box_ribbon, body .progress_inner #step-4:checked + input + div + div + div + div > .box_ribbon { + top: 50%; + left: 0px; + opacity: 1; +} +body .progress_inner #step-5:checked + div + div + div + div > .box_bow, body .progress_inner #step-4:checked + input + div + div + div + div > .box_bow { + top: -10px; + left: 0px; + opacity: 1; +} + +body .progress_inner #step-5:checked + div + div + div + div > .box_tag { + top: 10px; + left: 20px; + opacity: 1; +} +body .progress_inner #step-5:checked + div + div + div + div > .box_string { + top: 10px; + left: 20px; + opacity: 1; +} + +* { + box-sizing: border-box; +} + +body .progress_inner__step:before, body .progress_inner, body .progress_inner__status .box_base, body .progress_inner__status .box_item, body .progress_inner__status .box_ribbon, body .progress_inner__status .box_bow, body .progress_inner__status .box_bow__left, body .progress_inner__status .box_bow__right, body .progress_inner__status .box_tag, body .progress_inner__status .box_string { + position: absolute; + left: 0; + right: 0; + top:42%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + margin: auto; +} + +body .progress_inner__bar, body .progress_inner__bar--set { + height: 6px; + left: 10%; + background: -webkit-repeating-linear-gradient(45deg, #1ea4ec, #1ea4ec 4px, #1f8bc5 4px, #1f8bc5 10px); + background: repeating-linear-gradient(45deg, #1ea4ec, #1ea4ec 4px, #1f8bc5 4px, #1f8bc5 10px); + -webkit-transition: width 800ms cubic-bezier(0.915, 0.015, 0.3, 1.005); + transition: width 800ms cubic-bezier(0.915, 0.015, 0.3, 1.005); + border-radius: 6px; + width: 0; + position: relative; + z-index: -1; +} + +body .progress_inner__step:before { + width: 30px; + height: 30px; + color: #70afd0; + background: white; + line-height: 30px; + border: 3px solid #a6cde2; + font-size: 12px; + top: 3px; + border-radius: 100%; + -webkit-transition: all .4s; + transition: all .4s; + cursor: pointer; + pointer-events: none; +} + +body .progress_inner__step { + width: 20%; + font-size: 14px; + padding: 0 10px; + -webkit-transition: all .4s; + transition: all .4s; + float: left; + text-align: center; + position: relative; +} +body .progress_inner__step label { + padding-top: 50px; + top: -20px; + display: block; + position: relative; + cursor: pointer; +} +/*body .progress_inner__step:hover { + color: white; +} +body .progress_inner__step:hover:before { + color: white; + background: #1ea4ec; +}*/ + +body { + font-family: "Nunito", sans-serif; + background: #a6cde2; + color: #2e6c8e; + text-align: center; + font-weight: 900; +} +body .progress_inner { + height: 200px; + width: 1000px; +} +body .progress_inner #step-5:checked + div { + width: 80%; +} +body .progress_inner #step-5:checked + div + div + div > .tab:nth-of-type(5) { + opacity: 1; + top: 0; +} +body .progress_inner #step-5:checked + div + div + div + div { + right: 10%; +} +body .progress_inner #step-4:checked + input + div { + width: 60%; +} +body .progress_inner #step-4:checked + input + div + div + div > .tab:nth-of-type(4) { + opacity: 1; + top: 0; +} +body .progress_inner #step-4:checked + input + div + div + div + div { + right: 30%; +} +body .progress_inner #step-3:checked + input + input + div { + width: 40%; +} +body .progress_inner #step-3:checked + input + input + div + div + div > .tab:nth-of-type(3) { + opacity: 1; + top: 0; +} +body .progress_inner #step-3:checked + input + input + div + div + div + div { + right: 50%; +} +body .progress_inner #step-2:checked + input + input + input + div { + width: 20%; +} +body .progress_inner #step-2:checked + input + input + input + div + div + div > .tab:nth-of-type(2) { + opacity: 1; + top: 0; +} +body .progress_inner #step-2:checked + input + input + input + div + div + div + div { + right: 70%; +} +body .progress_inner #step-1:checked + input + input + input + input + div { + width: 0%; +} +body .progress_inner #step-1:checked + input + input + input + input + div + div + div > .tab:nth-of-type(1) { + opacity: 1; + top: 0; +} +body .progress_inner #step-1:checked + input + input + input + input + div + div + div + div { + right: 90%; +} +body .progress_inner__step:nth-of-type(1):before { + content: "1"; +} +body .progress_inner__step:nth-of-type(2):before { + content: "2"; +} +body .progress_inner__step:nth-of-type(3):before { + content: "3"; +} +body .progress_inner__step:nth-of-type(4):before { + content: "4"; +} +body .progress_inner__step:nth-of-type(5):before { + content: "5"; +} +body .progress_inner__step:nth-of-type(6):before { + content: "6"; +} +body .progress_inner__bar--set { + width: 80%; + top: -6px; + background: #70afd0; + position: relative; + z-index: -2; +} +body .progress_inner__tabs .tab { + opacity: 0; + position: absolute; + top: 40px; + text-align: center; + margin-top: 80px; + box-shadow: 0px 2px 1px #80b7d5; + padding: 30px; + background: white; + border-radius: 10px; + -webkit-transition: all .2s; + transition: all .2s; +} +body .progress_inner__tabs .tab h1 { + margin: 0; +} +body .progress_inner__tabs .tab p { + font-weight: 400; + opacity: 0.8; +} +body .progress_inner__status { + width: 40px; + height: 40px; + top: -65px; + -webkit-transition: right 800ms cubic-bezier(0.915, 0.015, 0.3, 1.005); + transition: right 800ms cubic-bezier(0.915, 0.015, 0.3, 1.005); + -webkit-transform: translateX(50%); + transform: translateX(50%); + position: absolute; +} +body .progress_inner__status div { + opacity: 0; + -webkit-transition: all 600ms cubic-bezier(0.915, 0.015, 0.3, 1.005); + transition: all 600ms cubic-bezier(0.915, 0.015, 0.3, 1.005); + -webkit-transition-delay: 300ms; + transition-delay: 300ms; +} +body .progress_inner__status div { + position: absolute; +} +body .progress_inner__status .box_base { + background: -webkit-repeating-linear-gradient(45deg, #986c5d, #986c5d 2px, #775144 2px, #775144 4px); + background: repeating-linear-gradient(45deg, #986c5d, #986c5d 2px, #775144 2px, #775144 4px); + width: 36px; + height: 40px; + z-index: 1; + border-radius: 1px; +} +body .progress_inner__status .box_lid { + width: 40px; + height: 13.33333px; + background: #775144; + z-index: 2; + border-radius: 1px; + top: 0; +} +body .progress_inner__status .box_item { + width: 20px; + height: 20px; + background: #be69d2; + z-index: 0; + border-radius: 4px; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); +} +body .progress_inner__status .box_ribbon { + width: 10px; + height: 42px; + background: #ee0f29; + z-index: 4; + border-radius: 1px; +} +body .progress_inner__status .box_bow__left, body .progress_inner__status .box_bow__right { + width: 6px; + height: 10px; + background: #be0c21; + position: absolute; + z-index: 3; + opacity: 1; + border-radius: 1px; +} +body .progress_inner__status .box_bow { + top: -6px; + z-index: 1; + -webkit-transition-delay: 500ms; + transition-delay: 500ms; +} +body .progress_inner__status .box_bow__left { + left: 6px; + -webkit-transform: rotate(45deg); + transform: rotate(45deg); +} +body .progress_inner__status .box_bow__right { + left: -4px; + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); +} +body .progress_inner__status .box_tag { + width: 20px; + height: 10px; + background: #487ac7; + z-index: 4; + -webkit-transform: rotate(-10deg) translateX(-40px) translateY(0px); + transform: rotate(-10deg) translateX(-40px) translateY(0px); + border-radius: 2px; + -webkit-transition-delay: 500ms; + transition-delay: 500ms; +} +body .progress_inner__status .box_string { + width: 17px; + height: 2px; + background: #343434; + z-index: 4; + -webkit-transform: rotate(-39deg) translateX(-22px) translateY(-12px); + transform: rotate(-39deg) translateX(-22px) translateY(-12px); +} +body .progress_inner input[type="radio"] { + display: none; +} +.step_header{ + text-align: left; + padding-left:7%; +} +.step_header img{ + height: 30px; + width: 30px; +} + +.success_wrapper{ + margin-top: 30px; + text-align: center; +} +.success_img{ + display: inline-block; +} +.success_img img{ + vertical-align: baseline; +} +.success_text{ + text-align: left; + display: inline-block; + margin-left: 14px; +} +.success_text2{ + font-family: PingFangSC-Regular; + font-size: 15px; + color: #8B919D; + letter-spacing: 0px; +} +.success_content{ + margin-top: 50px; + font-family: PingFangSC-Regular; + font-size: 15px; + color: #8B919D; + letter-spacing: 0px; +} +.content_align{ + margin:0 auto; + width:50%; + text-align:left; +} +.margin-bottom2{ + margin-top: 120px; +} +.agree-text{ + font-family: SanFranciscoText-Regular; + font-size: 15px; + color: #FF6600; + letter-spacing: 0px; +} +.agree-to{ + border: 1px solid #FF6600; + padding: 6px 8px 6px 8px; + color: grey; + cursor: pointer; +} +.agree_left{ + text-align: left; +} +body .dis_before:nth-child(1):before{ + background: #1ea4ec; +} +body .dis_before:nth-child(2):before{ + background: #1ea4ec; +} +body .dis_before:nth-child(3):before{ + background: #1ea4ec; +} +body .dis_before:nth-child(4):before{ + background: #1ea4ec; +} +body .dis_before:nth-child(5):before { + background: #1ea4ec; + } +/*.progress_inner__step:before{ + background: #1ea4ec; +} +.step_submit_color{ + color: white; + +}*/ + + diff --git a/src/main/ui/static/images/step/gou.png b/src/main/ui/static/images/step/gou.png new file mode 100644 index 0000000000000000000000000000000000000000..f4a81919afecf302160917ec3afb445862dea74a GIT binary patch literal 2689 zcmV-{3V!v8P){oH=ECY0Yyk@4 z8jS0vK;aw!tAe9XpdH;}tKN@+Yd8*s699DoyzAoG_g4T92pFgeWU}1MLR^9QeK6X) zG5PE=&$1eT?!}~!DZd72K!k3YhMK&VnFRosc-(#;9Pb7upPlzvRszr+e|`;2PwF)9 zc{?(#JTqTnYx^`f++B4vbv>ZueXIhYNy5i0O(#!-h%m{32%JX3(0`+6HaaM z6KVxOj`7Uz+93RzMF7t5&^fK!N2mpW(5ruXXRAk_^%m>;dpL90Iu3@vTr93;=KP%K>d_NT>t=DgKY& zJ`&M>xo+@RGqbP+mH7qQ0qCCJ3en$r@%6#Wgp=T~cdGA>%R6ZWAQYcIdS_3+RKht7 zMtg5`-&q>~UVPostlzH+2($p;#jjrc$P7WNB`6I*=AMW`s72s?x4p^e+8poj#O%#4ZwIJ7IIp-AycJ+Z7svhzo`U>HUi)sKX>s_ zbqF^DFrIw$%eWnefbcRn>|JkaK`H<7sa}t26?aH1VwiKz1X|-w?p_IFmj6=|5 z@#E3JdI3<_yJi}KHi$1En1_R{2f(ByXp8vv0HCmWac;7zwghbwKL&ugB}qx1chW+| zG!MNh2-+q-GyV%ky&cidwFiRorZ>|KLEFT)E)FoCmH@1r^HvuGZ4}>10P29Ct>PyH zg6zozVrn>Ov-lwZ%giCxeGaY~g0_pl_BmM2v&XkL1o~AaK5n8+RSwHs zrW*n;{_@q0ZWXtBRj@7yy!fkjJ7HCDy}_VO!%A5Qy!flV8w~=|4var<61Yj&O6wM;nH^Jm0A!ACZS+MgRJ zF9fO`+ZOS|Dd1`n=}3M6H`2rChM-O21Ni!7*y~1LjOg}oXL1AUf}myMi~RsA32#DT9lOW9^oo|V8lGo8}O8F%3KNSGkVds;3oA&4B6+)hD|PejMjt=|5GIfIR={Bhvflp0Y2eCG;C%sylf$T)NICMqU-ktz#k`<)teUl zJ?pICLKeVJ3oTGqp$e*wpHd(w>3MDcqNbohZAJ3#f5;33rM0B%50r8HH& zSgYCBHVa6ry^j{E>Z(+(GV!(g0Dg+7BxbHca-L7ygWzyitj(AK z*Vhifa#;9&M8pS8o-)pazpTsLC&6L`01Im%W(z+)9TDNENgzn!2`47KdsWL|6##J% z035jNBZ$;2*ut5O!q5BKN&uqticIEUJ|K|Da9ztm(yDKhC?~_Wpi4Y-F6(seRO@U# z0IOEv+W??}ZBt0OJPULMOvU(KyJM#+z9{Dm0P#ji%P>VBggyZ;@-(_^St&U2H5k{} z+P<#xV@=t*W?kX{1X_G5<04 v!_;vpKcX8Di-g$#I`=NW*;#M?{O|t*H6u>jbVF#)00000NkvXXu0mjfe5x2^ literal 0 HcmV?d00001 diff --git a/src/main/ui/static/images/step/num1_1.png b/src/main/ui/static/images/step/num1_1.png new file mode 100644 index 0000000000000000000000000000000000000000..e4a8e24962f35e91794d5bdf9cad4ecfa19443ff GIT binary patch literal 2413 zcmV-z36l1SP)A{}oySSm@FF!Gi~&;1GBKJOBlkK*5La zEr180;1VeK@Vy1_0JtfE@~6u!pxKK6p$-IP0@!^VDQzL(*8Io`=n4R@?*9(~27oXP z3HpGgpVNcwhrhWbF()iQ`Q)+;YqM8D0Cgg&BjTL0lT#NF4G^&(hR}!G()a1n_B6S- z=kq3O0VsEdyFq|&D5Sl#6fRRq1Vn)6VMt%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FW|W~)rE3#R{&5A{bE~y$QS4g8=RZCxDHt!?OXvMmybr> zC5G(2Ji-M4bk}~ZM9|_awfzP$7XVO6`#xu7wVc5D7umc?WIX_Re>yhu1;odr*JlG8 z&kx!RfH?O@H>F*b&%>l*0U`(tzf5|WgK0AW+=?HWa~*pLxc>oH>jq^4%;oRQi=a7u zOAG)Pw~ILf%(_jSm_M~8;QqxTDnObI5a5rj1yh9IBY?jNOS^GC7oW&pz$#(e>JQie zP*UrDBALLI5IB$}G!2M2*}hd{Nz?~$B|l)A@>PmFRr{VA0HPzC-C+*^->G)Wx1W~) zosFBdMp`mS6#x%GT(zaEe9^nq0q_v$LXf`lGXo%kpyTdMBf2VH`dk7zer}&Ku>cQw z0v{bn^^%sizwC!I1weE{%1)+T?k z&$$B-K_I?PzCJqygb#6qYR$6*$Kg%sG;T3R65}-jfQKmIZZ}alh)#Z`OcZbumKu4i z^~OX29BM_$IRds_Sr#HEkKlCLs`WVI&$5kC7GQDU;sg>Bv~9HrcQYQ^(}QY1OQov( zmeBw_E)AnPhH!`oZ&U`CS6gvPmjXC7S@HL>u>ybx5Kb=3urX^OkXRy&y0|hj^MF0L zF7-@s?zr$<1;G5EqC1NK_Xwe$*AgL2JQDQ7pwu(TvEwRVw6hj~Con{o;oo{dP$vxQ zX;}v`%aMY9h|q`Y-}*MqbgQBO6@r(w73pSx*;Wuj9RSOO^muPB!Pa7gAr4vq!qvmt zNH_qXX&68spmb&H4428$2@4<_r2qSJ33vbsPKO7;15j`Y6nyyJ0(bxlE`fp%-&+6= fK*1$Y@ZtXlKPUgaiheEK00000NkvXXu0mjfYtAeS literal 0 HcmV?d00001 diff --git a/src/main/ui/static/images/step/num1_2.png b/src/main/ui/static/images/step/num1_2.png new file mode 100644 index 0000000000000000000000000000000000000000..c009a6baa8b20515cf59fbf8bc8038b5003d9540 GIT binary patch literal 2845 zcmV+&3*z*NP)YE5NLPylKoi2^)xg zXD`IJ>m9Z2VEekQQn$KQ-K`8`Nv*2-RDU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 0 HcmV?d00001 diff --git a/src/main/ui/static/images/step/num1_4.png b/src/main/ui/static/images/step/num1_4.png new file mode 100644 index 0000000000000000000000000000000000000000..e1b9e40285e180860fd34c74c9879191b1751223 GIT binary patch literal 2607 zcmV+~3efe5P)?BIE>dP5@chS;jd*$O+<{0A_3FJ;(*X zvm1h^Yn~cRj0dBVTHX3+vBdo$m45oGs`Swa@vqVrz)IIXRvsb%6^9@K5CN#T1u9+>}ypfdnGoBa;~P5@z& z5)1)rKPGz{x4(sCu^<$nesEfcmFcr2fff<95OJ=t%{3Phogm^cO<@REwQrL*8xwO+ zxAP=#0jT#zTSfqGg#@n=VB5uBv{)trI3k4ilfCB9_3}Cmz)i!yMSzy;hPrzPR1OURhOMaie27<24h(Y|0&`tlTy?4P`v<^VM|9u-FJqShaxq#jb3vVXvCr8|S zinz`y0Bim60RZe5Q8AC6d3fG#zOhwaD*%WzEv8qWU5n*yHA0p{NLF6j@C`}_Ad`He zkBCsWWpEeYO9T@_+%0=ZC>4NuZ?uyjesr+`Tq#pZv^(i+4$3M|X#m9WUZF`5y61b% zcM5lCUs?(PYrWA&K-|$TWfgBE8k~1FcZ;ri;Q++O&(VY>Ku{>{_NI*At(%h zwchtbKzeP!1o06B@6J2TLb9ZV01&->^UM|%9T*2d#Q6!(XY(eAPfP({n$8m#1>icv zH$9F?o?>9ll0`}FsmY9?Q2-jf(Q!=g7Ss5@d_p?8=xjbU^%i3QM5oVGlQ5n``2M`} z#KfrE+D)$O?a8lBY?jNYg?+$l}!LL`xwX%-EDmBBgy0FYvBLlxY48|DI_(I0>HeF3MA^t%LrSZI3DZa&xT7}@}YknPizewP3c zWyzBz)CQo@AD#N{_~kL2?I>Wr$BQLpy14-@0K|@+gy5^L?6`0r5q!DmG?#8Q6Io5! z*y@50FtcTf@LXpHk`@5IkNuhSU)I)_g-}^&yE+{_1c*xta2*in`2xxSgwXqCNt8x^ zEGDxWvb=yx3Xu5%8Y-X+K%+N4LWCDC$hb}!q|$#go5_g|T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g z)#=H)_gGhe`GSizhDcN4AUge(GF@Yf1)PMn9UEi4Gf@D?cw#aM0lT3L3z?Hga5(8~ z4mkBM^BSiVV6oz22NDu=eN}|(9uM8gUQ>FaXqk;Z|1PHi_!TyeTbRN=BD}C=D3$k$ zUAmOOq00?FtB)4|+=6g$T8Br|9Rw0Xgq4FUmw}MUJm3H>YXcXYJ1($Z0dU7*?2Wb( zz-@6*w5=gRNIVh@)1)?V$+6=$zPQd?0Pet$DZ{_5grG&3wu({*(aVvNVTv$>%io4R z^>nYI02P9l<`zDjt^-WhlT;ifk99)&^_e+>^~DH7BxV5NHWe$5iwB@dn!pgCcIImj zm)SB11&~!T{=VD-5rB%*5dnw*RNMj;uYOd32tdUxQ1R+V1&9Dt+yWJ^{(qc_(#)rU RvuFSS002ovPDHLkV1if=oPhuU literal 0 HcmV?d00001 diff --git a/src/main/ui/static/images/step/num1_5.png b/src/main/ui/static/images/step/num1_5.png new file mode 100644 index 0000000000000000000000000000000000000000..63524502e12b640e0e50423cd3b91bffa7434765 GIT binary patch literal 2946 zcmV-|3w`v7P)Se0##sTT>f$`cS;3GM#Iu4huQ*kZ z4S?_41w4IjNyf%_Y)k5vTC!U_Vo5EX^XdHQ9ElMBN=*SO_3Go|5dlzg5JUh(0F;~p zC0~A&01*Hsr$EVqN1&kO0-Aiz+sTFOvjyX08*_6tnHIis< zi2@7^baA`!d6gu?N&ukxv0o>~djj@C+(olf&@Ud^ZgAWZOvNhs|W%yXW?NmlGdQ{{Bvk)2nqngup^?QRo(F_=8hyn zdEU#s05?WX9 zY99=GWNumr0JcufKY?gJ^DN8Qk-2--+COQVnV*A&1%SXQ03!2qFn`?DF$kOi zVC&?28^rG|kRT4h_;A&%If;@w0YJ3&?PJ!JcVHa=!p~2@f7mBM95Ds`W;;$`6#%0M z-|$-u^0)!33>GDo7d9h?Rspbia{eubcik}m!6xLh>*mf2TVJsTfN1pDVu{8$OvhKv z=T;8UtN_4=-oI+ptjt}5+}cexJN+I3FSR@5Xl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*LNI2uf|Gxb&?Xix1RS3m58Ks8pUe{v z^!Xw`{sc_JR7Q1w%Xc0M-nO*W3pNh=^W2j3j#Kt%6R7C1W?8rT@F;i6uo>nQk>t0? z;|Q!xB8`CP5^fBjV^|2!)E!0vY!Z~nn4QWxk~*IvE_`pKoATS7?)=S`b{RabQvI4E^+G*7ZnYrR6iebn#i7UYT@Lexi^wnhb139dO~ z`a!q(n~Og%;~ydj!XFF$1A(X_{iS<_7Y&B4XE5sD-)}(~tLypKWCV%VSX>ZCPMWt= z8Rj2)6y{tnP5Xxg1*Wkj{{x%Ao)$GhexJ?{n%qX9uOKTDG3RnB;T-5DdFdM0z98)d P&;c~nv{lPg&_VwPVp`v8 literal 0 HcmV?d00001 diff --git a/src/main/ui/static/merchantapplication/merchant_application.js b/src/main/ui/static/merchantapplication/merchant_application.js new file mode 100644 index 000000000..3dc2f44da --- /dev/null +++ b/src/main/ui/static/merchantapplication/merchant_application.js @@ -0,0 +1,204 @@ +angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', ['$scope', '$http','$interval', function ($scope, $http,$interval) { + var countryMap = [{ + "label": "AUS", + "value": "AUS" + }, { + "label": "CHN", + "value": "CHN" + }]; + var stateMap = [ + { + "label": "ACT", + "value": "ACT" + }, + { + "label": "NSW", + "value": "NSW" + }, + { + "label": "NT", + "value": "NT" + }, + { + "label": "QLD", + "value": "QLD" + }, + { + "label": "SA", + "value": "SA" + }, + { + "label": "TAS", + "value": "TAS" + }, + { + "label": "VIC", + "value": "VIC" + }, + { + "label": "WA", + "value": "WA" + } + ]; + var industryMap = [ + { + "label": "综合商城 Integrated Store", + "value": 336 + }, + { + "label": "食品 Food", + "value": 335 + }, + { + "label": "化妆品 Cosmetics", + "value": 334 + }, + { + "label": "鞋包服饰 Clothes", + "value": 327 + }, + { + "label": "酒店行业 Hospitality industry", + "value": 328 + }, + { + "label": "数码电器 Electric appliances", + "value": 332 + }, + { + "label": "母婴 Baby and maternal products", + "value": 333 + }, + { + "label": "文具/办公用品 Office supplies", + "value": 337 + }, + { + "label": "机票行业 Airline tickets industry", + "value": 339 + }, + { + "label": "国际物流 International logistics", + "value": 330 + }, + { + "label": "教育行业 Education section", + "value": 329 + }, + { + "label": "其它服务行业 Other services industry", + "value": 331 + }, + { + "label": "其它货物贸易行业 Other goods trade industry", + "value": 338 + } + ]; + + function getQueryString(name) { + var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); + var r = window.location.search.substr(1).match(reg); + if (r != null)return unescape(r[2]); + return null; + } + + var from = getQueryString("from"); + + $scope.industries = angular.copy(industryMap); + $scope.states = angular.copy(stateMap); + $scope.countries = angular.copy(countryMap); + $scope.seconds = 6; + $scope.canClick=false; + $scope.description = "Send Code"; + + $scope.disabledArray = new Array(true, false, false, false, false); + $scope.chooseArray = new Array(true, false, false, false, false); + $scope.changeChoose = function (index) { + $scope.chooseArray = new Array(false, false, false, false, false); + $scope.chooseArray[index] = true; + $scope.disabledArray[index] = true; + }; + + $scope.goToLogin = function () { + $scope.seconds = $scope.seconds -1; + if ($scope.seconds == 0) { + location.href = '/login.html'; + } + }; + + $scope.partner = {}; + + if (from != null && from.toString().length == 1) { + $scope.partner.source = from; + } + $scope.validateForm = function (form,index) { + /* if (form.$invalid) { + angular.forEach(form, function (item, key) { + if (key.indexOf('$') < 0) { + item.$dirty = true; + } + }); + return; + }*/ + $scope.changeChoose(index); + + }; + + + $scope.getTestCode = function(){ + var second=59; + var timerHandler; + timerHandler =$interval(function(){ + if(second<=0){ + $interval.cancel(timerHandler); //当执行的时间59s,结束时,取消定时器 ,cancle方法取消 + second=59; + $scope.description="获取验证码"; + $scope.canClick=false; //因为 ng-disabled属于布尔值,设置按钮可以点击,可点击发送 + }else{ + $scope.description=second+"s后重发"; + second--; + $scope.canClick=true; + } + },1000) //每一秒执行一次$interval定时器方法 + }; + + $scope.sendVerificationCode = function () { + $scope.getTestCode(); + }; + + $scope.save = function (from,index) { + $scope.validateForm(from,index); + /* var timer = $interval(function(){ + $scope.goToLogin(); + },1000);*/ + } + + + + /* $scope.captchaImage = '/partners/application/captcha-image'; + $scope.changeCaptchaImage = function () { + $scope.captchaImage = '/partners/application/captcha-image?' + Math.floor(Math.random() * 100); + }; + $scope.save = function (form) { + if (form.$invalid) { + angular.forEach(form, function (item, key) { + if (key.indexOf('$') < 0) { + item.$dirty = true; + } + }); + return; + } + $scope.partner.company_name = $scope.partner.short_name; + $('#login-btn').attr('disabled', true); + $http.post('partners/application', $scope.partner).then(function (resp) { + alert("Registered merchant application has been submitted successfully"); + location.href = 'partner_register_success.html'; + //commonDialog.alert({title: 'Success', content: 'Registered merchant application has been submitted successfully', type: 'success'}); + }, function (resp) { + alert(resp.data.message); + $scope.resError = resp.data.message; + $scope.changeCaptchaImage(); + $('#login-btn').attr('disabled', false); + }); + };*/ +}]); \ No newline at end of file From 09976bbab9944c8e02dcfdd4b1e9f8226cfb8cf3 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Wed, 23 May 2018 13:42:54 +0800 Subject: [PATCH 03/49] tmp --- .../core/SimpleClientApplyService.java | 2 +- .../impls/SimpleClientApplyServiceImpl.java | 40 +++++++++++++++++++ .../web/SimpleClientApplyController.java | 2 +- .../merchants/beans/NewAccountBean.java | 10 +++++ src/main/resources/application.properties | 5 +++ 5 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java 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 008d754c4..9e02379d4 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 @@ -4,7 +4,7 @@ import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import com.alibaba.fastjson.JSONObject; public interface SimpleClientApplyService { - String getSMSVerifyCode(String codeKey); + String getSMSVerifyCode(String codeKey,String phoneNumber,String nationCode); JSONObject newAccount(NewAccountBean accountBean); 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 new file mode 100644 index 000000000..658c11e0d --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -0,0 +1,40 @@ +package au.com.royalpay.payment.manage.application.core.impls; + +import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; +import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; +import au.com.royalpay.payment.tools.utils.sms.SmsSingleSender; + +import com.alibaba.fastjson.JSONObject; + +import org.springframework.beans.factory.annotation.Value; + +public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { + + @Value("${royalpay.sms.appid}") + private int appId; + @Value("${royalpay.sms.appkey}") + private String appKey; + + private final SmsSingleSender smsSingleSender = new SmsSingleSender(appId,appKey); + + @Override + String getSMSVerifyCode(String codeKey,String phoneNumber,String nationCode){ +// smsSingleSender.sendWithParam(); + return null; + } + + @Override + public JSONObject newAccount(NewAccountBean accountBean) { + return null; + } + + @Override + public void deleteSMSVerifyCodeKey(String codeKey) { + + } + + @Override + public String partnerSignIn(JSONObject account) { + return null; + } +} 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 1a8a47e00..b7ad70d2d 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 @@ -21,7 +21,7 @@ public class SimpleClientApplyController { @RequestMapping(value = "/account/{codeKey}", method = RequestMethod.POST) public void registerAccount(@PathVariable String codeKey, @RequestBody @Valid NewAccountBean accountBean, Errors errors, HttpServletResponse response) throws Exception { HttpUtils.handleValidErrors(errors); - String codeValue = simpleClientApplyService.getSMSVerifyCode(codeKey); + String codeValue = simpleClientApplyService.getSMSVerifyCode(codeKey,accountBean.getContactPhone(),accountBean.getNation_code()); if (codeValue == null || !codeValue.equals(accountBean.getUsername())) { throw new Exception("Verification code has expired or is not correct"); } diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/NewAccountBean.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/NewAccountBean.java index ca16c3f56..4fd5f8981 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/NewAccountBean.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/NewAccountBean.java @@ -18,6 +18,8 @@ public class NewAccountBean { private String displayName; @JSONField(name = "contact_phone") private String contactPhone; + @JSONField(name = "nation_code") + private String nation_code = "+61"; private int role = PartnerRole.CASHIER.getCode(); public JSONObject toJson() { @@ -70,4 +72,12 @@ public class NewAccountBean { public void setContactPhone(String contactPhone) { this.contactPhone = contactPhone; } + + public String getNation_code() { + return nation_code; + } + + public void setNation_code(String nation_code) { + this.nation_code = nation_code; + } } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index bc53561d1..490a6d3f3 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -106,3 +106,8 @@ mail.mailgun.domain=mail.royalpay.com.au mail.mailgun.default.merchantlist=merchants@mail.royalpay.com.au +############## +##短信key +############## +royalpay.sms.appid=1400035361 +royalpay.sms.appkey=d6e7cc6400ecd159963c1972cdb088cf From 48cc6509c0ca6185eb97788a43a178dd6aa2d054 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Wed, 23 May 2018 14:09:56 +0800 Subject: [PATCH 04/49] tmp --- .../core/SimpleClientApplyService.java | 4 +- .../impls/SimpleClientApplyServiceImpl.java | 46 +++++++++++++++---- .../web/SimpleClientApplyController.java | 2 +- 3 files changed, 42 insertions(+), 10 deletions(-) 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 9e02379d4..00f5f5aaa 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 @@ -4,11 +4,13 @@ import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import com.alibaba.fastjson.JSONObject; public interface SimpleClientApplyService { - String getSMSVerifyCode(String codeKey,String phoneNumber,String nationCode); + String getSMSVerifyCode(String codeKey); JSONObject newAccount(NewAccountBean accountBean); void deleteSMSVerifyCodeKey(String codeKey); String partnerSignIn(JSONObject account); + + String getSmsCodeAndSend(); } 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 658c11e0d..56cbe39cb 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 @@ -1,12 +1,22 @@ package au.com.royalpay.payment.manage.application.core.impls; -import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; -import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; -import au.com.royalpay.payment.tools.utils.sms.SmsSingleSender; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; -import com.alibaba.fastjson.JSONObject; +import javax.annotation.Resource; +import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.lang3.time.DateFormatUtils; import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.redis.core.StringRedisTemplate; + +import com.alibaba.fastjson.JSONObject; + +import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; +import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; +import au.com.royalpay.payment.tools.env.SysConfigManager; +import au.com.royalpay.payment.tools.utils.sms.SmsSingleSender; public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { @@ -14,13 +24,18 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { private int appId; @Value("${royalpay.sms.appkey}") private String appKey; + @Resource + private SysConfigManager sysConfigManager; + @Resource + private StringRedisTemplate stringRedisTemplate; private final SmsSingleSender smsSingleSender = new SmsSingleSender(appId,appKey); - + // TODO: 2018/5/23 kira 模板申请通过后修改 + private final int REGISTER_CLIENT_TEMPLID = 123; + private final String REGISTER_CLIENT_PREFIX = "REGISTER_CLIENT"; @Override - String getSMSVerifyCode(String codeKey,String phoneNumber,String nationCode){ -// smsSingleSender.sendWithParam(); - return null; + public String getSMSVerifyCode(String codeKey){ + return null; } @Override @@ -37,4 +52,19 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { public String partnerSignIn(JSONObject account) { return null; } + + @Override + public String getSmsCodeAndSend(String phoneNumber,String nationCode) { + JSONObject sysConfig = sysConfigManager.getSysConfig(); + List param = new ArrayList<>(); + String register_client_key = REGISTER_CLIENT_PREFIX+RandomStringUtils.random(6, true, true); + param.add(register_client_key); + String expireMin = (String) sysConfig.getOrDefault("sms.verification.code.expire",3); + param.add(expireMin); + stringRedisTemplate.boundValueOps(register_client_key).set(register_client_key, Long.parseLong(expireMin), TimeUnit.MINUTES); + + param.add(DateFormatUtils.format(coupon.getDate("expiry"), "yyyy-MM-dd")); + smsSingleSender.sendWithParam(nationCode,phoneNumber,REGISTER_CLIENT_TEMPLID,,"","",""); + return register_client_key; + } } 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 b7ad70d2d..1a8a47e00 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 @@ -21,7 +21,7 @@ public class SimpleClientApplyController { @RequestMapping(value = "/account/{codeKey}", method = RequestMethod.POST) public void registerAccount(@PathVariable String codeKey, @RequestBody @Valid NewAccountBean accountBean, Errors errors, HttpServletResponse response) throws Exception { HttpUtils.handleValidErrors(errors); - String codeValue = simpleClientApplyService.getSMSVerifyCode(codeKey,accountBean.getContactPhone(),accountBean.getNation_code()); + String codeValue = simpleClientApplyService.getSMSVerifyCode(codeKey); if (codeValue == null || !codeValue.equals(accountBean.getUsername())) { throw new Exception("Verification code has expired or is not correct"); } From 543964051bbccfe716888f8be6b0495ac13a2938 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Wed, 23 May 2018 16:23:13 +0800 Subject: [PATCH 05/49] tmp --- .../core/SimpleClientApplyService.java | 8 +- .../impls/SimpleClientApplyServiceImpl.java | 92 +++++++++++++++---- .../web/SimpleClientApplyController.java | 22 ++++- .../templates/mail/register_application.html | 55 +++++++++++ 4 files changed, 154 insertions(+), 23 deletions(-) create mode 100644 src/main/resources/templates/mail/register_application.html 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 00f5f5aaa..147f63f4b 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 @@ -4,7 +4,7 @@ import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import com.alibaba.fastjson.JSONObject; public interface SimpleClientApplyService { - String getSMSVerifyCode(String codeKey); + void verifyRegisterSMSCode(String codeKey, String accountName); JSONObject newAccount(NewAccountBean accountBean); @@ -12,5 +12,9 @@ public interface SimpleClientApplyService { String partnerSignIn(JSONObject account); - String getSmsCodeAndSend(); + String getSmsCodeAndSend(String phoneNumber,String nationCode,String accountName); + + void sendVerifyEmail(String address,JSONObject client); + + String generateRegisterProcessKey(String accountName); } 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 56cbe39cb..b2fef1ed9 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 @@ -1,21 +1,28 @@ package au.com.royalpay.payment.manage.application.core.impls; import java.util.ArrayList; -import java.util.List; +import java.util.HashSet; +import java.util.Set; import java.util.concurrent.TimeUnit; import javax.annotation.Resource; import org.apache.commons.lang3.RandomStringUtils; -import org.apache.commons.lang3.time.DateFormatUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.StringRedisTemplate; +import org.thymeleaf.context.Context; +import org.thymeleaf.spring4.SpringTemplateEngine; import com.alibaba.fastjson.JSONObject; import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; +import au.com.royalpay.payment.manage.system.core.MailGunService; import au.com.royalpay.payment.tools.env.SysConfigManager; +import au.com.royalpay.payment.tools.exceptions.BadRequestException; +import au.com.royalpay.payment.tools.exceptions.ServerErrorException; +import au.com.royalpay.payment.tools.mail.SendMail; import au.com.royalpay.payment.tools.utils.sms.SmsSingleSender; public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { @@ -26,16 +33,27 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { private String appKey; @Resource private SysConfigManager sysConfigManager; + @Resource + private MailGunService mailGunService; + @Resource + private SpringTemplateEngine thymeleaf; @Resource private StringRedisTemplate stringRedisTemplate; - private final SmsSingleSender smsSingleSender = new SmsSingleSender(appId,appKey); - // TODO: 2018/5/23 kira 模板申请通过后修改 - private final int REGISTER_CLIENT_TEMPLID = 123; + private final SmsSingleSender smsSingleSender = new SmsSingleSender(appId, appKey); + private final int REGISTER_CLIENT_TEMPLID = 126008; private final String REGISTER_CLIENT_PREFIX = "REGISTER_CLIENT"; + private final String REGISTER_CLIENT_PHONE_EXPIRE_PREFIX = "REGISTER_CLIENT_PHONE_EXPIRE"; + @Override - public String getSMSVerifyCode(String codeKey){ - return null; + public void verifyRegisterSMSCode(String codeKey,String accountName) { + String rediskey = getRegisterClientRedisKey(accountName); + String codeValue = stringRedisTemplate.boundValueOps(rediskey).get(); + if (codeValue == null || !codeValue.equals(codeKey)) { + throw new BadRequestException("Verification code has expired or is not correct"); + } + stringRedisTemplate.delete(rediskey); +// stringRedisTemplate.delete(getRegisterClientPhoneExpireRedisKey(phoneNumber)); } @Override @@ -54,17 +72,59 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { } @Override - public String getSmsCodeAndSend(String phoneNumber,String nationCode) { + public String getSmsCodeAndSend(String phoneNumber, String nationCode,String accountName) { + String reidsCheckCodeKey = getRegisterClientPhoneExpireRedisKey(phoneNumber); + String value = stringRedisTemplate.boundValueOps(reidsCheckCodeKey).get(); + if (StringUtils.isNotEmpty(value)) { + throw new BadRequestException("SMS has been sent,Please check your messages or try again in 3 minutes."); + } + JSONObject sysConfig = sysConfigManager.getSysConfig(); - List param = new ArrayList<>(); - String register_client_key = REGISTER_CLIENT_PREFIX+RandomStringUtils.random(6, true, true); - param.add(register_client_key); - String expireMin = (String) sysConfig.getOrDefault("sms.verification.code.expire",3); + ArrayList param = new ArrayList<>(); + String registerClientKey = getRegisterClientRedisKey(accountName); + String registerClientCode = RandomStringUtils.random(6, true, true); + param.add(registerClientCode); + String expireMin = (String) sysConfig.getOrDefault("sms.verification.code.expire", 3); param.add(expireMin); - stringRedisTemplate.boundValueOps(register_client_key).set(register_client_key, Long.parseLong(expireMin), TimeUnit.MINUTES); + try { + smsSingleSender.sendWithParam(nationCode, phoneNumber, REGISTER_CLIENT_TEMPLID, param, "", "", ""); + } catch (Exception e) { + throw new ServerErrorException("System Error"); + } + stringRedisTemplate.boundValueOps(registerClientKey).set(registerClientCode, Long.parseLong(expireMin), TimeUnit.MINUTES); + stringRedisTemplate.boundValueOps(reidsCheckCodeKey).set(reidsCheckCodeKey, Long.parseLong(expireMin), TimeUnit.MINUTES); + + return registerClientCode; + } + + @Override + public void sendVerifyEmail(String address,JSONObject client) { + Context ctx = new Context(); + ctx.setVariable("url", url); + final String content = thymeleaf.process("mail/register_application", ctx); + - param.add(DateFormatUtils.format(coupon.getDate("expiry"), "yyyy-MM-dd")); - smsSingleSender.sendWithParam(nationCode,phoneNumber,REGISTER_CLIENT_TEMPLID,,"","",""); - return register_client_key; + SendMail sendMail = new SendMail(); + Set to = new HashSet<>(); + to.add(address); + sendMail.setMailTos(to); + sendMail.setFrom("info@mail.royalpay.com.au"); + sendMail.setTitle("Royalpay"); + sendMail.setContent(content); + sendMail.setTags(tags); + mailGunService.sendMail(sendMail); + } + + @Override + public String generateRegisterProcessKey(String accountName) { + + return null; + } + + private String getRegisterClientRedisKey(String accountName){ + return REGISTER_CLIENT_PREFIX +accountName; + } + private String getRegisterClientPhoneExpireRedisKey(String phoneNumber){ + return REGISTER_CLIENT_PHONE_EXPIRE_PREFIX +phoneNumber; } } 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 1a8a47e00..88b1fd437 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 @@ -19,15 +19,27 @@ public class SimpleClientApplyController { private SimpleClientApplyService simpleClientApplyService; @RequestMapping(value = "/account/{codeKey}", method = RequestMethod.POST) - public void registerAccount(@PathVariable String codeKey, @RequestBody @Valid NewAccountBean accountBean, Errors errors, HttpServletResponse response) throws Exception { + public void registerAccount(@PathVariable String codeKey, @RequestBody @Valid NewAccountBean accountBean, Errors errors, HttpServletResponse response) + throws Exception { HttpUtils.handleValidErrors(errors); - String codeValue = simpleClientApplyService.getSMSVerifyCode(codeKey); - if (codeValue == null || !codeValue.equals(accountBean.getUsername())) { - throw new Exception("Verification code has expired or is not correct"); - } + simpleClientApplyService.verifyRegisterSMSCode(codeKey,accountBean.getUsername()); + JSONObject account = simpleClientApplyService.newAccount(accountBean); simpleClientApplyService.deleteSMSVerifyCodeKey(codeKey); String statusKey = simpleClientApplyService.partnerSignIn(account); HttpUtils.setCookie(response, CommonConsts.CODE_KEY, statusKey); } + + +// @RequestMapping(value = "/account/mail/verify", method = RequestMethod.GET) +// public void registerAccount(@PathVariable String codeKey, @RequestBody @Valid NewAccountBean accountBean, Errors errors, HttpServletResponse response) +// throws Exception { +// HttpUtils.handleValidErrors(errors); +// simpleClientApplyService.verifyRegisterSMSCode(codeKey, accountBean.getContactPhone()); +// +// JSONObject account = simpleClientApplyService.newAccount(accountBean); +// simpleClientApplyService.deleteSMSVerifyCodeKey(codeKey); +// String statusKey = simpleClientApplyService.partnerSignIn(account); +// HttpUtils.setCookie(response, CommonConsts.CODE_KEY, statusKey); +// } } diff --git a/src/main/resources/templates/mail/register_application.html b/src/main/resources/templates/mail/register_application.html new file mode 100644 index 000000000..a3e88d8fd --- /dev/null +++ b/src/main/resources/templates/mail/register_application.html @@ -0,0 +1,55 @@ + + + + + + + \ No newline at end of file From 1842e10bb3a5b4961340b9f7e272be891f561f19 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Wed, 23 May 2018 17:58:05 +0800 Subject: [PATCH 06/49] tmp --- .../core/SimpleClientApplyService.java | 17 +- .../impls/SimpleClientApplyServiceImpl.java | 127 +++++++++----- .../web/SimpleClientApplyController.java | 46 +++-- .../resources/templates/mail/verify_mail.html | 158 ++++++++++++++++++ 4 files changed, 288 insertions(+), 60 deletions(-) create mode 100644 src/main/resources/templates/mail/verify_mail.html 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 147f63f4b..762a81c00 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 @@ -4,17 +4,22 @@ import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import com.alibaba.fastjson.JSONObject; public interface SimpleClientApplyService { - void verifyRegisterSMSCode(String codeKey, String accountName); + void verifyRegisterSMSCode(String codeKey, String phoneNumber); JSONObject newAccount(NewAccountBean accountBean); - void deleteSMSVerifyCodeKey(String codeKey); - String partnerSignIn(JSONObject account); - String getSmsCodeAndSend(String phoneNumber,String nationCode,String accountName); + String getAndSendSmsCode(String phoneNumber, String nationCode); + + String checkOrGenerateRegisterProcessKey(String accountName, String codeKey); + + void deleteRegisterProcessKey(String codeKey); + + void sendVerifyEmail(String address, int client_id); + + String checkOrGenerateVerifyMailKey(String address, String codeKey); - void sendVerifyEmail(String address,JSONObject client); + void deleteVerifyMailKey(String codeKey); - String generateRegisterProcessKey(String accountName); } 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 b2fef1ed9..c0cca8e03 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 @@ -1,29 +1,34 @@ package au.com.royalpay.payment.manage.application.core.impls; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.TimeUnit; +import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; +import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; +import au.com.royalpay.payment.manage.merchants.core.ClientManager; +import au.com.royalpay.payment.manage.system.core.MailGunService; +import au.com.royalpay.payment.tools.env.PlatformEnvironment; +import au.com.royalpay.payment.tools.env.SysConfigManager; +import au.com.royalpay.payment.tools.exceptions.BadRequestException; +import au.com.royalpay.payment.tools.exceptions.ServerErrorException; +import au.com.royalpay.payment.tools.mail.SendMail; +import au.com.royalpay.payment.tools.utils.sms.SmsSingleSender; -import javax.annotation.Resource; +import com.alibaba.fastjson.JSONObject; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.util.Assert; import org.thymeleaf.context.Context; import org.thymeleaf.spring4.SpringTemplateEngine; -import com.alibaba.fastjson.JSONObject; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; -import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; -import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; -import au.com.royalpay.payment.manage.system.core.MailGunService; -import au.com.royalpay.payment.tools.env.SysConfigManager; -import au.com.royalpay.payment.tools.exceptions.BadRequestException; -import au.com.royalpay.payment.tools.exceptions.ServerErrorException; -import au.com.royalpay.payment.tools.mail.SendMail; -import au.com.royalpay.payment.tools.utils.sms.SmsSingleSender; +import javax.annotation.PostConstruct; +import javax.annotation.Resource; public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { @@ -37,23 +42,31 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { private MailGunService mailGunService; @Resource private SpringTemplateEngine thymeleaf; + @Resource + private ClientManager clientManager; @Resource private StringRedisTemplate stringRedisTemplate; private final SmsSingleSender smsSingleSender = new SmsSingleSender(appId, appKey); private final int REGISTER_CLIENT_TEMPLID = 126008; private final String REGISTER_CLIENT_PREFIX = "REGISTER_CLIENT"; - private final String REGISTER_CLIENT_PHONE_EXPIRE_PREFIX = "REGISTER_CLIENT_PHONE_EXPIRE"; + private final String REGISTER_CLIENT_PROCESS_PREFIX = "REGISTER_CLIENT_PROCESS"; + private final String VERIFY_MAIL_PREFIX = "VERIFY_MAIL"; + private final List tags = new ArrayList<>(); + + @PostConstruct + public void init(){ + tags.add("account"); + } @Override - public void verifyRegisterSMSCode(String codeKey,String accountName) { - String rediskey = getRegisterClientRedisKey(accountName); + public void verifyRegisterSMSCode(String codeKey,String phoneNumber) { + String rediskey = getRegisterClientRedisKey(phoneNumber); String codeValue = stringRedisTemplate.boundValueOps(rediskey).get(); if (codeValue == null || !codeValue.equals(codeKey)) { throw new BadRequestException("Verification code has expired or is not correct"); } stringRedisTemplate.delete(rediskey); -// stringRedisTemplate.delete(getRegisterClientPhoneExpireRedisKey(phoneNumber)); } @Override @@ -61,19 +74,14 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { return null; } - @Override - public void deleteSMSVerifyCodeKey(String codeKey) { - - } - @Override public String partnerSignIn(JSONObject account) { return null; } @Override - public String getSmsCodeAndSend(String phoneNumber, String nationCode,String accountName) { - String reidsCheckCodeKey = getRegisterClientPhoneExpireRedisKey(phoneNumber); + public String getAndSendSmsCode(String phoneNumber, String nationCode) { + String reidsCheckCodeKey = getRegisterClientRedisKey(phoneNumber); String value = stringRedisTemplate.boundValueOps(reidsCheckCodeKey).get(); if (StringUtils.isNotEmpty(value)) { throw new BadRequestException("SMS has been sent,Please check your messages or try again in 3 minutes."); @@ -81,7 +89,6 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { JSONObject sysConfig = sysConfigManager.getSysConfig(); ArrayList param = new ArrayList<>(); - String registerClientKey = getRegisterClientRedisKey(accountName); String registerClientCode = RandomStringUtils.random(6, true, true); param.add(registerClientCode); String expireMin = (String) sysConfig.getOrDefault("sms.verification.code.expire", 3); @@ -91,19 +98,20 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { } catch (Exception e) { throw new ServerErrorException("System Error"); } - stringRedisTemplate.boundValueOps(registerClientKey).set(registerClientCode, Long.parseLong(expireMin), TimeUnit.MINUTES); - stringRedisTemplate.boundValueOps(reidsCheckCodeKey).set(reidsCheckCodeKey, Long.parseLong(expireMin), TimeUnit.MINUTES); - + stringRedisTemplate.boundValueOps(getRegisterClientRedisKey(phoneNumber)).set(registerClientCode,Long.parseLong(expireMin), TimeUnit.MINUTES); return registerClientCode; } @Override - public void sendVerifyEmail(String address,JSONObject client) { + public void sendVerifyEmail(String address,int client_id) { + JSONObject client= clientManager.getClientInfo(client_id); + if(client==null){ + throw new BadRequestException("Merchant not found"); + } + String key = checkOrGenerateVerifyMailKey(address,null); Context ctx = new Context(); - ctx.setVariable("url", url); + ctx.setVariable("url", PlatformEnvironment.getEnv().concatUrl("/register/account/mail/"+address+"/verify/" + key+"/jump")); final String content = thymeleaf.process("mail/register_application", ctx); - - SendMail sendMail = new SendMail(); Set to = new HashSet<>(); to.add(address); @@ -113,18 +121,59 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { sendMail.setContent(content); sendMail.setTags(tags); mailGunService.sendMail(sendMail); + } @Override - public String generateRegisterProcessKey(String accountName) { + public String checkOrGenerateRegisterProcessKey(String accountName, String codeKey) { + Assert.notNull(accountName,"accountName can't be null"); + if(StringUtils.isNotEmpty(codeKey)){ + String redisAccountName = stringRedisTemplate.boundValueOps(getRegisterClientProcessRedisKey(codeKey)).get(); + if(!accountName.equals(redisAccountName)){ + throw new BadRequestException("Data error,Please re-register for safety."); + }else { + return codeKey; + } + } + String key = RandomStringUtils.random(10, true, false); + stringRedisTemplate.boundValueOps(getRegisterClientProcessRedisKey(key)).set(accountName,1,TimeUnit.HOURS); + return key; + } - return null; + @Override + public void deleteRegisterProcessKey(String codeKey) { + stringRedisTemplate.delete(getRegisterClientProcessRedisKey(codeKey)); } - private String getRegisterClientRedisKey(String accountName){ - return REGISTER_CLIENT_PREFIX +accountName; + @Override + public String checkOrGenerateVerifyMailKey(String address, String codeKey){ + Assert.notNull(address,"address can't be null"); + if(StringUtils.isNotEmpty(codeKey)){ + String redisAddress = stringRedisTemplate.boundValueOps(getVerifyMailRedisKey(codeKey)).get(); + if(!address.equals(redisAddress)){ + throw new BadRequestException("Data error"); + }else { + return codeKey; + } + } + String key = RandomStringUtils.random(10, true, false); + stringRedisTemplate.boundValueOps(getRegisterClientProcessRedisKey(key)).set(address,1,TimeUnit.HOURS); + return key; + + } + + @Override + public void deleteVerifyMailKey(String codeKey) { + stringRedisTemplate.delete(getVerifyMailRedisKey(codeKey)); + } + + private String getRegisterClientRedisKey(String phoneNumber){ + return REGISTER_CLIENT_PREFIX +phoneNumber; + } + private String getRegisterClientProcessRedisKey(String codeKey){ + return REGISTER_CLIENT_PROCESS_PREFIX+codeKey; } - private String getRegisterClientPhoneExpireRedisKey(String phoneNumber){ - return REGISTER_CLIENT_PHONE_EXPIRE_PREFIX +phoneNumber; + private String getVerifyMailRedisKey(String codekey){ + return VERIFY_MAIL_PREFIX+codekey; } } 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 88b1fd437..4d724308c 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 @@ -4,42 +4,58 @@ import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.http.HttpUtils; + import com.alibaba.fastjson.JSONObject; + +import org.springframework.stereotype.Controller; import org.springframework.validation.Errors; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; -@RestController +@Controller @RequestMapping("/register") public class SimpleClientApplyController { @Resource private SimpleClientApplyService simpleClientApplyService; + @Resource @RequestMapping(value = "/account/{codeKey}", method = RequestMethod.POST) + @ResponseBody public void registerAccount(@PathVariable String codeKey, @RequestBody @Valid NewAccountBean accountBean, Errors errors, HttpServletResponse response) throws Exception { HttpUtils.handleValidErrors(errors); - simpleClientApplyService.verifyRegisterSMSCode(codeKey,accountBean.getUsername()); + simpleClientApplyService.verifyRegisterSMSCode(codeKey,accountBean.getContactPhone()); JSONObject account = simpleClientApplyService.newAccount(accountBean); - simpleClientApplyService.deleteSMSVerifyCodeKey(codeKey); String statusKey = simpleClientApplyService.partnerSignIn(account); HttpUtils.setCookie(response, CommonConsts.CODE_KEY, statusKey); } -// @RequestMapping(value = "/account/mail/verify", method = RequestMethod.GET) -// public void registerAccount(@PathVariable String codeKey, @RequestBody @Valid NewAccountBean accountBean, Errors errors, HttpServletResponse response) -// throws Exception { -// HttpUtils.handleValidErrors(errors); -// simpleClientApplyService.verifyRegisterSMSCode(codeKey, accountBean.getContactPhone()); -// -// JSONObject account = simpleClientApplyService.newAccount(accountBean); -// simpleClientApplyService.deleteSMSVerifyCodeKey(codeKey); -// String statusKey = simpleClientApplyService.partnerSignIn(account); -// HttpUtils.setCookie(response, CommonConsts.CODE_KEY, statusKey); -// } + @RequestMapping(value = "/account/mail/{address}/verify/{codeKey}/jump", method = RequestMethod.GET) + public ModelAndView jumpVerifyMail(@PathVariable String codeKey, @PathVariable String address){ + simpleClientApplyService.checkOrGenerateVerifyMailKey(address,codeKey); + ModelAndView view = new ModelAndView("verify_mail"); + view.addObject("codeKey", codeKey); + return view; + } + + @RequestMapping(value = "/account/mail/{address}/verify/{codeKey}", method = RequestMethod.POST) + @ResponseBody + public void verifyMail(@PathVariable String codeKey, @PathVariable String address,@RequestBody JSONObject account){ + simpleClientApplyService.checkOrGenerateVerifyMailKey(address,codeKey); + + ModelAndView view = new ModelAndView("verify_mail"); + view.addObject("codeKey", codeKey); + + simpleClientApplyService.deleteVerifyMailKey(codeKey); + } } diff --git a/src/main/resources/templates/mail/verify_mail.html b/src/main/resources/templates/mail/verify_mail.html new file mode 100644 index 000000000..37ce3c593 --- /dev/null +++ b/src/main/resources/templates/mail/verify_mail.html @@ -0,0 +1,158 @@ + + + + + + RoyalPay | Reset Password + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 15fe2c59fb1204a59b76956dbd337e9749c784c6 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Wed, 23 May 2018 18:11:05 +0800 Subject: [PATCH 07/49] add verify mail & SMS code --- .../impls/SimpleClientApplyServiceImpl.java | 2 +- .../web/SimpleClientApplyController.java | 13 ++++++---- .../signin/core/SignInAccountService.java | 2 ++ .../core/impls/SignInAccountServiceImpl.java | 7 +++++ .../resources/templates/mail/verify_mail.html | 26 ++++++++++++------- 5 files changed, 35 insertions(+), 15 deletions(-) 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 c0cca8e03..52f322a93 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 @@ -151,7 +151,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { if(StringUtils.isNotEmpty(codeKey)){ String redisAddress = stringRedisTemplate.boundValueOps(getVerifyMailRedisKey(codeKey)).get(); if(!address.equals(redisAddress)){ - throw new BadRequestException("Data error"); + throw new BadRequestException("Mail expired"); }else { return codeKey; } 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 4d724308c..2d666d8ce 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 @@ -2,6 +2,8 @@ package au.com.royalpay.payment.manage.application.web; import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; +import au.com.royalpay.payment.manage.signin.beans.LoginInfo; +import au.com.royalpay.payment.manage.signin.core.SignInAccountService; import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.http.HttpUtils; @@ -26,7 +28,7 @@ public class SimpleClientApplyController { @Resource private SimpleClientApplyService simpleClientApplyService; @Resource - + private SignInAccountService signInAccountService; @RequestMapping(value = "/account/{codeKey}", method = RequestMethod.POST) @ResponseBody public void registerAccount(@PathVariable String codeKey, @RequestBody @Valid NewAccountBean accountBean, Errors errors, HttpServletResponse response) @@ -45,6 +47,7 @@ public class SimpleClientApplyController { simpleClientApplyService.checkOrGenerateVerifyMailKey(address,codeKey); ModelAndView view = new ModelAndView("verify_mail"); view.addObject("codeKey", codeKey); + view.addObject("address", address); return view; } @@ -52,10 +55,10 @@ public class SimpleClientApplyController { @ResponseBody public void verifyMail(@PathVariable String codeKey, @PathVariable String address,@RequestBody JSONObject account){ simpleClientApplyService.checkOrGenerateVerifyMailKey(address,codeKey); - - ModelAndView view = new ModelAndView("verify_mail"); - view.addObject("codeKey", codeKey); - + LoginInfo loginInfo = new LoginInfo(); + loginInfo.setLoginId(account.getString("userName")); + loginInfo.setPassword(account.getString("password")); + signInAccountService.accountCheck(loginInfo); simpleClientApplyService.deleteVerifyMailKey(codeKey); } } diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java index 7d8920447..0cdaa4683 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java @@ -17,6 +17,8 @@ public interface SignInAccountService { JSONObject managerLoginCheck(LoginInfo loginInfo); + JSONObject accountCheck(LoginInfo loginInfo); + JSONObject clientLoginCheck(LoginInfo loginInfo); void changeManagerPassword(JSONObject manager, ChangePwdBean change); diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java index fd25de569..42b3d7849 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java @@ -166,6 +166,13 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati return account; } + @Override + public JSONObject accountCheck(LoginInfo loginInfo) { + JSONObject account = managerMapper.findAvailableByLoginId(loginInfo.getLoginId()); + validLoginInfo(loginInfo, account); + return account; + } + private void validLoginInfo(LoginInfo loginInfo, JSONObject account) { if (account == null) { throw new BadRequestException(LocaleSupport.localeMessage("error.login.password")); diff --git a/src/main/resources/templates/mail/verify_mail.html b/src/main/resources/templates/mail/verify_mail.html index 37ce3c593..e038622e9 100644 --- a/src/main/resources/templates/mail/verify_mail.html +++ b/src/main/resources/templates/mail/verify_mail.html @@ -78,14 +78,19 @@ +
+ + +
+
-
+
@@ -105,6 +110,9 @@ + - +