【R】自助进件业务接口开发

master
liuxinxin 5 years ago
parent 3546e8e3b7
commit b6cff2105c

@ -5286,12 +5286,22 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
List<JSONObject> clientFiles = clientFilesMapper.findClientFile(client.getIntValue("client_id"));
if (clientFiles == null || clientFiles.equals("")) {
throw new BadRequestException("The Compliance File Must Be Uploaded!");
throw new BadRequestException("The Compliance File Must Be Uploaded!");
}
JSONObject account = getBankAccountByClientId(client.getIntValue("client_id"));
if (account == null) {
throw new BadRequestException("The Partner's Bank Account is not config!");
}
JSONObject representativeInfo = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id"));
for(String str:representativeInfo.keySet()){
if(representativeInfo.getString(str) == null || !(representativeInfo.getString(str).length()>0)|| !(client.getString("contact_job")!=null && client.getString("contact_job").length()>0)) {
throw new BadRequestException("The LegalPersonInfo is not config!");
}
}
if ( !(StringUtils.isNotBlank(client.getString("client_pay_type"))) || !(StringUtils.isNotBlank(client.getString("client_pay_desc"))) ) {
throw new BadRequestException("Merchant Payment Scenario is not config!");
}
int open_status_from = client.getIntValue("open_status");
OpenStatusModify openStatusModify = new OpenStatusModify(client_account, client_moniker, 4);
if ((client.getIntValue("source") == 1 || client.getIntValue("source") == 2) && client.getIntValue("approve_result") == 2) {

@ -13,6 +13,8 @@
<!-- Bootstrap 3.3.5 -->
<link href="static/css/merchant_application.css" rel="stylesheet">
<link href="static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="static/commons/css/multiLevelSelect.css" rel="stylesheet">
<!-- Font Awesome -->
<link href="static/lib/font-awesome-4.6.3/css/font-awesome.min.css" rel="stylesheet">
<!-- Font Awesome -->
@ -34,6 +36,7 @@
<script type="text/javascript" src="/static/lib/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/static/lib/blocs.min.js"></script>
<script type="text/javascript" src="/static/lib/ngfileupload/ng-file-upload.min.js"></script>
<script src="/static/lib/angular-plugins/ui-bootstrap-tpls-1.2.4.min.js"></script>
<script type="text/javascript" src="/static/merchantapplication/merchant_application.js"></script>
<style type="text/css">
.register-box-bg {
@ -119,6 +122,31 @@
background-color: #f7bf90;
border-color: #adadad;
}
@keyframes myfirst {
0% {
transform: rotateY(1deg);
}
100% {
transform: rotateY(90deg);
}
}
div.polaroid {
text-align: center;
}
div.rotate_left {
position: fixed;
width: 200px;
margin: 0 -100px;
top: 40%;
left: 50%;
z-index: 9999999;
}
.dh {
animation: myfirst 1s linear 0s infinite alternate;
}
</style>
<script>
var _hmt = _hmt || [];
@ -142,6 +170,8 @@
<div class="pace-activity"></div>
</div>
<div id="loading" style="width:100%;height:100%;display:none"></div>
<div id="main">
<div id="page-index" class="register-page">
<nav id="header" class="navbar navbar-dark navbar-full navbar-bg">
@ -201,6 +231,15 @@
</ul>
</div>
</nav>
<div class="polaroid" id="loading_logo" style="display: none">
<div class="rotate_left">
<img class="dh" src="static/images/r_logo.svg" alt="RoyalPay" style="width:150px;height:150px;margin-top: 10%;
margin-bottom: 10%;"/>
<p style="color: #666">To Be The Best QRCode Payment Service Provider!</p>
</div>
</div>
<div id="fullpage" class="fullpage-wrapper">
<div style="clear: both"></div>
<div class='progress' style="height: 0px">
@ -427,29 +466,32 @@
</ul>
</div>
</div>
</div>
</div>
<div class="form-group has-feedback">
<select class="form-control" ng-model="partner.wechatindustry" id="wechatindustry"
ng-change="changeDays(partner.clean_days)" name="wechatindustry" required
ng-options="wechatindustry.value as wechatindustry.label for wechatindustry in industries">
<option value="">WechatIndustry</option>
</select>
</div>
<div class="form-group has-feedback">
<select class="form-control" ng-model="partner.wechatindustry" id="wechatindustry"
ng-change="changeDays(partner.clean_days)" name="wechatindustry" required
ng-options="wechatindustry.value as wechatindustry.label for wechatindustry in industries">
<option value="" readonly>WechatIndustry</option>
</select>
</div>
<!--<div class="form-group">
<label class="control-label col-sm-2"
for="alipay_category">*Alipay Category</label>
<div class="col-sm-8">
<input class="form-control" id="alipay_category" required
name="alipay_category" readonly
ng-model="partner.alipayindustry"
multi-level-select-popup="alipayMccCategory"
on-select="onAlipayMccSelect($selected)">
</div>
<div class="form-group has-feedback">
<input class="form-control" id="alipay_category" required
name="alipay_category" readonly
ng-model="partner.alipay_category"
multi-level-select-popup="alipayMccCategory"
on-select="onAlipayMccSelect($selected)"
placeholder="alipayIndustry"
>
<div ng-messages="partnerForm.alipay_category.$error"
ng-if="partnerForm.alipay_category.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>-->
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Merchant Payment Scenario</div>
@ -762,13 +804,13 @@
</div>
</div>
<!--测试中-->
<a target="_blank" ng-href="{{signContract(0451120326,1)}}">Sign Contract</a>
<div class="row">
<div class="col-xs-12 margin-bottom">
<button type="button" class="btn btn-success btn-block btn-flat"
<!--<button type="button" class="btn btn-success btn-block btn-flat"
ng-click="saveApplyInfo(cleanForm,4)" ng-disabled="cleanForm.$invalid || !partner.agree || submit" >Submit<span ng-if="submit" class="dotting"></span>
</button>-->
<button type="button" class="btn btn-success btn-block btn-flat"
ng-click="submitApply()" ng-disabled="cleanForm.$invalid || !partner.agree || submit" >Submit<span ng-if="submit" class="dotting"></span>
</button>
<div>
<p ng-if="resError" style="padding: 6px 12px;font-size: 14px;"
@ -802,6 +844,9 @@
<p>4. If you have any questions, you can contact our customer service.<br>
若有任何疑问,请联系我们客服。
</p>
<p>
<a ng-href="{{contract_url}}" target="_blank">查看合同</a>
</p>
</div>
<div class="row" style=" margin-left: 70px; margin-right: 70px;">
<div class="col-xs-12">

@ -1,4 +1,5 @@
angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('applyPartnerCtrl', ['$scope', '$http','$interval','Upload', function ($scope, $http,$interval,Upload) {
var app = angular.module('applyPartnerApp', ['ngMessages','ngFileUpload','ui.bootstrap']);
app.controller('applyPartnerCtrl', ['$scope', '$http','$interval','Upload','$uibModal', 'commonDialog', function ($scope, $http,$interval,Upload,$uibModal,commonDialog) {
var countryMap = [{
"label": "AUS",
"value": "AUS"
@ -160,6 +161,7 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
$scope.partner.client_pay_type = [];
$scope.partner.client_pay_desc = [];
$scope.phone_code_timer=$interval(function () {}, 1000);
$scope.signInfo = {};
$scope.loadRoyalpayindustry = function () {
$http.get('/static/data/rp_industry_apply.json').then(function (resp) {
@ -171,7 +173,6 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
$scope.loadAlipayCategory = function () {
$http.get('/static/data/alipayMcc.json').then(function (resp) {
$scope.alipayMccCategory = resp.data;
debugger;
})
};
$scope.loadAlipayCategory();
@ -181,11 +182,6 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
$scope.partner.alipayindustry = selectedItem.mccCode;
};
$scope.onAlipayMccSelect = function (selectedItem) {
$scope.partner.alipay_category = selectedItem.label;
$scope.partner.alipayindustry = selectedItem.mccCode;
};
$scope.loadCustomerChannel = function () {
$http.get('/static/data/rp_customer_channel.json').then(function (resp) {
$scope.customerchannel = resp.data;
@ -694,4 +690,298 @@ angular.module('applyPartnerApp', ['ngMessages','ngFileUpload']).controller('app
}
};
$scope.submitSign = function (fullName) {
var sign = $("#signature").jSignature('getData', 'image');
var signInfo = {};
signInfo.src = 'data:' + sign[0] + ',' + sign[1];
signInfo.fullName = fullName;
$scope.$close(signInfo);
};
$scope.submitApply = function () {
$uibModal.open({
backdrop: false,
templateUrl: '/static/payment/partner/templates/agreement_signature_dialog.html',
controller: 'agreementSignDialogCtrl',
size: 'md'
}).result.then(function (result) {
$scope.confirmBtn = true;
$scope.signItBtn = false;
$scope.signInfo.fullName = result.fullName;
$scope.signInfo.src = result.src;
$scope.uploadSign();
})
};
$scope.uploadSign = function () {
if ($scope.signInfo.fullName == null || $scope.signInfo.fullName == "") {
commonDialog.alert({title: 'Submit Fail', content: 'Please confirm full name entered', type: 'error'});
return;
}
if ($scope.signInfo.src == null || $scope.signInfo.src == "") {
commonDialog.alert({title: 'Submit Fail', content: 'Please confirm signature', type: 'error'});
return;
}
document.getElementById("loading_logo").style ="";
$scope.white();
var signFile = dataURLtoFile($scope.signInfo.src, $scope.signInfo.fullName);
$scope.logoProgress = {value: 0};
Upload.upload({
url: '/register/clientCompliance/commit_aggregate_file'+'?username='+$scope.partner.contact_phone+'&clean_days='+$scope.partner.clean_days,
data: {file: signFile}
}).then(function (resp) {
$scope.contract_url= resp.data.contract_url;
document.getElementById('loading').style.display = "none";
document.getElementById('loading_logo').style.display = "none";
delete $scope.logoProgress;
$scope.changeChoose(4);
}, function (resp) {
debugger;
document.getElementById('loading').style.display = "none";
document.getElementById('loading_logo').style.display = "none";
delete $scope.logoProgress;
commonDialog.alert({title: 'Commit Aggregate File Fail', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.logoProgress.value = parseInt(100 * evt.loaded / evt.total);
});
};
$scope.white=function(){
$("#loading").css({
"position":"absolute",    //绝对位置
"display":"block",    //让对象成为块级元素
"background-color":"white",  //背景白色
"z-index":"9999",  //最上层显示
"opacity":"0.7"  //背景透明度
});
}
function dataURLtoFile(dataurl, filename) {//将base64转换为文件
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new File([u8arr], filename, {type: mime});
}
}]);
app.controller('agreementSignDialogCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) {
$scope.submitSign = function (fullName) {
var sign = $("#signature").jSignature('getData', 'image');
var signInfo = {};
signInfo.src = 'data:' + sign[0] + ',' + sign[1];
signInfo.fullName = fullName;
$scope.$close(signInfo);
};
}]);
app.factory('commonDialog', ['$q', '$uibModal', function ($q, $uibModal) {
return {
alert: function (cfg) {
var choises = [{label: 'OK', className: 'btn-default', key: '1'}];
var config = {
title: cfg.title,
content: cfg.content,
contentHtml: cfg.contentHtml,
backdrop: cfg.backdrop,
size: cfg.size,
choises: choises,
type: cfg.type
};
var defer = $q.defer();
showModalDialog(config).then(function () {
defer.resolve();
}, function () {
defer.resolve()
});
return defer.promise;
},
confirm: function (cfg) {
var choises = [{label: 'OK', className: 'btn-success', key: '1'},
{label: 'Cancel', className: 'btn-danger', key: '2', dismiss: true}];
var config = {
title: cfg.title,
content: cfg.content,
contentHtml: cfg.contentHtml,
json:cfg.json,
backdrop: cfg.backdrop,
size: cfg.size,
choises: cfg.choises || choises
};
var deferred = $q.defer();
showModalDialog(config).then(function (choice) {
if (choice.dismiss) {
deferred.reject();
} else {
deferred.resolve(choice.key);
}
}, function () {
deferred.reject();
});
return deferred.promise;
},
inputNum: function (cfg) {
return $uibModal.open({
templateUrl: '/static/commons/templates/num_input.html',
size: 'sm',
resolve: {
cfg: function () {
return cfg;
}
},
controller: ['$scope', 'cfg', function ($scope, cfg) {
$scope.title = cfg.title || 'Input Amount';
$scope.data = {};
$scope.submit = function () {
$scope.$close($scope.data.num);
};
}]
}).result;
},
inputText:function (cfg) {
return $uibModal.open({
backdrop: 'static', keyboard: false,
templateUrl:'/static/commons/templates/text_input.html',
size: cfg.size || 'sm',
resolve:{
cfg:function () {
return cfg;
}
},
controller:['$scope','cfg',function ($scope, cfg) {
$scope.title = cfg.title || 'Input Amount';
$scope.data = {};
$scope.submit = function () {
$scope.$close($scope.data.text);
};
}]
}).result;
}
};
function showModalDialog(cfg) {
cfg = angular.extend({}, defaultCfg, cfg);
return $uibModal.open({
templateUrl: 'static/commons/templates/dialog.html',
controller: 'commonModalCtrl',
size: cfg.size,
backdrop: cfg.backdrop,
resolve: {
cfg: function () {
return cfg;
}
}
}).result;
}
}]);
app.controller('commonModalCtrl', ['$scope', '$timeout', 'cfg', function ($scope, $timeout, cfg) {
var bgClasses = {
success: 'bg-success',
error: 'bg-warning',
info: 'bg-info'
};
var glyIcons = {
success: 'glyphicon-ok-circle',
error: 'glyphicon-remove-circle',
info: 'glyphicon-info-sign'
};
$scope.title = cfg.title;
$scope.content = cfg.content;
$scope.contentHtml = cfg.contentHtml;
$scope.jsonData = cfg.json;
$scope.bgClass = bgClasses[cfg.type];
$scope.glyIcon = glyIcons[cfg.type];
$scope.choises = cfg.choises;
if(cfg.type=='success'){
$timeout(function () {
$scope.$dismiss();
},2000)
}
$scope.btnClick = function (choice) {
$scope.$close(choice);
}
}]);
app.directive('multiLevelSelectPopup', [function () {
return {
restrict: 'A',
scope: {
multiLevelSelectPopup: '=',
childrenKey: '@',
labelKey: '@',
onSelect: '&'
},
link: function (scope, element, attr) {
var selectBox,bg;
var selectGroups = [];
scope.labelKey = scope.labelKey || 'label';
scope.childrenKey = scope.childrenKey || 'children';
$(element).focus(function () {
if (selectBox) {
selectBox.remove();
}
selectBox = $('<div></div>').addClass('ml-select-box');
var offset = $(this).offset();
selectBox.css({
top: (offset.top + $(this).outerHeight() + 3) + 'px',
left: offset.left + 'px'
});
var container = $('<div></div>').appendTo(selectBox);
initSelectLevel(container, scope.multiLevelSelectPopup, 0);
var $body = $('body');
selectBox.appendTo($body);
bg = $('<div></div>').css({position:'fixed',top:0,left:0,right:0,bottom:0,zIndex:9998}).appendTo($body);
bg.click(function () {
selectBox.remove();
bg.remove();
selectBox = null;
})
});
function initSelectLevel(container, list, groupIndex) {
if (selectGroups[groupIndex]) {
var groups = selectGroups.splice(groupIndex, 999);
angular.forEach(groups, function (group) {
group.remove();
})
}
var levelBox = $('<ul></ul>').addClass('select-group').appendTo(container);
selectGroups[groupIndex] = levelBox;
angular.forEach(list, function (item) {
var label = item[scope.labelKey];
var li = $('<li></li>').text(label).attr('title', label).appendTo(levelBox);
if (!item[scope.childrenKey] || !item[scope.childrenKey].length) {
if (angular.isFunction(scope.onSelect)) {
li.click(function () {
try {
scope.$apply(function () {
scope.onSelect({$selected: item});
})
}catch(err){}
selectBox.remove();
bg.remove();
selectBox = null;
})
}
} else {
li.hover(function () {
levelBox.find('.active').removeClass('active');
li.addClass('active');
initSelectLevel(container, item.children, groupIndex + 1);
});
}
})
}
}
}
}]);

@ -337,6 +337,17 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo
return;
}
if ($scope.partner.representativeInfo.address == null||
$scope.partner.representativeInfo.suburb == null ||
$scope.partner.representativeInfo.postcode == null ||
$scope.partner.representativeInfo.state == null ||
$scope.partner.representativeInfo.representative_person == null ||
$scope.partner.representativeInfo.phone == null ||
$scope.partner.representativeInfo.email == null ||
$scope.partner.representativeInfo.job_title == null || $scope.partner.contact_job == null || !$scope.partner.contact_job.length>0) {
commonDialog.alert({title: 'Message', content: '请前去完善商户法人信息注册地址,再进行提交!', type: 'info'});
return;
}
if (($scope.partner.business_structure == "Company" && $scope.partner.acn == null) || ($scope.partner.business_structure != "Company" && $scope.partner.abn == null)) {
commonDialog.alert({title: 'Message', content: '请前去完善商户资料,再进行提交!', type: 'info'});
return;

Loading…
Cancel
Save