From c2b9fc64241824b13073f8d30704bb0a9df65ce9 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Fri, 9 Mar 2018 17:00:57 +0800 Subject: [PATCH] update --- .../manage/merchants/core/ClientManager.java | 4 ++-- .../merchants/core/impls/ClientManagerImpl.java | 14 ++++++++------ .../merchants/web/PartnerManageController.java | 4 ++-- .../core/impl/ClientContractServiceImpl.java | 2 +- 4 files changed, 13 insertions(+), 11 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 41a9240aa..3e0825e09 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 @@ -256,11 +256,11 @@ public interface ClientManager { void getAgreeFile(String clientMoniker, JSONObject manager) throws Exception; - void getAggregateAgreeFile(String clientMoniker, JSONObject manager) throws Exception; + void getAggregateAgreeFile(String clientMoniker, JSONObject manager,boolean renewal) throws Exception; void temporaryExportPdf(String clientMoniker, JSONObject manager, HttpServletResponse httpResponse) throws Exception; - void importAgreeFile(String clientMoniker, JSONObject manager, String sourceFile); + void importAgreeFile(String clientMoniker, JSONObject manager, String sourceFile,boolean renewal); void completeAgree(String clientMoniker, 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 4623b9302..6f3c2c799 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 @@ -1865,7 +1865,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid ByteArrayOutputStream bos = pdu.templetPdfBos(file); stream = new ByteArrayInputStream(bos.toByteArray()); JSONObject fileRes = attachmentClient.uploadFile(stream, clientMoniker + "_agreement.pdf", false); - importAgreeFile(clientMoniker, manager, fileRes.getString("url")); + importAgreeFile(clientMoniker, manager, fileRes.getString("url"),false); } catch (Exception e) { logger.error("合同制作出现问题:", e); } finally { @@ -1875,7 +1875,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Override @Transactional - public void getAggregateAgreeFile(String clientMoniker, JSONObject manager) throws Exception { + public void getAggregateAgreeFile(String clientMoniker, JSONObject manager,boolean renewal) throws Exception { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -1933,7 +1933,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid InputStream stream = new ByteArrayInputStream(bos.toByteArray()); JSONObject fileRes = attachmentClient.uploadFile(stream, clientMoniker + "_" + System.currentTimeMillis() + "_agreement.pdf", false); if (fileRes != null) { - importAgreeFile(clientMoniker, manager, fileRes.getString("url")); + importAgreeFile(clientMoniker, manager, fileRes.getString("url"),renewal); } stream.close(); } catch (Exception e) { @@ -2019,7 +2019,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Override @Transactional - public void importAgreeFile(String clientMoniker, JSONObject manager, String sourceFile) { + public void importAgreeFile(String clientMoniker, JSONObject manager, String sourceFile,boolean renewal) { JSONObject client = getClientInfoByMoniker(clientMoniker); if (client == null) { throw new InvalidShortIdException(); @@ -2048,8 +2048,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid file.put("file_id", existFile.getString("file_id")); clientFilesMapper.update(file); } - client.put("open_status", 2); - clientMapper.update(client); + if(!renewal) { + client.put("open_status", 2); + clientMapper.update(client); + } if (manager != null) { saveClientAuditProcess(client.getIntValue("client_id"), 1, 2, "Compliance合同制作中", manager); 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 0f929319f..5343e2075 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 @@ -439,7 +439,7 @@ public class PartnerManageController { @ManagerMapping(value = "/{clientMoniker}/export/aggregate/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) public void exportAggregateAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) throws Exception { - clientManager.getAggregateAgreeFile(clientMoniker, manager); + clientManager.getAggregateAgreeFile(clientMoniker, manager,false); } @ManagerMapping(value = "/{clientMoniker}/temp/export/pdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.BD_USER, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) @@ -449,7 +449,7 @@ public class PartnerManageController { @ManagerMapping(value = "/{clientMoniker}/import/agreepdf", method = RequestMethod.PUT, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR}) public void importAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody JSONObject source) throws Exception { - clientManager.importAgreeFile(clientMoniker, manager, source.getString("source_agree_file")); + clientManager.importAgreeFile(clientMoniker, manager, source.getString("source_agree_file"),false); } @ManagerMapping(value = "/{clientMoniker}/notify/completeAgree", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.OPERATOR}) diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java index 2d926d0ad..5d6fb081a 100644 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/system/core/impl/ClientContractServiceImpl.java @@ -54,7 +54,7 @@ public class ClientContractServiceImpl implements ClientContractService { Date now = new Date(); if (contract == null || now.compareTo(contract.getDate("expiry_date")) > 0) { try { - clientManager.getAggregateAgreeFile(client.getString("client_moniker"), null); + clientManager.getAggregateAgreeFile(client.getString("client_moniker"), null,true); } catch (Exception e) { logger.info("App generate PDF failed"); throw new ServerErrorException("System error");