[R]商户信息添加KYC文件展示

master
liuxinxin 5 years ago
parent 0d5c44d26f
commit edca1fef29

@ -252,6 +252,8 @@ public interface ClientManager {
JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker);
JSONObject getAllKycFiles(JSONObject manager, String clientMoniker);
JSONObject getSourceAgreeFiles(JSONObject manage, String clientMoniker);
void deleteAuthFiles(String fileId);

@ -3448,6 +3448,36 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return fileJson;
}
@Override
public JSONObject getAllKycFiles(JSONObject manager, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker);
String[] fileKeys = {"client_bank_file", "kyc_utility_bill_file", "client_id_file"};
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> clientFiles = clientFilesMapper.findClientFile(client.getIntValue("client_id"));
JSONObject fileJson = new JSONObject();
if (clientFiles != null && clientFiles.size() > 0) {
for (String fileKey : fileKeys) {
List<JSONObject> clientFileUrl = clientFiles.stream()
.filter(json -> (fileKey.equals(json.getString("file_name"))))
.sorted((log1, log2) -> log2.getDate("last_update_date").compareTo(log1.getDate("last_update_date")))
.map(json -> {
JSONObject params = new JSONObject();
params.put("file_id", json.getString("file_id"));
params.put("file_value", json.getString("file_value"));
return params;
})
.collect(Collectors.toList());
if (clientFileUrl != null && clientFileUrl.size() > 0) {
fileJson.put(fileKey, clientFileUrl);
}
}
}
return fileJson;
}
@Override
public JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker) {
JSONObject client = getClientInfoByMoniker(clientMoniker);

@ -537,6 +537,11 @@ public class PartnerManageController {
return clientManager.getAllAuthFiles(manager, clientMoniker);
}
@ManagerMapping(value = "/{clientMoniker}/kycFile", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT})
public JSONObject getKycFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.getAllKycFiles(manager, clientMoniker);
}
@ManagerMapping(value = "/{clientMoniker}/file/source_agree_file", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER, ManagerRole.SERVANT})
public JSONObject getSourceAgreeAuthFiles(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.getSourceAgreeFiles(manager, clientMoniker);
@ -553,6 +558,12 @@ public class PartnerManageController {
clientManager.uploadAuthFiles(manager, clientMoniker, filesInfo);
}
@ManagerMapping(value = "/{clientMoniker}/kycFile", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void uploadKycFiles(@PathVariable String clientMoniker, @RequestBody ClientKycFilesInfo filesInfo,
@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientManager.uploadKycFiles(manager, clientMoniker, filesInfo);
}
@ManagerMapping(value = "/analysis", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR, ManagerRole.BD_USER})
public JSONObject getClientsAnalysis(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return clientManager.getClientsAnalysis(manager);

@ -581,16 +581,6 @@ public class PartnerViewController {
}
}
@PartnerMapping(value = "/update/kycFile", method = RequestMethod.PUT)
@ResponseBody
public void updateKycFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientKycFilesInfo filesInfo) {
JSONObject client = account.getJSONObject("client");
JSONObject manager = new JSONObject();
manager.put("display_name","client");
clientManager.uploadKycFiles(manager, account.getString("client_moniker"), filesInfo);
}
@PartnerMapping(value = "/update/wait_kyc_file", method = RequestMethod.PUT)
@ResponseBody
public void updateWaitKycFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientKycFilesInfo filesInfo) {

@ -21,6 +21,8 @@
<span class="small text-danger" style="margin: 20px 20px;font-size: 20px;" ng-if="file.client_refuse_reason">
({{file.client_refuse_reason}})</span>
</h1>
<br/>
<p ng-if="currentUser.client.client_less_file && currentUser.lessKycFiles">前去补充合规文件:<a ui-sref="compliance_to_perfect">点击前往</a></p>
</section>
<div class="panel-body box box-warning ng-scope" style="margin-top: 20px;">
<div class="form-horizontal">

@ -0,0 +1,145 @@
<style type="text/css">
img {
width: 100%;
}
</style>
<div class="panel panel-default">
<div class="panel-heading">KYC Files &nbsp;&nbsp;&nbsp;
<!--<a class="btn-group btn btn-success" ng-if="file" ng-href="{{downloadAsZip()}}" target="_blank">
<i class="fa fa-cloud-download">一键下载</i>
</a>-->
</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2">* ASIC File</label>
<div class="col-sm-4">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadBankFile($file)">
<i class="fa fa-upload"></i> Upload
</button>
<i class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none" ng-if="$root.complianceCheck.authFile"></i>
</div>
<uib-progressbar value="bankFileProgress.value" ng-if="bankFileProgress"></uib-progressbar>
<!-- <a ng-if="bankIsImage" target="_blank" ng-repeat="src in file.client_bank_file" ng-href="{{src}}">
<img ng-src="{{src}}" class="col-sm-8">
</a>-->
<table>
<tbody>
<tr ng-repeat="file_src in file.client_bank_file track by $index">
<td ng-bind="$index+1+'.'" ALIGN="left" VALIGN="top" class="btn">1</td>
<td><a ng-if="bankIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}"class="col-sm-6" style="border: 1px solid #ddd" onerror="this.src='/static/images/file_close.png'">
</a>
<button class="btn btn-danger" type="button" ng-click="deleteComplianceFiles(file_src.file_id)">X</button>
<a role="button" download="" target="_blank" class="btn-group btn btn-warning" type="button" href="{{file_src.file_value}}" ><i class="fa fa-download"></i></a>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-6">
<div class="form-control-static">
<p>Example请保证图片信息清晰可见,如下图</p>
<img class="col-sm-6" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/03/07/1488859920633_5ruVtDa30yY2ytBSDAAqxg0Ob2nreh.jpeg">
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">* ID </label>
<div class="col-sm-4">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadIDFile($file)">
<i class="fa fa-upload"></i> Upload
</button>
<i class="fa fa-check-square-o check-i" aria-hidden="true" style="float: none" ng-if="$root.complianceCheck.authFile"></i>
</div>
<uib-progressbar value="idFileProgress.value" ng-if="idFileProgress"></uib-progressbar>
<!--<a ng-if="idIsImage" ng-repeat="src in file.client_id_file" ng-href="{{src}}" target="_blank">
<img ng-src="{{src}}" class="col-sm-8"></a>-->
<table>
<tbody>
<tr ng-repeat="file_src in file.client_id_file track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a ng-if="bankIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}" class="col-sm-6" style="border: 1px solid #ddd" onerror="this.src='/static/images/file_close.png'">
</a>
<button class="btn btn-danger" type="button" ng-click="deleteComplianceFiles(file_src.file_id)">X</button>
<a role="button" class="btn-group btn btn-warning" type="button" ng-href="{{file_src.file_value}}" download="" target="_blank"><i class="fa fa-download"></i></a>
</td>
</tr>
</tbody></table>
</div>
<div class="col-sm-6">
<div class="form-control-static">
<div class="col-sm-6">
<p>Example请保证图片(护照或驾照)信息清晰可见,如下图</p>
<img class="col-xs-12" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/06/29/1498725651779_OPiqOP1dGnTpaxPsCR3P9lVrp4384b.jpg">
</div>
<div class="col-sm-6">
<br/>
<br/>
<img class="col-sm-12" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/06/29/1498725678615_Bv2tzUtihY5U6YK9ScveXzKkVWOnrF.jpg">
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2"> Utility Bill Files</label>
<div class="col-sm-4">
<div class="form-control-static">
<button class="btn btn-primary" type="button"
ngf-select="uploadCompanyFile($file)">
<i class="fa fa-upload"></i> Upload
</button>
</div>
<uib-progressbar value="billFileProgress.value" ng-if="billFileProgress"></uib-progressbar>
<table>
<tbody>
<tr ng-repeat="file_src in file.kyc_utility_bill_file track by $index">
<td ng-bind="$index+1+'.'" class="btn">1</td>
<td><a ng-if="billIsImage" target="_blank" ng-href="{{file_src.file_value}}">
<img ng-src="{{file_src.file_value}}" class="col-sm-8"
onerror="this.src='/static/images/file_close.png'">
</a>
<button class="btn btn-danger" type="button"
ng-click="deleteComplianceFiles(file_src.file_id)">
X
</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-sm-6">
<div class="form-control-static">
<div class="col-sm-12">
<p class="col-sm-6">Example公司请提供以下文件图片,如示例
<img class="col-xs-12" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/03/07/1488865011738_mW91ylSb5V1NJYu8jxvBPGNN49Zyel.jpeg">
</p>
<p class="col-sm-6">sole trade个体户),partnership合伙,trust信托请在http://abr.business.gov.au将查询结果截图上传
<img class="col-sm-12" style="border: 1px solid #ddd"
src="https://file.royalpay.com.au/open/2017/03/07/1488860564017_37spL6phUySM27oRtO4cQ7FOJblYJ6.jpeg">
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div style="text-align: center">
<a role="button" style="margin-bottom: 25px;" class="btn btn-success btn-sm ng-scope" ng-if="('10'|withRole)" ng-click="complianceCheck()">check</a>
</div>
</div>

@ -167,6 +167,15 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
return $http.get('/sys/partners/' + $stateParams.clientMoniker + '/file');
}]
}
}).state('partners.detail.kyc_files', {
url: '/kyc_files',
templateUrl: '/static/payment/kyc/templates/partner_kyc_files.html',
controller: 'partnerKycFileCtrl',
resolve: {
file: ['$http', '$stateParams', function ($http, $stateParams) {
return $http.get('/sys/partners/' + $stateParams.clientMoniker + '/kycFile');
}]
}
}).state('partners.detail.settlement', {
url: '/settlement',
templateUrl: '/static/payment/partner/templates/partner_settlement.html',
@ -4044,6 +4053,171 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter
$scope.complianceChangeCheck();
}]);
app.controller('partnerKycFileCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file) {
$scope.file = file.data || {};
//kyc files
$scope.uploadBankFile = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.bankFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.bankFileProgress;
$scope.file.file_bank_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_bank_info.endsWith('pdf')) {
$scope.bankIsImage = false;
} else {
$scope.bankIsImage = true;
}
}, function (resp) {
delete $scope.bankFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.bankFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
$scope.bankIsImage = true;
if ($scope.file.file_bank_info && $scope.file.file_bank_info.endsWith('pdf')) {
$scope.bankIsImage = false;
}
$scope.idIsImage = true;
if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) {
$scope.idIsImage = false;
}
$scope.billIsImage = true;
if ($scope.file.file_company_info && $scope.file.file_company_info.endsWith('pdf')) {
$scope.billIsImage = false;
}
//上传ID信息
$scope.uploadIDFile = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.idFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.idFileProgress;
$scope.file.file_id_info = resp.data.url;
$scope.updateFile();
if ($scope.file.file_id_info.endsWith('pdf')) {
$scope.idIsImage = false;
} else {
$scope.idIsImage = true;
}
}, function (resp) {
delete $scope.idFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.idFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
//上传账单流水
$scope.uploadCompanyFile = function (file) {
if (file != null) {
if (file.size > 3 * 1024 * 1024) {
commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB请压缩后重试', type: 'error'})
} else {
$scope.billFileProgress = {value: 0};
Upload.upload({
url: '/attachment/files',
data: {file: file}
}).then(function (resp) {
delete $scope.billFileProgress;
$scope.file.utility_bill_info = resp.data.url;
$scope.updateFile();
if ($scope.file.utility_bill_info.endsWith('pdf')) {
$scope.billIsImage = false;
} else {
$scope.billIsImage = true;
}
}, function (resp) {
delete $scope.billFileProgress;
commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'})
}, function (evt) {
$scope.billFileProgress.value = parseInt(100 * evt.loaded / evt.total);
})
}
}
};
/* $scope.downloadAsZip = function () {
var url = '/sys/partners/' + $scope.partner.client_moniker + '/download/complianceAsZIP';
return url;
};*/
$scope.deleteComplianceFiles = function (file_id) {
commonDialog.confirm({
title: 'Warning',
content: 'This operation will delete the file, Are you sure?'
}).then(function () {
$http.put('/sys/partners/auth_file/' + file_id + '/delete').then(function (resp) {
commonDialog.alert({
title: 'Success',
content: 'Delete Successful',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
};
$scope.updateFile = function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/kycFile', $scope.file).then(function () {
commonDialog.alert({
title: 'Success',
content: 'Upload Successful',
type: 'success'
});
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
}
function commitError() {
commonDialog.alert({
title: 'Error',
content: 'Missing file',
type: 'error'
});
};
$scope.complianceCheck = function () {
if (!$rootScope.complianceCheck) {
$rootScope.complianceCheck = {};
}
$rootScope.complianceCheck.client_id = $scope.partner.client_id;
$rootScope.complianceCheck.authFile = true;
};
$scope.complianceChangeCheck = function () {
if ($rootScope.complianceCheck) {
if ($scope.partner.client_id != $rootScope.complianceCheck.client_id) {
delete $rootScope.complianceCheck;
}
}
};
$scope.complianceChangeCheck();
}]);
app.controller('partnerSettlementCtrl', ['$scope', '$uibModal', '$http', 'clientMoniker', '$filter', function ($scope, $uibModal, $http, clientMoniker, $filter) {
$scope.params = {};
$scope.pagination = {};

@ -21,6 +21,8 @@
<span class="small text-danger" style="margin: 20px 20px;font-size: 20px;" ng-if="file.client_refuse_reason">
({{file.client_refuse_reason}})</span>
</h1>
<br/>
<p ng-if="currentUser.client.client_less_file && currentUser.lessKycFiles">前去补充KYC文件<a ui-sref="kyc_files_perfect">点击前往</a></p>
</section>
<div class="panel-body box box-warning ng-scope" style="margin-top: 20px;">
<div class="form-horizontal">

@ -277,6 +277,9 @@
<li ui-sref-active="active" ng-if="partner.show_all_permission && partner.is_valid==1">
<a ui-sref=".files">Compliance Files</a>
</li>
<li ui-sref-active="active" ng-if="partner.show_all_permission && partner.is_valid==1">
<a ui-sref=".kyc_files">KYC Files</a>
</li>
<li ui-sref-active="active" ng-if="partner.show_all_permission && partner.is_valid==1">
<a ui-sref=".settlement({clientMoniker:partner.client_moniker})">Settlement</a>
</li>

Loading…
Cancel
Save