[R]KCY认证Web端开发

master
liuxinxin 5 years ago
parent 9eeb3070f0
commit d466f2fc0f

@ -14,6 +14,8 @@ public interface ClientComplianceApply {
JSONObject complianceAuthFile(JSONObject client);
JSONObject kycAuthFile(JSONObject client);
void passComplianceFile(JSONObject manager,int clientId,JSONObject passInfo);
void refuseComplianceFile(JSONObject manager,int clientId,JSONObject refuseInfo);

@ -80,6 +80,37 @@ public class ClientComplianceApplyImpl implements ClientComplianceApply
};
@Override
public JSONObject kycAuthFile(JSONObject client)
{
String[] fileKeys = {"client_bank_file", "kyc_utility_bill_file", "client_id_file"};
if (client == null) {
throw new InvalidShortIdException();
}
List<JSONObject> clientFiles = clientFilesMapper.findAllClientFile(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("status", json.getString("status"));
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 void passComplianceFile(JSONObject manager, int clientId, JSONObject passInfo) {
JSONObject complianceDetail = clientComplianceCompanyMapper.findFileByClientId(clientId);
@ -123,7 +154,6 @@ public class ClientComplianceApplyImpl implements ClientComplianceApply
}
if (complianceDetail.getIntValue("status") == 2) {
throw new BadRequestException("已打回,请避免重复操作");
}
complianceDetail.put("description",refuseInfo.getString("description"));
complianceDetail.put("operator_id", manager.getString("manager_id"));

@ -50,4 +50,11 @@ public class ComplianceAuditController
return clientManager.getComplianceFilesForBD(client);
}
@RequestMapping(value = "/kyc/clientViewFiles/{clientMoniker}",method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public JSONObject searchKycFiles(@PathVariable String clientMoniker) {
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
return clientManager.getKycFilesForBD(client);
}
}

@ -30,6 +30,10 @@ public interface ClientComplianceCompanyMapper {
@AdvanceSelect(addonWhereClause = "type = 2")
JSONObject findKycFileByClientId(@Param("client_id") int client_id);
@AutoSql(type = SqlType.SELECT)
@AdvanceSelect(addonWhereClause = "type = 2 and status in(0,1,9)")
JSONObject findKycFileComplete(@Param("client_id") int client_id);
PageList<JSONObject> listClientCompliances(JSONObject params, PageBounds pageBounds);
List<JSONObject> listNeedHelpClients(JSONObject params);

@ -505,6 +505,8 @@ public interface ClientManager {
JSONObject getComplianceFilesForBD(JSONObject account);
JSONObject getKycFilesForBD(JSONObject account);
/**
*
*
@ -513,6 +515,8 @@ public interface ClientManager {
*/
JSONObject partnerIncrementalService(String clientMoniker);
boolean isPartnerKycfilesComplete(String clientMoniker);
/**
* /
*

@ -2287,6 +2287,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return file;
}
@Override
public JSONObject getKycFilesForBD(JSONObject account) {
JSONObject client = getClientInfo(account.getIntValue("client_id"));
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject file = clientComplianceApply.kycAuthFile(client);
file.put("file_company", clientComplianceCompanyMapper.findKycFileByClientId(account.getIntValue("client_id")));
file.put("client", client);
return file;
}
@Override
@Transactional
public void updateClientBDUsers(JSONObject manager, String clientMoniker, JSONObject data) throws Exception {
@ -6221,6 +6233,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}};
}
@Override
public boolean isPartnerKycfilesComplete(String clientMoniker) {
boolean lessKycFiles = true;
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);
if (client == null) {
throw new InvalidShortIdException();
}
JSONObject KycFilesAuth = clientComplianceCompanyMapper.findKycFileComplete(client.getIntValue("client_id"));
if(KycFilesAuth != null){
lessKycFiles = false;
}
return lessKycFiles;
}
@Override
public JSONObject partnerIncrementalServiceInfo(String clientMoniker,String channel){
JSONObject client = clientMapper.findClientByMoniker(clientMoniker);

@ -746,7 +746,12 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
@Override
public JSONObject checkKycFileStatus(JSONObject client) {
JSONObject result = new JSONObject();
result.put("client_less_file", false);
boolean lessKycFiles = true;
JSONObject KycFilesAuth = clientComplianceCompanyMapper.findKycFileComplete(client.getIntValue("client_id"));
if(KycFilesAuth != null){
lessKycFiles = false;
}
result.put("client_less_file", lessKycFiles);
List<JSONObject> clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id"));
boolean clientFilesIsLess = false;
for (int i = 0; i < KYC_FILE_KEYS.length; i++) {
@ -794,10 +799,8 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
}
fileJson.put("file_write", true);
result.put(fileKey,fileJson);
clientFilesIsLess = true;
}
}else {
clientFilesIsLess = true;
for (int c = 0; c < KYC_FILE_KEYS.length; c++) {
String key = KYC_FILE_KEYS[c];
JSONObject fileJson = new JSONObject();
@ -808,12 +811,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
}
}
}
if ((client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10 || client.getIntValue("approve_result") == 1 || client.getIntValue("open_status") == 5) && client.getIntValue("source")!=4 ) {
if (clientFilesIsLess) {
result.put("client_less_file", clientFilesIsLess);
whenClientLessFile(client, result);
}
}
return result;
}

@ -191,6 +191,7 @@ public class SignInController {
@PartnerMapping(value = "/current_partner", method = RequestMethod.GET)
public JSONObject partnerLoginStatus(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject partner) {
partner.put("has_incremental_setvice",clientManager.partnerIncrementalService(partner.getString("client_moniker")).getJSONArray("all_service").size()>0);
partner.put("lessKycFiles",clientManager.isPartnerKycfilesComplete(partner.getString("client_moniker")));
return partner;
}

@ -52,6 +52,9 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
resolve: {
file: ['$http', function ($http) {
return $http.get('/client/partner_info/compliance/clientViewFiles');
}],
kycFile: ['$http', function ($http) {
return $http.get('/client/partner_info/kyc/clientViewFiles');
}]
}
@ -63,6 +66,11 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
$scope.ComplianceToperfect();
complianceNoticeCount++;
}
if($scope.currentUser.lessKycFiles && complianceNoticeCount==0 && $scope.currentUser.role!=3)
{
$scope.ComplianceToperfect();
complianceNoticeCount++;
}
connectWebSocket();
if ($scope.currentUser.role == 1 || $scope.currentUser.role == 2) {
$scope.getAgStatus();
@ -477,8 +485,10 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo
})
}
}]);
app.controller('partnerFilesCtrl', ['$scope', '$http', '$sce', 'file', function ($scope, $http, $sce, file) {
app.controller('partnerFilesCtrl', ['$scope', '$http', '$sce', 'file', 'kycFile', function ($scope, $http, $sce, file , kycFile) {
$scope.file = angular.copy(file);
$scope.kycFile = angular.copy(kycFile);
debugger;
}]);
app.factory('myLoginLogView', ['$uibModal', function ($uibModal) {
return {

@ -33,6 +33,15 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
url: '/partners/KycFilesAuth',
templateUrl: 'static/sys/templates/partner_kyc_flies_auth.html',
controller: 'kycFilesAuthForClientCtrl'
}).state('kyc_files_detail', {
url: '/{client_moniker}/kyc_files_detail',
templateUrl: '/static/payment/partner/templates/client_kyc_files_to_auth.html',
controller: 'partnerKycFilesDetail',
resolve: {
file: ['$http','$stateParams',function ($http, $stateParams) {
return $http.get('/compliance/audit/kyc/clientViewFiles/'+ $stateParams.client_moniker);
}]
}
})
}]);
@ -112,6 +121,38 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
};
}]);
app.controller('partnerKycFilesDetail', ['$rootScope', '$scope', '$http', '$state', '$uibModal', 'commonDialog', 'file', function ($rootScope, $scope, $http, $state, $uibModal, commonDialog, file) {
$scope.file = file.data || {};
debugger;
$scope.partner = $scope.file.client;
$scope.passPartnerComplianceFiles = function () {
commonDialog.confirm({
title: 'Confirm!',
content: '确认是否通过商户合规文件?'
}).then(function () {
$http.put('/compliance/audit/'+$scope.file.client.client_id+'/pass/complianceFile',{}).then(function (resp) {
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
})
})
}
$scope.refusePartnerComplianceFiles = function (obj) {
var partner = angular.copy(obj);
$uibModal.open({
templateUrl: '/static/payment/partner/templates/refuse_reason.html',
controller: 'refusePartnerComplianceFilesCtrl',
resolve: {
partner: partner
}
})
};
}]);
app.controller('refusePartnerComplianceFilesCtrl', ['$scope', '$http', '$state', 'partner', function ($scope, $http, $state, partner) {
$scope.partner = angular.copy(partner);
$scope.partner.description = "";

@ -0,0 +1,151 @@
<style type="text/css">
img {
width: 100%;
}
</style>
<div class="content">
<div class="row">
<div class="col-sm-12">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs">
<li ui-sref-active-eq="active">
<a ui-sref="partner_detail({client_moniker:partner.client_moniker})">Partner Detail</a>
</li>
<li ui-sref-active="active">
<a ui-sref="kyc_files_detail({client_moniker:partner.client_moniker})">KYC Files Audit</a>
</li>
</ul>
<div class="tab-content" ui-view>
<div class="panel panel-default">
<div class="panel-body">
<div class="form-group">
<label class="control-label col-sm-2">商户KYC文件审核详情</label>
<div class="col-sm-10">
<p class="form-control-static">
<span ng-if="file.file_company.status==0">待审核</span>
<span ng-if="file.file_company.status==1">通过</span>
<span ng-if="file.file_company.status==2">打回<p class="small text-danger" ng-if="file.file_company.description && file.file_company.description!=' '"> 打回原因:({{file.file_company.description}}</p></span>
</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Partner Code</label>
<div class="col-sm-10">
<p class="form-control-static">
<a class="text-primary" role="button" title="Detail"
ui-sref="partners.detail({clientMoniker:partner.client_moniker})">
<span id="parent_code">{{partner.client_moniker}}</span>
</a>
</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Company Name</label>
<div class="col-sm-10">
<p class="form-control-static">
<span ng-bind="partner.company_name"></span>
<span
ng-if="isComplianceOfCompanyName && partner.open_status"
style="margin-left: 10px;font-weight: 700;color: red;">
注意:(微信渠道可能不合规)
</span>
<span class="description-text text-red" ng-if="('10000000010' | withRole)" ng-bind="partner.same_company_name"></span>
</p>
</div>
</div>
</div>
<div class="panel-heading" ng-if="'10'|withRole">KYC Files &nbsp;&nbsp;&nbsp;
<button class="btn-group btn btn-warning" type="button"
ng-click="passPartnerComplianceFiles()" ng-if="file.file_company.status !=1 && file.file_company.status !=2" >PASS
</button>
<button class="btn btn-danger" type="button"
ng-click="refusePartnerComplianceFiles(file.client)" ng-if="file.file_company.status !=1 && file.file_company.status !=2">REFUSE
</button>
<button class="btn-group btn btn-warning" type="button" ng-if="file.file_company.status == 1" >Already Passed
</button>
<button class="btn btn-danger" type="button" ng-if=" file.file_company.status == 2">Already Refused
</button>
</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-4" style="text-align: center;">* bank statement
<span ng-if="file.client_bank_file[0].status == 0" class="small text-dark">(未提交)</span>
<span ng-if="file.client_bank_file[0].status == 1" class="small text-success">(已通过)</span>
<span ng-if="file.client_bank_file[0].status == 2" class="small text-danger">(待审核)</span>
<span ng-if="file.client_bank_file[0].status == 3" class="small text-danger">(已驳回)</span>
</label>
<div class="col-sm-6">
<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 target="_blank" ng-href="{{file_src.file_value}}">
<img class="col-sm-6" style="border: 1px solid #ddd" ng-src="{{file_src.file_value}}" class="col-sm-8" onerror="this.src='/static/images/file_close.png'">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" style="text-align: center;">* ID
<span ng-if="file.client_id_file[0].status == 0" class="small text-dark">(未提交)</span>
<span ng-if="file.client_id_file[0].status == 1" class="small text-success">(已通过)</span>
<span ng-if="file.client_id_file[0].status == 2" class="small text-danger">(待审核)</span>
<span ng-if="file.client_id_file[0].status == 3" class="small text-danger">(已驳回)</span>
</label>
<div class="col-sm-6">
<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 target="_blank" ng-href="{{file_src.file_value}}">
<img class="col-sm-6" style="border: 1px solid #ddd" ng-src="{{file_src.file_value}}" class="col-sm-8" onerror="this.src='/static/images/file_close.png'">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" style="text-align: center;">Utility Bill Files
<span ng-if="file.kyc_utility_bill_file[0].status == 0" class="small text-dark">(未提交)</span>
<span ng-if="file.kyc_utility_bill_file[0].status == 1" class="small text-success">(已通过)</span>
<span ng-if="file.kyc_utility_bill_file[0].status == 2" class="small text-danger">(待审核)</span>
<span ng-if="file.kyc_utility_bill_file[0].status == 3" class="small text-danger">(已驳回)</span>
</label>
<div class="col-sm-6">
<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 target="_blank" ng-href="{{file_src.file_value}}">
<img class="col-sm-6" style="border: 1px solid #ddd" ng-src="{{file_src.file_value}}" class="col-sm-8" onerror="this.src='/static/images/file_close.png'">
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

@ -1,5 +1,6 @@
<div class="modal-header bg-green">
<h4 style="text-align: center">合规文件补充通知<span ng-if="file.data.client_refuse_reason" style="color:#b55252">({{file.data.client_refuse_reason}})</span></h4>
<h4 style="text-align: center">KYC文件补充通知<span ng-if="kycFile.data.client_refuse_reason" style="color:#b55252">({{kycFile.data.client_refuse_reason}})</span></h4>
</div>
<div class="modal-body" style="padding: 30px">
<div class="row">
@ -55,6 +56,15 @@
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="form-horizontal">
<p>前去补充合规文件:<a ui-sref="compliance_to_perfect" ng-click="$dismiss()">点击前往</a></p>
<p>前去补充KYC文件<a ui-sref="basic.kyc_files_perfect" ng-click="$dismiss()">点击前往</a></p>
</div>
</div>
</div>
</div>
<div class="modal-footer">

@ -53,6 +53,9 @@
<li ui-sref-active="active">
<a ui-sref="compliance_detail({client_moniker:partner.client_moniker})">Compliance Audit</a>
</li>
<li ui-sref-active="active">
<a ui-sref="kyc_files_detail({client_moniker:partner.client_moniker})">KYC Files Audit</a>
</li>
</ul>
<div class="tab-content" ui-view>
<div class="panel panel-default">

@ -109,7 +109,7 @@
<span ng-if="compliance_company.source==2">Web</span>
</td>
<td><a class="text-primary" role="button" title="Detail"
ui-sref="compliance_detail({client_moniker:compliance_company.client_moniker})">
ui-sref="kyc_files_detail({client_moniker:compliance_company.client_moniker})">
<i class="fa fa-search"></i> Detail
</a>
</td>

Loading…
Cancel
Save