From b36e9d11c89e4f42cbf65d36a603c0175b09d02e Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 21 Aug 2019 18:23:47 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../appclient/core/RetailAppService.java | 2 +- .../core/impls/RetailAppServiceImp.java | 22 +++++++++++++++++-- .../appclient/web/RetailAppController.java | 5 ++--- .../core/impls/SignInAccountServiceImpl.java | 1 + src/main/ui/static/boot/indexMainApp.js | 10 +++++++++ .../ui/static/dashboard/partner-dashboard.js | 16 -------------- src/main/ui/static/payment/partner/partner.js | 4 ++-- ...html => client_compliance_to_perfect.html} | 8 +++---- .../templates/client_partner_detail.html | 4 ++-- .../partner/templates/partner_auth_files.html | 2 +- 10 files changed, 43 insertions(+), 31 deletions(-) rename src/main/ui/static/payment/partner/templates/{client_compliance_to_prefect.html => client_compliance_to_perfect.html} (96%) diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java index 5f29f8f1b..5dd8f117f 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/RetailAppService.java @@ -198,7 +198,7 @@ public interface RetailAppService { void getCBBankAggregateFile(JSONObject device, HttpServletResponse httpResponse); - void getSourceAggregateFile(JSONObject device, HttpServletResponse httpResponse); + JSONObject getSourceAggregateFile(JSONObject device); JSONObject getClientAggregateFile(JSONObject device, MultipartFile file) throws IOException; diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java index 175ad4aa9..9522dc305 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/RetailAppServiceImp.java @@ -2216,7 +2216,7 @@ public class RetailAppServiceImp implements RetailAppService { } @Override - public void getSourceAggregateFile(JSONObject device, HttpServletResponse httpResponse) { + public JSONObject getSourceAggregateFile(JSONObject device) { String clientType = device.getString("client_type"); deviceSupport.findRegister(clientType); JSONObject client = clientManager.getClientInfo(device.getIntValue("client_id")); @@ -2246,7 +2246,7 @@ public class RetailAppServiceImp implements RetailAppService { client.put("bank_account_number", bankAccount.getString("account_no")); client.put("bank_account_name", bankAccount.getString("account_name")); } - exportAggregateFile(client, httpResponse); + return exportClientAggregateFile(client); } @Override @@ -2361,6 +2361,24 @@ public class RetailAppServiceImp implements RetailAppService { } } + private JSONObject exportClientAggregateFile(JSONObject client) { + InputStream stream = null; + JSONObject result = new JSONObject(); + try { + PdfUtils pdu = new PdfUtils(); + pdu.setTemplatePdfPath(CBBANK_AGGREGATE_FILE); + pdu.setPdfTemplate(client); + File file = new File(client.getString("client_moniker") + "_agreement.pdf"); + ByteArrayOutputStream bos = pdu.templetPdfBos(file); + stream = new ByteArrayInputStream(bos.toByteArray()); + JSONObject fileInfo = attachmentClient.uploadFile(stream, client.getString("client_moniker") + "_agreement_source.pdf", false); + result.put("file_value", fileInfo.getString("url")); + } catch (Exception e) { + throw new BadRequestException("获取合同文件失败"); + } + return result; + } + private void deleteAccountEmailKey(String codeKey){ stringRedisTemplate.delete(getUpdateAccountEmailKey(codeKey)); } diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java index 307f4ef01..4b753b492 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailAppController.java @@ -732,12 +732,11 @@ public class RetailAppController { /** * 原合同文件 * @param device - * @param httpResponse */ @RequestMapping(value = "/client/aggregate_file", method = RequestMethod.GET) - public void getSourceAggregateFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,HttpServletResponse httpResponse) { + public JSONObject getSourceAggregateFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { //todo 后面需替换成正式合同 - retailAppService.getSourceAggregateFile(device, httpResponse); + return retailAppService.getSourceAggregateFile(device); } /** 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 ea362263b..d5c8b85e2 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 @@ -164,6 +164,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati if (client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10) { List clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); if (clientFiles != null && clientFiles.size() > 0) { + clientFiles = clientFiles.stream().filter(fileJson -> ((fileJson.getIntValue("status") == 1 || fileJson.getIntValue("status") == 2))).collect(Collectors.toList()); String[] fileKeys = {"client_bank_file", "client_company_file", "client_id_file", "client_agree_file"}; for (String fileKey : fileKeys) { if (clientFiles.stream().noneMatch(fileJson -> fileKey.equals(fileJson.getString("file_name")))) { diff --git a/src/main/ui/static/boot/indexMainApp.js b/src/main/ui/static/boot/indexMainApp.js index 3d36c1f4a..b9a45284e 100644 --- a/src/main/ui/static/boot/indexMainApp.js +++ b/src/main/ui/static/boot/indexMainApp.js @@ -44,6 +44,16 @@ define(['angular', 'angularSanitize', 'angularAnimate', 'angularMessages', 'uiRo }) pwdcount++; } + $scope.ComplianceToperfect = function () { + $uibModal.open({ + templateUrl: '/static/payment/partner/templates/compliance_files_advice.html', + backdrop: false + }) + }; + if($scope.currentUser.client.client_less_file) + { + $scope.ComplianceToperfect(); + } connectWebSocket(); if ($scope.currentUser.role == 1 || $scope.currentUser.role == 2) { $scope.getAgStatus(); diff --git a/src/main/ui/static/dashboard/partner-dashboard.js b/src/main/ui/static/dashboard/partner-dashboard.js index 6f5f0b430..07209cc68 100644 --- a/src/main/ui/static/dashboard/partner-dashboard.js +++ b/src/main/ui/static/dashboard/partner-dashboard.js @@ -974,22 +974,6 @@ define(['angular','decimal', 'uiRouter', 'uiBootstrap', 'angularEcharts'], funct }) } - - /* '$scope', '$http','partner',*/ - $scope.ComplianceToPrefect = function () { - $uibModal.open({ - templateUrl: '/static/payment/partner/templates/compliance_files_advice.html', - backdrop: false, - }) - }; - - /*if($scope.currentUser.client.client_less_file) - { - debugger; - var a = $scope.currentUser.client.client_less_file; - $scope.ComplianceToPrefect(); - }*/ - }]); app.controller('contactCustomerServiceDialogCtrl', ['$scope', '$http', function ($scope, $http) { diff --git a/src/main/ui/static/payment/partner/partner.js b/src/main/ui/static/payment/partner/partner.js index 167f31716..7e93477de 100644 --- a/src/main/ui/static/payment/partner/partner.js +++ b/src/main/ui/static/payment/partner/partner.js @@ -38,8 +38,8 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload','uiBoot }] } }).state('basic.compliance_to_perfect', { - url: '/compliance_to_prefect', - templateUrl: '/static/payment/partner/templates/client_compliance_to_prefect.html', + url: '/compliance_to_perfect', + templateUrl: '/static/payment/partner/templates/client_compliance_to_perfect.html', controller: 'clientCommitToComplianceFilesCtrl', resolve: { file: ['$http', function ($http) { diff --git a/src/main/ui/static/payment/partner/templates/client_compliance_to_prefect.html b/src/main/ui/static/payment/partner/templates/client_compliance_to_perfect.html similarity index 96% rename from src/main/ui/static/payment/partner/templates/client_compliance_to_prefect.html rename to src/main/ui/static/payment/partner/templates/client_compliance_to_perfect.html index 6ceca3780..c9f6d0b7b 100644 --- a/src/main/ui/static/payment/partner/templates/client_compliance_to_prefect.html +++ b/src/main/ui/static/payment/partner/templates/client_compliance_to_perfect.html @@ -73,8 +73,8 @@ - @@ -117,8 +117,8 @@ - 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 3c5697a8d..7b93e6b11 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,8 +53,8 @@ Compliance files -
  • - Compliance to prefect +
  • + Compliance to perfect

    (资料审核中)

  • diff --git a/src/main/ui/static/payment/partner/templates/partner_auth_files.html b/src/main/ui/static/payment/partner/templates/partner_auth_files.html index 5ad9be5c5..f0d80fc59 100644 --- a/src/main/ui/static/payment/partner/templates/partner_auth_files.html +++ b/src/main/ui/static/payment/partner/templates/partner_auth_files.html @@ -72,7 +72,7 @@
    1 - + +
    1 - + +
    -
    1 +