add 增加按钮跳转、bd上传文件修复

master
luoyang 5 years ago
parent 79193155b2
commit 0d5c44d26f

@ -1,6 +1,7 @@
package au.com.royalpay.payment.manage.kyc.core;
import au.com.royalpay.payment.manage.kyc.bean.KycPartnersQuery;
import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
@ -22,4 +23,6 @@ public interface KycService {
JSONObject getKYCFilesForBDHelp(JSONObject manager, String clientMoniker);
void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source);
void uploadKycFiles(JSONObject manager, String clientMoniker, ClientKycFilesInfo kycFilesInfo);
}

@ -8,6 +8,7 @@ import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientMapper;
import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.notice.core.MailService;
import au.com.royalpay.payment.manage.signin.core.SignInAccountService;
@ -216,10 +217,13 @@ public class KycServiceImpl implements KycService {
@Override
public void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source) {
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
int sourceEnum = 2;
if (client == null) {
throw new InvalidShortIdException();
}
if (account.containsKey("manager_id")) {
checkClientBelongBd(client.getIntValue("client_id"), account.getString("manager_id"));
}
int sourceEnum = 2;
List<JSONObject> clientAllAuthFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id"));
if (clientAllAuthFiles == null || clientAllAuthFiles.size() == 0) {
throw new BadRequestException("Please check the information is uploaded completely");
@ -271,6 +275,16 @@ public class KycServiceImpl implements KycService {
}
}
@Override
public void uploadKycFiles(JSONObject manager, String clientMoniker, ClientKycFilesInfo kycFilesInfo) {
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
checkClientBelongBd(client.getIntValue("client_id"), manager.getString("manager_id"));
clientManager.uploadKycFilesForWaitCompliance(manager, clientMoniker, kycFilesInfo);
}
private void checkManagerPermission(JSONObject manager, JSONObject params, KycPartnersQuery query) {
//todo 可支持bdleader查看组内bd商户kyc情况
// if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) {

@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.kyc.web;
import au.com.royalpay.payment.manage.kyc.bean.KycPartnersQuery;
import au.com.royalpay.payment.manage.kyc.core.KycService;
import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo;
import au.com.royalpay.payment.manage.permission.manager.ManagerMapping;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
@ -48,4 +49,10 @@ public class KycManageController {
manager.put("bd_handle", params.getString("bd_handle"));
kycService.commitAuthKycFilesToCompliance(clientMoniker, manager, "Web");
}
@ManagerMapping(value = "/{clientMoniker}/update", role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void updateKycFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject account, @RequestBody ClientKycFilesInfo filesInfo) {
JSONObject manager = new JSONObject();
kycService.uploadKycFiles(manager, clientMoniker, filesInfo);
}
}

@ -140,8 +140,101 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
};
$scope.loadKYCDashboardInfo();
}]);
app.controller('bdHelpKYCProgressCtrl', [ '$scope', '$http', '$state', 'file', 'commonDialog',function ($scope, $http, $state, file, commonDialog) {
app.controller('bdHelpKYCProgressCtrl', [ '$scope', '$http', '$state', 'file', 'commonDialog', '$location', '$anchorScroll','Upload',function ($scope, $http, $state, file, commonDialog, $location, $anchorScroll, Upload) {
$scope.file = angular.copy(file.data) || {};
$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.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.updateFile = function () {
$http.put('/sys/kyc/manage/'+ $scope.file.client.client_moniker + '/update', $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'});
})
};
$scope.deleteComplianceFiles = function (file_id) {
$scope.file_id = file_id;
commonDialog.confirm({
@ -169,7 +262,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
commonDialog.alert({title: 'Error', content: '请提交ID护照或驾照信息', type: 'error'});
return;
}
if (($scope.file.id_type == "" || $scope.file.id_type == undefined || $scope.file.id_type == null) && !$scope.file.file_company.bd_handle) {
if (($scope.file.file_company.id_type == "" || $scope.file.file_company.id_type == undefined || $scope.file.file_company.id_type == null) && !$scope.file.file_company.bd_handle) {
commonDialog.alert({title: 'Error', content: '请选择ID文件的类型', type: 'error'});
return;
}
@ -199,6 +292,12 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
});
};
$scope.hrefBdHandle = function () {
$location.hash("bd-handle");
$anchorScroll();
$('#bd-handle').focus()
}
}]);
app.controller('partnerDetailForBDHelpCtrl', [ '$scope', '$http', '$state', 'partner', 'commonDialog',function ($scope, $http, $state, partner, commonDialog) {
$scope.partner = angular.copy(partner.data);

@ -54,8 +54,9 @@
</div>
</div>
<div class="panel-heading">Audit Files &nbsp;&nbsp;&nbsp;
<button class="btn btn-warning" type="button">如无法提供KYC文件在下方"无法提供材料原因"填写原因后提交
</button>
<button class="btn btn-warning" type="button" ng-click="hrefBdHandle()">如无法提供KYC文件在下方"无法提供材料原因"填写原因后提交
</button>
</a>
</div>
<div class="panel-body">
<div class="form-horizontal">
@ -72,9 +73,10 @@
<table>
<tbody>
<tr>
<a target="_blank" ng-href="{{file.client_bank_file[0].file_value}}">
<img ng-src="{{file.client_bank_file[0].file_value}}" class="col-sm-8"
onerror="this.src='/static/images/file_close.png'">
</td>
</a>
</tr>
</tbody>
</table>
@ -124,9 +126,10 @@
<table>
<tbody>
<tr>
<a target="_blank" ng-href="{{file.client_id_file[0].file_value}}">
<img ng-src="{{file.client_id_file[0].file_value}}" class="col-sm-8"
onerror="this.src='/static/images/file_close.png'">
</td>
</a>
</tr>
</tbody>
</table>
@ -192,7 +195,7 @@
<label class="control-label col-sm-3"> 无法提供材料原因:</label>
<div class="col-sm-4">
<div class="form-control-static">
<textarea class="form-control" ng-model="file.file_company.bd_handle" style="height: 150px"></textarea>
<textarea class="form-control" ng-model="file.file_company.bd_handle" style="height: 150px" id="bd-handle"></textarea>
</div>
</div>
</div>

Loading…
Cancel
Save