From adc653509bbe0d730ada919bd911746144f87c0d Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 11 Dec 2019 17:33:37 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E3=80=81=E5=A2=9E=E5=8A=A0BD=E7=AB=AFhandle=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=EF=BC=88=E6=97=A0=E6=B3=95=E6=8F=90=E4=BE=9B=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E6=9C=AA=E5=AE=8C=E5=96=84=E3=80=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=93=8D=E4=BD=9C=E6=9C=AA=E6=A0=B8=E9=AA=8C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/{KycManage.java => KycService.java} | 5 +- ...KycManageImpl.java => KycServiceImpl.java} | 64 +- .../payment/manage/kyc/web/KycController.java | 22 + .../manage/kyc/web/KycManageController.java | 23 +- .../system/ClientComplianceCompanyMapper.java | 8 +- .../manage/merchants/core/ClientManager.java | 4 +- .../core/impls/ClientManagerImpl.java | 50 +- .../merchants/web/PartnerViewController.java | 8 +- src/main/ui/static/boot/index-boot.js | 3 +- src/main/ui/static/boot/indexMainApp.js | 10 +- src/main/ui/static/payment/kyc/kyc-manage.js | 90 ++- src/main/ui/static/payment/kyc/kyc.js | 213 ++++++ .../kyc/templates/bd_kyc_partner_detail.html | 301 +++++++++ .../kyc/templates/bd_kyc_progress.html | 203 ++++++ .../templates/client_kyc_files_complete.html | 61 +- .../kyc/templates/partner_kyc_progress.html | 632 +++++++++--------- src/main/ui/static/payment/partner/partner.js | 237 ------- .../templates/compliance_files_advice.html | 5 +- 18 files changed, 1253 insertions(+), 686 deletions(-) rename src/main/java/au/com/royalpay/payment/manage/kyc/core/{KycManage.java => KycService.java} (76%) rename src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/{KycManageImpl.java => KycServiceImpl.java} (76%) create mode 100644 src/main/java/au/com/royalpay/payment/manage/kyc/web/KycController.java create mode 100644 src/main/ui/static/payment/kyc/kyc.js create mode 100644 src/main/ui/static/payment/kyc/templates/bd_kyc_partner_detail.html create mode 100644 src/main/ui/static/payment/kyc/templates/bd_kyc_progress.html rename src/main/ui/static/payment/{partner => kyc}/templates/client_kyc_files_complete.html (85%) 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/KycService.java similarity index 76% rename from src/main/java/au/com/royalpay/payment/manage/kyc/core/KycManage.java rename to src/main/java/au/com/royalpay/payment/manage/kyc/core/KycService.java index 2c67ce1d2..c8a1940cb 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/KycService.java @@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject; import java.util.List; -public interface KycManage { +public interface KycService { JSONObject listProgressClients(JSONObject manager, KycPartnersQuery query); @@ -17,4 +17,7 @@ public interface KycManage { void sendNotify(JSONObject complianceInfo); + void kycNotifyBd(JSONObject account, String source); + + JSONObject getKYCFilesForBDHelp(JSONObject manager, String clientMoniker); } 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/KycServiceImpl.java similarity index 76% rename from src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycManageImpl.java rename to src/main/java/au/com/royalpay/payment/manage/kyc/core/impls/KycServiceImpl.java index 7225e8f77..35251c4e8 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/KycServiceImpl.java @@ -1,16 +1,19 @@ package au.com.royalpay.payment.manage.kyc.core.impls; +import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.manage.kyc.bean.KycPartnersQuery; -import au.com.royalpay.payment.manage.kyc.core.KycManage; +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.ClientMapper; +import au.com.royalpay.payment.manage.merchants.core.ClientManager; 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.exceptions.BadRequestException; 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; @@ -32,7 +35,7 @@ import java.util.Date; import java.util.List; @Service -public class KycManageImpl implements KycManage { +public class KycServiceImpl implements KycService { private Logger logger = LoggerFactory.getLogger(getClass()); @Resource @@ -40,6 +43,8 @@ public class KycManageImpl implements KycManage { @Resource private ClientMapper clientMapper; @Resource + private ClientManager clientManager; + @Resource private ClientBDMapper clientBDMapper; @Resource private FinancialBDConfigMapper financialBDConfigMapper; @@ -155,6 +160,53 @@ public class KycManageImpl implements KycManage { } + @Override + public void kycNotifyBd(JSONObject account, String source) { + JSONObject client = clientManager.getClientInfo(account.getIntValue("client_id")); + if (client == null) { + throw new InvalidShortIdException(); + } + int sourceEnum = 2; + 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); + fileComp.put("is_valid", 1); + clientComplianceCompanyMapper.save(fileComp); + } 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); + } else { + throw new BadRequestException("please do not repeat submission!"); + } + sendNotify(fileComp); + } + + @Override + public JSONObject getKYCFilesForBDHelp(JSONObject manager, String clientMoniker) { + JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker); + if (client == null) { + throw new InvalidShortIdException(); + } + checkClientBelongBd(client.getIntValue("client_id"), manager.getString("manager_id")); + JSONObject kycInfo = clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id")); + if (kycInfo == null || kycInfo.getIntValue("status") != 9) { + throw new BadRequestException("This Partner is not application submitted"); + } + return clientManager.getKycFilesForBD(client); + } + private void checkManagerPermission(JSONObject manager, JSONObject params, KycPartnersQuery query) { //todo 可支持bdleader查看组内bd商户kyc情况 // if (ManagerRole.BD_USER.hasRole(manager.getIntValue("role"))) { @@ -181,4 +233,12 @@ public class KycManageImpl implements KycManage { } //todo 如果是合规,增加bd_user为customerService } + + private void checkClientBelongBd(int clientId, String managerId) { + int permissionInt = clientBDMapper.checkBDPermission(clientId, managerId); + if (permissionInt < 1) { +// throw new BadRequestException("This Partner is not belongs to you"); + } + + } } diff --git a/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycController.java b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycController.java new file mode 100644 index 000000000..19f6b819c --- /dev/null +++ b/src/main/java/au/com/royalpay/payment/manage/kyc/web/KycController.java @@ -0,0 +1,22 @@ +package au.com.royalpay.payment.manage.kyc.web; + +import au.com.royalpay.payment.manage.kyc.core.KycService; +import au.com.royalpay.payment.manage.permission.manager.PartnerMapping; +import au.com.royalpay.payment.tools.CommonConsts; +import com.alibaba.fastjson.JSONObject; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +@RestController +@RequestMapping("/sys/kyc/partner") +public class KycController { + @Resource + private KycService kycService; + + @PartnerMapping(value = "/notifyBd", method = RequestMethod.PUT) + @ResponseBody + public void clientKycBdIntervention(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { + kycService.kycNotifyBd(account, "web"); + } +} 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 4e79f6c9f..14f17cb95 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 @@ -1,15 +1,12 @@ 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.kyc.core.KycService; 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 org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.List; @@ -17,27 +14,31 @@ import java.util.List; @RestController @RequestMapping("/sys/kyc/manage") public class KycManageController { - @Resource - private KycManage kycManage; + private KycService kycService; @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); + return kycService.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); + return kycService.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); + return kycService.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); + return kycService.getKycDashboard(manager); + } + + @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); } } 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 f8c8ebb5e..6ddc6dfc6 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 @@ -24,15 +24,15 @@ public interface ClientComplianceCompanyMapper { @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "type = 1") - JSONObject findFileByClientId(@Param("client_id") int client_id); + JSONObject findFileByClientId(@Param("client_id") int clientId); @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "type = 2") - JSONObject findKycFileByClientId(@Param("client_id") int client_id); + JSONObject findKycFileByClientId(@Param("client_id") int clientId); @AutoSql(type = SqlType.SELECT) - @AdvanceSelect(addonWhereClause = "type = 2 and status in(0,1,9)") - JSONObject findKycFileComplete(@Param("client_id") int client_id); + @AdvanceSelect(addonWhereClause = "type = 2 and status in (0,1,9)") + JSONObject findKycFileComplete(@Param("client_id") int clientId); PageList listClientCompliances(JSONObject params, PageBounds pageBounds); 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 1c22aa5bc..43555ea7b 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 @@ -268,8 +268,6 @@ public interface ClientManager { 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); @@ -505,7 +503,7 @@ public interface ClientManager { JSONObject getComplianceFilesForBD(JSONObject account); - JSONObject getKycFilesForBD(JSONObject account); + JSONObject getKycFilesForBD(JSONObject client); /** * 获取商户所有增值服务 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 d7352ea12..6886cc11e 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 @@ -17,12 +17,11 @@ import au.com.royalpay.payment.core.PaymentChannelApi; import au.com.royalpay.payment.core.exceptions.EmailException; import au.com.royalpay.payment.core.exceptions.InvalidShortIdException; import au.com.royalpay.payment.core.mappers.SysClientMapper; -import au.com.royalpay.payment.manage.appclient.beans.RSvcMchBean; -import au.com.royalpay.payment.tools.defines.IncrementalChannel; import au.com.royalpay.payment.core.utils.OrderExpiryRuleResolver; import au.com.royalpay.payment.manage.analysis.mappers.TransactionAnalysisMapper; import au.com.royalpay.payment.manage.appclient.beans.AppClientBean; import au.com.royalpay.payment.manage.appclient.beans.AppMerchantBean; +import au.com.royalpay.payment.manage.appclient.beans.RSvcMchBean; import au.com.royalpay.payment.manage.application.core.SimpleClientApplyService; import au.com.royalpay.payment.manage.complianceAudit.core.ClientComplianceApply; import au.com.royalpay.payment.manage.dev.bean.TestMerchantAccountInfo; @@ -54,6 +53,7 @@ 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.connections.mpsupport.exceptions.WechatException; +import au.com.royalpay.payment.tools.defines.IncrementalChannel; import au.com.royalpay.payment.tools.env.PlatformEnvironment; import au.com.royalpay.payment.tools.env.SysConfigManager; import au.com.royalpay.payment.tools.exceptions.BadRequestException; @@ -92,7 +92,7 @@ import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.commons.lang3.time.DateUtils; 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.CellStyle; import org.apache.poi.ss.usermodel.Font; import org.dom4j.Element; import org.slf4j.Logger; @@ -133,8 +133,8 @@ import java.security.KeyPair; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; import java.text.SimpleDateFormat; -import java.util.*; import java.util.List; +import java.util.*; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.zip.ZipEntry; @@ -2288,13 +2288,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } @Override - public JSONObject getKycFilesForBD(JSONObject account) { - JSONObject client = getClientInfo(account.getIntValue("client_id")); + public JSONObject getKycFilesForBD(JSONObject client) { if (client == null) { throw new InvalidShortIdException(); } JSONObject file = clientComplianceApply.kycAuthFile(client); - file.put("file_company", clientComplianceCompanyMapper.findKycFileByClientId(account.getIntValue("client_id"))); + file.put("file_company", clientComplianceCompanyMapper.findKycFileByClientId(client.getIntValue("client_id"))); file.put("client", client); return file; } @@ -3605,6 +3604,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid fileComp.put("client_id", client.getIntValue("client_id")); fileComp.put("submit_time", new Date()); fileComp.put("status", 0); + fileComp.put("type", 1); fileComp.put("company_photo", companyPhoto); fileComp.put("store_photo", storePhoto); fileComp.put("company_website", webSite); @@ -3685,42 +3685,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid 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 45ecde1d0..3873ce478 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,8 +3,8 @@ 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.ClientKycFilesInfo; 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; @@ -621,12 +621,6 @@ public class PartnerViewController { 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/ui/static/boot/index-boot.js b/src/main/ui/static/boot/index-boot.js index 63d340672..aa091fb70 100644 --- a/src/main/ui/static/boot/index-boot.js +++ b/src/main/ui/static/boot/index-boot.js @@ -79,7 +79,8 @@ var modules = [ {path: 'static/integralmall/coupon_cancellation', module: 'couponCancellation', roles: [1,2]}, {path: 'static/invoice/invoice_assistant', module: 'partnerInvoice', roles: [1]}, {path: 'static/payment/billqrcode/bill-qrcode-manage', module: 'billQrCodeManagement', roles: [1,2,3]}, - {path: 'static/incrementalService/partner-incremental-service', module: 'partnerIncrementalService', roles: [1,2,3]} + {path: 'static/incrementalService/partner-incremental-service', module: 'partnerIncrementalService', roles: [1,2,3]}, + {path: 'static/payment/kyc/kyc', module: 'kycApp', roles: [1,2,3]} ]; require(['angular', 'jquery'], function (angular, $) { diff --git a/src/main/ui/static/boot/indexMainApp.js b/src/main/ui/static/boot/indexMainApp.js index 814906a71..d66ad4ec4 100644 --- a/src/main/ui/static/boot/indexMainApp.js +++ b/src/main/ui/static/boot/indexMainApp.js @@ -61,13 +61,8 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo }) }; - if($scope.currentUser.client.client_less_file && complianceNoticeCount==0 && $scope.currentUser.role!=3) - { - $scope.ComplianceToperfect(); - complianceNoticeCount++; - } - if($scope.currentUser.lessKycFiles && complianceNoticeCount==0 && $scope.currentUser.role!=3) - { + //todo 这边需要调整 或者关系 不能做两个if,字段放到client里,位置要一致,有bug当补充合规材料提交后不提示弹窗,弹窗样式要修改 + if(($scope.currentUser.client.client_less_file ||$scope.currentUser.lessKycFiles) && complianceNoticeCount==0 && $scope.currentUser.role!=3) { $scope.ComplianceToperfect(); complianceNoticeCount++; } @@ -488,7 +483,6 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo app.controller('partnerFilesCtrl', ['$scope', '$http', '$sce', 'file', 'kycFile', function ($scope, $http, $sce, file , kycFile) { $scope.file = angular.copy(file); $scope.kycFile = angular.copy(kycFile); - debugger; }]); app.factory('myLoginLogView', ['$uibModal', function ($uibModal) { return { diff --git a/src/main/ui/static/payment/kyc/kyc-manage.js b/src/main/ui/static/payment/kyc/kyc-manage.js index 952afaeb6..25a8c13c2 100644 --- a/src/main/ui/static/payment/kyc/kyc-manage.js +++ b/src/main/ui/static/payment/kyc/kyc-manage.js @@ -6,11 +6,28 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS url: '/partners/partnerKYCProgress', templateUrl: 'static/payment/kyc/templates/partner_kyc_progress.html', controller: 'partnerKYCProgressCtrl' + }).state('partnerKYCProgress.bdHelpKycProgress', { + url: '/{clientMoniker}/bdHelpKycProgress', + templateUrl: 'static/payment/kyc/templates/bd_kyc_progress.html', + controller: 'bdHelpKYCProgressCtrl', + resolve: { + file: ['$http','$stateParams',function ($http, $stateParams) { + return $http.get('/sys/kyc/manage/' + $stateParams.clientMoniker + '/bd_help'); + }] + } + }).state('partnerKYCProgress.partner_detail', { + url: '/{clientMoniker}/partner_detail', + templateUrl: '/static/payment/kyc/templates/bd_kyc_partner_detail.html', + controller: 'partnerDetailForBDHelpCtrl', + resolve: { + partner: ['$http', '$stateParams', function ($http, $stateParams) { + return $http.get('/sys/partners/' + $stateParams.clientMoniker); + }] + } }) }]); - - app.controller('partnerKYCProgressCtrl', ['$scope', '$sce', '$http','$uibModal', - function ($scope, $sce, $http, $uibModal) { + app.controller('partnerKYCProgressCtrl', ['$scope', '$sce', '$http','$uibModal', 'commonDialog', + function ($scope, $sce, $http, $uibModal, commonDialog) { $scope.ctrl = { plusShow1: false, plusShow2: false, @@ -123,16 +140,65 @@ define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootS }; $scope.loadKYCDashboardInfo(); }]); - - 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) { - + app.controller('bdHelpKYCProgressCtrl', [ '$scope', '$http', '$state', 'file', 'commonDialog',function ($scope, $http, $state, file, commonDialog) { + $scope.file = angular.copy(file.data) || {}; + $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.clientComplianceViewCommit = function () { + if (!$scope.file.client_bank_file.file_value) { + commonDialog.alert({title: 'Error', content: '请提交* ASIC File', type: 'error'}); + return; + } + if (!$scope.file.client_id_file.file_value) { + commonDialog.alert({title: 'Error', content: '请提交ID护照或驾照信息', type: 'error'}); + return; + } + if ($scope.file.id_type == "" || $scope.file.id_type == undefined || $scope.file.id_type == null) { + commonDialog.alert({title: 'Error', content: '请选择ID文件的类型', type: 'error'}); + return; + } + if ($scope.file.id_type == "passport") { + if (!$scope.file.kyc_utility_bill_file.file_value) { + commonDialog.alert({title: 'Error', content: '请提交Utility Bill FIles(水电煤账单)信息', 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'}); + }) }); - } + + }; + }]); + app.controller('partnerDetailForBDHelpCtrl', [ '$scope', '$http', '$state', 'partner', 'commonDialog',function ($scope, $http, $state, partner, commonDialog) { + $scope.partner = angular.copy(partner.data); }]); return app; }); diff --git a/src/main/ui/static/payment/kyc/kyc.js b/src/main/ui/static/payment/kyc/kyc.js new file mode 100644 index 000000000..1d11a71be --- /dev/null +++ b/src/main/ui/static/payment/kyc/kyc.js @@ -0,0 +1,213 @@ +define(['angular', 'static/commons/commons', 'uiBootstrap', 'uiRouter', 'ngBootSwitch', 'ngFileUpload', 'uiSelect'], function (angular) { + 'use strict'; + var app = angular.module('kycApp', ['ui.bootstrap', 'ui.router', 'frapontillo.bootstrap-switch', 'ngFileUpload', 'ui.select']); + app.config(['$stateProvider', function ($stateProvider) { + $stateProvider.state('kyc_files_perfect', { + url: '/kyc_files_perfect', + templateUrl: '/static/payment/kyc/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('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 = ""; + $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 notify BD ?' + }).then(function () { + $http.put('/sys/kyc/partner/notifyBd').then(function () { + commonDialog.alert({ + title: 'Success', + content: 'Notify Successful,Please wait for bd to contact you', + type: 'success' + }); + $state.go('partner_dashboard'); + }, function (resp) { + commonDialog.alert({title: 'Error', content: resp.data.message, type: 'error'}); + }) + }) + }; + $scope.clientComplianceViewCommit = function () { + if (!$scope.file.client_bank_file.file_value) { + commonDialog.alert({title: 'Error', content: '请提交* ASIC File', type: 'error'}); + return; + } + if (!$scope.file.client_id_file.file_value) { + commonDialog.alert({title: 'Error', content: '请提交ID护照或驾照信息', type: 'error'}); + return; + } + if ($scope.file.id_type == "" || $scope.file.id_type == undefined || $scope.file.id_type == null) { + commonDialog.alert({title: 'Error', content: '请选择ID文件的类型', type: 'error'}); + return; + } + if ($scope.file.id_type == "passport") { + if (!$scope.file.kyc_utility_bill_file.file_value) { + commonDialog.alert({title: 'Error', content: '请提交Utility Bill FIles(水电煤账单)信息', 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'}); + }) + }) + }; + }]); + return app; +}); + diff --git a/src/main/ui/static/payment/kyc/templates/bd_kyc_partner_detail.html b/src/main/ui/static/payment/kyc/templates/bd_kyc_partner_detail.html new file mode 100644 index 000000000..fd27917f5 --- /dev/null +++ b/src/main/ui/static/payment/kyc/templates/bd_kyc_partner_detail.html @@ -0,0 +1,301 @@ + + +
+
+
+ +
+
+
+ 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 new file mode 100644 index 000000000..4a73473b8 --- /dev/null +++ b/src/main/ui/static/payment/kyc/templates/bd_kyc_progress.html @@ -0,0 +1,203 @@ + + +
+
+
+ +
+
+
diff --git a/src/main/ui/static/payment/partner/templates/client_kyc_files_complete.html b/src/main/ui/static/payment/kyc/templates/client_kyc_files_complete.html similarity index 85% rename from src/main/ui/static/payment/partner/templates/client_kyc_files_complete.html rename to src/main/ui/static/payment/kyc/templates/client_kyc_files_complete.html index 753ad0ea8..0008a21af 100644 --- a/src/main/ui/static/payment/partner/templates/client_kyc_files_complete.html +++ b/src/main/ui/static/payment/kyc/templates/client_kyc_files_complete.html @@ -60,6 +60,26 @@ +
+ +
+
+ +

+ If client have already attached surcharge in their own system, ignore this choice.
+ It is recommended to notice customers about they will pay addition money as surcharge in the payment page.
+ 请选择上传ID的文件类型.
+ 上传护照文件需要您上传水电煤账单文件.
+ 上传驾照,水电煤账单文件可以不填. +

+
+
+
+
@@ -97,25 +117,6 @@
-
- -
-
- -
-
-
-
-
-

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

-
-
-
-
-
@@ -159,26 +160,14 @@
-
- -
-
- -
-
-
-
-
-

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

-
-
-
-
-
- + +
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文件:点击前往