From 0b7616f2125089c4fceae89132f20d5d1ab1035e Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Mon, 9 Dec 2019 13:51:00 +0800 Subject: [PATCH 01/32] =?UTF-8?q?[R]KCY=E8=AE=A4=E8=AF=81Web=E7=AB=AF?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mappers/system/ClientAsicFilesMapper.java | 55 +++++ .../manage/merchants/core/ClientManager.java | 2 + .../core/impls/ClientManagerImpl.java | 17 ++ .../merchants/web/PartnerViewController.java | 6 + src/main/ui/static/payment/partner/partner.js | 222 ++++++++++++++++++ .../partner/templates/client_asic_files.html | 73 ++++++ .../templates/client_partner_detail.html | 4 + 7 files changed, 379 insertions(+) create mode 100644 src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAsicFilesMapper.java create mode 100644 src/main/ui/static/payment/partner/templates/client_asic_files.html diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAsicFilesMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAsicFilesMapper.java new file mode 100644 index 000000000..ebefafc10 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAsicFilesMapper.java @@ -0,0 +1,55 @@ +package au.com.royalpay.payment.manage.mappers.system; + +import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect; +import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; +import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; +import cn.yixblog.support.mybatis.autosql.annotations.SqlType; +import com.alibaba.fastjson.JSONObject; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * Created by yishuqian on 06/03/2017. + */ +@AutoMapper(tablename = "sys_asic_files", pkName = "file_id") +public interface ClientAsicFilesMapper { + @AutoSql(type = SqlType.INSERT) + void save(JSONObject partner); + + @AutoSql(type = SqlType.UPDATE) + void update(JSONObject partner); + + @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "is_valid = 1 and status = 1") + List findClientFile(@Param("client_id") int clientId); + + @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 1 or status = 2) and file_name='client_agree_file'") + List findClientPassAggreeFile(@Param("client_id") int clientId); + + @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 0 or status = 3) and file_name='client_agree_file'") + List findClientAggreeFileCommit(@Param("client_id") int clientId); + + List findAllClientFile(@Param("client_id") int clientId); + + @AutoSql(type = SqlType.SELECT) + JSONObject findFileById(@Param("file_id") String file_id); + + List findFileByClientAndType(@Param("client_id") int client_id, @Param("file_name") String file_name); + + JSONObject getSourceAgreeFilesByClientId(@Param("client_id") int clientId); + + void deleteByClientAndFileId(@Param("file_id") String file_id); + + void deleteAggreeByClientId(@Param("client_id") int file_id); + + void confirmAgreeFile(@Param("client_id") int client_id); + + void updateBeforeCompliance(@Param("client_id") int client_id); + + void refuseCompliance(@Param("client_id") int client_id); + + void passCompliance(@Param("client_id") int client_id); +} 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 3cbdf6454..bba14968a 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 @@ -248,6 +248,8 @@ public interface ClientManager { JSONObject getAuthFiles(JSONObject manager, String clientMoniker); + JSONObject getAsicFiles(JSONObject manager, String clientMoniker); + JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker); JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker); 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 26a4f6dd8..4c12b38e7 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 @@ -230,6 +230,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Resource private ClientFilesMapper clientFilesMapper; + @Resource + private ClientAsicFilesMapper clientAsicFilesMapper; + @Resource private TransactionMapper transactionMapper; @@ -3384,6 +3387,20 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return fileJson; } + @Override + public JSONObject getAsicFiles(JSONObject manager, String clientMoniker) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + List clientFiles = clientAsicFilesMapper.findClientFile(client.getIntValue("client_id")); + JSONObject fileJson = new JSONObject(); + for (JSONObject file : clientFiles) { + fileJson.put(file.getString("file_name"), file.getString("file_value")); + } + return fileJson; + } + @Override public JSONObject getSourceAgreeFiles(JSONObject manage, String clientMoniker) { JSONObject client = getClientInfoByMoniker(clientMoniker); 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 4d8441971..0cfb51557 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 @@ -524,6 +524,12 @@ public class PartnerViewController { return clientManager.getAuthFiles(null,account.getString("client_moniker")); } + @PartnerMapping(value = "/asic/files", method = RequestMethod.GET) + @ResponseBody + public JSONObject asicFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + return clientManager.getAsicFiles(null,account.getString("client_moniker")); + } + @PartnerMapping(value = "/compliance/complianceInfo", method = RequestMethod.GET) @ResponseBody public JSONObject complianceInfo(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index 00233e49e..70c51e78f 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -74,6 +74,15 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo url: '/devices', templateUrl: '/static/payment/partner/templates/client_devices.html', controller: 'clientDeviceCtrl' + }).state('basic.asic_files', { + url: '/{client_moniker}/asic_files', + templateUrl: '/static/payment/partner/templates/client_asic_files.html', + controller: 'clientASICFilesCtrl', + resolve: { + asicFile: ['$http', function ($http) { + return $http.get('/client/partner_info/asic/files'); + }] + } }) }]); app.controller('clientPartnerDetailCtrl', ['$scope', '$http', 'stateMap', 'partner', 'industryMap', 'businessStructuresMap', 'commonDialog', 'Upload', '$state', function ($scope, $http, stateMap, partner, industryMap, businessStructuresMap, commonDialog, Upload, $state) { @@ -856,6 +865,219 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo } }; }]); + + app.controller('clientASICFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, asicFile) { + + $scope.asicFile = asicFile.data || {}; + //asic files + debugger; + $scope.id_type = 'passport'; + + $scope.uploadAsicFile = function (file) { + debugger; + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.AsicFileProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.AsicFileProgress; + $scope.asicFile.file_bank_info = resp.data.url; + $scope.updateFile(); + if ($scope.asicFile.file_bank_info.endsWith('pdf')) { + $scope.AsicIsImage = false; + } else { + $scope.AsicIsImage = true; + } + }, function (resp) { + delete $scope.AsicFileProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.AsicFileProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + $scope.agreeIsImage = true; + if ($scope.file.file_agreement_info && $scope.file.file_agreement_info.endsWith('pdf')) { + $scope.agreeIsImage = false; + } + $scope.bankIsImage = true; + if ($scope.file.file_bank_info && $scope.file.file_bank_info.endsWith('pdf')) { + $scope.bankIsImage = false; + } + $scope.companyIsImage = true; + if ($scope.file.file_company_info && $scope.file.file_company_info.endsWith('pdf')) { + $scope.companyIsImage = false; + } + $scope.applyIsImage = true; + if ($scope.file.file_apply_info && $scope.file.file_apply_info.endsWith('pdf')) { + $scope.applyIsImage = false; + } + $scope.idIsImage = true; + if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) { + $scope.idIsImage = false; + } + + $scope.uploadCompanyFile = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.companyFileProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.companyFileProgress; + $scope.file.file_company_info = resp.data.url; + $scope.updateFile(); + if ($scope.file.file_company_info.endsWith('pdf')) { + $scope.companyIsImage = false; + } else { + $scope.companyIsImage = true; + } + }, function (resp) { + delete $scope.companyFileProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.companyFileProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + //上传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.uploadAgreementFile = function (file) { + if (file != null) { + if (file.size > 10 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过5MB,请压缩后重试', type: 'error'}) + } else { + $scope.agreementFileProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.agreementFileProgress; + $scope.file.file_agreement_info = resp.data.url; + $scope.updateFile(); + if ($scope.file.file_agreement_info.endsWith('pdf')) { + $scope.agreeIsImage = false; + } else { + $scope.agreeIsImage = true; + } + }, function (resp) { + delete $scope.agreementFileProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.agreementFileProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + //上传申请表 + $scope.uploadApplyFile = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.applyFileProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.applyFileProgress; + $scope.file.file_apply_info = resp.data.url; + $scope.updateFile(); + if ($scope.file.file_apply_info.endsWith('pdf')) { + $scope.applyIsImage = false; + } else { + $scope.applyIsImage = true; + } + }, function (resp) { + delete $scope.applyFileProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.applyFileProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + + } + } + }; + + /* $scope.downloadAsZip = function () { + var url = '/sys/partners/' + $scope.partner.client_moniker + '/download/complianceAsZIP'; + return url; + }; + */ + $scope.updateFile = function () { + $http.put('/client/partner_info/update/file', $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.commitPartner = function () { + if ($scope.file) { + if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) { + $http.put('/client/partner_info/compliance_audit').then(function (resp) { + + }); + } else { + commitError(); + } + } else { + commitError(); + } + }; + }]); + + app.controller('clientCommitToComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file','partner', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file, partner) { $scope.file = file.data || {}; $scope.partner = partner.data || {}; diff --git a/src/main/ui/static/payment/partner/templates/client_asic_files.html b/src/main/ui/static/payment/partner/templates/client_asic_files.html new file mode 100644 index 000000000..138a9449b --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/client_asic_files.html @@ -0,0 +1,73 @@ + +
+
+
+
+ +
+
+ + + +
+ + + +
+
+
+

Example:请保证图片信息清晰可见,如下图

+ +
+
+
+ +
+ +
+
+ + + +
+ + + +
+
+
+
+

Example:请保证图片(护照或驾照)信息清晰可见,如下图

+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ diff --git a/src/main/ui/static/payment/partner/templates/client_partner_detail.html b/src/main/ui/static/payment/partner/templates/client_partner_detail.html index dbbcd61c1..60c3eabbc 100644 --- a/src/main/ui/static/payment/partner/templates/client_partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/client_partner_detail.html @@ -53,6 +53,10 @@ Compliance files +
  • + ASIC files +
  • +
    From 6daa0cf64044b41615bdfea3c2bf8a4e387dde9e Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 10 Dec 2019 15:21:37 +0800 Subject: [PATCH 02/32] =?UTF-8?q?add=20=E5=95=86=E6=88=B7kyc=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/kyc/bean/KycPartnersQuery.java | 67 ++++ .../payment/manage/kyc/core/KycManage.java | 16 + .../manage/kyc/core/impls/KycManageImpl.java | 73 ++++ .../manage/kyc/web/KycManageController.java | 38 ++ .../system/ClientComplianceCompanyMapper.java | 5 +- .../manage/mappers/system/ClientMapper.java | 2 +- .../system/ClientComplianceCompanyMapper.xml | 54 +++ .../manage/mappers/system/ClientMapper.xml | 29 +- .../commons/services/circleChart.min.js | 1 + .../ui/static/menu/templates/main_menu.html | 13 +- src/main/ui/static/payment/kyc/kyc-manage.js | 84 ++++ .../kyc/templates/partner_kyc_progress.html | 375 ++++++++++++++++++ 12 files changed, 753 insertions(+), 4 deletions(-) create mode 100644 src/main/java/au/com/royalpay/payment/manage/kyc/bean/KycPartnersQuery.java create mode 100644 src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java create mode 100644 src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java create mode 100644 src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java create mode 100644 src/main/ui/static/commons/services/circleChart.min.js create mode 100644 src/main/ui/static/payment/kyc/kyc-manage.js create mode 100644 src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/bean/KycPartnersQuery.java b/src/main/java/au/com/royalpay/payment/manage/kyc/bean/KycPartnersQuery.java new file mode 100644 index 000000000..e627150e0 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/bean/KycPartnersQuery.java @@ -0,0 +1,67 @@ +package au.com.royalpay.payment.manage.kyc.bean; + +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.lang3.StringUtils; + +/** + * Created by yishuqian on 8/30/16. + */ +public class KycPartnersQuery { + private String clientMoniker; + private String status; + private int page = 1; + private int limit = 10; + private boolean onlyMe = false; + + public String getClientMoniker() { + return clientMoniker; + } + + public void setClientMoniker(String title) { + this.clientMoniker = title; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public int getPage() { + return page; + } + + public void setPage(int page) { + this.page = page; + } + + public int getLimit() { + return limit; + } + + public void setLimit(int limit) { + this.limit = limit; + } + + public boolean isOnlyMe() { + return onlyMe; + } + + public void setOnlyMe(boolean onlyMe) { + this.onlyMe = onlyMe; + } + + public JSONObject toJsonParam() { + JSONObject param = new JSONObject(); + if (StringUtils.isNotBlank(clientMoniker)) { + param.put("clientMoniker", getClientMoniker()); + } + if (StringUtils.isNotBlank(status)) { + param.put("status", getStatus()); + } + return param; + } + +} diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java new file mode 100644 index 000000000..41f8fc80b --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java @@ -0,0 +1,16 @@ +package au.com.royalpay.payment.manage.kyc.core; + +import au.com.royalpay.payment.manage.kyc.bean.KycPartnersQuery; +import com.alibaba.fastjson.JSONObject; + +import java.util.List; + +public interface KycManage { + + JSONObject listProgressClients(JSONObject manager, KycPartnersQuery query); + + JSONObject listCompletedClients(JSONObject manager, KycPartnersQuery query); + + List listNeedHelpClients(JSONObject manager, KycPartnersQuery query); + +} diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java new file mode 100644 index 000000000..91a9b33da --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java @@ -0,0 +1,73 @@ +package au.com.royalpay.payment.manage.kyc.core.impls; + +import au.com.royalpay.payment.manage.kyc.bean.KycPartnersQuery; +import au.com.royalpay.payment.manage.kyc.core.KycManage; +import au.com.royalpay.payment.manage.mappers.financial.FinancialBDConfigMapper; +import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper; +import au.com.royalpay.payment.manage.mappers.system.ClientMapper; +import au.com.royalpay.payment.tools.permission.enums.ManagerRole; +import au.com.royalpay.payment.tools.utils.PageListUtils; +import com.alibaba.fastjson.JSONObject; +import com.github.miemiedev.mybatis.paginator.domain.Order; +import com.github.miemiedev.mybatis.paginator.domain.PageBounds; +import com.github.miemiedev.mybatis.paginator.domain.PageList; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class KycManageImpl implements KycManage { + @Resource + private ClientMapper clientMapper; + @Resource + private FinancialBDConfigMapper financialBDConfigMapper; + @Resource + private ClientComplianceCompanyMapper clientComplianceCompanyMapper; + + @Override + public JSONObject listProgressClients(JSONObject manager, KycPartnersQuery query) { + JSONObject params = query.toJsonParam(); + checkManagerPermission(manager, params, query); + PageList progressClients = clientComplianceCompanyMapper.listKycProgressClients(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); + return PageListUtils.buildPageListResult(progressClients); + } + + @Override + public JSONObject listCompletedClients(JSONObject manager, KycPartnersQuery query) { + JSONObject params = query.toJsonParam(); + checkManagerPermission(manager, params, query); + PageList completedClients = clientMapper.listCompletedContractKycClients(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); + return PageListUtils.buildPageListResult(completedClients); + } + + @Override + public List listNeedHelpClients(JSONObject manager, KycPartnersQuery query) { + JSONObject params = query.toJsonParam(); + checkManagerPermission(manager, params, query); + return clientComplianceCompanyMapper.listNeedHelpClients(params); + } + + private void checkManagerPermission(JSONObject manager, JSONObject params, KycPartnersQuery query) { + if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { + JSONObject bdConfig = financialBDConfigMapper.getBdConfig(manager.getString("manager_id")); + if (bdConfig != null) { + params.put("bd_group", bdConfig.getString("bd_group")); + List listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group")); + List bdUserId = listGroupBds.stream().map(groupBd -> groupBd.getString("manager_id")).collect(Collectors.toList()); + if (params.containsKey("bd_user")) { + if (!bdUserId.contains(params.getString("bd_user"))) { + params.remove("bd_user"); + } + } + } + if (query.isOnlyMe()) { + params.put("bd_user", manager.getString("manager_id")); + if (params.containsKey("bd_group")) { + params.remove("bd_group"); + } + } + } + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java new file mode 100644 index 000000000..9a73613d3 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java @@ -0,0 +1,38 @@ +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.KycManage; +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; +import com.alibaba.fastjson.JSONObject; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +@RestController +@RequestMapping("/sys/kyc/manage") +public class KycManageController { + + @Resource + private KycManage kycManage; + + @ManagerMapping(value = "/partner/progressing", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) + public JSONObject listProgressClients(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, KycPartnersQuery query) { + return kycManage.listProgressClients(manager, query); + } + + @ManagerMapping(value = "/partner/completed", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) + public JSONObject listCompletedClients(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, KycPartnersQuery query) { + return kycManage.listCompletedClients(manager, query); + } + + @ManagerMapping(value = "/partner/need_help", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) + public List listNeedHelpClients(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, KycPartnersQuery query) { + return kycManage.listNeedHelpClients(manager, query); + } +} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java index 3a1a84cac..0b679b211 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java @@ -1,6 +1,5 @@ package au.com.royalpay.payment.manage.mappers.system; -import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect; import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; @@ -27,4 +26,8 @@ public interface ClientComplianceCompanyMapper { PageList listClientCompliances(JSONObject params, PageBounds pageBounds); + List listNeedHelpClients(JSONObject params); + + PageList listKycProgressClients(JSONObject params, PageBounds pageBounds); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index ca69cb19f..e031a1e74 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -4,7 +4,6 @@ import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect; import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; @@ -141,4 +140,5 @@ public interface ClientMapper { List listUseAlipayMerchant(@Param("start") int start, @Param("end") int end); + PageList listCompletedContractKycClients(JSONObject params, PageBounds pageBounds); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml index 11b887cbe..cb20417ca 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml @@ -2,15 +2,69 @@ + + + + diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml index 14649d122..bc0238644 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml @@ -770,5 +770,32 @@ and client_id < #{end} - + diff --git a/src/main/ui/static/commons/services/circleChart.min.js b/src/main/ui/static/commons/services/circleChart.min.js new file mode 100644 index 000000000..8cd5f4662 --- /dev/null +++ b/src/main/ui/static/commons/services/circleChart.min.js @@ -0,0 +1 @@ +(function(a){"use strict";a.fn.circleChart=function(g){const h={color:"#3459eb",backgroundColor:"#e6e6e6",background:!0,speed:2e3,widthRatio:0.2,value:66,unit:"percent",counterclockwise:!1,size:110,startAngle:0,animate:!0,backgroundFix:!0,lineCap:"round",animation:"easeInOutCubic",text:!1,redraw:!1,cAngle:0,textCenter:!0,textSize:!1,textWeight:"normal",textFamily:"sans-serif",relativeTextSize:1/7,autoCss:!0,onDraw:!1};let i={linearTween:(s,u,v,w)=>v*s/w+u,easeInQuad:(s,u,v,w)=>{return s/=w,v*s*s+u},easeOutQuad:(s,u,v,w)=>{return s/=w,-v*s*(s-2)+u},easeInOutQuad:(s,u,v,w)=>{return(s/=w/2,1>s)?v/2*s*s+u:(s--,-v/2*(s*(s-2)-1)+u)},easeInCubic:(s,u,v,w)=>{return s/=w,v*s*s*s+u},easeOutCubic:(s,u,v,w)=>{return s/=w,s--,v*(s*s*s+1)+u},easeInOutCubic:(s,u,v,w)=>{return(s/=w/2,1>s)?v/2*s*s*s+u:(s-=2,v/2*(s*s*s+2)+u)},easeInQuart:(s,u,v,w)=>{return s/=w,v*s*s*s*s+u},easeOutQuart:(s,u,v,w)=>{return s/=w,s--,-v*(s*s*s*s-1)+u},easeInOutQuart:(s,u,v,w)=>{return(s/=w/2,1>s)?v/2*s*s*s*s+u:(s-=2,-v/2*(s*s*s*s-2)+u)},easeInQuint:(s,u,v,w)=>{return s/=w,v*s*s*s*s*s+u},easeOutQuint:(s,u,v,w)=>{return s/=w,s--,v*(s*s*s*s*s+1)+u},easeInOutQuint:(s,u,v,w)=>{return(s/=w/2,1>s)?v/2*s*s*s*s*s+u:(s-=2,v/2*(s*s*s*s*s+2)+u)},easeInSine:(s,u,v,w)=>-v*Math.cos(s/w*(Math.PI/2))+v+u,easeOutSine:(s,u,v,w)=>v*Math.sin(s/w*(Math.PI/2))+u,easeInOutSine:(s,u,v,w)=>-v/2*(Math.cos(Math.PI*s/w)-1)+u,easeInExpo:(s,u,v,w)=>v*Math.pow(2,10*(s/w-1))+u,easeOutExpo:(s,u,v,w)=>v*(-Math.pow(2,-10*s/w)+1)+u,easeInOutExpo:(s,u,v,w)=>{return(s/=w/2,1>s)?v/2*Math.pow(2,10*(s-1))+u:(s--,v/2*(-Math.pow(2,-10*s)+2)+u)},easeInCirc:(s,u,v,w)=>{return s/=w,-v*(Math.sqrt(1-s*s)-1)+u},easeOutCubic:(s,u,v,w)=>{return s/=w,s--,v*(s*s*s+1)+u},easeInOutCubic:(s,u,v,w)=>{return(s/=w/2,1>s)?v/2*s*s*s+u:(s-=2,v/2*(s*s*s+2)+u)},easeOutCirc:(s,u,v,w)=>{return s/=w,s--,v*Math.sqrt(1-s*s)+u},easeInOutCirc:(s,u,v,w)=>{return(s/=w/2,1>s)?-v/2*(Math.sqrt(1-s*s)-1)+u:(s-=2,v/2*(Math.sqrt(1-s*s)+1)+u)}},j=(s,u,v,w,x,y,z,A)=>{let B=Object.create(j.prototype);return B.pos=s,B.bAngle=u,B.eAngle=v,B.cAngle=w,B.radius=x,B.lineWidth=y,B.sAngle=z,B.settings=A,B};j.prototype={onDraw(s){if(!1!==this.settings.onDraw){let u=Object.assign({},this),v={percent:q,rad:w=>w,"default":n};u.value=(v[this.settings.unit]||v["default"])(u.cAngle),u.text=w=>l(s,w),u.settings.onDraw(s,u)}},drawBackground(s){s.beginPath(),s.arc(this.pos,this.pos,this.settings.backgroundFix?0.9999*this.radius:this.radius,0,2*Math.PI),s.lineWidth=this.settings.backgroundFix?0.95*this.lineWidth:this.lineWidth,s.strokeStyle=this.settings.backgroundColor,s.stroke()},draw(s){if(s.beginPath(),this.settings.counterclockwise){let u=2*Math.PI;s.arc(this.pos,this.pos,this.radius,u-this.bAngle,u-(this.bAngle+this.cAngle),this.settings.counterclockwise)}else s.arc(this.pos,this.pos,this.radius,this.bAngle,this.bAngle+this.cAngle,this.settings.counterclockwise);s.lineWidth=this.lineWidth,s.lineCap=this.settings.lineCap,s.strokeStyle=this.settings.color,s.stroke()},animate(s,u,v,w,x){let y=new Date().getTime()-v;1>y&&(y=1),v-w<1.05*this.settings.speed&&(!x&&1e3*this.cAngle<=Math.floor(1e3*this.eAngle)||x&&1e3*this.cAngle>=Math.floor(1e3*this.eAngle))?(this.cAngle=i[this.settings.animation]((v-w)/y,this.sAngle,this.eAngle-this.sAngle,this.settings.speed/y),u.clearRect(0,0,this.settings.size,this.settings.size),this.settings.background&&this.drawBackground(u),this.draw(u),this.onDraw(s),v=new Date().getTime(),r(()=>this.animate(s,u,v,w,x))):(this.cAngle=this.eAngle,u.clearRect(0,0,this.settings.size,this.settings.size),this.settings.background&&this.drawBackground(u),this.draw(u),this.setCurrentAnglesData(s))},setCurrentAnglesData(s){let u={percent:q,rad:w=>w,"default":n},v=u[this.settings.unit]||u["default"];s.data("current-c-angle",v(this.cAngle)),s.data("current-start-angle",v(this.bAngle))}};let l=(s,u)=>{s.data("text",u),a(".circleChart_text",s).html(u)},m=s=>{let u=s.getContext("2d"),v=window.devicePixelRatio||1,w=u.webkitBackingStorePixelRatio||u.mozBackingStorePixelRatio||u.msBackingStorePixelRatio||u.oBackingStorePixelRatio||u.backingStorePixelRatio||1,x=v/w,y=s.width,z=s.height;s.width=y*x,s.height=z*x,s.style.width=y+"px",s.style.height=z+"px",u.scale(x,x)},n=s=>180*(s/Math.PI),o=s=>s/180*Math.PI,p=s=>o(360*(s/100)),q=s=>100*(n(s)/360),r=(()=>window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(u){window.setTimeout(u,1e3/60)})();return this.each((s,u)=>{let v=a(u),w={},x=v.data();for(let K in x)x.hasOwnProperty(K)&&0===K.indexOf("_cache_")&&h.hasOwnProperty(K.substring(7))&&(w[K.substring(7)]=x[K]);let y=Object.assign({},h,w,x,g);for(let K in y)y.hasOwnProperty(K)&&0!==K.indexOf("_cache_")&&v.data("_cache_"+K,y[K]);a("canvas.circleChart_canvas",v).length||(v.append(function(){return a("",{"class":"circleChart_canvas"}).prop({width:y.size,height:y.size}).css(y.autoCss?{"margin-left":"auto","margin-right":"auto",display:"block"}:{})}),m(a("canvas",v).get(0))),a("p.circleChart_text",v).length||!1===y.text||(v.append("

    "+y.text+"

    "),y.autoCss&&(y.textCenter?a("p.circleChart_text",v).css({position:"absolute","line-height":y.size+"px",top:0,width:"100%",margin:0,padding:0,"text-align":"center","font-size":!1===y.textSize?y.size*y.relativeTextSize:y.textSize,"font-weight":y.textWeight,"font-family":y.textFamily}):a("p.circleChart_text",v).css({"padding-top":"5px","text-align":"center","font-weight":y.textWeight,"font-family":y.textFamily,"font-size":!1===y.textSize?y.size*y.relativeTextSize:y.textSize}))),y.autoCss&&v.css("position","relative"),y.redraw||(y.cAngle=y.currentCAngle?y.currentCAngle:y.cAngle,y.startAngle=y.currentStartAngle?y.currentStartAngle:y.startAngle);let z=a("canvas",v).get(0),A=z.getContext("2d"),B={percent:p,rad:K=>K,"default":o},C=B[y.unit]||B["default"],D=C(y.startAngle),E=C(y.value),F=C(y.cAngle),G=y.size/2,H=G*(1-y.widthRatio/2),I=H*y.widthRatio,J=j(G,D,E,F,H,I,F,y);v.data("size",y.size),y.animate?0===y.value?r(()=>{A.clearRect(0,0,y.size,y.size),J.settings.background&&J.drawBackground(A),J.onDraw(v)}):J.animate(v,A,new Date().getTime(),new Date().getTime(),F>E):(J.cAngle=J.eAngle,r(()=>{A.clearRect(0,0,y.size,y.size),y.background&&J.drawBackground(A),0===y.value?J.settings.background&&J.drawBackground(A):(J.draw(A),J.setCurrentAnglesData(v)),J.onDraw(v)}))})}})(jQuery); diff --git a/src/main/ui/static/menu/templates/main_menu.html b/src/main/ui/static/menu/templates/main_menu.html index 254faa697..102153b65 100644 --- a/src/main/ui/static/menu/templates/main_menu.html +++ b/src/main/ui/static/menu/templates/main_menu.html @@ -31,7 +31,8 @@
    ---> 返回 +--> + 返回
    @@ -61,6 +62,16 @@
    + diff --git a/src/main/ui/static/payment/kyc/kyc-manage.js b/src/main/ui/static/payment/kyc/kyc-manage.js new file mode 100644 index 000000000..d01c9fbdc --- /dev/null +++ b/src/main/ui/static/payment/kyc/kyc-manage.js @@ -0,0 +1,84 @@ +define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiSelect'], function (angular) { + 'use strict'; + var app = angular.module('kycManageApp', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload', 'ui.select']); + app.config(['$stateProvider', function ($stateProvider) { + $stateProvider.state('partnerKYCProgress', { + url: '/partners/partnerKYCProgress', + templateUrl: 'static/payment/kyc/templates/partner_kyc_progress.html', + controller: 'partnerKYCProgressCtrl' + }) + }]); + + app.controller('partnerKYCProgressCtrl', ['$scope', '$sce', '$http','$uibModal', + function ($scope, $sce, $http, $uibModal) { + $scope.ctrl = { + plusShow1: false, + plusShow2: false, + plusShow3: false + }; + $scope.progressPagination = {}; + $scope.completedPagination = {}; + $scope.params = {}; + $scope.loadClientProgressing = function (page,status) { + var params = angular.copy($scope.params); + params.status = status; + params.page = page || $scope.progressPagination.page || 1; + $http.get('/sys/kyc/manage/partner/progressing', {params: params}).then(function (resp) { + $scope.approving = resp.data.data; + $scope.progressPagination = resp.data.pagination; + }); + }; + + $scope.loadClientCompleted = function (page) { + var params = angular.copy($scope.params); + params.page = page || $scope.completedPagination.page || 1; + $http.get('/sys/kyc/manage/partner/completed', {params: params}).then(function (resp) { + $scope.completed_contract = resp.data.data; + $scope.completedPagination = resp.data.pagination; + }); + }; + + $scope.loadClientNeedHelp = function () { + var params = angular.copy($scope.params); + $http.get('/sys/kyc/manage/partner/need_help', {params: params}).then(function (resp) { + $scope.need_help = resp.data; + }); + }; + $scope.loadClientNeedHelp(); + $scope.loadClientCompleted(); + $scope.loadClientProgressing(); + $scope.statusSelected = function (arr) { + return $scope.params.status != null && $scope.params.status.filter(function (status) { + return arr.indexOf(status) >= 0 + }).length > 0 || $scope.status != null && $scope.status.filter(function (status) { + return arr.indexOf(status) >= 0 + }).length > 0 + }; + + $scope.addHandleLog = function (info) { + debugger + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/add_handle_log.html', + controller: 'addHandleDetailCtrl', + resolve:{ + compliance_id:function () { + return info.compliance_id; + }} + }).result.then(function () { + commonDialog.alert({title: 'Success', type: 'success'}); + }) + }; + }]); + + app.controller('addHandleDetailCtrl', [ '$scope', '$http', '$state', 'compliance_id', 'commonDialog',function ($scope, $http, $state, compliance_id, commonDialog) { + $scope.handleDetail = {compliance_id:compliance_id}; + $scope.addHandleLog = function () { + $http.put('/register/manage', $scope.handleDetail).then(function (resp) { + $scope.$close(); + },function (resp) { + + }); + } + }]); + return app; +}); diff --git a/src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html b/src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html new file mode 100644 index 000000000..127f415f2 --- /dev/null +++ b/src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html @@ -0,0 +1,375 @@ + + + +
    +

    商户KYC认证进度

    + +
    + +
    +
    + +
    +
    +

    44

    + +

    User Registrations

    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +

    44

    + +

    User Registrations

    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +

    44

    + +

    User Registrations

    +
    +
    +
    +
    +
    +
    +
    + +
    +
    待处理需要帮助的商户({{need_help.length}}家): +
    + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    Client MonikerShort NameCompliance StatusRegister TimeSubmit TimeSourceOperation
    + {{client.client_moniker}} + + 通过({{client.approve_time}}) + 资料完善中 + (自助开通)资料完善中 + 自助开通试用中({{client.approve_time}}~{{client.expiry_time}}) + 不通过({{client.approve_time}}) + 申请打回({{client.refuse_remark|limitTo:15}}) + 等待合规 + 自助开通(等待合规) + 合同制作完成 + 等待BD上传材料审核 + 绿色通道申请中 + 等待合规 + + App + Web + + + Detail + | + Handle + +
    +
    +
    + + +
    +
    已提交审核({{progressPagination.totalCount}}家): +
    + + +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +

    + All | + 待审核| + 通过 +

    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Client MonikerShort NameCompliance StatusRegister TimeAuthFile StatusSubmit TimeSourceOperation
    + 通过({{client.approve_time}}) + 资料完善中 + (自助开通)资料完善中 + 自助开通试用中({{client.approve_time}}~{{client.expiry_time}}) + 不通过({{client.approve_time}}) + 申请打回({{client.refuse_remark|limitTo:15}}) + 等待合规 + 自助开通(等待合规) + 合同制作完成 + 等待BD上传材料审核 + 绿色通道申请中 + 等待合规 + + 待审核 + 通过 + 打回 + + App + Web + + Detail + +
    +
    + +
    +
    + +
    +
    未提交审核({{completedPagination.totalCount}}家): +
    + + +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +

    + All | + 未提交 | + 打回 +

    +
    +
    + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Client MonikerShort NameCompliance StatusRegister TimeOperation
    + 通过({{client.approve_time}}) + 资料完善中 + (自助开通)资料完善中 + 自助开通试用中({{client.approve_time}}~{{client.expiry_time}}) + 不通过({{client.approve_time}}) + 申请打回({{client.refuse_remark|limitTo:15}}) + 等待合规 + 自助开通(等待合规) + 合同制作完成 + 等待BD上传材料审核 + 绿色通道申请中 + 等待合规 + + Detail + +
    +
    + +
    +
    + From 97effc720b2abdbef0ae4228f14f80a7e06ad793 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 10 Dec 2019 16:20:54 +0800 Subject: [PATCH 03/32] =?UTF-8?q?add=20=E5=95=86=E6=88=B7=E7=94=B3?= =?UTF-8?q?=E8=AF=B7BD=E5=B8=AE=E5=8A=A9=E5=90=8E=EF=BC=8C=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E6=8E=A8=E9=80=81=E3=80=81=E5=BE=AE=E4=BF=A1=E6=8E=A8?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payment/manage/kyc/core/KycManage.java | 2 + .../manage/kyc/core/impls/KycManageImpl.java | 89 +++++++++++++++++++ .../system/ClientComplianceCompanyMapper.xml | 10 +-- .../templates/mail/kyc_email_notice.html | 28 ++++++ 4 files changed, 122 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/templates/mail/kyc_email_notice.html diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java index 41f8fc80b..132c28ee0 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java @@ -13,4 +13,6 @@ public interface KycManage { List listNeedHelpClients(JSONObject manager, KycPartnersQuery query); + void sendNotify(JSONObject complianceInfo); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java index 91a9b33da..358f92f74 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java @@ -3,28 +3,55 @@ package au.com.royalpay.payment.manage.kyc.core.impls; import au.com.royalpay.payment.manage.kyc.bean.KycPartnersQuery; import au.com.royalpay.payment.manage.kyc.core.KycManage; 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; import au.com.royalpay.payment.manage.mappers.system.ClientMapper; +import au.com.royalpay.payment.manage.notice.core.MailService; +import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; +import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; +import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; +import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.permission.enums.ManagerRole; +import au.com.royalpay.payment.tools.threadpool.RoyalThreadPoolExecutor; import au.com.royalpay.payment.tools.utils.PageListUtils; import com.alibaba.fastjson.JSONObject; import com.github.miemiedev.mybatis.paginator.domain.Order; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.time.DateFormatUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; +import org.thymeleaf.context.Context; +import org.thymeleaf.spring5.SpringTemplateEngine; import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @Service public class KycManageImpl implements KycManage { + + private Logger logger = LoggerFactory.getLogger(getClass()); + @Resource + private MailService mailService; @Resource private ClientMapper clientMapper; @Resource + private ClientBDMapper clientBDMapper; + @Resource private FinancialBDConfigMapper financialBDConfigMapper; @Resource private ClientComplianceCompanyMapper clientComplianceCompanyMapper; + @Resource + private SpringTemplateEngine thymeleaf; + @Resource + private RoyalThreadPoolExecutor royalThreadPoolExecutor; + @Resource + private MpWechatApiProvider mpWechatApiProvider; @Override public JSONObject listProgressClients(JSONObject manager, KycPartnersQuery query) { @@ -49,6 +76,68 @@ public class KycManageImpl implements KycManage { return clientComplianceCompanyMapper.listNeedHelpClients(params); } + @Override + public void sendNotify(JSONObject complianceInfo) { + JSONObject client = clientMapper.findClient(complianceInfo.getIntValue("client_id")); + List bds = clientBDMapper.listClientBDInfoAvailable(complianceInfo.getIntValue("client_id"), new Date()); + List emails = new ArrayList<>(); + List openIds = new ArrayList<>(); + String bdNames = ""; + for (JSONObject bd : bds) { + String email = bd.getString("email"); + if (StringUtils.isNotEmpty(email)) { + emails.add(email); + bdNames += bd.getString("display_name"); + } + if (StringUtils.isNotEmpty(bd.getString("wechat_openid"))) { + openIds.add(bd.getString("wechat_openid")); + } + } + Context ctx = new Context(); + ctx.setVariable("img_url", PlatformEnvironment.getEnv().concatUrl("/static/images/royalpay_logo.png")); + ctx.setVariable("name", bdNames); + ctx.setVariable("client_moniker", client.getString("client_moniker")); + ctx.setVariable("contact_person", client.getString("contact_person")); + ctx.setVariable("contact_phone", client.getString("contact_phone")); + ctx.setVariable("contact_email", client.getString("contact_email")); + ctx.setVariable("submit_time", DateFormatUtils.format(complianceInfo.getDate("submit_time"),"yyyy-MM-dd HH:mm:ss")); + final String content = thymeleaf.process("mail/kyc_email_notice", ctx); + if (emails.size() > 0) { + royalThreadPoolExecutor.execute(() -> { + try { + mailService.sendEmail("[RoyalPay]商户需要您协助补充KYC材料,请尽快查看", StringUtils.join(emails, ","), "", content); + } catch (Exception e) { + logger.error("邮件发送失败", e); + } + }); + } + if (openIds.size() > 0) { + for (String openId : openIds) { + try { + MpWechatApi mpWechatApi = mpWechatApiProvider.getApiFromOpenId(openId); + if (mpWechatApi == null) { + return; + } + String templateId = mpWechatApi.getTemplateId("payment-success-cashier"); + if (templateId == null) { + return; + } + TemplateMessage message = new TemplateMessage(openId, templateId, null); + message.put("first", "有新商户需要您协助补充KYC材料,请尽快查看", "#ff0000"); + message.put("keyword1", "KYC认证商户申请协助", "#0000ff"); + message.put("keyword2", client.getString("company_name"), "#000000"); + message.put("keyword3", DateFormatUtils.format(complianceInfo.getDate("submit_time"),"yyyy-MM-dd HH:mm:ss"), "#000000"); + message.put("keyword4", "联系人:" + client.getString("contact_person") + " 电话:" + client.getString("contact_phone"), "#000000"); + message.put("remark", "您可以在后台帮助商户提交材料或填写无法提供材料文件的原因", "#ff0000"); + mpWechatApi.sendTemplateMessage(message); + } catch (Exception e) { + logger.error("cashier message failed", e); + } + } + } + + } + private void checkManagerPermission(JSONObject manager, JSONObject params, KycPartnersQuery query) { if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { JSONObject bdConfig = financialBDConfigMapper.getBdConfig(manager.getString("manager_id")); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml index cb20417ca..0a30565fb 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml @@ -19,13 +19,7 @@ c.source as client_source,c.refuse_remark,a.* FROM client_authfile_compliance a INNER JOIN sys_clients c on c.client_id = a.client_id and a.type = 2 - and a.need_help = 1 - - and c.client_moniker = #{client_moniker} - - - and a.status = #{status} - + and a.status = 9 INNER JOIN sys_client_bd d ON a.client_id = d.client_id AND d.bd_id = #{bd_user} and date(d.start_date)<= date(now()) and (d.end_date is null or date(d.end_date)>= date(now())) and @@ -47,6 +41,8 @@ c.source as client_source,a.* FROM client_authfile_compliance a INNER JOIN sys_clients c on c.client_id = a.client_id and a.type = 2 + and a.status != 9 + and a.status != 2 and c.client_moniker = #{client_moniker} diff --git a/src/main/resources/templates/mail/kyc_email_notice.html b/src/main/resources/templates/mail/kyc_email_notice.html new file mode 100644 index 000000000..a8e8e84fd --- /dev/null +++ b/src/main/resources/templates/mail/kyc_email_notice.html @@ -0,0 +1,28 @@ + + + + + + +
    +
    +
    + +
    +
    +

    您好,

    +

    商户:需要您协助上传KYC材料。(申请时间:)

    +

    请尽快联系商户,您可以帮助商户提交材料或填写无法提供材料文件的原因。

    +

    商户联系人:

    +

    联系电话:

    +

    邮箱:

    + + 此致
    + RoyalPay +
    +
    + +
    + + + From e2d411b60f8535645ec2fd17a2123794beadef98 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Tue, 10 Dec 2019 16:48:18 +0800 Subject: [PATCH 04/32] =?UTF-8?q?[R]KCY=E8=AE=A4=E8=AF=81Web=E7=AB=AF?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bean/ClientComplianceQuery.java | 12 + .../mappers/system/ClientAsicFilesMapper.java | 55 --- .../system/ClientComplianceCompanyMapper.java | 6 + .../mappers/system/ClientFilesMapper.java | 3 + .../merchants/beans/ClientKycFilesInfo.java | 54 +++ .../manage/merchants/core/ClientManager.java | 10 +- .../core/impls/ClientManagerImpl.java | 142 ++++++- .../merchants/web/PartnerViewController.java | 41 +- .../signin/core/SignInAccountService.java | 2 + .../core/impls/SignInAccountServiceImpl.java | 78 ++++ .../system/ClientComplianceCompanyMapper.xml | 3 + src/main/ui/static/payment/partner/partner.js | 349 +++++++++--------- .../payment/partner/partner_compliance.js | 27 ++ .../partner/templates/client_asic_files.html | 73 ---- .../templates/client_kyc_files_complete.html | 186 ++++++++++ .../templates/client_partner_detail.html | 2 +- .../partner_compliance_for_client.html | 10 + .../sys/templates/partner_kyc_flies_auth.html | 140 +++++++ 18 files changed, 858 insertions(+), 335 deletions(-) delete mode 100644 src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAsicFilesMapper.java create mode 100644 src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientKycFilesInfo.java delete mode 100644 src/main/ui/static/payment/partner/templates/client_asic_files.html create mode 100644 src/main/ui/static/payment/partner/templates/client_kyc_files_complete.html create mode 100644 src/main/ui/static/sys/templates/partner_kyc_flies_auth.html diff --git a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/bean/ClientComplianceQuery.java b/src/main/java/au/com/royalpay/payment/manage/complianceAudit/bean/ClientComplianceQuery.java index 602c02ec2..d9ab1e4d8 100644 --- a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/bean/ClientComplianceQuery.java +++ b/src/main/java/au/com/royalpay/payment/manage/complianceAudit/bean/ClientComplianceQuery.java @@ -13,12 +13,16 @@ public class ClientComplianceQuery { private int page = 1; private String status; private String client_moniker; + private String type = "1"; public JSONObject toJson(){ JSONObject jason = new JSONObject(); if(StringUtils.isNotEmpty(status)){ jason.put("status",status); } + if(StringUtils.isNotEmpty(type)){ + jason.put("type",type); + } if(StringUtils.isNotEmpty(client_moniker)){ jason.put("client_moniker",client_moniker); } @@ -56,4 +60,12 @@ public class ClientComplianceQuery { public void setClient_moniker(String client_moniker) { this.client_moniker = client_moniker; } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAsicFilesMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAsicFilesMapper.java deleted file mode 100644 index ebefafc10..000000000 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAsicFilesMapper.java +++ /dev/null @@ -1,55 +0,0 @@ -package au.com.royalpay.payment.manage.mappers.system; - -import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect; -import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; -import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; -import cn.yixblog.support.mybatis.autosql.annotations.SqlType; -import com.alibaba.fastjson.JSONObject; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -/** - * Created by yishuqian on 06/03/2017. - */ -@AutoMapper(tablename = "sys_asic_files", pkName = "file_id") -public interface ClientAsicFilesMapper { - @AutoSql(type = SqlType.INSERT) - void save(JSONObject partner); - - @AutoSql(type = SqlType.UPDATE) - void update(JSONObject partner); - - @AutoSql(type = SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1 and status = 1") - List findClientFile(@Param("client_id") int clientId); - - @AutoSql(type = SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 1 or status = 2) and file_name='client_agree_file'") - List findClientPassAggreeFile(@Param("client_id") int clientId); - - @AutoSql(type = SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 0 or status = 3) and file_name='client_agree_file'") - List findClientAggreeFileCommit(@Param("client_id") int clientId); - - List findAllClientFile(@Param("client_id") int clientId); - - @AutoSql(type = SqlType.SELECT) - JSONObject findFileById(@Param("file_id") String file_id); - - List findFileByClientAndType(@Param("client_id") int client_id, @Param("file_name") String file_name); - - JSONObject getSourceAgreeFilesByClientId(@Param("client_id") int clientId); - - void deleteByClientAndFileId(@Param("file_id") String file_id); - - void deleteAggreeByClientId(@Param("client_id") int file_id); - - void confirmAgreeFile(@Param("client_id") int client_id); - - void updateBeforeCompliance(@Param("client_id") int client_id); - - void refuseCompliance(@Param("client_id") int client_id); - - void passCompliance(@Param("client_id") int client_id); -} diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java index 0b679b211..83a376add 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java @@ -1,5 +1,6 @@ package au.com.royalpay.payment.manage.mappers.system; +import cn.yixblog.support.mybatis.autosql.annotations.AdvanceSelect; import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.SqlType; @@ -22,8 +23,13 @@ public interface ClientComplianceCompanyMapper { void update(JSONObject partner); @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "type = 1") JSONObject findFileByClientId(@Param("client_id") int client_id); + @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "type = 2") + JSONObject findKycFileByClientId(@Param("client_id") int client_id); + PageList listClientCompliances(JSONObject params, PageBounds pageBounds); List listNeedHelpClients(JSONObject params); diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java index 9d16b9fcc..70f1af5fc 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientFilesMapper.java @@ -25,6 +25,9 @@ public interface ClientFilesMapper { @AdvanceSelect(addonWhereClause = "is_valid = 1 and status = 1") List findClientFile(@Param("client_id") int clientId); + @AutoSql(type = SqlType.SELECT) + JSONObject findFileByIdAndvalue(@Param("client_id") int clientId,@Param("file_name") String fileType); + @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "is_valid = 1 and (status = 1 or status = 2) and file_name='client_agree_file'") List findClientPassAggreeFile(@Param("client_id") int clientId); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientKycFilesInfo.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientKycFilesInfo.java new file mode 100644 index 000000000..4f5209f71 --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/ClientKycFilesInfo.java @@ -0,0 +1,54 @@ +package au.com.royalpay.payment.manage.merchants.beans; + +import com.alibaba.fastjson.JSONObject; + +/** + * Created by liuxinxin on 09/12/2019. + */ +public class ClientKycFilesInfo { + + private String file_bank_info; + + private String file_id_info; + + private String utility_bill_info; + + private int authStatus=0; + + public JSONObject toJson(){ + return (JSONObject)JSONObject.toJSON(this); + } + + public String getFile_bank_info() { + return file_bank_info; + } + + public void setFile_bank_info(String file_bank_info) { + this.file_bank_info = file_bank_info; + } + + public String getFile_id_info() { + return file_id_info; + } + + public void setFile_id_info(String file_id_info) { + this.file_id_info = file_id_info; + } + + public String getUtility_bill_info() { + return utility_bill_info; + } + + public void setUtility_bill_info(String utility_bill_info) { + this.utility_bill_info = utility_bill_info; + } + + public int getAuthStatus() { + return authStatus; + } + + public void setAuthStatus(int authStatus) { + this.authStatus = authStatus; + } + +} 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 bba14968a..52f4aec4d 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 @@ -248,8 +248,6 @@ public interface ClientManager { JSONObject getAuthFiles(JSONObject manager, String clientMoniker); - JSONObject getAsicFiles(JSONObject manager, String clientMoniker); - JSONObject getClientViewAuthFiles(JSONObject manager, String clientMoniker); JSONObject getAllAuthFiles(JSONObject manager, String clientMoniker); @@ -262,10 +260,16 @@ public interface ClientManager { void uploadAuthFiles(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo); + void uploadKycFiles(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo); + List uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo); void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source); + void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source); + + void commitKycBdIntervention(String clientMoniker, JSONObject account, String source); + JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException; JSONObject getClientsAnalysis(JSONObject manager); @@ -495,6 +499,8 @@ public interface ClientManager { JSONObject getComplianceFiles(JSONObject account); + JSONObject getKycFiles(JSONObject account); + JSONObject getClientInfoByAggree(JSONObject account); JSONObject getComplianceFilesForBD(JSONObject account); 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 4c12b38e7..a9e414d16 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 @@ -94,7 +94,6 @@ import org.apache.poi.hssf.usermodel.*; import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.Font; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.dom4j.Element; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -230,9 +229,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Resource private ClientFilesMapper clientFilesMapper; - @Resource - private ClientAsicFilesMapper clientAsicFilesMapper; - @Resource private TransactionMapper transactionMapper; @@ -320,6 +316,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid private static final String CLIENT_APPLY_FILE = "client_apply_file"; private static final List tags = new ArrayList<>(); + private static final String KYC_UTILITY_BILL_FILE = "kyc_utility_bill_file"; + @Value("${app.agreetemplate.classic.path}") private String agreetemplatePdfPath; @Value("${app.agreetemplate.aggregate.path}") @@ -2177,6 +2175,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return file; } + @Override + public JSONObject getKycFiles(JSONObject account) { + JSONObject client = getClientInfo(account.getIntValue("client_id")); + if (client == null) { + throw new InvalidShortIdException(); + } + JSONObject file = signInAccountService.checkKycFileStatus(client); + JSONObject compliance = clientComplianceCompanyMapper.findKycFileByClientId(account.getIntValue("client_id")); + file.put("file_company", compliance); + return file; + } + @Override public JSONObject getClientInfoByAggree(JSONObject account) { JSONObject client = getClientInfo(account.getIntValue("client_id")); @@ -3387,20 +3397,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid return fileJson; } - @Override - public JSONObject getAsicFiles(JSONObject manager, String clientMoniker) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - if (client == null) { - throw new InvalidShortIdException(); - } - List clientFiles = clientAsicFilesMapper.findClientFile(client.getIntValue("client_id")); - JSONObject fileJson = new JSONObject(); - for (JSONObject file : clientFiles) { - fileJson.put(file.getString("file_name"), file.getString("file_value")); - } - return fileJson; - } - @Override public JSONObject getSourceAgreeFiles(JSONObject manage, String clientMoniker) { JSONObject client = getClientInfoByMoniker(clientMoniker); @@ -3514,6 +3510,23 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid // } } + @Override + @Transactional + public void uploadKycFiles(JSONObject manager, String clientMoniker, ClientKycFilesInfo filesInfo) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + int clientId = client.getIntValue("client_id"); + try { + updateSysClientFiles(manager, clientId, CLIENT_BANK_FILE, filesInfo.getFile_bank_info()); + updateSysClientFiles(manager, clientId, CLIENT_ID_FILE, filesInfo.getFile_id_info()); + updateSysClientFiles(manager, clientId, KYC_UTILITY_BILL_FILE, filesInfo.getUtility_bill_info()); + } catch (Exception e) { + logger.error("上传合规文件失败", e); + } + } + @Override @Transactional public List uploadAuthFilesForWaitCompliance(JSONObject manager, String clientMoniker, ClientAuthFilesInfo filesInfo) { @@ -3603,6 +3616,99 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid signInAccountService.clearAccountCache(account.getString("account_id")); } + @Override + @Transactional + public void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + int sourceEnum = 2; + if (client == null) { + throw new InvalidShortIdException(); + } + List clientAllAuthFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); + if (clientAllAuthFiles == null || clientAllAuthFiles.size() == 0) { + throw new BadRequestException("Please check the information is uploaded completely"); + } + + String[] fileKeys = {"client_bank_file", "client_id_file"}; + String[] fileNames = {"ASIC File", "ID"}; + if( "passport".equals(account.getString("idType")) ){ + String[] fileKeys_passport = {"client_bank_file", "kyc_utility_bill_file", "client_id_file"}; + String[] fileNames_passport = {"ASIC File", "Utility Bill Files", "ID"}; + fileKeys = fileKeys_passport; + fileNames = fileNames_passport; + } + + for (int i = 0; i < fileKeys.length; i++) { + String fileKey = fileKeys[i]; + if (clientAllAuthFiles.stream().noneMatch(fileJson -> fileKey.equals(fileJson.getString("file_name")))) { + throw new BadRequestException("Please check the " + fileNames[i] + " is uploaded completely"); + } + + } + if ("app".equals(source.toLowerCase())) { + sourceEnum = 1; + } + + JSONObject fileComp = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); + if (fileComp == null) { + fileComp = new JSONObject(); + fileComp.put("client_id", client.getIntValue("client_id")); + fileComp.put("submit_time", new Date()); + fileComp.put("status", 0); + fileComp.put("source", sourceEnum); + fileComp.put("commit_by_id", account.getString("account_id")); + fileComp.put("type", 2); + clientComplianceCompanyMapper.save(fileComp); + clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id")); + } else if (fileComp.getIntValue("status") == 2) { + fileComp.put("status", 0); + fileComp.put("submit_time", new Date()); + fileComp.put("source", sourceEnum); + fileComp.put("commit_by_id", account.getString("account_id")); + clientComplianceCompanyMapper.update(fileComp); + clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id")); + } else { + throw new BadRequestException("please do not repeat submission!"); + } + signInAccountService.clearAccountCache(account.getString("account_id")); + } + + @Override + @Transactional + public void commitKycBdIntervention(String clientMoniker, JSONObject account, String source) { + JSONObject client = getClientInfoByMoniker(clientMoniker); + int sourceEnum = 2; + if (client == null) { + throw new InvalidShortIdException(); + } + if ("app".equals(source.toLowerCase())) { + sourceEnum = 1; + } + JSONObject fileComp = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); + if (fileComp == null) { + fileComp = new JSONObject(); + fileComp.put("client_id", client.getIntValue("client_id")); + fileComp.put("submit_time", new Date()); + fileComp.put("status", 9); + fileComp.put("source", sourceEnum); + fileComp.put("commit_by_id", account.getString("account_id")); + fileComp.put("type", 2); + clientComplianceCompanyMapper.save(fileComp); + clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id")); + } else if (fileComp.getIntValue("status") == 2) { + fileComp.put("status", 9); + fileComp.put("submit_time", new Date()); + fileComp.put("source", sourceEnum); + fileComp.put("commit_by_id", account.getString("account_id")); + clientComplianceCompanyMapper.update(fileComp); + clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id")); + } else { + throw new BadRequestException("please do not repeat submission!"); + } + signInAccountService.clearAccountCache(account.getString("account_id")); + } + + @Override public JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException { if (StringUtils.isBlank(file.getOriginalFilename())) { 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 0cfb51557..45ecde1d0 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 @@ -3,12 +3,12 @@ package au.com.royalpay.payment.manage.merchants.web; import au.com.royalpay.payment.core.exceptions.ParamInvalidException; import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper; +import au.com.royalpay.payment.manage.merchants.beans.ClientKycFilesInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientAuthFilesInfo; import au.com.royalpay.payment.manage.merchants.beans.ClientRegisterInfo; import au.com.royalpay.payment.manage.merchants.beans.NewAccountBean; import au.com.royalpay.payment.manage.merchants.core.ClientManager; import au.com.royalpay.payment.manage.merchants.core.ClientSignEventSupport; -import au.com.royalpay.payment.manage.permission.manager.ManagerMapping; import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; import au.com.royalpay.payment.manage.permission.manager.RequirePartner; import au.com.royalpay.payment.manage.pos.datasource.ReadOnlyConnection; @@ -25,14 +25,11 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.http.HttpUtils; import au.com.royalpay.payment.tools.merchants.beans.QRCodeConfig; -import au.com.royalpay.payment.tools.permission.enums.ManagerRole; import au.com.royalpay.payment.tools.permission.enums.PartnerRole; import au.com.royalpay.payment.tools.permission.wechat.WechatMapping; import com.alibaba.fastjson.JSONObject; -import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.Model; import org.springframework.validation.Errors; import org.springframework.web.bind.annotation.*; @@ -44,8 +41,6 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; import java.io.OutputStream; -import java.util.Arrays; -import java.util.Date; import java.util.List; /** @@ -524,11 +519,6 @@ public class PartnerViewController { return clientManager.getAuthFiles(null,account.getString("client_moniker")); } - @PartnerMapping(value = "/asic/files", method = RequestMethod.GET) - @ResponseBody - public JSONObject asicFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - return clientManager.getAsicFiles(null,account.getString("client_moniker")); - } @PartnerMapping(value = "/compliance/complianceInfo", method = RequestMethod.GET) @ResponseBody @@ -542,6 +532,12 @@ public class PartnerViewController { return clientManager.getComplianceFiles(account); } + @PartnerMapping(value = "/kyc/clientViewFiles", method = RequestMethod.GET) + @ResponseBody + public JSONObject kycFiles(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + return clientManager.getKycFiles(account); + } + @PartnerMapping(value = "/aggregateFile/client_info", method = RequestMethod.GET) @ResponseBody @@ -586,6 +582,16 @@ 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_compliance_file", method = RequestMethod.PUT) @ResponseBody public void updateWaitComplianceFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestBody ClientAuthFilesInfo filesInfo) { @@ -608,6 +614,19 @@ public class PartnerViewController { clientManager.commitAuthFilesToCompliance(clientMoniker, account, "Web"); } + @PartnerMapping(value = "/clientCompliance/{clientMoniker}/kycFilesViewCommit/{idType}", method = RequestMethod.POST) + @ResponseBody + public void clientKycFilesViewCommit(@PathVariable String clientMoniker ,@PathVariable String idType,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + account.put("idType", idType); + clientManager.commitAuthKycFilesToCompliance(clientMoniker, account, "Web"); + } + + @PartnerMapping(value = "/clientCompliance/{clientMoniker}/kycBdIntervention", method = RequestMethod.POST) + @ResponseBody + public void clientKycBdIntervention(@PathVariable String clientMoniker ,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + clientManager.commitAuthKycFilesToCompliance(clientMoniker, account, "Web"); + } + @PartnerMapping(value = "/clientCompliance/{clientMoniker}/commit_aggregate_file", method = RequestMethod.POST) @ResponseBody public JSONObject getClientArregateFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam MultipartFile file, @RequestHeader("User-Agent") String userAgent, HttpServletRequest request) throws IOException { diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java index f035120e2..d0e7ddb2c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java @@ -69,4 +69,6 @@ public interface SignInAccountService { JSONObject checkAuthFileStatus(JSONObject client); + JSONObject checkKycFileStatus(JSONObject client); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java index 600727fe9..478bb2877 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInAccountServiceImpl.java @@ -98,6 +98,10 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati private final String[] FILE_KEYS = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file"}; private final String[] PUT_KEYS = {"file_bank_info", "file_company_info", "file_id_info", "file_agreement_info"}; private final String[] FILE_NAMES = {"* bank statement", "* Certificate of Registration", "* ID", "* Agreement"}; + + private final String[] KYC_FILE_KEYS = {"client_bank_file", "kyc_utility_bill_file", "client_id_file"}; + private final String[] KYC_PUT_KEYS = {"file_bank_info", "utility_bill_info", "file_id_info"}; + private final String[] KYC_FILE_NAMES = {"* ASIC File", "Utility Bill Files", "* ID"}; private final int RESET_PASSWORD_TEMPLID = 126978; private ApplicationEventPublisher publisher; private static final List tags = new ArrayList<>(); @@ -739,6 +743,80 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati return result; } + @Override + public JSONObject checkKycFileStatus(JSONObject client) { + JSONObject result = new JSONObject(); + result.put("client_less_file", false); + List clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); + boolean clientFilesIsLess = false; + for (int i = 0; i < KYC_FILE_KEYS.length; i++) { + String fileKey = KYC_FILE_KEYS[i]; + if (clientFiles != null && clientFiles.size() > 0) { + List clientFileUrl = clientFiles.stream() + .filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 1 || fileJson.getIntValue("status") == 2))) + .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) { + JSONObject fileJson = new JSONObject(); + fileJson.put("key", KYC_PUT_KEYS[i]); + fileJson.put("name", KYC_FILE_NAMES[i]); + fileJson.put("file_value", clientFileUrl); + fileJson.put("file_write", false); + result.put(fileKey,fileJson); + } else { + List clientBackToFileUrl = clientFiles.stream() + .filter(fileJson -> (fileKey.equals(fileJson.getString("file_name")) && (fileJson.getIntValue("status") == 0 || fileJson.getIntValue("status") == 3))) + .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()); + JSONObject fileJson = new JSONObject(); + fileJson.put("key", KYC_PUT_KEYS[i]); + fileJson.put("name", KYC_FILE_NAMES[i]); + if (clientBackToFileUrl != null && clientBackToFileUrl.size() > 0) { + if ("client_agree_file".equals(fileKey)) { + List agreeFile = new ArrayList<>(); + agreeFile.add(clientBackToFileUrl.get(0)); + fileJson.put("file_value", agreeFile); + }else { + fileJson.put("file_value", clientBackToFileUrl); + } + } + 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(); + fileJson.put("key", KYC_PUT_KEYS[c]); + fileJson.put("name", KYC_FILE_NAMES[c]); + fileJson.put("file_write", true); + result.put(key,fileJson); + } + } + } + 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; + } + private void whenClientLessFile(JSONObject client,JSONObject result) { JSONObject authFileCompliance = clientComplianceCompanyMapper.findFileByClientId(client.getIntValue("client_id")); if (authFileCompliance != null && StringUtils.isNotBlank(authFileCompliance.getString("description"))) { diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml index 0a30565fb..ae387f100 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml @@ -11,6 +11,9 @@ and a.status = #{status} + + and a.type = #{type} +
    diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index 70c51e78f..0cf00b422 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -74,13 +74,16 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo url: '/devices', templateUrl: '/static/payment/partner/templates/client_devices.html', controller: 'clientDeviceCtrl' - }).state('basic.asic_files', { - url: '/{client_moniker}/asic_files', - templateUrl: '/static/payment/partner/templates/client_asic_files.html', - controller: 'clientASICFilesCtrl', + }).state('basic.kyc_files_perfect', { + url: '/kyc_files_perfect', + templateUrl: '/static/payment/partner/templates/client_kyc_files_complete.html', + controller: 'clientCommitToKycFilesCtrl', resolve: { - asicFile: ['$http', function ($http) { - return $http.get('/client/partner_info/asic/files'); + file: ['$http', function ($http) { + return $http.get('/client/partner_info/kyc/clientViewFiles'); + }], + partner: ['$http', function ($http) { + return $http.get('/client/partner_info'); }] } }) @@ -866,37 +869,77 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo }; }]); - app.controller('clientASICFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file', function ($scope, $http, $rootScope, commonDialog, $state, Upload, asicFile) { + app.controller('clientCommitToComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file','partner', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file, partner) { + $scope.file = file.data || {}; + $scope.partner = partner.data || {}; - $scope.asicFile = asicFile.data || {}; - //asic files - debugger; - $scope.id_type = 'passport'; + $scope.uploadStorePhoto = function (file) { + if (file != null) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + $scope.storePhotoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.storePhotoProgress; + $scope.file.photo_info.store_photo = resp.data.url; + }, function (resp) { + delete $scope.storePhotoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + $scope.uploadShopPhoto = function (file) { + if (file != null) { + if (file.size > 2 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) + } else { + $scope.shopPhotoProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.shopPhotoProgress; + $scope.file.photo_info.company_photo = resp.data.url; + }, function (resp) { + delete $scope.shopPhotoProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; - $scope.uploadAsicFile = function (file) { - debugger; + //audit files + $scope.uploadBankFile = function (file) { if (file != null) { if (file.size > 3 * 1024 * 1024) { commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) } else { - $scope.AsicFileProgress = {value: 0}; + $scope.bankFileProgress = {value: 0}; Upload.upload({ url: '/attachment/files', data: {file: file} }).then(function (resp) { - delete $scope.AsicFileProgress; - $scope.asicFile.file_bank_info = resp.data.url; + delete $scope.bankFileProgress; + $scope.file.file_bank_info = resp.data.url; $scope.updateFile(); - if ($scope.asicFile.file_bank_info.endsWith('pdf')) { - $scope.AsicIsImage = false; + if ($scope.file.file_bank_info.endsWith('pdf')) { + $scope.bankIsImage = false; } else { - $scope.AsicIsImage = true; + $scope.bankIsImage = true; } }, function (resp) { - delete $scope.AsicFileProgress; + delete $scope.bankFileProgress; commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) }, function (evt) { - $scope.AsicFileProgress.value = parseInt(100 * evt.loaded / evt.total); + $scope.bankFileProgress.value = parseInt(100 * evt.loaded / evt.total); }) } } @@ -921,7 +964,6 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) { $scope.idIsImage = false; } - $scope.uploadCompanyFile = function (file) { if (file != null) { if (file.size > 3 * 1024 * 1024) { @@ -1043,7 +1085,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo }; */ $scope.updateFile = function () { - $http.put('/client/partner_info/update/file', $scope.file).then(function () { + $http.put('/client/partner_info/update/wait_compliance_file', $scope.file).then(function () { commonDialog.alert({ title: 'Success', content: 'Upload Successful', @@ -1062,6 +1104,65 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo type: 'error' }); }; + + + $scope.clientComplianceViewCommit = function () { + if (!$scope.file.client_agree_file) { + commonDialog.alert({title: 'Error', content: '请提交* Agreement', type: 'error'}); + return; + } else if (!$scope.file.client_id_file) { + commonDialog.alert({title: 'Error', content: '请提交* ID', type: 'error'}); + return; + } else if (!$scope.file.client_bank_file) { + commonDialog.alert({title: 'Error', content: '请提交* bank statement', type: 'error'}); + return; + } else if (!$scope.file.client_company_file) { + commonDialog.alert({title: 'Error', content: '请提交* Certificate of Registration', type: 'error'}); + return; + } + if ((!$scope.file.photo_info.company_photo || !$scope.file.photo_info.store_photo) && !$scope.file.photo_info.web_site) { + alert('Please upload two photos or fill out the website'); + return; + } + + commonDialog.confirm({ + title: 'Warning', + content: 'Are you sure to submit files?' + }).then(function () { + $http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/viewCommit', $scope.file.photo_info).then(function () { + commonDialog.alert({ + title: 'Success', + content: 'Commit 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({ + title: 'Warning', + content: 'This operation will delete the file, Are you sure?' + }).then(function () { + $http.put('/client/partner_info/auth_file/' + $scope.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.commitPartner = function () { if ($scope.file) { if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) { @@ -1075,55 +1176,16 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo commitError(); } }; - }]); - app.controller('clientCommitToComplianceFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file','partner', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file, partner) { + }]); + + app.controller('clientCommitToKycFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file','partner', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file, partner) { $scope.file = file.data || {}; $scope.partner = partner.data || {}; - $scope.uploadStorePhoto = function (file) { - if (file != null) { - if (file.size > 2 * 1024 * 1024) { - commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) - } else { - $scope.storePhotoProgress = {value: 0}; - Upload.upload({ - url: '/attachment/files', - data: {file: file} - }).then(function (resp) { - delete $scope.storePhotoProgress; - $scope.file.photo_info.store_photo = resp.data.url; - }, function (resp) { - delete $scope.storePhotoProgress; - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) - }, function (evt) { - $scope.storePhotoProgress.value = parseInt(100 * evt.loaded / evt.total); - }) - } - } - }; - $scope.uploadShopPhoto = function (file) { - if (file != null) { - if (file.size > 2 * 1024 * 1024) { - commonDialog.alert({title: 'Error', content: '文件大小不能超过2MB,请压缩后重试', type: 'error'}) - } else { - $scope.shopPhotoProgress = {value: 0}; - Upload.upload({ - url: '/attachment/files', - data: {file: file} - }).then(function (resp) { - delete $scope.shopPhotoProgress; - $scope.file.photo_info.company_photo = resp.data.url; - }, function (resp) { - delete $scope.shopPhotoProgress; - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) - }, function (evt) { - $scope.shopPhotoProgress.value = parseInt(100 * evt.loaded / evt.total); - }) - } - } - }; + $scope.file.id_type = 'passport'; + $scope.file.need_bd = true; //audit files $scope.uploadBankFile = function (file) { @@ -1153,53 +1215,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo } } }; - $scope.agreeIsImage = true; - if ($scope.file.file_agreement_info && $scope.file.file_agreement_info.endsWith('pdf')) { - $scope.agreeIsImage = false; - } - $scope.bankIsImage = true; - if ($scope.file.file_bank_info && $scope.file.file_bank_info.endsWith('pdf')) { - $scope.bankIsImage = false; - } - $scope.companyIsImage = true; - if ($scope.file.file_company_info && $scope.file.file_company_info.endsWith('pdf')) { - $scope.companyIsImage = false; - } - $scope.applyIsImage = true; - if ($scope.file.file_apply_info && $scope.file.file_apply_info.endsWith('pdf')) { - $scope.applyIsImage = false; - } - $scope.idIsImage = true; - if ($scope.file.file_id_info && $scope.file.file_id_info.endsWith('pdf')) { - $scope.idIsImage = false; - } - $scope.uploadCompanyFile = function (file) { - if (file != null) { - if (file.size > 3 * 1024 * 1024) { - commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) - } else { - $scope.companyFileProgress = {value: 0}; - Upload.upload({ - url: '/attachment/files', - data: {file: file} - }).then(function (resp) { - delete $scope.companyFileProgress; - $scope.file.file_company_info = resp.data.url; - $scope.updateFile(); - if ($scope.file.file_company_info.endsWith('pdf')) { - $scope.companyIsImage = false; - } else { - $scope.companyIsImage = true; - } - }, function (resp) { - delete $scope.companyFileProgress; - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) - }, function (evt) { - $scope.companyFileProgress.value = parseInt(100 * evt.loaded / evt.total); - }) - } - } - }; + //上传ID信息 $scope.uploadIDFile = function (file) { if (file != null) { @@ -1229,72 +1245,50 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo } }; - //上传协议文件 - $scope.uploadAgreementFile = function (file) { - if (file != null) { - if (file.size > 10 * 1024 * 1024) { - commonDialog.alert({title: 'Error', content: '文件大小不能超过5MB,请压缩后重试', type: 'error'}) - } else { - $scope.agreementFileProgress = {value: 0}; - Upload.upload({ - url: '/attachment/files', - data: {file: file} - }).then(function (resp) { - delete $scope.agreementFileProgress; - $scope.file.file_agreement_info = resp.data.url; - $scope.updateFile(); - if ($scope.file.file_agreement_info.endsWith('pdf')) { - $scope.agreeIsImage = false; - } else { - $scope.agreeIsImage = true; - } - }, function (resp) { - delete $scope.agreementFileProgress; - commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) - }, function (evt) { - $scope.agreementFileProgress.value = parseInt(100 * evt.loaded / evt.total); - }) - } - } - }; - - //上传申请表 - $scope.uploadApplyFile = function (file) { + //上传账单流水 + $scope.uploadCompanyFile = function (file) { if (file != null) { if (file.size > 3 * 1024 * 1024) { commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) } else { - $scope.applyFileProgress = {value: 0}; + $scope.billFileProgress = {value: 0}; Upload.upload({ url: '/attachment/files', data: {file: file} }).then(function (resp) { - delete $scope.applyFileProgress; - $scope.file.file_apply_info = resp.data.url; + delete $scope.billFileProgress; + $scope.file.utility_bill_info = resp.data.url; $scope.updateFile(); - if ($scope.file.file_apply_info.endsWith('pdf')) { - $scope.applyIsImage = false; + if ($scope.file.utility_bill_info.endsWith('pdf')) { + $scope.billIsImage = false; } else { - $scope.applyIsImage = true; + $scope.billIsImage = true; } }, function (resp) { - delete $scope.applyFileProgress; + delete $scope.billFileProgress; commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) }, function (evt) { - $scope.applyFileProgress.value = parseInt(100 * evt.loaded / evt.total); + $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.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; + } + $scope.updateFile = function () { - $http.put('/client/partner_info/update/wait_compliance_file', $scope.file).then(function () { + $http.put('/client/partner_info/update/kycFile', $scope.file).then(function () { commonDialog.alert({ title: 'Success', content: 'Upload Successful', @@ -1306,6 +1300,23 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo }) }; + $scope.needBDIntervention = function () { + commonDialog.confirm({ + title: 'Warning', + content: 'Are you sure to need BD intervention ?' + }).then(function () { + $http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/kycBdIntervention').then(function () { + commonDialog.alert({ + title: 'Success', + content: 'Commit Successful', + type: 'success' + }); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }) + }; + function commitError() { commonDialog.alert({ title: 'Error', @@ -1316,29 +1327,18 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo $scope.clientComplianceViewCommit = function () { - if (!$scope.file.client_agree_file) { - commonDialog.alert({title: 'Error', content: '请提交* Agreement', type: 'error'}); - return; - } else if (!$scope.file.client_id_file) { - commonDialog.alert({title: 'Error', content: '请提交* ID', type: 'error'}); + if (!$scope.file.client_id_file) { + commonDialog.alert({title: 'Error', content: '请提交* ASIC File', type: 'error'}); return; } else if (!$scope.file.client_bank_file) { commonDialog.alert({title: 'Error', content: '请提交* bank statement', type: 'error'}); return; - } else if (!$scope.file.client_company_file) { - commonDialog.alert({title: 'Error', content: '请提交* Certificate of Registration', type: 'error'}); - return; } - if ((!$scope.file.photo_info.company_photo || !$scope.file.photo_info.store_photo) && !$scope.file.photo_info.web_site) { - alert('Please upload two photos or fill out the website'); - return; - } - commonDialog.confirm({ title: 'Warning', content: 'Are you sure to submit files?' }).then(function () { - $http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/viewCommit', $scope.file.photo_info).then(function () { + $http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/kycFilesViewCommit/'+ $scope.file.id_type).then(function () { commonDialog.alert({ title: 'Success', content: 'Commit Successful', @@ -1371,7 +1371,6 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo }) }; - $scope.commitPartner = function () { if ($scope.file) { if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) { diff --git a/src/main/ui/static/payment/partner/partner_compliance.js b/src/main/ui/static/payment/partner/partner_compliance.js index ac3fe2eb0..4349bc0c1 100644 --- a/src/main/ui/static/payment/partner/partner_compliance.js +++ b/src/main/ui/static/payment/partner/partner_compliance.js @@ -29,6 +29,10 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS templateUrl: '/static/payment/partner/templates/compliance_auth.html', controller: 'partnerComplianceAuditCtrl' + }).state('partner_kyc_files_auth', { + url: '/partners/KycFilesAuth', + templateUrl: 'static/sys/templates/partner_kyc_flies_auth.html', + controller: 'kycFilesAuthForClientCtrl' }) }]); @@ -55,6 +59,29 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS }; }]); + app.controller('kycFilesAuthForClientCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', + function ($scope, $sce, $http, $filter, $uibModal, businessStructuresMap, industryMap, stateMap, sectorMap, countryMap) { + $scope.pagination = {}; + $scope.industries = industryMap.configs(); + $scope.states = stateMap.configs(); + $scope.countries = countryMap.configs(); + $scope.params = {type:'2'}; + $scope.loadClientCompliance = function (page) { + var params = angular.copy($scope.params); + params.page = page || $scope.pagination.page || 1; + $http.get('/compliance/audit/listClientCompliances', {params: params}).then(function (resp) { + $scope.compliances = resp.data.data; + $scope.pagination = resp.data.pagination; + }); + }; + $scope.loadClientCompliance(1); + $scope.statusSelected = function (arr) { + return $scope.params.status != null && $scope.params.status.filter(function (status) { + return arr.indexOf(status) >= 0 + }).length > 0 + }; + }]); + app.controller('partnerComplianceCompanyDetail', ['$rootScope', '$scope', '$http', '$state', '$uibModal', 'commonDialog', 'file', function ($rootScope, $scope, $http, $state, $uibModal, commonDialog, file) { $scope.file = file.data || {}; $scope.partner = $scope.file.client; diff --git a/src/main/ui/static/payment/partner/templates/client_asic_files.html b/src/main/ui/static/payment/partner/templates/client_asic_files.html deleted file mode 100644 index 138a9449b..000000000 --- a/src/main/ui/static/payment/partner/templates/client_asic_files.html +++ /dev/null @@ -1,73 +0,0 @@ - -
    -
    -
    -
    - -
    -
    - - - -
    - - - -
    -
    -
    -

    Example:请保证图片信息清晰可见,如下图

    - -
    -
    -
    - -
    - -
    -
    - - - -
    - - - -
    -
    -
    -
    -

    Example:请保证图片(护照或驾照)信息清晰可见,如下图

    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    - diff --git a/src/main/ui/static/payment/partner/templates/client_kyc_files_complete.html b/src/main/ui/static/payment/partner/templates/client_kyc_files_complete.html new file mode 100644 index 000000000..753ad0ea8 --- /dev/null +++ b/src/main/ui/static/payment/partner/templates/client_kyc_files_complete.html @@ -0,0 +1,186 @@ + +
    +

    商户KYC文件补充 + + ({{file.client_refuse_reason}}) +

    +
    +
    +
    +
    + +
    +
    + +
    + + + + + + + + +
    1 + + +
    + + +
    +
    +
    +

    Example:请保证图片信息清晰可见,如示例 + +

    +
    +
    +
    + +
    + +
    +
    + +
    + + + + + + + + +
    1 + + +
    +
    +
    +
    +
    +

    Example:请保证图片(护照或驾照)信息清晰可见,如示例 + + +

    +
    +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +

    选择ID类型,若选择Driver's license,Utility Bill Files可以选填

    +
    +
    +
    +
    + +
    + +
    +
    + +
    + + + + + + + + +
    1 + + + +
    +
    +
    +
    +
    +

    Example:公司请提供以下文件图片,如示例 + +

    +

    sole trade(个体户),partnership(合伙),trust(信托)请在http://abr.business.gov.au,将查询结果截图上传 + +

    +
    +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    +
    +

    对补充材料有疑问,需要BD介入帮助,如果需要BD介入帮助,上述材料可不填

    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + diff --git a/src/main/ui/static/payment/partner/templates/client_partner_detail.html b/src/main/ui/static/payment/partner/templates/client_partner_detail.html index 60c3eabbc..0fee727c7 100644 --- a/src/main/ui/static/payment/partner/templates/client_partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/client_partner_detail.html @@ -54,7 +54,7 @@
  • - ASIC files + KYC files
  • diff --git a/src/main/ui/static/sys/templates/partner_compliance_for_client.html b/src/main/ui/static/sys/templates/partner_compliance_for_client.html index 9d2ee7f88..0bf44744f 100644 --- a/src/main/ui/static/sys/templates/partner_compliance_for_client.html +++ b/src/main/ui/static/sys/templates/partner_compliance_for_client.html @@ -10,6 +10,16 @@
    +
    diff --git a/src/main/ui/static/sys/templates/partner_kyc_flies_auth.html b/src/main/ui/static/sys/templates/partner_kyc_flies_auth.html new file mode 100644 index 000000000..35e1296f3 --- /dev/null +++ b/src/main/ui/static/sys/templates/partner_kyc_flies_auth.html @@ -0,0 +1,140 @@ +
    +

    商户合规文件审核

    + +
    + + +
    +
    + + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +

    + All | + + 待审核| + 通过| + 打回 +

    +
    +
    + +
    +
    +
    +
    +
    + +
    + + +
    From 40b36c432af25c0faeca729f6cd5547924aa923e Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 11 Dec 2019 10:27:58 +0800 Subject: [PATCH 05/32] =?UTF-8?q?add=20=E5=95=86=E6=88=B7KYC=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E8=BF=9B=E5=BA=A6=E7=99=BE=E5=88=86=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payment/manage/kyc/core/KycManage.java | 2 + .../manage/kyc/core/impls/KycManageImpl.java | 58 ++++++--- .../manage/kyc/web/KycManageController.java | 5 + .../system/ClientComplianceCompanyMapper.java | 2 + .../manage/mappers/system/ClientMapper.java | 2 + .../system/ClientComplianceCompanyMapper.xml | 23 ++++ .../manage/mappers/system/ClientMapper.xml | 19 +++ src/main/ui/static/payment/kyc/kyc-manage.js | 57 ++++++++- .../kyc/templates/partner_kyc_progress.html | 117 ++++++++++-------- 9 files changed, 211 insertions(+), 74 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java index 132c28ee0..2c67ce1d2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java @@ -11,6 +11,8 @@ public interface KycManage { JSONObject listCompletedClients(JSONObject manager, KycPartnersQuery query); + JSONObject getKycDashboard(JSONObject manager); + List listNeedHelpClients(JSONObject manager, KycPartnersQuery query); void sendNotify(JSONObject complianceInfo); diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java index 358f92f74..7225e8f77 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java @@ -30,7 +30,6 @@ import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.stream.Collectors; @Service public class KycManageImpl implements KycManage { @@ -69,6 +68,24 @@ public class KycManageImpl implements KycManage { return PageListUtils.buildPageListResult(completedClients); } + @Override + public JSONObject getKycDashboard(JSONObject manager) { + JSONObject params = new JSONObject(); + JSONObject result = new JSONObject(); + if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { + params.put("bd_user", manager.getString("manager_id")); + } + List needHelps = clientComplianceCompanyMapper.listNeedHelpClients(params); + result.put("total_need_help", needHelps != null ? needHelps.size() : 0); + result.put("total_partner", clientMapper.countKycClients(params)); + result.put("total_progressing", clientComplianceCompanyMapper.countKycProgressClients(params)); + params.put("status", 1); + result.put("total_pass_partner", clientComplianceCompanyMapper.countKycProgressClients(params)); + params.put("status", 2); + result.put("total_refuse_partner", clientComplianceCompanyMapper.countKycProgressClients(params)); + return result; + } + @Override public List listNeedHelpClients(JSONObject manager, KycPartnersQuery query) { JSONObject params = query.toJsonParam(); @@ -139,24 +156,29 @@ public class KycManageImpl implements KycManage { } private void checkManagerPermission(JSONObject manager, JSONObject params, KycPartnersQuery query) { + //todo 可支持bdleader查看组内bd商户kyc情况 +// if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { +// JSONObject bdConfig = financialBDConfigMapper.getBdConfig(manager.getString("manager_id")); +// if (bdConfig != null) { +// params.put("bd_group", bdConfig.getString("bd_group")); +// List listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group")); +// List bdUserId = listGroupBds.stream().map(groupBd -> groupBd.getString("manager_id")).collect(Collectors.toList()); +// if (params.containsKey("bd_user")) { +// if (!bdUserId.contains(params.getString("bd_user"))) { +// params.remove("bd_user"); +// } +// } +// } +// if (query.isOnlyMe()) { +// params.put("bd_user", manager.getString("manager_id")); +// if (params.containsKey("bd_group")) { +// params.remove("bd_group"); +// } +// } +// } if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { - JSONObject bdConfig = financialBDConfigMapper.getBdConfig(manager.getString("manager_id")); - if (bdConfig != null) { - params.put("bd_group", bdConfig.getString("bd_group")); - List listGroupBds = financialBDConfigMapper.listGroupBds(bdConfig.getString("bd_group")); - List bdUserId = listGroupBds.stream().map(groupBd -> groupBd.getString("manager_id")).collect(Collectors.toList()); - if (params.containsKey("bd_user")) { - if (!bdUserId.contains(params.getString("bd_user"))) { - params.remove("bd_user"); - } - } - } - if (query.isOnlyMe()) { - params.put("bd_user", manager.getString("manager_id")); - if (params.containsKey("bd_group")) { - params.remove("bd_group"); - } - } + params.put("bd_user", manager.getString("manager_id")); } + //todo 如果是合规,增加bd_user为customerService } } diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java index 9a73613d3..4e79f6c9f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java @@ -35,4 +35,9 @@ public class KycManageController { public List listNeedHelpClients(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, KycPartnersQuery query) { return kycManage.listNeedHelpClients(manager, query); } + + @ManagerMapping(value = "/partner/dashboard", method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) + public JSONObject getKycDashboard(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + return kycManage.getKycDashboard(manager); + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java index 83a376add..fc04c8c55 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.java @@ -36,4 +36,6 @@ public interface ClientComplianceCompanyMapper { PageList listKycProgressClients(JSONObject params, PageBounds pageBounds); + int countKycProgressClients(JSONObject params); + } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java index e031a1e74..82f4aa242 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientMapper.java @@ -141,4 +141,6 @@ public interface ClientMapper { List listUseAlipayMerchant(@Param("start") int start, @Param("end") int end); PageList listCompletedContractKycClients(JSONObject params, PageBounds pageBounds); + + int countKycClients(JSONObject params); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml index ae387f100..a05fd66e0 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientComplianceCompanyMapper.xml @@ -66,4 +66,27 @@ + + diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml index bc0238644..d41967fe2 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientMapper.xml @@ -798,4 +798,23 @@ + + diff --git a/src/main/ui/static/payment/kyc/kyc-manage.js b/src/main/ui/static/payment/kyc/kyc-manage.js index d01c9fbdc..69dab1bae 100644 --- a/src/main/ui/static/payment/kyc/kyc-manage.js +++ b/src/main/ui/static/payment/kyc/kyc-manage.js @@ -56,7 +56,6 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS }; $scope.addHandleLog = function (info) { - debugger $uibModal.open({ templateUrl: '/static/payment/partner/templates/add_handle_log.html', controller: 'addHandleDetailCtrl', @@ -68,6 +67,62 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS commonDialog.alert({title: 'Success', type: 'success'}); }) }; + $scope.loadKYCDashboardInfo = function () { + var params = angular.copy($scope.params); + $http.get('/sys/kyc/manage/partner/dashboard').then(function (resp) { + $scope.total_need_help = resp.data.total_need_help; + $scope.total_partner = resp.data.total_partner; + $scope.total_progressing = resp.data.total_progressing; + $scope.total_pass_partner = resp.data.total_pass_partner; + $scope.total_refuse_partner = resp.data.total_refuse_partner; + $(".circleChart1").circleChart({ + value: ($scope.total_need_help/$scope.total_partner)*100, + redraw: false, + startAngle: 50, + color: "#68cf7c", + size: 130, + text: 0 + '%', + onDraw: function(el, circle){ + $(".circleChart_text", el).html(Math.round(circle.value) + '%'); + } + }); + $(".circleChart2").circleChart({ + value: ($scope.total_progressing/$scope.total_partner)*100, + redraw: false, + startAngle: 50, + color: "#68cf7c", + size: 130, + text: 0 + '%', + onDraw: function(el, circle){ + $(".circleChart_text", el).html(Math.round(circle.value) + '%'); + } + }); + $(".circleChart3").circleChart({ + value: ($scope.total_pass_partner/$scope.total_partner)*100, + redraw: false, + startAngle: 50, + color: "#96cf9a", + size: 130, + text: 0 + '%', + onDraw: function(el, circle){ + $(".circleChart_text", el).html(Math.round(circle.value) + '%'); + } + }); + + $(".circleChart4").circleChart({ + value: ($scope.total_refuse_partner/$scope.total_progressing)*100, + redraw: false, + startAngle: 50, + color: "#96cf9a", + size: 130, + text: 0 + '%', + onDraw: function(el, circle){ + $(".circleChart_text", el).html(Math.round(circle.value) + '%'); + } + }); + }); + }; + $scope.loadKYCDashboardInfo(); }]); app.controller('addHandleDetailCtrl', [ '$scope', '$http', '$state', 'compliance_id', 'commonDialog',function ($scope, $http, $state, compliance_id, commonDialog) { diff --git a/src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html b/src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html index 127f415f2..c6a104b36 100644 --- a/src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html +++ b/src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html @@ -3,36 +3,30 @@ .btn-box-tool { color: #97a0b3 } + .bg-info4 { + color: white; + background-color: #00c0ef; + margin: 0 10px 20px 10px; + } + .bg-info1 { + color: white; + background-color: #dd4b39; + margin: 0 10px 20px 10px; + } + .bg-info2 { + color: white; + background-color: #00a65a; + margin: 0 10px 20px 10px; + } + .bg-info3 { + color: white; + background-color: #f39c12; + margin: 0 10px 20px 10px; + } + .circleChart_canvas { + display: none; + } -

    商户KYC认证进度

    -
    -
    +
    +
    -
    -
    -

    44

    - -

    User Registrations

    +
    +
    +

    {{total_need_help}}

    +

    {{total_need_help}}/{{total_partner}}

    +

    需要帮助的商户/总商户数

    -
    -
    +
    +
    -
    +
    -
    -
    -

    44

    - -

    User Registrations

    +
    +
    +

    {{total_progressing}}

    +

    {{total_progressing}}/{{total_partner}}

    +

    已提交材料/总商户数

    -
    -
    +
    +
    -
    +
    -
    -
    -

    44

    - -

    User Registrations

    +
    +
    +

    {{total_pass_partner}}

    +

    {{total_pass_partner}}/{{total_partner}}

    +

    已通过/总商户数

    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +

    {{total_refuse_partner}}

    +

    {{total_refuse_partner}}/{{total_progressing}}

    +

    材料打回/提交审核商户数

    -
    -
    +
    +
    @@ -253,7 +260,7 @@
    + +
    +
    +
    +

    前去补充合规文件:点击前往

    +

    前去补充KYC文件:点击前往

    +
    +
    +
    diff --git a/src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html b/src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html index c6a104b36..cfe7e3024 100644 --- a/src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html +++ b/src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html @@ -27,7 +27,7 @@ display: none; } -
    +

    商户KYC认证进度

    - -
    -
    - -
    -
    -

    {{total_need_help}}

    -

    {{total_need_help}}/{{total_partner}}

    -

    需要帮助的商户/总商户数

    -
    -
    -
    +
    +
    +
    + +
    +
    +

    {{total_need_help}}

    +

    {{total_need_help}}/{{total_partner}}

    +

    需要帮助的商户/总商户数

    +
    +
    +
    +
    -
    -
    - -
    -
    -

    {{total_progressing}}

    -

    {{total_progressing}}/{{total_partner}}

    -

    已提交材料/总商户数

    -
    -
    -
    +
    + +
    +
    +

    {{total_progressing}}

    +

    {{total_progressing}}/{{total_partner}}

    +

    已提交材料/总商户数

    +
    +
    +
    +
    -
    -
    - -
    -
    -

    {{total_pass_partner}}

    -

    {{total_pass_partner}}/{{total_partner}}

    -

    已通过/总商户数

    +
    + +
    +
    +

    {{total_pass_partner}}

    +

    {{total_pass_partner}}/{{total_partner}}

    +

    已通过/总商户数

    +
    +
    +
    +
    -
    -
    +
    +
    + +
    +
    +

    {{total_refuse_partner}}

    +

    {{total_refuse_partner}}/{{total_progressing}}

    +

    材料打回/提交审核商户数

    +
    +
    +
    +
    -
    - -
    -
    -

    {{total_refuse_partner}}

    -

    {{total_refuse_partner}}/{{total_progressing}}

    -

    材料打回/提交审核商户数

    -
    -
    -
    +
    +
    待处理需要帮助的商户({{need_help.length}}家): +
    + +
    -
    -
    - -
    -
    待处理需要帮助的商户({{need_help.length}}家): -
    - - +
    + + + + + + + + + + + + + + + + + + + + + + + +
    Client MonikerShort NameCompliance StatusRegister TimeSubmit TimeSourceOperation
    + {{client.client_moniker}} + + 通过({{client.approve_time}}) + 资料完善中 + (自助开通)资料完善中 + 自助开通试用中({{client.approve_time}}~{{client.expiry_time}}) + 不通过({{client.approve_time}}) + 申请打回({{client.refuse_remark|limitTo:15}}) + 等待合规 + 自助开通(等待合规) + 合同制作完成 + 等待BD上传材料审核 + 绿色通道申请中 + 等待合规 + + App + Web + + + Detail + | + Handle + +
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Client MonikerShort NameCompliance StatusRegister TimeSubmit TimeSourceOperation
    - {{client.client_moniker}} - - 通过({{client.approve_time}}) - 资料完善中 - (自助开通)资料完善中 - 自助开通试用中({{client.approve_time}}~{{client.expiry_time}}) - 不通过({{client.approve_time}}) - 申请打回({{client.refuse_remark|limitTo:15}}) - 等待合规 - 自助开通(等待合规) - 合同制作完成 - 等待BD上传材料审核 - 绿色通道申请中 - 等待合规 - - App - Web - - - Detail - | - Handle - -
    -
    -
    - - -
    -
    已提交审核({{progressPagination.totalCount}}家): -
    - - +
    +
    已提交审核({{progressPagination.totalCount}}家): +
    + + +
    -
    -
    -
    -
    -
    -
    - -
    - +
    +
    +
    +
    +
    + +
    + +
    -
    -
    - -
    -

    - All | - 待审核| - 通过 -

    +
    + +
    +

    + All | + 待审核| + 通过 +

    +
    +
    -
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Client MonikerShort NameCompliance StatusRegister TimeAuthFile StatusSubmit TimeSourceOperation
    + 通过({{client.approve_time}}) + 资料完善中 + (自助开通)资料完善中 + 自助开通试用中({{client.approve_time}}~{{client.expiry_time}}) + 不通过({{client.approve_time}}) + 申请打回({{client.refuse_remark|limitTo:15}}) + 等待合规 + 自助开通(等待合规) + 合同制作完成 + 等待BD上传材料审核 + 绿色通道申请中 + 等待合规 + + 待审核 + 通过 + 打回 + + App + Web + + Detail + +
    +
    +
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Client MonikerShort NameCompliance StatusRegister TimeAuthFile StatusSubmit TimeSourceOperation
    - 通过({{client.approve_time}}) - 资料完善中 - (自助开通)资料完善中 - 自助开通试用中({{client.approve_time}}~{{client.expiry_time}}) - 不通过({{client.approve_time}}) - 申请打回({{client.refuse_remark|limitTo:15}}) - 等待合规 - 自助开通(等待合规) - 合同制作完成 - 等待BD上传材料审核 - 绿色通道申请中 - 等待合规 - - 待审核 - 通过 - 打回 - - App - Web - - Detail - -
    -
    - -
    -
    - -
    -
    未提交审核({{completedPagination.totalCount}}家): -
    - - +
    +
    未提交审核({{completedPagination.totalCount}}家): +
    + + +
    -
    -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -

    - All | - 未提交 | - 打回 -

    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +

    + All | + 未提交 | + 打回 +

    +
    +
    +
    - +
    +
    + + + + + + + + + + + + + + + + + + + + +
    Client MonikerShort NameCompliance StatusRegister TimeOperation
    + 通过({{client.approve_time}}) + 资料完善中 + (自助开通)资料完善中 + 自助开通试用中({{client.approve_time}}~{{client.expiry_time}}) + 不通过({{client.approve_time}}) + 申请打回({{client.refuse_remark|limitTo:15}}) + 等待合规 + 自助开通(等待合规) + 合同制作完成 + 等待BD上传材料审核 + 绿色通道申请中 + 等待合规 + + Detail + +
    +
    +
    -
    - - - - - - - - - - - - - - - - - - - - -
    Client MonikerShort NameCompliance StatusRegister TimeOperation
    - 通过({{client.approve_time}}) - 资料完善中 - (自助开通)资料完善中 - 自助开通试用中({{client.approve_time}}~{{client.expiry_time}}) - 不通过({{client.approve_time}}) - 申请打回({{client.refuse_remark|limitTo:15}}) - 等待合规 - 自助开通(等待合规) - 合同制作完成 - 等待BD上传材料审核 - 绿色通道申请中 - 等待合规 - - Detail - -
    -
    - -
    + diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index 0cf00b422..42f724a76 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -74,18 +74,6 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo url: '/devices', templateUrl: '/static/payment/partner/templates/client_devices.html', controller: 'clientDeviceCtrl' - }).state('basic.kyc_files_perfect', { - url: '/kyc_files_perfect', - templateUrl: '/static/payment/partner/templates/client_kyc_files_complete.html', - controller: 'clientCommitToKycFilesCtrl', - resolve: { - file: ['$http', function ($http) { - return $http.get('/client/partner_info/kyc/clientViewFiles'); - }], - partner: ['$http', function ($http) { - return $http.get('/client/partner_info'); - }] - } }) }]); app.controller('clientPartnerDetailCtrl', ['$scope', '$http', 'stateMap', 'partner', 'industryMap', 'businessStructuresMap', 'commonDialog', 'Upload', '$state', function ($scope, $http, stateMap, partner, industryMap, businessStructuresMap, commonDialog, Upload, $state) { @@ -1161,231 +1149,6 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiBoo }) }) }; - - - $scope.commitPartner = function () { - if ($scope.file) { - if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) { - $http.put('/client/partner_info/compliance_audit').then(function (resp) { - - }); - } else { - commitError(); - } - } else { - commitError(); - } - }; - - - }]); - - app.controller('clientCommitToKycFilesCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', 'Upload', 'file','partner', function ($scope, $http, $rootScope, commonDialog, $state, Upload, file, partner) { - $scope.file = file.data || {}; - $scope.partner = partner.data || {}; - - $scope.file.id_type = 'passport'; - $scope.file.need_bd = true; - - //audit 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); - }) - } - } - }; - - //上传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.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; - } - - $scope.updateFile = function () { - $http.put('/client/partner_info/update/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'}); - }) - }; - - $scope.needBDIntervention = function () { - commonDialog.confirm({ - title: 'Warning', - content: 'Are you sure to need BD intervention ?' - }).then(function () { - $http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/kycBdIntervention').then(function () { - commonDialog.alert({ - title: 'Success', - content: 'Commit Successful', - type: 'success' - }); - }, function (resp) { - commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); - }) - }) - }; - - function commitError() { - commonDialog.alert({ - title: 'Error', - content: 'Missing file', - type: 'error' - }); - }; - - - $scope.clientComplianceViewCommit = function () { - if (!$scope.file.client_id_file) { - commonDialog.alert({title: 'Error', content: '请提交* ASIC File', type: 'error'}); - return; - } else if (!$scope.file.client_bank_file) { - commonDialog.alert({title: 'Error', content: '请提交* bank statement', type: 'error'}); - return; - } - commonDialog.confirm({ - title: 'Warning', - content: 'Are you sure to submit files?' - }).then(function () { - $http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/kycFilesViewCommit/'+ $scope.file.id_type).then(function () { - commonDialog.alert({ - title: 'Success', - content: 'Commit 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({ - title: 'Warning', - content: 'This operation will delete the file, Are you sure?' - }).then(function () { - $http.put('/client/partner_info/auth_file/' + $scope.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.commitPartner = function () { - if ($scope.file) { - if ($scope.file.file_bank_info != null && $scope.file.file_company_info != null && $scope.file.file_id_info != null && $scope.file_apply_info != null) { - $http.put('/client/partner_info/compliance_audit').then(function (resp) { - - }); - } else { - commitError(); - } - } else { - commitError(); - } - }; - - }]); app.controller('aggregateFileCtrl', ['$scope', '$http', '$rootScope', 'commonDialog', '$state', '$uibModal', 'Upload', function ($scope, $http, $rootScope, commonDialog, $state, $uibModal, Upload) { diff --git a/src/main/ui/static/payment/partner/templates/compliance_files_advice.html b/src/main/ui/static/payment/partner/templates/compliance_files_advice.html index d47978378..2d03a300d 100644 --- a/src/main/ui/static/payment/partner/templates/compliance_files_advice.html +++ b/src/main/ui/static/payment/partner/templates/compliance_files_advice.html @@ -61,15 +61,12 @@

    前去补充合规文件:点击前往

    -

    前去补充KYC文件:点击前往

    +

    前去补充KYC文件:点击前往

    From 8457814c0da6bd65a0728f7b5a5178d6cc042be9 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 11 Dec 2019 18:35:16 +0800 Subject: [PATCH 09/32] =?UTF-8?q?add=20=E5=A2=9E=E5=8A=A0bd=20handle=20tex?= =?UTF-8?q?tarea=20=E5=AE=8C=E5=96=84bd=E5=B8=AE=E5=8A=A9=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payment/manage/kyc/core/KycService.java | 2 + .../manage/kyc/core/impls/KycServiceImpl.java | 64 +++++++++++++++++++ .../manage/kyc/web/KycManageController.java | 7 ++ .../manage/merchants/core/ClientManager.java | 2 - .../core/impls/ClientManagerImpl.java | 57 ----------------- .../merchants/web/PartnerViewController.java | 12 ++-- src/main/ui/static/payment/kyc/kyc-manage.js | 17 +++-- .../kyc/templates/bd_kyc_progress.html | 11 +++- 8 files changed, 97 insertions(+), 75 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java index c8a1940cb..1916fb5f6 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java @@ -20,4 +20,6 @@ public interface KycService { void kycNotifyBd(JSONObject account, String source); JSONObject getKYCFilesForBDHelp(JSONObject manager, String clientMoniker); + + void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source); } diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java index 35251c4e8..50c16f6f0 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java @@ -6,9 +6,11 @@ import au.com.royalpay.payment.manage.kyc.core.KycService; 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; +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.core.ClientManager; import au.com.royalpay.payment.manage.notice.core.MailService; +import au.com.royalpay.payment.manage.signin.core.SignInAccountService; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi; import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider; import au.com.royalpay.payment.tools.connections.mpsupport.beans.TemplateMessage; @@ -56,6 +58,10 @@ public class KycServiceImpl implements KycService { private RoyalThreadPoolExecutor royalThreadPoolExecutor; @Resource private MpWechatApiProvider mpWechatApiProvider; + @Resource + private ClientFilesMapper clientFilesMapper; + @Resource + private SignInAccountService signInAccountService; @Override public JSONObject listProgressClients(JSONObject manager, KycPartnersQuery query) { @@ -207,6 +213,64 @@ public class KycServiceImpl implements KycService { return clientManager.getKycFilesForBD(client); } + @Override + public void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source) { + JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); + int sourceEnum = 2; + if (client == null) { + throw new InvalidShortIdException(); + } + List clientAllAuthFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); + if (clientAllAuthFiles == null || clientAllAuthFiles.size() == 0) { + throw new BadRequestException("Please check the information is uploaded completely"); + } + String[] fileKeys = {"client_bank_file", "client_id_file"}; + String[] fileNames = {"ASIC File", "ID"}; + if(StringUtils.equalsIgnoreCase("passport",account.getString("id_type")) ){ + String[] fileKeysPassport = {"client_bank_file", "kyc_utility_bill_file", "client_id_file"}; + String[] fileNamesPassport = {"ASIC File", "Utility Bill Files", "ID"}; + fileKeys = fileKeysPassport; + fileNames = fileNamesPassport; + } + for (int i = 0; i < fileKeys.length; i++) { + String fileKey = fileKeys[i]; + if (clientAllAuthFiles.stream().noneMatch(fileJson -> fileKey.equals(fileJson.getString("file_name")))) { + throw new BadRequestException("Please check the " + fileNames[i] + " is uploaded completely"); + } + } + if ("app".equals(source.toLowerCase())) { + sourceEnum = 1; + } + + JSONObject fileComp = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); + if (fileComp == null) { + fileComp = new JSONObject(); + fileComp.put("client_id", client.getIntValue("client_id")); + fileComp.put("submit_time", new Date()); + fileComp.put("status", 0); + 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")); + clientComplianceCompanyMapper.save(fileComp); + clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id")); + } 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("bd_handle", account.getString("bd_handle")); + clientComplianceCompanyMapper.update(fileComp); + clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id")); + } else { + throw new BadRequestException("please do not repeat submission!"); + } + if (account.containsKey("account_id")) { + signInAccountService.clearAccountCache(account.getString("account_id")); + } + } + private void checkManagerPermission(JSONObject manager, JSONObject params, KycPartnersQuery query) { //todo 可支持bdleader查看组内bd商户kyc情况 // if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java index 14f17cb95..bfaa3423c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java @@ -41,4 +41,11 @@ public class KycManageController { public JSONObject getKycFilesForBDHelp(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { return kycService.getKYCFilesForBDHelp(manager,clientMoniker); } + + @ManagerMapping(value = "/{clientMoniker}/kycCommit", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) + public void clientKycFilesViewCommit(@PathVariable String clientMoniker ,@RequestBody JSONObject params,@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + manager.put("id_type", params.getString("id_type")); + manager.put("bd_handle", params.getString("bd_handle")); + kycService.commitAuthKycFilesToCompliance(clientMoniker, manager, "Web"); + } } 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 43555ea7b..9a725a52d 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 @@ -266,8 +266,6 @@ public interface ClientManager { void commitAuthFilesToCompliance(String clientMoniker, JSONObject account, String source); - void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source); - JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException; JSONObject getClientsAnalysis(JSONObject manager); 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 6886cc11e..321f509c7 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 @@ -3628,63 +3628,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid signInAccountService.clearAccountCache(account.getString("account_id")); } - @Override - @Transactional - public void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source) { - JSONObject client = getClientInfoByMoniker(clientMoniker); - int sourceEnum = 2; - if (client == null) { - throw new InvalidShortIdException(); - } - List clientAllAuthFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); - if (clientAllAuthFiles == null || clientAllAuthFiles.size() == 0) { - throw new BadRequestException("Please check the information is uploaded completely"); - } - - String[] fileKeys = {"client_bank_file", "client_id_file"}; - String[] fileNames = {"ASIC File", "ID"}; - if( "passport".equals(account.getString("idType")) ){ - String[] fileKeys_passport = {"client_bank_file", "kyc_utility_bill_file", "client_id_file"}; - String[] fileNames_passport = {"ASIC File", "Utility Bill Files", "ID"}; - fileKeys = fileKeys_passport; - fileNames = fileNames_passport; - } - - for (int i = 0; i < fileKeys.length; i++) { - String fileKey = fileKeys[i]; - if (clientAllAuthFiles.stream().noneMatch(fileJson -> fileKey.equals(fileJson.getString("file_name")))) { - throw new BadRequestException("Please check the " + fileNames[i] + " is uploaded completely"); - } - - } - if ("app".equals(source.toLowerCase())) { - sourceEnum = 1; - } - - JSONObject fileComp = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); - if (fileComp == null) { - fileComp = new JSONObject(); - fileComp.put("client_id", client.getIntValue("client_id")); - fileComp.put("submit_time", new Date()); - fileComp.put("status", 0); - fileComp.put("source", sourceEnum); - fileComp.put("commit_by_id", account.getString("account_id")); - fileComp.put("type", 2); - clientComplianceCompanyMapper.save(fileComp); - clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id")); - } else if (fileComp.getIntValue("status") == 2) { - fileComp.put("status", 0); - fileComp.put("submit_time", new Date()); - fileComp.put("source", sourceEnum); - fileComp.put("commit_by_id", account.getString("account_id")); - clientComplianceCompanyMapper.update(fileComp); - clientFilesMapper.updateBeforeCompliance(client.getIntValue("client_id")); - } else { - throw new BadRequestException("please do not repeat submission!"); - } - signInAccountService.clearAccountCache(account.getString("account_id")); - } - @Override public JSONObject getClientAggregateFile(JSONObject account, MultipartFile file) throws IOException { if (StringUtils.isBlank(file.getOriginalFilename())) { 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 3873ce478..21359a1b8 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 @@ -1,8 +1,7 @@ package au.com.royalpay.payment.manage.merchants.web; import au.com.royalpay.payment.core.exceptions.ParamInvalidException; -import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; -import au.com.royalpay.payment.manage.mappers.system.ClientComplianceCompanyMapper; +import au.com.royalpay.payment.manage.kyc.core.KycService; 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; @@ -59,12 +58,9 @@ public class PartnerViewController { @Resource private ClientContractService clientContractService; @Resource - private ClientComplianceCompanyMapper clientComplianceCompanyMapper; - @Resource private SignInAccountService signInAccountService; - @Resource - private SimpleClientApplyService simpleClientApplyService; + private KycService kycService; @RequestMapping(method = RequestMethod.GET) @RequirePartner @@ -617,8 +613,8 @@ public class PartnerViewController { @PartnerMapping(value = "/clientCompliance/{clientMoniker}/kycFilesViewCommit/{idType}", method = RequestMethod.POST) @ResponseBody public void clientKycFilesViewCommit(@PathVariable String clientMoniker ,@PathVariable String idType,@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - account.put("idType", idType); - clientManager.commitAuthKycFilesToCompliance(clientMoniker, account, "Web"); + account.put("id_type", idType); + kycService.commitAuthKycFilesToCompliance(clientMoniker, account, "Web"); } @PartnerMapping(value = "/clientCompliance/{clientMoniker}/commit_aggregate_file", method = RequestMethod.POST) diff --git a/src/main/ui/static/payment/kyc/kyc-manage.js b/src/main/ui/static/payment/kyc/kyc-manage.js index 25a8c13c2..31a6e6aea 100644 --- a/src/main/ui/static/payment/kyc/kyc-manage.js +++ b/src/main/ui/static/payment/kyc/kyc-manage.js @@ -161,35 +161,38 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS }) }; $scope.clientComplianceViewCommit = function () { - if (!$scope.file.client_bank_file.file_value) { + if (!$scope.file.client_bank_file && !$scope.file.file_company.bd_handle) { commonDialog.alert({title: 'Error', content: '请提交* ASIC File', type: 'error'}); return; } - if (!$scope.file.client_id_file.file_value) { + if (!$scope.file.client_id_file && !$scope.file.file_company.bd_handle) { commonDialog.alert({title: 'Error', content: '请提交ID护照或驾照信息', type: 'error'}); return; } - if ($scope.file.id_type == "" || $scope.file.id_type == undefined || $scope.file.id_type == null) { + if (($scope.file.id_type == "" || $scope.file.id_type == undefined || $scope.file.id_type == null) && !$scope.file.file_company.bd_handle) { commonDialog.alert({title: 'Error', content: '请选择ID文件的类型', type: 'error'}); return; } - if ($scope.file.id_type == "passport") { - if (!$scope.file.kyc_utility_bill_file.file_value) { + if ($scope.file.id_type == "passport" && !$scope.file.file_company.bd_handle) { + if (!$scope.file.kyc_utility_bill_file) { commonDialog.alert({title: 'Error', content: '请提交Utility Bill FIles(水电煤账单)信息', type: 'error'}); return; } } + var params = {}; + params.bd_handle = $scope.file.file_company.bd_handle; + params.id_type = $scope.file.file_company.id_type; commonDialog.confirm({ title: 'Warning', content: 'Are you sure to submit files?' }).then(function () { - $http.post('/client/partner_info/clientCompliance/' + $scope.partner.client_moniker + '/kycFilesViewCommit/' + $scope.file.id_type).then(function () { + $http.post('/sys/kyc/manage/' + $scope.file.client.client_moniker + '/kycCommit', params).then(function () { commonDialog.alert({ title: 'Success', content: 'Commit Successful', type: 'success' }); - $state.reload(); + $state.go('partnerKYCProgress',{},{reload: true}); }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) diff --git a/src/main/ui/static/payment/kyc/templates/bd_kyc_progress.html b/src/main/ui/static/payment/kyc/templates/bd_kyc_progress.html index 4a73473b8..c8622f699 100644 --- a/src/main/ui/static/payment/kyc/templates/bd_kyc_progress.html +++ b/src/main/ui/static/payment/kyc/templates/bd_kyc_progress.html @@ -95,7 +95,7 @@
    - @@ -188,6 +188,15 @@
    +
    + +
    +
    + +
    +
    +
    +
    + + + + diff --git a/src/main/ui/static/payment/kyc/templates/compliance_audit_authfile.html b/src/main/ui/static/payment/kyc/templates/compliance_audit_authfile.html new file mode 100644 index 000000000..2c7f9968f --- /dev/null +++ b/src/main/ui/static/payment/kyc/templates/compliance_audit_authfile.html @@ -0,0 +1,119 @@ +
    +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +

    + All | + + 待审核| + 通过| + 打回 +

    +
    +
    + +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Client MonikerShort NameCompliance StatusRegister TimeBDAuthFile StatusSubmit TimeSourceOperation
    + 通过({{compliance_company.approve_time}}) + 资料完善中 + (自助开通)资料完善中 + 自助开通试用中({{compliance_company.approve_time}}~{{compliance_company.expiry_time}}) + 不通过({{compliance_company.approve_time}}) + 申请打回({{compliance_company.refuse_remark|limitTo:15}}) + 等待合规 + 自助开通(等待合规) + 合同制作完成 + 等待BD上传材料审核 + 绿色通道申请中 + 等待合规 + + 待审核 + 通过 + 打回 + + App + Web + + Detail + +
    +
    + +
    +
    +
    +
    +
    +
    diff --git a/src/main/ui/static/payment/kyc/templates/compliance_audit_kyc.html b/src/main/ui/static/payment/kyc/templates/compliance_audit_kyc.html new file mode 100644 index 000000000..2c7f9968f --- /dev/null +++ b/src/main/ui/static/payment/kyc/templates/compliance_audit_kyc.html @@ -0,0 +1,119 @@ +
    +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +

    + All | + + 待审核| + 通过| + 打回 +

    +
    +
    + +
    +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Client MonikerShort NameCompliance StatusRegister TimeBDAuthFile StatusSubmit TimeSourceOperation
    + 通过({{compliance_company.approve_time}}) + 资料完善中 + (自助开通)资料完善中 + 自助开通试用中({{compliance_company.approve_time}}~{{compliance_company.expiry_time}}) + 不通过({{compliance_company.approve_time}}) + 申请打回({{compliance_company.refuse_remark|limitTo:15}}) + 等待合规 + 自助开通(等待合规) + 合同制作完成 + 等待BD上传材料审核 + 绿色通道申请中 + 等待合规 + + 待审核 + 通过 + 打回 + + App + Web + + Detail + +
    +
    + +
    +
    +
    +
    +
    +
    diff --git a/src/main/ui/static/payment/partner/partner_compliance.js b/src/main/ui/static/payment/partner/partner_compliance.js index f03c14d31..b67db4565 100644 --- a/src/main/ui/static/payment/partner/partner_compliance.js +++ b/src/main/ui/static/payment/partner/partner_compliance.js @@ -4,7 +4,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS app.config(['$stateProvider', function ($stateProvider) { $stateProvider.state('partner_compliance_auth', { url: '/partners/complianceForClient', - templateUrl: 'static/sys/templates/partner_compliance_for_client.html', + templateUrl: 'static/payment/kyc/templates/compliance_audit.html', controller: 'compliancePartnerForClientCtrl' }).state('compliance_detail', { url: '/{client_moniker}/compliance_detail', @@ -28,11 +28,14 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS url: '/partner/complianceForAudit', templateUrl: '/static/payment/partner/templates/compliance_auth.html', controller: 'partnerComplianceAuditCtrl' - - }).state('partner_kyc_files_auth', { - url: '/partners/KycFilesAuth', - templateUrl: 'static/sys/templates/partner_kyc_flies_auth.html', + }).state('partner_compliance_auth.partner_kyc_files_auth', { + url: '/partners/KycFiles', + templateUrl: 'static/payment/kyc/templates/compliance_audit_kyc.html', controller: 'kycFilesAuthForClientCtrl' + }).state('partner_compliance_auth.partner_authfile', { + url: '/partners/authfile', + templateUrl: 'static/payment/kyc/templates/compliance_audit_authfile.html', + controller: 'authFileForClientCtrl' }).state('kyc_files_detail', { url: '/{client_moniker}/kyc_files_detail', templateUrl: '/static/payment/partner/templates/client_kyc_files_to_auth.html', @@ -45,13 +48,19 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS }) }]); - app.controller('compliancePartnerForClientCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', + app.controller('compliancePartnerForClientCtrl', ['$rootScope','$state', function ($rootScope,$state) { + if ($state.is('partner_compliance_auth')){ + $state.go('.partner_authfile'); + } + }]); + + app.controller('kycFilesAuthForClientCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', function ($scope, $sce, $http, $filter, $uibModal, businessStructuresMap, industryMap, stateMap, sectorMap, countryMap) { $scope.pagination = {}; $scope.industries = industryMap.configs(); $scope.states = stateMap.configs(); $scope.countries = countryMap.configs(); - $scope.params = {}; + $scope.params = {type:'2'}; $scope.loadClientCompliance = function (page) { var params = angular.copy($scope.params); params.page = page || $scope.pagination.page || 1; @@ -68,13 +77,13 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS }; }]); - app.controller('kycFilesAuthForClientCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', + app.controller('authFileForClientCtrl', ['$scope', '$sce', '$http', '$filter', '$uibModal', 'businessStructuresMap', 'industryMap', 'stateMap', 'sectorMap', 'countryMap', function ($scope, $sce, $http, $filter, $uibModal, businessStructuresMap, industryMap, stateMap, sectorMap, countryMap) { $scope.pagination = {}; $scope.industries = industryMap.configs(); $scope.states = stateMap.configs(); $scope.countries = countryMap.configs(); - $scope.params = {type:'2'}; + $scope.params = {}; $scope.loadClientCompliance = function (page) { var params = angular.copy($scope.params); params.page = page || $scope.pagination.page || 1; diff --git a/src/main/ui/static/sys/templates/partner_compliance_for_client.html b/src/main/ui/static/sys/templates/partner_compliance_for_client.html deleted file mode 100644 index 0bf44744f..000000000 --- a/src/main/ui/static/sys/templates/partner_compliance_for_client.html +++ /dev/null @@ -1,138 +0,0 @@ -
    -

    商户合规文件审核

    - -
    - -
    -
    - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -

    - All | - - 待审核| - 通过| - 打回 -

    -
    -
    - -
    -
    -
    -
    -
    - -
    - - -
    diff --git a/src/main/ui/static/sys/templates/partner_kyc_flies_auth.html b/src/main/ui/static/sys/templates/partner_kyc_flies_auth.html deleted file mode 100644 index 9eda08968..000000000 --- a/src/main/ui/static/sys/templates/partner_kyc_flies_auth.html +++ /dev/null @@ -1,140 +0,0 @@ -
    -

    商户合规文件审核

    - -
    - - -
    -
    - - -
    -
    -
    -
    - -
    - -
    -
    -
    - -
    -

    - All | - - 待审核| - 通过| - 打回 -

    -
    -
    - -
    -
    -
    -
    -
    - -
    - - -
    From eca84799a1e6ef0ae24f84f3556e63e965d96568 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 12 Dec 2019 14:06:06 +0800 Subject: [PATCH 11/32] =?UTF-8?q?fix=20=E4=BC=98=E5=8C=96=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/payment/partner/partner_compliance.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/main/ui/static/payment/partner/partner_compliance.js b/src/main/ui/static/payment/partner/partner_compliance.js index b67db4565..f6e77530e 100644 --- a/src/main/ui/static/payment/partner/partner_compliance.js +++ b/src/main/ui/static/payment/partner/partner_compliance.js @@ -24,10 +24,6 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS return $http.get('/compliance/audit/compliance/clientViewFiles/'+ $stateParams.client_moniker); }] } - }).state('compliance_for_audit_detail', { - url: '/partner/complianceForAudit', - templateUrl: '/static/payment/partner/templates/compliance_auth.html', - controller: 'partnerComplianceAuditCtrl' }).state('partner_compliance_auth.partner_kyc_files_auth', { url: '/partners/KycFiles', templateUrl: 'static/payment/kyc/templates/compliance_audit_kyc.html', @@ -132,7 +128,6 @@ 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 () { @@ -175,15 +170,5 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS }) } }]); - - - app.controller('partnerComplianceAuditCtrl', ['$rootScope','$state','$stateParams', function ($rootScope,$state,$stateParams) { - if ($state.is('compliance_for_audit_detail')){ - $state.go('partner_detail'); - } - }]); - - - return app; }); From 801aab3d83d5aa1db82bcde89f79113758245691 Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 12 Dec 2019 14:14:28 +0800 Subject: [PATCH 12/32] =?UTF-8?q?fix=20=E4=BC=98=E5=8C=96=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/static/payment/kyc/kyc-manage.js | 6 +++--- src/main/ui/static/payment/kyc/kyc.js | 2 +- .../{partner_kyc_progress.html => bd_client_progress.html} | 0 ...d_kyc_partner_detail.html => bd_help_client_detail.html} | 0 .../{bd_kyc_progress.html => bd_help_client_progress.html} | 0 ...c_files_complete.html => client_kyc_files_progress.html} | 0 src/main/ui/static/payment/partner/partner_compliance.js | 6 ++---- 7 files changed, 6 insertions(+), 8 deletions(-) rename src/main/ui/static/payment/kyc/templates/{partner_kyc_progress.html => bd_client_progress.html} (100%) rename src/main/ui/static/payment/kyc/templates/{bd_kyc_partner_detail.html => bd_help_client_detail.html} (100%) rename src/main/ui/static/payment/kyc/templates/{bd_kyc_progress.html => bd_help_client_progress.html} (100%) rename src/main/ui/static/payment/kyc/templates/{client_kyc_files_complete.html => client_kyc_files_progress.html} (100%) diff --git a/src/main/ui/static/payment/kyc/kyc-manage.js b/src/main/ui/static/payment/kyc/kyc-manage.js index 31a6e6aea..28bc63b24 100644 --- a/src/main/ui/static/payment/kyc/kyc-manage.js +++ b/src/main/ui/static/payment/kyc/kyc-manage.js @@ -4,11 +4,11 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS app.config(['$stateProvider', function ($stateProvider) { $stateProvider.state('partnerKYCProgress', { url: '/partners/partnerKYCProgress', - templateUrl: 'static/payment/kyc/templates/partner_kyc_progress.html', + templateUrl: 'static/payment/kyc/templates/bd_client_progress.html', controller: 'partnerKYCProgressCtrl' }).state('partnerKYCProgress.bdHelpKycProgress', { url: '/{clientMoniker}/bdHelpKycProgress', - templateUrl: 'static/payment/kyc/templates/bd_kyc_progress.html', + templateUrl: 'static/payment/kyc/templates/bd_help_client_progress.html', controller: 'bdHelpKYCProgressCtrl', resolve: { file: ['$http','$stateParams',function ($http, $stateParams) { @@ -17,7 +17,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS } }).state('partnerKYCProgress.partner_detail', { url: '/{clientMoniker}/partner_detail', - templateUrl: '/static/payment/kyc/templates/bd_kyc_partner_detail.html', + templateUrl: '/static/payment/kyc/templates/bd_help_client_detail.html', controller: 'partnerDetailForBDHelpCtrl', resolve: { partner: ['$http', '$stateParams', function ($http, $stateParams) { diff --git a/src/main/ui/static/payment/kyc/kyc.js b/src/main/ui/static/payment/kyc/kyc.js index 1d11a71be..9d27012d3 100644 --- a/src/main/ui/static/payment/kyc/kyc.js +++ b/src/main/ui/static/payment/kyc/kyc.js @@ -4,7 +4,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS app.config(['$stateProvider', function ($stateProvider) { $stateProvider.state('kyc_files_perfect', { url: '/kyc_files_perfect', - templateUrl: '/static/payment/kyc/templates/client_kyc_files_complete.html', + templateUrl: '/static/payment/kyc/templates/client_kyc_files_progress.html', controller: 'clientCommitToKycFilesCtrl', resolve: { file: ['$http', function ($http) { diff --git a/src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html b/src/main/ui/static/payment/kyc/templates/bd_client_progress.html similarity index 100% rename from src/main/ui/static/payment/kyc/templates/partner_kyc_progress.html rename to src/main/ui/static/payment/kyc/templates/bd_client_progress.html diff --git a/src/main/ui/static/payment/kyc/templates/bd_kyc_partner_detail.html b/src/main/ui/static/payment/kyc/templates/bd_help_client_detail.html similarity index 100% rename from src/main/ui/static/payment/kyc/templates/bd_kyc_partner_detail.html rename to src/main/ui/static/payment/kyc/templates/bd_help_client_detail.html diff --git a/src/main/ui/static/payment/kyc/templates/bd_kyc_progress.html b/src/main/ui/static/payment/kyc/templates/bd_help_client_progress.html similarity index 100% rename from src/main/ui/static/payment/kyc/templates/bd_kyc_progress.html rename to src/main/ui/static/payment/kyc/templates/bd_help_client_progress.html diff --git a/src/main/ui/static/payment/kyc/templates/client_kyc_files_complete.html b/src/main/ui/static/payment/kyc/templates/client_kyc_files_progress.html similarity index 100% rename from src/main/ui/static/payment/kyc/templates/client_kyc_files_complete.html rename to src/main/ui/static/payment/kyc/templates/client_kyc_files_progress.html diff --git a/src/main/ui/static/payment/partner/partner_compliance.js b/src/main/ui/static/payment/partner/partner_compliance.js index f6e77530e..a4cb64ef4 100644 --- a/src/main/ui/static/payment/partner/partner_compliance.js +++ b/src/main/ui/static/payment/partner/partner_compliance.js @@ -105,15 +105,13 @@ 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/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({ From 79193155b2baabccf94c115a329780934f9fdc72 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Thu, 12 Dec 2019 16:48:19 +0800 Subject: [PATCH 13/32] [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', From 0d5c44d26f88c5ef88819f60faa9078a80700a7a Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 12 Dec 2019 16:58:44 +0800 Subject: [PATCH 14/32] =?UTF-8?q?add=20=E5=A2=9E=E5=8A=A0=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E8=B7=B3=E8=BD=AC=E3=80=81bd=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../payment/manage/kyc/core/KycService.java | 3 + .../manage/kyc/core/impls/KycServiceImpl.java | 16 ++- .../manage/kyc/web/KycManageController.java | 7 ++ src/main/ui/static/payment/kyc/kyc-manage.js | 103 +++++++++++++++++- .../templates/bd_help_client_progress.html | 13 ++- 5 files changed, 134 insertions(+), 8 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java index 1916fb5f6..45377ca65 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java @@ -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); } diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java index 50c16f6f0..8312f07a7 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java @@ -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 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"))) { diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java index bfaa3423c..f0e2f347a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java @@ -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); + } } diff --git a/src/main/ui/static/payment/kyc/kyc-manage.js b/src/main/ui/static/payment/kyc/kyc-manage.js index 28bc63b24..64272baee 100644 --- a/src/main/ui/static/payment/kyc/kyc-manage.js +++ b/src/main/ui/static/payment/kyc/kyc-manage.js @@ -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); diff --git a/src/main/ui/static/payment/kyc/templates/bd_help_client_progress.html b/src/main/ui/static/payment/kyc/templates/bd_help_client_progress.html index c8622f699..415a262f4 100644 --- a/src/main/ui/static/payment/kyc/templates/bd_help_client_progress.html +++ b/src/main/ui/static/payment/kyc/templates/bd_help_client_progress.html @@ -54,8 +54,9 @@
    Audit Files     - + +
    @@ -72,9 +73,10 @@ + - +
    @@ -124,9 +126,10 @@ + - +
    @@ -192,7 +195,7 @@
    - +
    From edca1fef2979057aeabc1a77187b4d0d0f84cc5c Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Thu, 12 Dec 2019 18:05:37 +0800 Subject: [PATCH 15/32] =?UTF-8?q?[R]=E5=95=86=E6=88=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0KYC=E6=96=87=E4=BB=B6=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/merchants/core/ClientManager.java | 2 + .../core/impls/ClientManagerImpl.java | 30 +++ .../web/PartnerManageController.java | 11 ++ .../merchants/web/PartnerViewController.java | 10 - .../templates/client_kyc_files_progress.html | 2 + .../kyc/templates/partner_kyc_files.html | 145 +++++++++++++++ .../static/payment/partner/partner-manage.js | 174 ++++++++++++++++++ .../client_compliance_to_perfect.html | 2 + .../partner/templates/partner_detail.html | 3 + 9 files changed, 369 insertions(+), 10 deletions(-) create mode 100644 src/main/ui/static/payment/kyc/templates/partner_kyc_files.html 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 3f635fabd..a741510b7 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 @@ -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); 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 9cb1ad500..e94002049 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 @@ -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 clientFiles = clientFilesMapper.findClientFile(client.getIntValue("client_id")); + JSONObject fileJson = new JSONObject(); + if (clientFiles != null && clientFiles.size() > 0) { + for (String fileKey : fileKeys) { + List 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); diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java index b829c9597..1d99a9bb3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/web/PartnerManageController.java @@ -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); 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 a0eed3674..1beb36904 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 @@ -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) { diff --git a/src/main/ui/static/payment/kyc/templates/client_kyc_files_progress.html b/src/main/ui/static/payment/kyc/templates/client_kyc_files_progress.html index 0008a21af..7bf7e7e10 100644 --- a/src/main/ui/static/payment/kyc/templates/client_kyc_files_progress.html +++ b/src/main/ui/static/payment/kyc/templates/client_kyc_files_progress.html @@ -21,6 +21,8 @@ ({{file.client_refuse_reason}}) +
    +

    前去补充合规文件:点击前往

    diff --git a/src/main/ui/static/payment/kyc/templates/partner_kyc_files.html b/src/main/ui/static/payment/kyc/templates/partner_kyc_files.html new file mode 100644 index 000000000..e83b5b67c --- /dev/null +++ b/src/main/ui/static/payment/kyc/templates/partner_kyc_files.html @@ -0,0 +1,145 @@ + +
    +
    KYC Files     + +
    +
    +
    +
    + +
    +
    + + +
    + + + + + + + + + +
    1 + + + + +
    + + +
    +
    +
    +

    Example:请保证图片信息清晰可见,如下图

    + +
    +
    +
    + +
    + +
    +
    + + +
    + + + + + + + + +
    1 + + + + +
    +
    +
    +
    +
    +

    Example:请保证图片(护照或驾照)信息清晰可见,如下图

    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    + +
    +
    + +
    + + + + + + + + +
    1 + + + +
    +
    +
    +
    +
    +

    Example:公司请提供以下文件图片,如示例 + +

    +

    sole trade(个体户),partnership(合伙),trust(信托)请在http://abr.business.gov.au,将查询结果截图上传 + +

    +
    +
    +
    +
    + +
    +
    +
    + check +
    +
    + diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index e810cbfa0..abe9ae776 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -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 = {}; diff --git a/src/main/ui/static/payment/partner/templates/client_compliance_to_perfect.html b/src/main/ui/static/payment/partner/templates/client_compliance_to_perfect.html index 2f5d5feaa..eadd5e66a 100644 --- a/src/main/ui/static/payment/partner/templates/client_compliance_to_perfect.html +++ b/src/main/ui/static/payment/partner/templates/client_compliance_to_perfect.html @@ -21,6 +21,8 @@ ({{file.client_refuse_reason}}) +
    +

    前去补充KYC文件:点击前往

    diff --git a/src/main/ui/static/payment/partner/templates/partner_detail.html b/src/main/ui/static/payment/partner/templates/partner_detail.html index 7e2ac4067..fae0946e3 100644 --- a/src/main/ui/static/payment/partner/templates/partner_detail.html +++ b/src/main/ui/static/payment/partner/templates/partner_detail.html @@ -277,6 +277,9 @@
  • Compliance Files
  • +
  • + KYC Files +
  • Settlement
  • From 9a449431775be241e23b506522dcf9ada07aeeca Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 13 Dec 2019 09:30:47 +0800 Subject: [PATCH 16/32] fix ui --- .../static/payment/kyc/templates/bd_help_client_progress.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/ui/static/payment/kyc/templates/bd_help_client_progress.html b/src/main/ui/static/payment/kyc/templates/bd_help_client_progress.html index 415a262f4..8fd2e1430 100644 --- a/src/main/ui/static/payment/kyc/templates/bd_help_client_progress.html +++ b/src/main/ui/static/payment/kyc/templates/bd_help_client_progress.html @@ -20,7 +20,7 @@
    - +

    待审核 From ffc7c5681028dcd4b12cc66f112adc493fbbd380 Mon Sep 17 00:00:00 2001 From: luoyang Date: Fri, 13 Dec 2019 16:04:38 +0800 Subject: [PATCH 17/32] =?UTF-8?q?add=20=E4=BC=98=E5=8C=96=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E4=BB=A3=E7=A0=81=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=B8=89?= =?UTF-8?q?=E7=BA=A7=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/impl/ClientComplianceApplyImpl.java | 5 +- .../payment/manage/kyc/core/KycService.java | 4 +- .../manage/kyc/core/impls/KycServiceImpl.java | 16 +- .../manage/kyc/web/KycManageController.java | 12 +- src/main/ui/static/payment/kyc/kyc-manage.js | 2 +- .../compliance_audit_client_detail.html | 228 +++++++++++++ .../kyc/templates/compliance_audit_kyc.html | 2 +- .../compliance_audit_kyc_detail.html | 18 ++ .../payment/partner/partner_compliance.js | 50 +-- .../templates/client_compliance_to_auth.html | 2 +- .../templates/client_kyc_files_to_auth.html | 244 +++++++------- .../templates/compliance_files_advice.html | 9 +- .../partner_detail_for_compliance.html | 304 ------------------ 13 files changed, 426 insertions(+), 470 deletions(-) create mode 100644 src/main/ui/static/payment/kyc/templates/compliance_audit_client_detail.html create mode 100644 src/main/ui/static/payment/kyc/templates/compliance_audit_kyc_detail.html delete mode 100644 src/main/ui/static/payment/partner/templates/partner_detail_for_compliance.html diff --git a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/impl/ClientComplianceApplyImpl.java b/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/impl/ClientComplianceApplyImpl.java index 30a20f497..c91e3128b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/impl/ClientComplianceApplyImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/complianceAudit/core/impl/ClientComplianceApplyImpl.java @@ -16,9 +16,7 @@ import com.github.miemiedev.mybatis.paginator.domain.Order; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import org.apache.commons.lang3.StringUtils; -import org.omg.CORBA.SystemException; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.util.List; @@ -81,8 +79,7 @@ public class ClientComplianceApplyImpl implements ClientComplianceApply }; @Override - public JSONObject kycAuthFile(JSONObject client) - { + public JSONObject kycAuthFile(JSONObject client) { String[] fileKeys = {"client_bank_file", "kyc_utility_bill_file", "client_id_file"}; if (client == null) { throw new InvalidShortIdException(); diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java index 45377ca65..e358d8316 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java @@ -20,9 +20,11 @@ public interface KycService { void kycNotifyBd(JSONObject account, String source); - JSONObject getKYCFilesForBDHelp(JSONObject manager, String clientMoniker); + JSONObject getKycFilesForBdHelp(JSONObject manager, String clientMoniker); void commitAuthKycFilesToCompliance(String clientMoniker, JSONObject account, String source); void uploadKycFiles(JSONObject manager, String clientMoniker, ClientKycFilesInfo kycFilesInfo); + + void deleteAuthFiles(String fileId, JSONObject manager); } diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java index 8312f07a7..933404d46 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java @@ -201,7 +201,7 @@ public class KycServiceImpl implements KycService { } @Override - public JSONObject getKYCFilesForBDHelp(JSONObject manager, String clientMoniker) { + public JSONObject getKycFilesForBdHelp(JSONObject manager, String clientMoniker) { JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -285,6 +285,20 @@ public class KycServiceImpl implements KycService { clientManager.uploadKycFilesForWaitCompliance(manager, clientMoniker, kycFilesInfo); } + @Override + public void deleteAuthFiles(String fileId, JSONObject manager) { + JSONObject file = clientFilesMapper.findFileById(fileId); + if (file.getIntValue("status") == 1 || file.getIntValue("status") == 2) { + throw new BadRequestException("The file has passed and cannot be deleted"); + } + JSONObject client = clientManager.getClientInfo(file.getIntValue("client_id")); + if (client == null) { + throw new InvalidShortIdException(); + } + checkClientBelongBd(file.getIntValue("client_id"), manager.getString("manager_id")); + clientFilesMapper.deleteByClientAndFileId(fileId); + } + private void checkManagerPermission(JSONObject manager, JSONObject params, KycPartnersQuery query) { //todo 可支持bdleader查看组内bd商户kyc情况 // if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java index f0e2f347a..07165700d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycManageController.java @@ -39,8 +39,8 @@ public class KycManageController { } @ManagerMapping(value = "/{clientMoniker}/bd_help",method = RequestMethod.GET, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) - public JSONObject getKycFilesForBDHelp(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { - return kycService.getKYCFilesForBDHelp(manager,clientMoniker); + public JSONObject getKycFilesForBdHelp(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @PathVariable String clientMoniker) { + return kycService.getKycFilesForBdHelp(manager,clientMoniker); } @ManagerMapping(value = "/{clientMoniker}/kycCommit", method = RequestMethod.POST, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) @@ -51,8 +51,12 @@ public class KycManageController { } @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(); + public void updateKycFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody ClientKycFilesInfo filesInfo) { kycService.uploadKycFiles(manager, clientMoniker, filesInfo); } + + @ManagerMapping(value = "/auth_file/{fileId}/delete", method = RequestMethod.PUT, role = {ManagerRole.OPERATOR, ManagerRole.BD_USER}) + public void deleteAuthFiles(@PathVariable String fileId, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) { + kycService.deleteAuthFiles(fileId, manager); + } } diff --git a/src/main/ui/static/payment/kyc/kyc-manage.js b/src/main/ui/static/payment/kyc/kyc-manage.js index 64272baee..37cbde964 100644 --- a/src/main/ui/static/payment/kyc/kyc-manage.js +++ b/src/main/ui/static/payment/kyc/kyc-manage.js @@ -241,7 +241,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS title: 'Warning', content: 'This operation will delete the file, Are you sure?' }).then(function () { - $http.put('/client/partner_info/auth_file/' + $scope.file_id + '/delete').then(function (resp) { + $http.put('/sys/kyc/manage/auth_file/' + $scope.file_id + '/delete').then(function (resp) { commonDialog.alert({ title: 'Success', content: 'Delete Successful', diff --git a/src/main/ui/static/payment/kyc/templates/compliance_audit_client_detail.html b/src/main/ui/static/payment/kyc/templates/compliance_audit_client_detail.html new file mode 100644 index 000000000..bd4341b6e --- /dev/null +++ b/src/main/ui/static/payment/kyc/templates/compliance_audit_client_detail.html @@ -0,0 +1,228 @@ +

    +
    + Partner Basic Information +
    +
    +
    +
    + + +
    +

    + {{partner.client_moniker}} + (Sub Partner of + ) + + (已禁用) +

    +
    +
    +
    + + +
    +

    + + + 注意:(微信渠道可能不合规) + + +

    +
    +
    +
    + + +
    +

    +

    + 注意:(微信渠道可能不合规) +

    +
    +
    +
    + + +
    +

    +
    +
    +
    + +
    +

    +

    + 注意:(微信渠道可能不合规) +

    +
    +
    + +
    + + +
    +

    +

    + 注意:(微信渠道可能不合规) +

    +
    +
    +
    + +
    + +
    +
    +
    + + +
    +

    +
    +
    +
    + +
    +

    +
    +
    +
    + + +
    +

    +
    +
    + +
    + + +
    +

    +
    +
    +
    + + +
    +

    +
    +
    +
    + + +
    +

    +
    +
    +
    + +
    +

    +
    +
    +
    +
    +
    + +
    +
    Partner Contact Information
    +
    +
    +
    + + +
    +

    +
    +
    +
    + + +
    +

    +

    +
    +
    +
    + + +
    +

    + + +

    +

    +
    +
    +
    +
    +
    + +
    +
    Address Information
    +
    +
    + +
    + + +
    +

    +

    +
    +
    +
    + + +
    +

    +
    +
    +
    + + +
    +

    +
    +
    +
    + + +
    +

    +
    +
    +
    + + +
    +

    +
    +
    +
    + +
    +

    +
    +
    +
    +
    +
    diff --git a/src/main/ui/static/payment/kyc/templates/compliance_audit_kyc.html b/src/main/ui/static/payment/kyc/templates/compliance_audit_kyc.html index 2c7f9968f..cad0780c7 100644 --- a/src/main/ui/static/payment/kyc/templates/compliance_audit_kyc.html +++ b/src/main/ui/static/payment/kyc/templates/compliance_audit_kyc.html @@ -87,7 +87,7 @@ Web + ui-sref="partner_compliance_auth.kycDetail({client_moniker:compliance_company.client_moniker})"> Detail diff --git a/src/main/ui/static/payment/kyc/templates/compliance_audit_kyc_detail.html b/src/main/ui/static/payment/kyc/templates/compliance_audit_kyc_detail.html new file mode 100644 index 000000000..eecc050c8 --- /dev/null +++ b/src/main/ui/static/payment/kyc/templates/compliance_audit_kyc_detail.html @@ -0,0 +1,18 @@ +
    +
    +
    + +
    +
    +
    diff --git a/src/main/ui/static/payment/partner/partner_compliance.js b/src/main/ui/static/payment/partner/partner_compliance.js index a4cb64ef4..962cbc606 100644 --- a/src/main/ui/static/payment/partner/partner_compliance.js +++ b/src/main/ui/static/payment/partner/partner_compliance.js @@ -6,7 +6,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS url: '/partners/complianceForClient', templateUrl: 'static/payment/kyc/templates/compliance_audit.html', controller: 'compliancePartnerForClientCtrl' - }).state('compliance_detail', { + }).state('partner_compliance_auth.compliance_detail', { url: '/{client_moniker}/compliance_detail', templateUrl: '/static/payment/partner/templates/client_compliance_to_auth.html', controller: 'partnerComplianceCompanyDetail', @@ -15,25 +15,29 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS return $http.get('/compliance/audit/compliance/clientViewFiles/'+ $stateParams.client_moniker); }] } - }).state('partner_detail', { - url: '/{client_moniker}/partner_detail', - templateUrl: '/static/payment/partner/templates/partner_detail_for_compliance.html', - controller: 'partnerComplianceCompanyDetail', - resolve: { - file: ['$http','$stateParams',function ($http, $stateParams) { - return $http.get('/compliance/audit/compliance/clientViewFiles/'+ $stateParams.client_moniker); - }] - } + }).state('partner_compliance_auth.kycDetail.partner_detail', { + url: '/partner_detail', + templateUrl: '/static/payment/kyc/templates/compliance_audit_client_detail.html', + controller: 'compliancePartnerDetailCtrl', + resolve: { + partner: ['$http', '$stateParams', function ($http, $stateParams) { + return $http.get('/sys/partners/' + $stateParams.client_moniker); + }] + } }).state('partner_compliance_auth.partner_kyc_files_auth', { url: '/partners/KycFiles', templateUrl: 'static/payment/kyc/templates/compliance_audit_kyc.html', controller: 'kycFilesAuthForClientCtrl' + }).state('partner_compliance_auth.kycDetail', { + url: '/{client_moniker}', + templateUrl: 'static/payment/kyc/templates/compliance_audit_kyc_detail.html', + controller: 'kycDetailCtrl' }).state('partner_compliance_auth.partner_authfile', { url: '/partners/authfile', templateUrl: 'static/payment/kyc/templates/compliance_audit_authfile.html', controller: 'authFileForClientCtrl' - }).state('kyc_files_detail', { - url: '/{client_moniker}/kyc_files_detail', + }).state('partner_compliance_auth.kycDetail.kyc_files_detail', { + url: '/kyc_files_audit', templateUrl: '/static/payment/partner/templates/client_kyc_files_to_auth.html', controller: 'partnerKycFilesDetail', resolve: { @@ -44,7 +48,7 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS }) }]); - app.controller('compliancePartnerForClientCtrl', ['$rootScope','$state', function ($rootScope,$state) { + app.controller('compliancePartnerForClientCtrl', ['$rootScope','$state', '$stateParams', function ($rootScope,$state,$stateParams) { if ($state.is('partner_compliance_auth')){ $state.go('.partner_authfile'); } @@ -124,7 +128,19 @@ 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) { + app.controller('kycDetailCtrl', ['$scope', '$rootScope','$state', '$stateParams', function ($scope,$rootScope,$state, $stateParams) { + $scope.clientMoniker = $stateParams.client_moniker; + + if ($state.is('partner_compliance_auth.kycDetail')){ + $state.go('.kyc_files_detail', {client_moniker: $stateParams.client_moniker}); + } + }]); + app.controller('compliancePartnerDetailCtrl', ['$scope', 'partner','$rootScope', '$stateParams', function ($scope, partner,$rootScope, $stateParams) { + $scope.partner = angular.copy(partner.data); + $scope.clientMoniker = $stateParams.client_moniker; + }]); + app.controller('partnerKycFilesDetail', ['$rootScope', '$scope', '$http', '$state', '$uibModal', 'commonDialog', 'file', '$stateParams', function ($rootScope, $scope, $http, $state, $uibModal, commonDialog, file, $stateParams) { + $scope.clientMoniker = $stateParams.client_moniker; $scope.file = file.data || {}; $scope.partner = $scope.file.client; @@ -133,13 +149,13 @@ 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/complianceFile', {}).then(function (resp) { $state.reload(); }, function (resp) { commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); }) }) - } + }; $scope.refusePartnerComplianceFiles = function (obj) { @@ -153,8 +169,6 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS }) }; }]); - - app.controller('refusePartnerComplianceFilesCtrl', ['$scope', '$http', '$state', 'partner', function ($scope, $http, $state, partner) { $scope.partner = angular.copy(partner); $scope.partner.description = ""; diff --git a/src/main/ui/static/payment/partner/templates/client_compliance_to_auth.html b/src/main/ui/static/payment/partner/templates/client_compliance_to_auth.html index 4064a51e9..909841b8d 100644 --- a/src/main/ui/static/payment/partner/templates/client_compliance_to_auth.html +++ b/src/main/ui/static/payment/partner/templates/client_compliance_to_auth.html @@ -10,7 +10,7 @@