[R]KCY认证Web端开发

master
liuxinxin 5 years ago
parent ffc7c56810
commit 4fff0e0de6

@ -18,6 +18,10 @@ public interface ClientComplianceApply {
void passComplianceFile(JSONObject manager,int clientId,JSONObject passInfo);
void passKycFile(JSONObject manager,int clientId,JSONObject passInfo);
void refuseComplianceFile(JSONObject manager,int clientId,JSONObject refuseInfo);
void refuseKycFile(JSONObject manager,int clientId,JSONObject refuseInfo);
}

@ -4,6 +4,7 @@ package au.com.royalpay.payment.manage.complianceAudit.core.impl;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.manage.complianceAudit.bean.ClientComplianceQuery;
import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply;
import au.com.royalpay.payment.manage.kyc.enums.FilesAuthEnum;
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;
@ -122,7 +123,10 @@ public class ClientComplianceApplyImpl implements ClientComplianceApply
complianceDetail.put("status",1);
complianceDetail.put("description",' ');
clientComplianceCompanyMapper.update(complianceDetail);
clientFilesMapper.passCompliance(clientId);
clientFilesMapper.updateFilesAuthStatus(clientId,
FilesAuthEnum.PASS_OPR.getAfterStatus(),
FilesAuthEnum.PASS_OPR.getBeforeStatus(),
FilesAuthEnum.PASS_OPR.getAuthType("compliance"));
JSONObject client = clientManager.getClientInfo(clientId);
boolean clientChanged = false;
@ -143,6 +147,25 @@ public class ClientComplianceApplyImpl implements ClientComplianceApply
}
}
@Override
public void passKycFile(JSONObject manager, int clientId, JSONObject passInfo) {
JSONObject complianceDetail = clientComplianceCompanyMapper.findKycFileByClientId(clientId);
if (complianceDetail == null) {
throw new BadRequestException("无此记录");
}
if (complianceDetail.getIntValue("status") == 1) {
throw new BadRequestException("审核已通过,请避免重复操作");
}
complianceDetail.put("operator_id", manager.getString("manager_id"));
complianceDetail.put("status",1);
complianceDetail.put("description",' ');
clientComplianceCompanyMapper.update(complianceDetail);
clientFilesMapper.updateFilesAuthStatus(clientId,
FilesAuthEnum.PASS_OPR.getAfterStatus(),
FilesAuthEnum.PASS_OPR.getBeforeStatus(),
FilesAuthEnum.PASS_OPR.getAuthType("kyc"));
}
@Override
public void refuseComplianceFile(JSONObject manager, int clientId, JSONObject refuseInfo) {
JSONObject complianceDetail = clientComplianceCompanyMapper.findFileByClientId(clientId);
@ -156,6 +179,29 @@ public class ClientComplianceApplyImpl implements ClientComplianceApply
complianceDetail.put("operator_id", manager.getString("manager_id"));
complianceDetail.put("status",2);
clientComplianceCompanyMapper.update(complianceDetail);
clientFilesMapper.refuseCompliance(clientId);
clientFilesMapper.updateFilesAuthStatus(clientId,
FilesAuthEnum.REFUSE_OPR.getAfterStatus(),
FilesAuthEnum.REFUSE_OPR.getBeforeStatus(),
FilesAuthEnum.REFUSE_OPR.getAuthType("compliance"));
}
@Override
public void refuseKycFile(JSONObject manager, int clientId, JSONObject refuseInfo) {
JSONObject complianceDetail = clientComplianceCompanyMapper.findKycFileByClientId(clientId);
if (complianceDetail == null) {
throw new BadRequestException("无此记录");
}
if (complianceDetail.getIntValue("status") == 2) {
throw new BadRequestException("已打回,请避免重复操作");
}
complianceDetail.put("description",refuseInfo.getString("description"));
complianceDetail.put("operator_id", manager.getString("manager_id"));
complianceDetail.put("status",2);
clientComplianceCompanyMapper.update(complianceDetail);
clientFilesMapper.updateFilesAuthStatus(clientId,
FilesAuthEnum.REFUSE_OPR.getAfterStatus(),
FilesAuthEnum.REFUSE_OPR.getBeforeStatus(),
FilesAuthEnum.REFUSE_OPR.getAuthType("kyc"));
}
}

@ -38,11 +38,21 @@ public class ComplianceAuditController
clientComplianceApply.passComplianceFile(manager,clientId,passInfo);
}
@ManagerMapping(value = "/{clientId}/pass/kycFile", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void passKycAudit(@PathVariable int clientId, @RequestBody JSONObject passInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientComplianceApply.passKycFile(manager,clientId,passInfo);
}
@ManagerMapping(value = "/{clientId}/refuse/complianceFile", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void refuseComplianceAudit(@PathVariable int clientId, @RequestBody JSONObject refuseInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientComplianceApply.refuseComplianceFile(manager,clientId,refuseInfo);
}
@ManagerMapping(value = "/{clientId}/refuse/kycFile", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER})
public void refuseKycAudit(@PathVariable int clientId, @RequestBody JSONObject refuseInfo, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
clientComplianceApply.refuseKycFile(manager,clientId,refuseInfo);
}
@RequestMapping(value = "/compliance/clientViewFiles/{clientMoniker}",method = RequestMethod.GET)
@RequireManager(role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.OPERATOR, ManagerRole.SERVANT})
public JSONObject searchCompliances(@PathVariable String clientMoniker) {

@ -3,6 +3,7 @@ package au.com.royalpay.payment.manage.kyc.core.impls;
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.manage.kyc.bean.KycPartnersQuery;
import au.com.royalpay.payment.manage.kyc.core.KycService;
import au.com.royalpay.payment.manage.kyc.enums.FilesAuthEnum;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientBDMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper;
@ -255,18 +256,25 @@ public class KycServiceImpl implements KycService {
fileComp.put("source", sourceEnum);
fileComp.put("commit_by_id", account.containsKey("account_id") ? account.getString("account_id") : account.getString("manager_id"));
fileComp.put("type", 2);
fileComp.put("id_type", account.getString("idType"));
fileComp.put("id_type", account.getString("id_type"));
clientComplianceCompanyMapper.save(fileComp);
clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id"));
clientFilesMapper.updateFilesAuthStatus(client.getIntValue("client_id"),
FilesAuthEnum.COMMIT_OPR.getAfterStatus(),
FilesAuthEnum.COMMIT_OPR.getBeforeStatus(),
FilesAuthEnum.COMMIT_OPR.getAuthType("kyc"));
} else if (fileComp.getIntValue("status") == 2 || fileComp.getIntValue("status") == 9) {
fileComp.put("status", 0);
fileComp.put("submit_time", new Date());
fileComp.put("source", sourceEnum);
fileComp.put("commit_by_id", account.containsKey("account_id") ? account.getString("account_id") : account.getString("manager_id"));
fileComp.put("id_type", account.getString("idType"));
fileComp.put("id_type", account.getString("id_type"));
fileComp.put("bd_handle", account.getString("bd_handle"));
clientComplianceCompanyMapper.update(fileComp);
clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id"));
clientFilesMapper.updateFilesAuthStatus(client.getIntValue("client_id"),
FilesAuthEnum.COMMIT_OPR.getAfterStatus(),
FilesAuthEnum.COMMIT_OPR.getBeforeStatus(),
FilesAuthEnum.COMMIT_OPR.getAuthType("kyc"));
} else {
throw new BadRequestException("please do not repeat submission");
}

@ -0,0 +1,41 @@
package au.com.royalpay.payment.manage.kyc.enums;
/**
* @Author: liuxinxin
* @Date: 2019-12-13
*/
public enum FilesAuthEnum {
PASS_OPR(new int[]{2},1),
COMMIT_OPR(new int[]{0,3},2),
REFUSE_OPR(new int[]{2},3);
private final int[] beforeStatus;
private final int afterStatus;
public int[] getBeforeStatus() {
return beforeStatus;
}
public int getAfterStatus() {
return afterStatus;
}
FilesAuthEnum(int[] beforeStatus, int afterStatus) {
this.beforeStatus = beforeStatus;
this.afterStatus = afterStatus;
}
public String[] getAuthType(String type) {
switch (type) {
case "kyc":
return new String[]{"client_bank_file","client_id_file","kyc_utility_bill_file"};
case "compliance":
return new String[]{"client_bank_file","client_id_file","client_agree_file","client_company_file"};
default:
return null;
}
}
}

@ -51,9 +51,6 @@ public interface ClientFilesMapper {
void confirmAgreeFile(@Param("client_id") int client_id);
void updateBeforeCompliance(@Param("client_id") int client_id);
void updateFilesAuthStatus(@Param("client_id") int client_id,@Param("status") int status,@Param("original_status_type") int[] original_status_type,@Param("file_names") String[] file_names);
void refuseCompliance(@Param("client_id") int client_id);
void passCompliance(@Param("client_id") int client_id);
}

@ -26,6 +26,7 @@ import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService;
import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply;
import au.com.royalpay.payment.manage.dev.bean.TestMerchantAccountInfo;
import au.com.royalpay.payment.manage.device.core.DeviceManager;
import au.com.royalpay.payment.manage.kyc.enums.FilesAuthEnum;
import au.com.royalpay.payment.manage.management.sysconfig.core.impls.PermissionPartnerManagerImpl;
import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper;
import au.com.royalpay.payment.manage.mappers.log.*;
@ -3662,7 +3663,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
fileComp.put("source", sourceEnum);
fileComp.put("commit_by_id", account.getString("account_id"));
clientComplianceCompanyMapper.save(fileComp);
clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id"));
clientFilesMapper.updateFilesAuthStatus(client.getIntValue("client_id"),
FilesAuthEnum.COMMIT_OPR.getAfterStatus(),
FilesAuthEnum.COMMIT_OPR.getBeforeStatus(),
FilesAuthEnum.COMMIT_OPR.getAuthType("compliance"));
} else if (fileComp.getIntValue("status") == 2) {
fileComp.put("status", 0);
fileComp.put("submit_time", new Date());
@ -3672,7 +3676,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
fileComp.put("source", sourceEnum);
fileComp.put("commit_by_id", account.getString("account_id"));
clientComplianceCompanyMapper.update(fileComp);
clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id"));
clientFilesMapper.updateFilesAuthStatus(client.getIntValue("client_id"),
FilesAuthEnum.COMMIT_OPR.getAfterStatus(),
FilesAuthEnum.COMMIT_OPR.getBeforeStatus(),
FilesAuthEnum.COMMIT_OPR.getAuthType("compliance"));
} else {
throw new BadRequestException("please do not repeat submission");
}

@ -37,20 +37,23 @@
and client_id = #{client_id}
</update>
<update id="updateBeforeCompliance">
<update id="updateFilesAuthStatus">
update sys_files
set status = 2
set status = #{status}
where client_id = #{client_id}
and is_valid = 1
and (status = 0 or status = 3)
</update>
<update id="refuseCompliance">
update sys_files set `status` = 3 where client_id = #{client_id} and is_valid = 1 and status = 2
</update>
<update id="passCompliance">
update sys_files set `status` = 1 where client_id = #{client_id} and is_valid = 1 and status = 2
<if test="original_status_type !=null ">
AND status IN
<foreach collection="original_status_type" open="(" close=")" separator="," item="status_type">
#{status_type}
</foreach>
</if>
<if test="file_names!=null">
AND file_name IN
<foreach collection="file_names" open="(" close=")" separator="," item="file_name">
#{file_name}
</foreach>
</if>
</update>
</mapper>

@ -20,7 +20,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.file = file.data || {};
$scope.partner = partner.data || {};
$scope.file.id_type = "";
$scope.file.id_type = $scope.file.file_company.id_type||"";
$scope.file.need_bd = true;
//audit files

@ -18,8 +18,8 @@
</style>
<section class="content-header">
<h1>商户KYC文件补充
<span class="small text-danger" style="margin: 20px 20px;font-size: 20px;" ng-if="file.client_refuse_reason">
({{file.client_refuse_reason}})</span>
<span class="small text-danger" style="margin: 20px 20px;font-size: 20px;" ng-if="file.file_company.description">
({{file.file_company.description}})</span>
</h1>
<br/>
<p ng-if="currentUser.client.client_less_file && currentUser.lessKycFiles">前去补充合规文件:<a ui-sref="compliance_to_perfect">点击前往</a></p>
@ -43,8 +43,7 @@
<td><a ng-if="bankIsImage" 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>
onerror="this.src='/static/images/file_close.png'"></a>
</td>
</tr>
</tbody>

@ -14,7 +14,7 @@
<div class="form-group">
<label class="control-label col-sm-2">* ASIC File</label>
<div class="col-sm-4">
<div class="form-control-static">
<div class="form-control-static" ng-if="role =='compliance'">
<button class="btn btn-primary" type="button"
ngf-select="uploadBankFile($file)">
<i class="fa fa-upload"></i> Upload
@ -53,7 +53,7 @@
<div class="form-group">
<label class="control-label col-sm-2">* ID </label>
<div class="col-sm-4">
<div class="form-control-static">
<div class="form-control-static" ng-if="role =='compliance'">
<button class="btn btn-primary" type="button"
ngf-select="uploadIDFile($file)">
<i class="fa fa-upload"></i> Upload
@ -96,7 +96,7 @@
<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">
<div class="form-control-static" ng-if="role =='compliance'">
<button class="btn btn-primary" type="button"
ngf-select="uploadCompanyFile($file)">
<i class="fa fa-upload"></i> Upload

@ -149,7 +149,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
title: 'Confirm!',
content: '确认是否通过商户合规文件?'
}).then(function () {
$http.put('/compliance/audit/' + $scope.file.client.client_id + '/pass/complianceFile', {}).then(function (resp) {
$http.put('/compliance/audit/' + $scope.file.client.client_id + '/pass/kycFile', {}).then(function (resp) {
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});
@ -175,7 +175,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS
$scope.refusePartnerComplianceFiles = function () {
var a = $scope.partner.description;
$http.put('/compliance/audit/'+$scope.partner.client_id+'/refuse/complianceFile',{description:$scope.partner.description}).then(function (resp) {
$http.put('/compliance/audit/'+$scope.partner.client_id+'/refuse/kycFile',{description:$scope.partner.description}).then(function (resp) {
$state.reload();
}, function (resp) {
commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'});

Loading…
Cancel
Save