From a116631a343a9d55b6809007176bb55aef6221cf Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 29 Aug 2019 10:12:34 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E5=95=86=E6=88=B7=E7=AD=BE=E5=90=8D?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0ip=E3=80=81id=E3=80=81=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E3=80=81=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E6=AD=A3=E5=BC=8F=E4=B8=8A=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../payment/manage/appclient/core/RetailAppService.java | 2 +- .../manage/appclient/core/impls/RetailAppServiceImp.java | 5 ++++- .../payment/manage/appclient/web/RetailAppController.java | 4 ++-- .../manage/merchants/core/impls/ClientManagerImpl.java | 7 ++++++- .../manage/merchants/web/PartnerViewController.java | 6 +++++- .../manage/signin/core/impls/SignInAccountServiceImpl.java | 4 ++-- .../partner/templates/client_compliance_to_perfect.html | 4 ++-- .../payment/partner/templates/contract_for_compliance.html | 2 +- 9 files changed, 24 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index eaaa2bb0f..862604f78 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.1.34 + 1.1.35 UTF-8 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 310c063d1..774d9ddba 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 @@ -202,7 +202,7 @@ public interface RetailAppService { JSONObject getSourceAggregateFile(JSONObject device); - JSONObject getClientAggregateFile(JSONObject device, MultipartFile file) throws IOException; + JSONObject getClientAggregateFile(JSONObject device, MultipartFile file, String ua) throws IOException; List uploadGreenChannelAuthFiles(JSONObject device, ClientAuthFilesInfo filesInfo); 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 ba640eac3..f4d161634 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 @@ -48,6 +48,7 @@ import au.com.royalpay.payment.tools.device.message.AppMessage; import au.com.royalpay.payment.tools.device.message.AppMsgSender; import au.com.royalpay.payment.tools.device.support.DeviceRegister; import au.com.royalpay.payment.tools.env.PlatformEnvironment; +import au.com.royalpay.payment.tools.env.RequestEnvironment; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.NotFoundException; @@ -2315,7 +2316,7 @@ public class RetailAppServiceImp implements RetailAppService { } @Override - public JSONObject getClientAggregateFile(JSONObject device,MultipartFile file) throws IOException{ + public JSONObject getClientAggregateFile(JSONObject device,MultipartFile file, String userAgent) throws IOException{ String clientType = device.getString("client_type"); deviceSupport.findRegister(clientType); @@ -2323,6 +2324,8 @@ public class RetailAppServiceImp implements RetailAppService { throw new BadRequestException("Please Enter Full Name"); } JSONObject account = clientAccountMapper.findById(device.getString("account_id")); + account.put("signature_ip", RequestEnvironment.getClientIp()); + account.put("user_agent", userAgent); return clientManager.getClientAggregateFile(account, file); } 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 ca677b3b1..d48aa3b5b 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 @@ -750,8 +750,8 @@ public class RetailAppController { * @param file 签名的url图片 */ @RequestMapping(value = "/client/aggregate_file", method = RequestMethod.POST) - public JSONObject getClientAggregateFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestParam MultipartFile file) throws IOException { - return retailAppService.getClientAggregateFile(device, file); + public JSONObject getClientAggregateFile(@ModelAttribute(CommonConsts.RETAIL_DEVICE) JSONObject device,@RequestParam MultipartFile file, @RequestHeader("User-Agent") String ua) throws IOException { + return retailAppService.getClientAggregateFile(device, file, ua); } /** 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 0e71b2642..71aa9360e 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 @@ -3500,16 +3500,21 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (aggregateFiles != null && aggregateFiles.size() > 0) { clientFilesMapper.deleteAggreeByClientId(clientId); } + String signatureAccountId = StringUtils.isNotBlank("account_id")?manager.getString("account_id"):manager.getString("manager_id"); JSONObject fileJson = new JSONObject(); fileJson.put("client_id", clientId); fileJson.put("last_update_date", new Date()); fileJson.put("last_update_by", manager.getString("display_name")); fileJson.put("file_name", fileType); fileJson.put("file_value", fileValue); + fileJson.put("signature_time", new Date()); + fileJson.put("signature_ip", manager.getString("signature_ip")); + fileJson.put("user_agent", manager.getString("user_agent")); + fileJson.put("signature_account_id", signatureAccountId); fileJson.put("status", 0); fileJson.put("is_valid", 1); clientFilesMapper.save(fileJson); - logger.info(clientId + "的合同文件上传成功" + fileJson.getString("file_id")); + logger.info("{}合同文件上传成功,IP:{},us-agent:{},signature_id:{}",clientId,manager.getString("signature_ip"),manager.getString("user_agent"),signatureAccountId); JSONObject file = new JSONObject(); file.put("file_id", fileJson.getString("file_id")); file.put("file_value", fileJson.getString("file_value")); 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 cb7c3f9a3..ee208bf27 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 @@ -20,6 +20,7 @@ import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery; import au.com.royalpay.payment.manage.tradelog.core.TradeLogService; import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.connections.mpsupport.beans.WxOauthType; +import au.com.royalpay.payment.tools.env.RequestEnvironment; import au.com.royalpay.payment.tools.exceptions.BadRequestException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.http.HttpUtils; @@ -38,6 +39,7 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; @@ -587,7 +589,9 @@ public class PartnerViewController { @PartnerMapping(value = "/clientCompliance/{clientMoniker}/commit_aggregate_file", method = RequestMethod.POST) @ResponseBody - public JSONObject getClientArregateFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam MultipartFile file) throws IOException { + public JSONObject getClientArregateFile(@ModelAttribute(CommonConsts.PARTNER_STATUS) JSONObject account, @RequestParam MultipartFile file, @RequestHeader("User-Agent") String userAgent, HttpServletRequest request) throws IOException { + account.put("signature_ip", RequestEnvironment.getClientIp()); + account.put("user_agent", userAgent); return clientManager.getClientAggregateFile(account, file); } 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 f8bfb61df..46ed185f5 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 @@ -166,7 +166,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati client.putAll(clientConfigService.find(client_id)); client = clientInfoWithNoSecretInfo(client); client.put("client_less_file", false); - if (client.getIntValue("client_id") == 9 &&(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 ((client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10 || client.getIntValue("approve_result") ==1 || client.getIntValue("open_status") == 5) && client.getIntValue("source")!=4) { 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()); @@ -644,7 +644,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati JSONObject result = new JSONObject(); result.put("client_less_file", false); result.put("put_fail_pdf", "https://file.royalpay.com.au/open/2019/08/28/1566959635986_P1GuvCkuWINPhUJUqUQnz8E0u6Lgpx.pdf"); - if (client.getIntValue("client_id") == 9 &&(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 ((client.getIntValue("approve_result") == 2 || client.getIntValue("open_status") == 10 || client.getIntValue("approve_result") == 1 || client.getIntValue("open_status") == 5) && client.getIntValue("source")!=4) { List clientFiles = clientFilesMapper.findAllClientFile(client.getIntValue("client_id")); boolean clientFilesIsLess = false; for (int i = 0; i < FILE_KEYS.length; i++) { 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 784dc06fb..a574160f2 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 @@ -157,11 +157,11 @@
Resign The Contract + ui-sref="compliance_contract">Resign The Agreement Sign The Contract + ui-sref="compliance_contract">Sign The Agreement diff --git a/src/main/ui/static/payment/partner/templates/contract_for_compliance.html b/src/main/ui/static/payment/partner/templates/contract_for_compliance.html index 5f6e94a85..df5b90f7f 100644 --- a/src/main/ui/static/payment/partner/templates/contract_for_compliance.html +++ b/src/main/ui/static/payment/partner/templates/contract_for_compliance.html @@ -111,7 +111,7 @@