From 65975c4f6e8177ea4854262c14945ecc28cc6ae5 Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Fri, 9 Mar 2018 10:20:19 +0800 Subject: [PATCH] update --- .../manage/appclient/web/RetailAppController.java | 2 +- .../merchants/web/PartnerManageController.java | 2 +- .../manage/system/core/ClientContractService.java | 2 +- .../system/core/impl/ClientContractServiceImpl.java | 13 ++++++++++--- 4 files changed, 13 insertions(+), 6 deletions(-) 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 dcab8dfbf..e3806f093 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 @@ -345,6 +345,6 @@ public class RetailAppController { @RequestMapping(value = "/file/agree/confirm", method = RequestMethod.POST) public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device) { - clientContractService.confirmSourceAgreement(device.getIntValue("client_id")); + clientContractService.confirmSourceAgreement(device.getIntValue("client_id"),device.getString("account_id")); } } 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 a6d19ba52..379016e93 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 @@ -532,6 +532,6 @@ public class PartnerManageController { @PartnerMapping(value = "/agree/confirm", method = RequestMethod.POST) public void confirmSourceAgreeFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account) { - clientContractService.confirmSourceAgreement(account.getIntValue("client_id")); + clientContractService.confirmSourceAgreement(account.getIntValue("client_id"),account.getString("account_id")); } } diff --git a/src/main/java/au/com/royalpay/payment/manage/system/core/ClientContractService.java b/src/main/java/au/com/royalpay/payment/manage/system/core/ClientContractService.java index ca4eacb0f..3b7804ee1 100644 --- a/src/main/java/au/com/royalpay/payment/manage/system/core/ClientContractService.java +++ b/src/main/java/au/com/royalpay/payment/manage/system/core/ClientContractService.java @@ -6,7 +6,7 @@ public interface ClientContractService { JSONObject getOrGenerateSourceAgreement(int client_id); - void confirmSourceAgreement(int client_id); + void confirmSourceAgreement(int client_id,String account_id); JSONObject getSourceAgreement(int client_id); 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 e4a59299d..f053245a4 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 @@ -1,5 +1,6 @@ package au.com.royalpay.payment.manage.system.core.impl; +import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper; import au.com.royalpay.payment.manage.mappers.system.ClientFilesMapper; import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper; import au.com.royalpay.payment.manage.mappers.system.ClientsContractMapper; @@ -38,6 +39,8 @@ public class ClientContractServiceImpl implements ClientContractService { private ClientRateMapper clientRateMapper; @Resource private SysConfigManager sysConfigManager; + @Resource + private ClientAccountMapper clientAccountMapper; @Override @Transactional @@ -84,7 +87,7 @@ public class ClientContractServiceImpl implements ClientContractService { @Override @Transactional - public void confirmSourceAgreement(int client_id) { + public void confirmSourceAgreement(int client_id,String account_id) { JSONObject client = clientManager.getClientInfo(client_id); if (client == null) { throw new NotFoundException("merchant not found"); @@ -99,7 +102,11 @@ public class ClientContractServiceImpl implements ClientContractService { if(contract.getBoolean("has_sign")){ return; } + JSONObject account = clientAccountMapper.findById(account_id); + contract.put("has_sign", 1); + contract.put("sign_account_id",account_id); + contract.put("signatory",account.getString("display_name")); clientsContractMapper.update(contract); Date now = new Date(); List rateInfo = clientRateMapper.minExpiryTime(client_id, null); @@ -118,8 +125,8 @@ public class ClientContractServiceImpl implements ClientContractService { p.remove("client_rate_id"); p.put("create_time",now); p.put("update_time",now); - p.put("active_time",DateUtils.addDays(p.getDate("active_time"),1)); - p.put("expiry_time",DateUtils.addYears(p.getDate("expiry_time"),1)); + p.put("active_time",DateUtils.addDays(p.getDate("expiry_time"),1)); + p.put("expiry_time",DateUtils.addYears(p.getDate("active_time"),1)); clientRateMapper.saveRate(p); }); }