diff --git a/pom.xml b/pom.xml index c54dd8186..cbfe662f4 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 1.1.2 - 1.0.23 + 1.0.24 diff --git a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java index 8f2f4c2be..0d40d8a79 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/beans/ClientPreApplyBean.java @@ -53,6 +53,9 @@ public class ClientPreApplyBean { private String codeKey; private boolean agree; private String nation_code; + private String client_pay_type; + private String client_pay_desc; + public JSONObject insertObject() { JSONObject res = (JSONObject) JSON.toJSON(this); @@ -234,4 +237,20 @@ public class ClientPreApplyBean { public void setNation_code(String nation_code) { this.nation_code = nation_code; } + + public void setClient_pay_type(String client_pay_type) { + this.client_pay_type = client_pay_type; + } + + public void setClient_pay_desc(String client_pay_desc) { + this.client_pay_desc = client_pay_desc; + } + + public String getClient_pay_type() { + return client_pay_type; + } + + public String getClient_pay_desc() { + return client_pay_desc; + } } 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 eda1415b7..e61854e5f 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 @@ -378,6 +378,10 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { clientConfig.put("client_moniker", clientMoniker); clientConfig.put("clean_days", apply.getIntValue("clean_days")); clientConfig.put("common_sub_merchant_id", 1); + if (StringUtils.isNotBlank(apply.getString("client_pay_type")) && StringUtils.isNotBlank(apply.getString("client_pay_desc"))) { + clientConfig.put("client_pay_type", apply.getString("client_pay_type")); + clientConfig.put("client_pay_desc", apply.getString("client_pay_desc")); + } clientConfigMapper.save(clientConfig); apply.put("client_moniker", clientMoniker); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java index 94a7e4227..99b8288a4 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientApplyImpl.java @@ -26,6 +26,7 @@ import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; @@ -217,6 +218,10 @@ public class ClientApplyImpl implements ClientApply, ApplicationEventPublisherAw clientMapper.save(partner); JSONObject clientConfig = new JSONObject(); + if (StringUtils.isNotBlank(apply.getString("client_pay_type")) && StringUtils.isNotBlank(apply.getString("client_pay_desc"))) { + clientConfig.put("client_pay_type", apply.getString("client_pay_type")); + clientConfig.put("client_pay_desc", apply.getString("client_pay_desc")); + } clientConfig.put("client_id",partner.getIntValue("client_id")); clientConfig.put("client_moniker",info.getClientMoniker()); clientConfigService.save(clientConfig); diff --git a/src/main/ui/merchant_application.html b/src/main/ui/merchant_application.html index e932ae63a..6842c7812 100644 --- a/src/main/ui/merchant_application.html +++ b/src/main/ui/merchant_application.html @@ -400,14 +400,126 @@ - +
+
Merchant Payment Scenario
+
+
+
+ + +
+ +
+ +
+
+ +
+
+
+
+ +
diff --git a/src/main/ui/static/merchantapplication/merchant_application.js b/src/main/ui/static/merchantapplication/merchant_application.js index 1cee2109e..9872b7f12 100644 --- a/src/main/ui/static/merchantapplication/merchant_application.js +++ b/src/main/ui/static/merchantapplication/merchant_application.js @@ -229,6 +229,53 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', } }; + $scope.partner.client_pay_type = []; + $scope.partner.client_pay_desc = []; + var resetClientPayDescByTpey = function (type) { + type = parseInt(type); + if (type == 1) { + while (parseInt($scope.partner.client_pay_desc[0]) < 6) { + $scope.partner.client_pay_desc.splice(0, 1); + } + } + if (type == 2) { + while (parseInt($scope.partner.client_pay_desc[$scope.partner.client_pay_desc.length-1]) > 5) { + $scope.partner.client_pay_desc.splice($scope.partner.client_pay_desc.length-1, 1); + } + } + }; + + var compare = function (x, y) { + x = parseInt(x); + y = parseInt(y); + if (x < y) { + return -1; + } else if (x > y) { + return 1; + } else { + return 0; + } + } + $scope.toggleClientPayType = function (type) { + var $idx = $scope.partner.client_pay_type.indexOf(type); + if ($idx >= 0) { + $scope.partner.client_pay_type.splice($idx, 1); + resetClientPayDescByTpey(type); + } else { + $scope.partner.client_pay_type.push(type); + $scope.partner.client_pay_type.sort(compare); + } + }; + $scope.toggleClientPayDesc = function (type) { + var $idx = $scope.partner.client_pay_desc.indexOf(type); + if ($idx >= 0) { + $scope.partner.client_pay_desc.splice($idx, 1); + } else { + $scope.partner.client_pay_desc.push(type); + $scope.partner.client_pay_desc.sort(compare); + } + }; + $scope.saveStep1 = function (form,index) { alert('Do not forget your login id ('+$scope.partner.contact_phone+') and password'); $scope.initErrorMsg(); @@ -269,6 +316,33 @@ angular.module('applyPartnerApp', ['ngMessages']).controller('applyPartnerCtrl', alert("Company Name包含敏感词汇,请检查后重新提交!"); return; } + if ($scope.partner.client_pay_type.length==0) { + alert('请选择商户支付场景') + return; + } + if ($scope.partner.client_pay_desc.length==0) { + alert('请选择商户支付方式') + return; + } + if ($scope.partner.client_pay_type.indexOf('1') >= 0 && $scope.partner.client_pay_type.indexOf('2') >= 0) { + var fristDesc = $scope.partner.client_pay_desc[0]; + var lastDesc = $scope.partner.client_pay_desc[($scope.partner.client_pay_desc.length - 1)]; + if (parseInt(fristDesc) > 5 || parseInt(lastDesc) < 6) { + alert("请检查线上/线下支付场景是否已选择支付方式") + return; + } + } + if ($scope.partner.client_pay_desc.indexOf('8') >= 0) { + var lastDesc = $scope.partner.client_pay_desc[($scope.partner.client_pay_desc.length - 1)]; + if (parseInt(lastDesc) < 10) { + alert("请检查线下支付是否已选择收银系统类型") + return; + } + } + if ($scope.partner.client_pay_type instanceof Array) { + $scope.partner.client_pay_type = $scope.partner.client_pay_type.join(','); + $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.join(','); + } $http.post('/register/info/update/' + $scope.partner.username, $scope.partner).then(function (resp) { if (index == 3) { $scope.getRateConfig(); diff --git a/src/main/ui/static/payment/partner/templates/simple_application_detail.html b/src/main/ui/static/payment/partner/templates/simple_application_detail.html index e0c14b56e..5312ad1bb 100644 --- a/src/main/ui/static/payment/partner/templates/simple_application_detail.html +++ b/src/main/ui/static/payment/partner/templates/simple_application_detail.html @@ -234,6 +234,102 @@
+
+
Merchant Payment Scenario
+
+
+
+ +
+ + +
+
+
+ +
+ + + + + +
+
+
+
+ +
+ + + + +
+
+
+
+
+ +
+ + + + +
+
+
+
+
+