From 79193155b2baabccf94c115a329780934f9fdc72 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Thu, 12 Dec 2019 16:48:19 +0800 Subject: [PATCH] [R]fix --- .../manage/merchants/core/ClientManager.java | 2 ++ .../core/impls/ClientManagerImpl.java | 21 +++++++++++++++++++ .../merchants/web/PartnerViewController.java | 17 ++++++++++++++- src/main/ui/static/payment/kyc/kyc.js | 2 +- 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java index 9a725a52d..3f635fabd 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/ClientManager.java @@ -262,6 +262,8 @@ public interface ClientManager { void uploadKycFiles(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo); + List uploadKycFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo); + List uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo); void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java index 321f509c7..9cb1ad500 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/core/impls/ClientManagerImpl.java @@ -3560,6 +3560,27 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return fileResult; } + @Override + @Transactional + public List uploadKycFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + List fileResult = new ArrayList<>(); + if (client == null) { + throw new InvalidShortIdException(); + } + int clientId = client.getIntValue("client_id"); + try { + updateSysClientFilesForWaitCompliance(manager, clientId, CLIENT_BANK_FILE, filesInfo.getFile_bank_info(),fileResult); + updateSysClientFilesForWaitCompliance(manager, clientId, CLIENT_ID_FILE, filesInfo.getFile_id_info(),fileResult); + updateSysClientFilesForWaitCompliance(manager, clientId, KYC_UTILITY_BILL_FILE, filesInfo.getUtility_bill_info(),fileResult); + } catch (Exception e) { + logger.error("上传KYC文件失败", e); + throw new BadRequestException("上传KYC文件失败" + e.getMessage()); + } + return fileResult; + } + + @Override @Transactional public void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source) { diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java index 21359a1b8..a0eed3674 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerViewController.java @@ -2,6 +2,7 @@ package au.com.royalpay.payment.manage.merchants.web; import au.com.royalpay.payment.core.exceptions.ParamInvalidException; import au.com.royalpay.payment.manage.kyc.core.KycService; +import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper; import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; @@ -60,6 +61,8 @@ public class PartnerViewController { @Resource private SignInAccountService signInAccountService; @Resource + private ClientComplianceCompanyMapper clientComplianceCompanyMapper; + @Resource private KycService kycService; @RequestMapping(method = RequestMethod.GET) @@ -588,6 +591,19 @@ public class PartnerViewController { 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) { + JSONObject KycFilesAuth = clientComplianceCompanyMapper.findKycFileComplete(account.getIntValue("client_id")); + if (KycFilesAuth == null) { + JSONObject manager = new JSONObject(); + manager.put("display_name","client"); + clientManager.uploadKycFilesForWaitCompliance(manager, account.getString("client_moniker"), filesInfo); + }else { + throw new BadRequestException("已通过审核,暂不能提交和修改"); + } + } + @PartnerMapping(value = "/update/wait_compliance_file", method = RequestMethod.PUT) @ResponseBody public void updateWaitComplianceFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientAuthFilesInfo filesInfo) { @@ -602,7 +618,6 @@ public class PartnerViewController { } } - @PartnerMapping(value = "/clientCompliance/{clientMoniker}/viewCommit", method = RequestMethod.POST) @ResponseBody public void clientComplianceViewCommit(@PathVariable String clientMoniker ,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody JSONObject photoInfo) { diff --git a/src/main/ui/static/payment/kyc/kyc.js b/src/main/ui/static/payment/kyc/kyc.js index 9d27012d3..9870c3fda 100644 --- a/src/main/ui/static/payment/kyc/kyc.js +++ b/src/main/ui/static/payment/kyc/kyc.js @@ -124,7 +124,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS } $scope.updateFile = function () { - $http.put('/client/partner_info/update/kycFile', $scope.file).then(function () { + $http.put('/client/partner_info/update/wait_kyc_file', $scope.file).then(function () { commonDialog.alert({ title: 'Success', content: 'Upload Successful',