From 9f389e322e19a666a612d5532f40342ea6ffda26 Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 4 Nov 2019 17:07:37 +0800 Subject: [PATCH 01/33] serverless trigger --- .../qcloud/QCloudServerlessTrigger.java | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/QCloudServerlessTrigger.java b/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/QCloudServerlessTrigger.java index 4e680c42a..31150db85 100644 --- a/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/QCloudServerlessTrigger.java +++ b/src/main/java/au/com/royalpay/payment/manage/support/serverless/qcloud/QCloudServerlessTrigger.java @@ -14,8 +14,10 @@ import org.springframework.http.ResponseEntity; import org.springframework.http.converter.StringHttpMessageConverter; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; +import org.springframework.web.server.ResponseStatusException; import java.nio.charset.StandardCharsets; +import java.time.Duration; /** * Create by davep at 2019-08-12 9:31 @@ -35,6 +37,8 @@ public class QCloudServerlessTrigger implements ServerlessFunctionTrigger { this.secretKey = secretKey; this.region = region; this.restTemplate = new RestTemplateBuilder() + .setConnectTimeout(Duration.ofMinutes(5)) + .setReadTimeout(Duration.ofMinutes(5)) .messageConverters(new StringHttpMessageConverter(StandardCharsets.UTF_8)) .build(); } @@ -44,18 +48,25 @@ public class QCloudServerlessTrigger implements ServerlessFunctionTrigger { public JSONObject triggerFunction(String function, JSONObject params) { ServerLessFunctionInvokeRequest request = new ServerLessFunctionInvokeRequest(secretId, secretKey, region, function, params); ResponseEntity resp = restTemplate.exchange(request.request(), String.class); - JSONObject data = JSON.parseObject(resp.getBody()); - JSONObject response = data.getJSONObject("Response"); - String requestId = response.getString("RequestId"); - JSONObject result = response.getJSONObject("Result"); - int invokeResult = result.getIntValue("InvokeResult"); - if (invokeResult != 0) { - String errMsg = result.getString("ErrMsg"); - logger.error("Invoking function [{}] failed,request id={},invoke result={},errMsg={}", function, requestId, invokeResult, errMsg); - throw new ServerErrorException("Invoke function " + function + " failed:[" + errMsg + "]"); + if (resp.getStatusCode().is2xxSuccessful()) { + JSONObject data = JSON.parseObject(resp.getBody()); + if (data == null) { + throw new ServerErrorException("Invoke function " + function + " failed:[no response]"); + } + JSONObject response = data.getJSONObject("Response"); + String requestId = response.getString("RequestId"); + JSONObject result = response.getJSONObject("Result"); + int invokeResult = result.getIntValue("InvokeResult"); + if (invokeResult != 0) { + String errMsg = result.getString("ErrMsg"); + logger.error("Invoking function [{}] failed,request id={},invoke result={},errMsg={}", function, requestId, invokeResult, errMsg); + throw new ServerErrorException("Invoke function " + function + " failed:[" + errMsg + "]"); + } else { + String retMsg = result.getString("RetMsg"); + return StringUtils.isNotEmpty(retMsg) ? JSON.parseObject(retMsg) : null; + } } else { - String retMsg = result.getString("RetMsg"); - return StringUtils.isNotEmpty(retMsg) ? JSON.parseObject(retMsg) : null; + throw new ResponseStatusException(resp.getStatusCode(), "Invoke function " + function + " failed:[no response]"); } } From 09a9488055865e76c37480578a3b504db83c73e6 Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 4 Nov 2019 17:22:15 +0800 Subject: [PATCH 02/33] fix pom --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fbf05d924..c37b74052 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.55 + 1.2.56 UTF-8 From bfeeb11ad9a5e746749b6fffa5c02761466fefc7 Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 4 Nov 2019 17:57:24 +0800 Subject: [PATCH 03/33] fix merchant_application.js --- .../ui/static/merchantapplication/merchant_application.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/ui/static/merchantapplication/merchant_application.js b/src/main/ui/static/merchantapplication/merchant_application.js index 3731b0e01..6eb369e4c 100644 --- a/src/main/ui/static/merchantapplication/merchant_application.js +++ b/src/main/ui/static/merchantapplication/merchant_application.js @@ -489,6 +489,14 @@ alert('请选择商户支付方式') return; } + + if (!$scope.partner.client_pay_type instanceof Array) { + $scope.partner.client_pay_type = $scope.partner.client_pay_type.split(','); + } + + if (!$scope.partner.client_pay_desc instanceof Array) { + $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.split(','); + } if ($scope.partner.client_pay_type.indexOf('1') >= 0) { if ($scope.partner.client_pay_desc.join(',').indexOf('10') < 0) { alert("请检查线上支付场景是否已选择支付方式"); From 209fc9454c448fec216f36b5405c0eff1e4d58ce Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 4 Nov 2019 18:07:57 +0800 Subject: [PATCH 04/33] fix merchant_application.js --- .../merchant_application.js | 34 ------------------- 1 file changed, 34 deletions(-) diff --git a/src/main/ui/static/merchantapplication/merchant_application.js b/src/main/ui/static/merchantapplication/merchant_application.js index 6eb369e4c..41cd82057 100644 --- a/src/main/ui/static/merchantapplication/merchant_application.js +++ b/src/main/ui/static/merchantapplication/merchant_application.js @@ -481,40 +481,6 @@ } } - if ($scope.partner.client_pay_type.length == 0) { - alert('请选择商户支付场景') - return; - } - if ($scope.partner.client_pay_desc.length == 0) { - alert('请选择商户支付方式') - return; - } - - if (!$scope.partner.client_pay_type instanceof Array) { - $scope.partner.client_pay_type = $scope.partner.client_pay_type.split(','); - } - - if (!$scope.partner.client_pay_desc instanceof Array) { - $scope.partner.client_pay_desc = $scope.partner.client_pay_desc.split(','); - } - if ($scope.partner.client_pay_type.indexOf('1') >= 0) { - if ($scope.partner.client_pay_desc.join(',').indexOf('10') < 0) { - alert("请检查线上支付场景是否已选择支付方式"); - return; - } - } - if ($scope.partner.client_pay_type.indexOf('2') >= 0) { - if ($scope.partner.client_pay_desc.join(',').indexOf('20') < 0) { - alert("请检查线下支付场景是否已选择支付方式"); - return; - } - } - if ($scope.partner.client_pay_desc.join(',').indexOf('203') >= 0) { - if ($scope.partner.client_pay_desc.join(',').indexOf('2030') < 0 && $scope.partner.client_pay_desc.join(',').indexOf('20399') < 0) { - alert("请检查线下支付是否已选择收银系统类型"); - return; - } - } $scope.initParam(); if ($scope.partner.company_name.indexOf("Migration") != -1) { alert("Company Name包含敏感词汇,请检查后重新提交!"); From 05c485b4d5b92feb700db8298d4fa72820adb258 Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 4 Nov 2019 19:05:51 +0800 Subject: [PATCH 05/33] serverless trigger, add loggers --- .../manage/merchants/core/impls/ClientManagerImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 6e1885f6e..a5d3f99e0 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 @@ -522,6 +522,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid @Override public void exportClients(JSONObject manager, PartnerQuery query, HttpServletResponse resp) { JSONObject params = prepareListClientsParameter(manager, query); + logger.info("exporting_clients:--->{}", params); JSONObject retResp = serverlessFunctionTrigger.triggerFunction("export_merchants", params); String contentB64 = retResp.getString("content"); resp.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); @@ -3615,7 +3616,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid Date endDate = TimeZoneUtils.nextYearByCurrDay(); String end_date = DateFormatUtils.format(endDate, "dd/MM/yyyy"); client.put("end_date", end_date); - client.put("full_name", URLDecoder.decode(file.getOriginalFilename(),"UTF-8")); + client.put("full_name", URLDecoder.decode(file.getOriginalFilename(), "UTF-8")); BufferedImage img = ImageIO.read(file.getInputStream()); ByteArrayOutputStream out = new ByteArrayOutputStream(); ImageIO.write(img, "png", out); @@ -5293,12 +5294,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new BadRequestException("The Partner's Bank Account is not config!"); } JSONObject representativeInfo = sysClientLegalPersonMapper.findRepresentativeInfo(client.getIntValue("client_id")); - for(String str:representativeInfo.keySet()){ - if(representativeInfo.getString(str) == null || !(representativeInfo.getString(str).length()>0)|| !(client.getString("contact_job")!=null && client.getString("contact_job").length()>0)) { + for (String str : representativeInfo.keySet()) { + if (representativeInfo.getString(str) == null || !(representativeInfo.getString(str).length() > 0) || !(client.getString("contact_job") != null && client.getString("contact_job").length() > 0)) { throw new BadRequestException("The LegalPersonInfo is not config!Please upgrade the RoyalPay App version"); } } - if ( !(StringUtils.isNotBlank(client.getString("client_pay_type"))) || !(StringUtils.isNotBlank(client.getString("client_pay_desc"))) ) { + if (!(StringUtils.isNotBlank(client.getString("client_pay_type"))) || !(StringUtils.isNotBlank(client.getString("client_pay_desc")))) { throw new BadRequestException("Merchant Payment Scenario is not config!"); } From 6260572efccc84b7f58c01546b0097b52864dd28 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 5 Nov 2019 10:22:39 +0800 Subject: [PATCH 06/33] =?UTF-8?q?fix=20=E5=BE=AE=E4=BF=A1=E5=AD=90?= =?UTF-8?q?=E5=95=86=E6=88=B7=E5=8F=B7=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../payment/manage/merchants/beans/SubMerchantIdApply.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index c37b74052..090493008 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.56 + 1.2.57 UTF-8 diff --git a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubMerchantIdApply.java b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubMerchantIdApply.java index f156abc3a..2bc113649 100644 --- a/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubMerchantIdApply.java +++ b/src/main/java/au/com/royalpay/payment/manage/merchants/beans/SubMerchantIdApply.java @@ -100,12 +100,12 @@ public class SubMerchantIdApply { this.merchant_name = merchant_name; } - public String getMerchant_shortname() { + public String getMerchant_storename() { return this.merchant_storename; } - public void setMerchant_shortname(String merchant_shortname) { - this.merchant_storename = merchant_shortname; + public void setMerchant_storename(String merchant_storename) { + this.merchant_storename = merchant_storename; } public String getOffice_phone() { From 13df0df1c1318904b19717832c56c748fd145fdc Mon Sep 17 00:00:00 2001 From: duLingLing Date: Tue, 5 Nov 2019 14:00:42 +0800 Subject: [PATCH 07/33] =?UTF-8?q?Upd:=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/appclient/core/impls/RetailAppServiceImp.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 090493008..8911eba45 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.57 + 1.2.58 UTF-8 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 fb02576de..bec9140bc 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 @@ -2270,7 +2270,7 @@ public class RetailAppServiceImp implements RetailAppService { result.put("contact_phone",account.getString("contact_phone")); String contact_phone = account.getString("contact_phone").replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2"); result.put("remark_contact_phone",contact_phone); - result.put("naticon_code",account.getString("nation_code")); + result.put("nation_code",account.getString("nation_code")); } result.put("wechat_bind_status",account.containsKey("wechat_openid")); if(account.containsKey("wechat_openid")){ From 5315d8ddbc569b1365bd5f51971af690c07748a8 Mon Sep 17 00:00:00 2001 From: duLingLing Date: Tue, 5 Nov 2019 14:31:07 +0800 Subject: [PATCH 08/33] =?UTF-8?q?Upd:=E4=BF=AE=E6=94=B9=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=9F=AD=E4=BF=A1=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E5=8F=91=E9=80=81=E6=8E=A5=E5=8F=A3?= 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 | 7 ++++--- .../payment/manage/appclient/web/RetailAppController.java | 5 ++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 8911eba45..052c04bab 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.58 + 1.2.59 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 90eac6ea6..782c9d590 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 @@ -189,7 +189,7 @@ public interface RetailAppService { void updateAccountEmail(JSONObject device, JSONObject codekey); - void bindAccountPhone(JSONObject device, JSONObject phone); + void bindAccountPhone(JSONObject device); JSONObject updateAccountPhone(JSONObject device,JSONObject codekey); 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 bec9140bc..e162f3ce1 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 @@ -2133,15 +2133,16 @@ public class RetailAppServiceImp implements RetailAppService { } @Override - public void bindAccountPhone(JSONObject device, JSONObject phone) { + public void bindAccountPhone(JSONObject device) { String codeKey = device.getString("account_id"); String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).get(); if (StringUtils.isNotEmpty(codeKeyValueRedis)) { throw new BadRequestException("Captcha has been sent.Please check your phone or try again in 1 minutes."); } + JSONObject client = clientAccountMapper.findById(device.getString("account_id")); String codeKeyValue = RandomStringUtils.random(6, false, true); - String nationCode = phone.getString("nation_code").contains("+")?phone.getString("nation_code").substring(1):phone.getString("nation_code"); - String phoneNumber = phone.getString("contact_phone"); + String nationCode = client.getString("nation_code").contains("+")?client.getString("nation_code").substring(1):client.getString("nation_code"); + String phoneNumber = client.getString("contact_phone"); ArrayList param = new ArrayList<>(); param.add("绑定手机号"); param.add(codeKeyValue); 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 d6d812bcc..ee109dccd 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 @@ -724,12 +724,11 @@ public class RetailAppController { * 接收关联手机的验证码 * * @param device - * @param phone contact_phone * @throws Exception */ @PutMapping("/account/phone") - public JSONObject bindAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject phone) throws Exception { - retailAppService.bindAccountPhone(device, phone); + public JSONObject bindAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device) throws Exception { + retailAppService.bindAccountPhone(device); return new JSONObject(); } From 5a1dec2a4763e911bdf6a44bf44180c51120c264 Mon Sep 17 00:00:00 2001 From: duLingLing Date: Tue, 5 Nov 2019 15:30:51 +0800 Subject: [PATCH 09/33] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E6=94=B6=E8=A7=A3=E7=BB=91=E5=8F=91?= =?UTF-8?q?=E9=80=81=E9=AA=8C=E8=AF=81=E7=A0=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../appclient/core/RetailAppService.java | 4 ++- .../core/impls/RetailAppServiceImp.java | 27 +++++++++++++++++-- .../appclient/web/RetailAppController.java | 21 ++++++++++++--- 4 files changed, 46 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 052c04bab..3db99dcf0 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.59 + 1.2.60 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 782c9d590..5836b9e72 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 @@ -189,7 +189,9 @@ public interface RetailAppService { void updateAccountEmail(JSONObject device, JSONObject codekey); - void bindAccountPhone(JSONObject device); + void sendBindAccountPhone(JSONObject device,JSONObject phone); + + void sendUnbindAccountPhone(JSONObject device); JSONObject updateAccountPhone(JSONObject device,JSONObject codekey); 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 e162f3ce1..bd7a62c6f 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 @@ -2133,7 +2133,30 @@ public class RetailAppServiceImp implements RetailAppService { } @Override - public void bindAccountPhone(JSONObject device) { + public void sendBindAccountPhone(JSONObject device, JSONObject phone) { + String codeKey = device.getString("account_id"); + String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).get(); + if (StringUtils.isNotEmpty(codeKeyValueRedis)) { + throw new BadRequestException("Captcha has been sent.Please check your phone or try again in 1 minutes."); + } + String codeKeyValue = RandomStringUtils.random(6, false, true); + String nationCode = phone.getString("nation_code").contains("+")?phone.getString("nation_code").substring(1):phone.getString("nation_code"); + String phoneNumber = phone.getString("contact_phone"); + ArrayList param = new ArrayList<>(); + param.add("绑定手机号"); + param.add(codeKeyValue); + String expireMin = "1"; + param.add(expireMin); + try { + smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, BIND_PHONE_TEMPLID, param, "RoyalPay", "", ""); + } catch (Exception e) { + logger.error(e.getMessage(), e); + throw new BadRequestException("Phone number is wrong.Please try again."); + } + stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).set(codeKeyValue + "&" + nationCode + "&" + phoneNumber, Long.parseLong(expireMin), TimeUnit.MINUTES); + } + @Override + public void sendUnbindAccountPhone(JSONObject device) { String codeKey = device.getString("account_id"); String codeKeyValueRedis = stringRedisTemplate.boundValueOps(getUpdateAccountPhoneKey(codeKey)).get(); if (StringUtils.isNotEmpty(codeKeyValueRedis)) { @@ -2144,7 +2167,7 @@ public class RetailAppServiceImp implements RetailAppService { String nationCode = client.getString("nation_code").contains("+")?client.getString("nation_code").substring(1):client.getString("nation_code"); String phoneNumber = client.getString("contact_phone"); ArrayList param = new ArrayList<>(); - param.add("绑定手机号"); + param.add("解綁绑定手机号"); param.add(codeKeyValue); String expireMin = "1"; param.add(expireMin); 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 ee109dccd..444874b12 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 @@ -724,12 +724,25 @@ public class RetailAppController { * 接收关联手机的验证码 * * @param device + * @param phone contact_phone * @throws Exception */ - @PutMapping("/account/phone") - public JSONObject bindAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device) throws Exception { - retailAppService.bindAccountPhone(device); - return new JSONObject(); + @PutMapping("/account/phone/bind") + public JSONObject sendBindAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject phone) throws Exception { + retailAppService.sendBindAccountPhone(device, phone); + return new JSONObject(); + } + + /** + * 接收解绑手机的验证码 + * + * @param device + * @throws Exception + */ + @PutMapping("/account/phone/unbind") + public JSONObject unBindAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device) throws Exception { + retailAppService.sendUnbindAccountPhone(device); + return new JSONObject(); } /** From 4fd9de60e8bf558505312d20efa09d49dd7b2d0e Mon Sep 17 00:00:00 2001 From: duLingLing Date: Tue, 5 Nov 2019 15:45:45 +0800 Subject: [PATCH 10/33] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E6=94=B6=E8=A7=A3=E7=BB=91=E5=8F=91?= =?UTF-8?q?=E9=80=81=E9=AA=8C=E8=AF=81=E7=A0=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../payment/manage/appclient/web/RetailAppController.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 3db99dcf0..86c67c2c3 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.60 + 1.2.61 UTF-8 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 444874b12..b6916a91b 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 @@ -727,7 +727,7 @@ public class RetailAppController { * @param phone contact_phone * @throws Exception */ - @PutMapping("/account/phone/bind") + @PutMapping("/account/phone_verify/bind") public JSONObject sendBindAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device, @RequestBody JSONObject phone) throws Exception { retailAppService.sendBindAccountPhone(device, phone); return new JSONObject(); @@ -739,7 +739,7 @@ public class RetailAppController { * @param device * @throws Exception */ - @PutMapping("/account/phone/unbind") + @PutMapping("/account/phone_verify/unbind") public JSONObject unBindAccountPhone(@ModelAttribute(RETAIL_DEVICE) JSONObject device) throws Exception { retailAppService.sendUnbindAccountPhone(device); return new JSONObject(); From 0db2b3a57614d208f8e038b5ed2a4ccfacac8481 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 5 Nov 2019 17:03:42 +0800 Subject: [PATCH 11/33] =?UTF-8?q?add=20=E8=87=AA=E5=8A=A9=E8=BF=9B?= =?UTF-8?q?=E4=BB=B6=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/merchants/core/impls/ClientManagerImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 86c67c2c3..954e9682c 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.61 + 1.2.62 UTF-8 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 a5d3f99e0..d6dea6438 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 @@ -4977,11 +4977,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid String[] payType = clientConfig.getString("client_pay_type").split(","); if (Arrays.asList(payType).contains("1")) { registerAlipayOnlineGms(clientMoniker, null); - switchChannelPermission(account, clientMoniker, "Alipay", true); + enableGatewayAlipayOnline(account, clientMoniker, true); } if (Arrays.asList(payType).contains("2")) { registerAlipayGms(clientMoniker, null); - enableGatewayAlipayOnline(account, clientMoniker, true); + switchChannelPermission(account, clientMoniker, "Alipay", true); } } } From ac6f9877e1890815ec865f15de19774f824e2e26 Mon Sep 17 00:00:00 2001 From: duLingLing Date: Tue, 5 Nov 2019 18:43:05 +0800 Subject: [PATCH 12/33] =?UTF-8?q?=E5=88=AA=E9=99=A4ip=E9=99=90=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../web/RetailValidationController.java | 8 +++---- .../signin/core/SignInStatusManager.java | 10 ++++---- .../core/impls/SignInStatusManagerImpl.java | 24 +++++++++---------- 4 files changed, 21 insertions(+), 23 deletions(-) diff --git a/pom.xml b/pom.xml index 954e9682c..22c0e7af1 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.62 + 1.2.63 UTF-8 diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java index cc7f761f5..fb2dbc8c3 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java @@ -208,7 +208,7 @@ public class RetailValidationController implements ApplicationEventPublisherAwar HttpUtils.handleValidErrors(errors); JSONObject result = new JSONObject(); simpleClientApplyService.verifyLoginSMSCode(params.getString("verify_code"), contactPhone); - String signKey = signInStatusManager.getClientInfoByPhoneStatusKey(contactPhone, nationCode,RequestEnvironment.getClientIp()); + String signKey = signInStatusManager.getClientInfoByPhoneStatusKey(contactPhone, nationCode); if(signKey!=null){ JSONObject account = signInStatusManager.getCurrentClient(signKey); account = JSON.parseObject(account.toJSONString()); @@ -247,7 +247,7 @@ public class RetailValidationController implements ApplicationEventPublisherAwar loginInfo.setLoginId(params.getString("loginId")); loginInfo.setPassword(params.getString("password")); String signKey = signInStatusManager.verifyClientAccountLogin(loginInfo,"phone"); - signInStatusManager.verifyClientLoginPhoneBindCode(contactPhone,nationCode,RequestEnvironment.getClientIp()); + signInStatusManager.verifyClientLoginPhoneBindCode(contactPhone,nationCode); JSONObject account = signInStatusManager.getCurrentClient(signKey); retailAppService.updateLoginClientAccountPhone(account, contactPhone,nationCode); account.put("sign_key", signKey); @@ -271,7 +271,7 @@ public class RetailValidationController implements ApplicationEventPublisherAwar public JSONObject clientAppWechatSignIn(@RequestBody JSONObject params, Errors errors) { HttpUtils.handleValidErrors(errors); - JSONObject account = signInStatusManager.clientAppWechatSignIn(params.getString("code"),RequestEnvironment.getClientIp()); + JSONObject account = signInStatusManager.clientAppWechatSignIn(params.getString("code")); if(!account.getBoolean("bind_status")){ deviceSupport.validDeviceWithClient(account, params.getString("app_openid")); return account; @@ -287,7 +287,7 @@ public class RetailValidationController implements ApplicationEventPublisherAwar */ @PostMapping("/login/wechat_bind") public JSONObject wechatLoginBind(@RequestBody JSONObject params){ - JSONObject wechatInfo = signInStatusManager.verifyClientLoginWechatBindCode(params.getString("wechat_openid"),RequestEnvironment.getClientIp()); + JSONObject wechatInfo = signInStatusManager.verifyClientLoginWechatBindCode(params.getString("wechat_openid")); LoginInfo loginInfo = new LoginInfo(); loginInfo.setLoginId(params.getString("loginId")); loginInfo.setPassword(params.getString("password")); diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInStatusManager.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInStatusManager.java index cbdb88d7c..2dc07fbd0 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInStatusManager.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInStatusManager.java @@ -73,7 +73,7 @@ public interface SignInStatusManager { * @param code * @return */ - JSONObject clientAppWechatSignIn(String code,String ip); + JSONObject clientAppWechatSignIn(String code); /** * 手机号登录 @@ -81,7 +81,7 @@ public interface SignInStatusManager { * @param nationCode * @return */ - String getClientInfoByPhoneStatusKey(String phone,String nationCode,String ip); + String getClientInfoByPhoneStatusKey(String phone,String nationCode); /** * 登录绑定校验用户名密码 @@ -93,17 +93,15 @@ public interface SignInStatusManager { /** * 微信openId是否有申请绑定 * @param codeId - * @param ip * @return */ - JSONObject verifyClientLoginWechatBindCode (String codeId,String ip); + JSONObject verifyClientLoginWechatBindCode (String codeId); /** * 微信手机号是否有申请绑定 * @param phone * @param nationCode - * @param ip * @return */ - void verifyClientLoginPhoneBindCode (String phone,String nationCode,String ip); + void verifyClientLoginPhoneBindCode (String phone,String nationCode); } diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInStatusManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInStatusManagerImpl.java index 6a28b02f5..98b0bdb4d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInStatusManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInStatusManagerImpl.java @@ -82,12 +82,12 @@ public class SignInStatusManagerImpl implements SignInStatusManager { } @Override - public String getClientInfoByPhoneStatusKey(String phone, String nationCode,String ip) { + public String getClientInfoByPhoneStatusKey(String phone, String nationCode) { String statusKey = newStatusKey(); JSONObject account = clientAccountMapper.findOneByPhoneAndCreateTimeDesc(phone, "+" + nationCode); if (account == null) { String expireMin = "5"; - stringRedisTemplate.boundValueOps(getClientLoginPhoneBindRedisKey(phone,nationCode,ip)).set(phone, Long.parseLong(expireMin), TimeUnit.MINUTES); + stringRedisTemplate.boundValueOps(getClientLoginPhoneBindRedisKey(phone,nationCode)).set(phone, Long.parseLong(expireMin), TimeUnit.MINUTES); return null; } stringRedisTemplate.boundValueOps(partnerLoginRedisKey(statusKey)).set(account.getString("account_id") + "", 30, TimeUnit.MINUTES); @@ -380,7 +380,7 @@ public class SignInStatusManagerImpl implements SignInStatusManager { } @Override - public JSONObject clientAppWechatSignIn(String code,String ip) { + public JSONObject clientAppWechatSignIn(String code) { JSONObject user = mpClientAppWechatApiProvider.getApi("merchant-app").appLoginUser(code); if(user==null){ throw new BadRequestException("WeChat users do not exist"); @@ -396,7 +396,7 @@ public class SignInStatusManagerImpl implements SignInStatusManager { res.put("app_openid", openId); res.put("status", "success"); String expireMin = "5"; - stringRedisTemplate.boundValueOps(getClientLoginWechatBindRedisKey(openId,ip)).set(openId+"&"+nickName+"&"+unionId, Long.parseLong(expireMin), TimeUnit.MINUTES); + stringRedisTemplate.boundValueOps(getClientLoginWechatBindRedisKey(openId)).set(openId+"&"+nickName+"&"+unionId, Long.parseLong(expireMin), TimeUnit.MINUTES); return res; } String statusKey = newStatusKey(); @@ -411,14 +411,14 @@ public class SignInStatusManagerImpl implements SignInStatusManager { return result; } - private String getClientLoginWechatBindRedisKey(String openId,String ip){ - return "login:"+":"+CLIENT_LOGIN_WECHAT_BIND_PREFIX + "&"+openId+"&"+ip; + private String getClientLoginWechatBindRedisKey(String openId){ + return "login:"+":"+CLIENT_LOGIN_WECHAT_BIND_PREFIX + "&"+openId; } @Override - public JSONObject verifyClientLoginWechatBindCode(String openId,String ip){ - String rediskey = getClientLoginWechatBindRedisKey(openId,ip); + public JSONObject verifyClientLoginWechatBindCode(String openId){ + String rediskey = getClientLoginWechatBindRedisKey(openId); String codeValue = stringRedisTemplate.boundValueOps(rediskey).get(); if (codeValue == null || !codeValue.split("&")[0].equals(openId)) { throw new BadRequestException("The WeChat ID does not apply for binding"); @@ -432,12 +432,12 @@ public class SignInStatusManagerImpl implements SignInStatusManager { }}; } - private String getClientLoginPhoneBindRedisKey(String phone,String nationCode,String ip){ - return "login:"+CLIENT_LOGIN_PHONE_BIND_PREFIX + "&"+nationCode+"&"+phone+"&"+ip; + private String getClientLoginPhoneBindRedisKey(String phone,String nationCode){ + return "login:"+CLIENT_LOGIN_PHONE_BIND_PREFIX + "&"+nationCode+"&"+phone; } - public void verifyClientLoginPhoneBindCode(String phone,String nationCode,String ip){ - String rediskey = getClientLoginPhoneBindRedisKey(phone,nationCode,ip); + public void verifyClientLoginPhoneBindCode(String phone,String nationCode){ + String rediskey = getClientLoginPhoneBindRedisKey(phone,nationCode); String codeValue = stringRedisTemplate.boundValueOps(rediskey).get(); if (codeValue == null || !codeValue.equals(phone)) { throw new BadRequestException("The phone number is for application binding"); From b7e4a0043b167c48e06d88a41a5ec51d307b392f Mon Sep 17 00:00:00 2001 From: duLingLing Date: Tue, 5 Nov 2019 18:47:25 +0800 Subject: [PATCH 13/33] =?UTF-8?q?=E5=8D=87=E7=B4=9A=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 22c0e7af1..c53ea7ddd 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.63 + 1.2.66 UTF-8 From 1a304a9fd5af93f5faa47538ad85c53d819238cd Mon Sep 17 00:00:00 2001 From: duLingLing Date: Tue, 5 Nov 2019 19:31:34 +0800 Subject: [PATCH 14/33] =?UTF-8?q?UPD:=E4=BF=AE=E6=94=B9=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E7=A1=AE=E5=AE=9A=E7=BB=91=E5=AE=9A=EF=BC=8C=E4=BC=98=E5=85=88?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E7=94=A8=E6=88=B7=E5=90=8D=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/appclient/web/RetailValidationController.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c53ea7ddd..74a69d65d 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.66 + 1.2.67 UTF-8 diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java index fb2dbc8c3..5e9b27285 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/web/RetailValidationController.java @@ -287,11 +287,11 @@ public class RetailValidationController implements ApplicationEventPublisherAwar */ @PostMapping("/login/wechat_bind") public JSONObject wechatLoginBind(@RequestBody JSONObject params){ - JSONObject wechatInfo = signInStatusManager.verifyClientLoginWechatBindCode(params.getString("wechat_openid")); LoginInfo loginInfo = new LoginInfo(); loginInfo.setLoginId(params.getString("loginId")); loginInfo.setPassword(params.getString("password")); String signKey = signInStatusManager.verifyClientAccountLogin(loginInfo,"wechat"); + JSONObject wechatInfo = signInStatusManager.verifyClientLoginWechatBindCode(params.getString("wechat_openid")); JSONObject account = signInStatusManager.getCurrentClient(signKey); params.put("nick_name",wechatInfo.getString("nick_name")); params.put("union_id",wechatInfo.getString("union_id")); From bdba35af6703898b0c9c8f6bc5597fd9a105ebb4 Mon Sep 17 00:00:00 2001 From: luoyang Date: Tue, 5 Nov 2019 20:07:07 +0800 Subject: [PATCH 15/33] =?UTF-8?q?fix=20=E6=81=A2=E5=A4=8D=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/appclient/core/impls/ManageAppServiceImp.java | 5 +++++ .../manage/appclient/core/impls/RetailAppServiceImp.java | 2 ++ .../application/core/impls/SimpleClientApplyServiceImpl.java | 4 +++- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 74a69d65d..a3241eb12 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 manage - 1.2.67 + 1.2.69 UTF-8 diff --git a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java index dcdd976b7..367d85e39 100644 --- a/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/appclient/core/impls/ManageAppServiceImp.java @@ -38,6 +38,8 @@ import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; import org.apache.ibatis.annotations.Param; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.cache.annotation.Cacheable; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; @@ -52,6 +54,7 @@ import java.util.stream.Collectors; @Service public class ManageAppServiceImp implements ManageAppService { + private Logger logger = LoggerFactory.getLogger(getClass()); @Resource private ManageDeviceSupport manageDeviceSupport; @@ -470,6 +473,7 @@ public class ManageAppServiceImp implements ManageAppService { throw new BadRequestException("Captcha has been sent.Please check your email or try again in 5 minutes."); } String codeKeyValue = RandomStringUtils.random(6, false, true); + logger.debug("send sms code : {} ", codeKeyValue); Context ctx = new Context(); JSONObject manager = managerMapper.findById(device.getString("manager_id")); ctx.setVariable("account",manager); @@ -512,6 +516,7 @@ public class ManageAppServiceImp implements ManageAppService { throw new BadRequestException("Captcha has been sent.Please check your phone or try again in 5 minutes."); } String codeKeyValue = RandomStringUtils.random(6, false, true); + logger.debug("send sms code : {} ", codeKeyValue); String nationCode = phone.getString("nation_code"); String phoneNumber = phone.getString("contact_phone"); ArrayList param = new ArrayList<>(); 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 bd7a62c6f..8d9bf838c 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 @@ -2098,6 +2098,7 @@ public class RetailAppServiceImp implements RetailAppService { throw new BadRequestException("Captcha has been sent.Please check your email or try again in 5 minutes."); } String codeKeyValue = RandomStringUtils.random(6, false, true); + logger.debug("send sms code : {} ", codeKeyValue); Context ctx = new Context(); JSONObject account = clientAccountMapper.findById(device.getString("account_id")); ctx.setVariable("account", account); @@ -2140,6 +2141,7 @@ public class RetailAppServiceImp implements RetailAppService { throw new BadRequestException("Captcha has been sent.Please check your phone or try again in 1 minutes."); } String codeKeyValue = RandomStringUtils.random(6, false, true); + logger.debug("send sms code : {} ", codeKeyValue); String nationCode = phone.getString("nation_code").contains("+")?phone.getString("nation_code").substring(1):phone.getString("nation_code"); String phoneNumber = phone.getString("contact_phone"); ArrayList param = new ArrayList<>(); diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index 53c1eb8f5..48f52bd43 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -170,6 +170,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { param.add(registerClientCode); String expireMin = "3"; param.add(expireMin); + logger.debug("send sms code : {} ", registerClientCode); try { if(request.getLocales().nextElement().equals(Locale.CHINESE)|| request.getLocales().nextElement().equals(Locale.SIMPLIFIED_CHINESE)){ smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID, param, "RoyalPay", "", ""); @@ -769,7 +770,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { Runnable task2 = () -> { try { if (signInfo != null) { - clientManager.registerClientApplyGMS(clientMoniker, sysAccount.getString("account_id")); +// clientManager.registerClientApplyGMS(clientMoniker, sysAccount.getString("account_id")); }else { clientManager.getNewAggregateAgreeFile(clientMoniker, null, true); } @@ -872,6 +873,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { param.add("RoyalPay"); param.add(registerClientCode); String expireMin = "1"; + logger.debug("{} phone sms send code :{}",phoneNumber,registerClientCode); param.add(expireMin); try { if(request.getLocales().nextElement().equals(Locale.CHINESE)|| request.getLocales().nextElement().equals(Locale.SIMPLIFIED_CHINESE)){ From 336314699357c0067959d2a1bf1b04fbbcd06310 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 6 Nov 2019 09:17:24 +0800 Subject: [PATCH 16/33] =?UTF-8?q?fix=20findAccountByPhone=E6=9F=A5?= =?UTF-8?q?=E5=88=B0=E5=A4=9A=E6=9D=A1=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 +--- .../manage/appclient/core/impls/RetailAppServiceImp.java | 2 +- .../application/core/impls/SimpleClientApplyServiceImpl.java | 4 ++-- .../payment/manage/mappers/system/ClientAccountMapper.java | 2 +- .../manage/merchants/core/impls/ClientManagerImpl.java | 1 - 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index a3241eb12..b02a3fbe1 100644 --- a/pom.xml +++ b/pom.xml @@ -8,10 +8,8 @@ 1.1.5 4.0.0 - manage - 1.2.69 - + 1.2.70 UTF-8 1.4.0 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 8d9bf838c..1e12421b4 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 @@ -2195,7 +2195,7 @@ public class RetailAppServiceImp implements RetailAppService { if (!StringUtils.equals(captcha, params.getString("captcha"))) { throw new BadRequestException("Verification code is wrong"); } - JSONObject account = clientAccountMapper.findByPhone(contactPhone, "+" + nationCode); + List account = clientAccountMapper.findByPhone(contactPhone, "+" + nationCode); if (account != null) { throw new BadRequestException("Mobile phone number has been bound to other users, please unbind it before binding"); } diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index 48f52bd43..33cb0305b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -280,7 +280,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { if (!nation_code.startsWith("+")) { nation_code = "+" + nation_code; } - JSONObject account = clientAccountMapper.findByPhone(contact_phone, nation_code); + List account = clientAccountMapper.findByPhone(contact_phone, nation_code); if (account != null) { throw new ForbiddenException("用户名已被注册"); } @@ -598,7 +598,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { } JSONObject apply = sysClientPreMapperMapper.findByUserName(username); - JSONObject account = clientAccountMapper.findByPhone(apply.getString("contact_phone"), "+61"); + List account = clientAccountMapper.findByPhone(apply.getString("contact_phone"), "+61"); if (account != null) { throw new ForbiddenException("The user name has been registered"); } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java index dcf2ad82f..2005ca0fc 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java @@ -28,7 +28,7 @@ public interface ClientAccountMapper { @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "is_valid=1") - JSONObject findByPhone(@Param("contact_phone") String contact_phone,@Param("nation_code")String nation_code); + List findByPhone(@Param("contact_phone") String contact_phone,@Param("nation_code")String nation_code); @AutoSql(type = SqlType.SELECT) JSONObject findDetail(@Param("account_id") String accountId); 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 d6dea6438..16d9a65e3 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 @@ -1582,7 +1582,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (clientAccountMapper.findByPhone(account.getContactPhone(), "+" + account.getNation_code()) != null) { throw new BadRequestException("Mobile phone number has been bound to other accounts"); } - ; } @Override From e3211c89fa278b372c4eb987ebc886c86d3e19df Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 6 Nov 2019 10:44:52 +0800 Subject: [PATCH 17/33] fix findAccountByPhone --- pom.xml | 2 +- .../manage/merchants/core/impls/ClientManagerImpl.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index b02a3fbe1..9b5e43734 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.70 + 1.2.71 UTF-8 1.4.0 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 16d9a65e3..a137baf6f 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 @@ -1557,7 +1557,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid throw new InvalidShortIdException(); } checkOrgPermission(manager, client); - checkPhoneAndWechatExist(account); + if (StringUtils.isNotBlank(account.getContactPhone())) { + checkPhoneAndWechatExist(account); + } JSONObject accountJson = account.toJson(); JSONObject accountCheck = clientAccountMapper.findByUsernameForDuplicate(accountJson.getString("username")); if (accountCheck != null) { @@ -1579,7 +1581,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } private void checkPhoneAndWechatExist(NewAccountBean account) { - if (clientAccountMapper.findByPhone(account.getContactPhone(), "+" + account.getNation_code()) != null) { + if (clientAccountMapper.findByPhone(account.getContactPhone(), account.getNation_code().startsWith("+")?account.getNation_code():"+"+account.getNation_code()) != null) { throw new BadRequestException("Mobile phone number has been bound to other accounts"); } } From 794e6375597cde04c444c7442d6478ebc6541644 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 6 Nov 2019 11:29:15 +0800 Subject: [PATCH 18/33] =?UTF-8?q?fix=20customer=5Fsurcharge=5Frate=20?= =?UTF-8?q?=E6=9C=AA=E9=80=9A=E8=BF=87=E4=B9=9F=E5=8F=AF=E4=BB=A5=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../merchants/core/impls/ClientManagerImpl.java | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 9b5e43734..05ac6f933 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.71 + 1.2.72 UTF-8 1.4.0 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 a137baf6f..fb8f5d81a 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 @@ -420,15 +420,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid client.put("temp_sub_merchant", checkSubMerchantIdInCommonPool(subMerchantId)); } } - if (client.getIntValue("approve_result") == 1 - || (client.getIntValue("approve_result") == 2 && (client.getIntValue("source") == 1 || client.getIntValue("source") == 2))) { - try { - JSONObject activeRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); - if (activeRate != null) { - client.put("rate_value", activeRate.getDouble("rate_value")); - } - } catch (Exception ignore) { + try { + JSONObject activeRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat"); + if (activeRate != null) { + client.put("rate_value", activeRate.getDouble("rate_value")); } + } catch (Exception ignore) { + } client.put("max_customer_surcharge_rate", PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()); if (client.getBigDecimal("rate_value") != null) { From 64ea8a5d6244d1762af16ecb409916d9131be558 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Wed, 6 Nov 2019 13:48:27 +0800 Subject: [PATCH 19/33] =?UTF-8?q?=E3=80=90R=E3=80=91=E5=B9=BF=E5=91=8A?= =?UTF-8?q?=E4=BD=8D=E5=B1=8F=E8=94=BD=E5=90=8C=E8=A1=8C=E4=B8=9A=E5=95=86?= =?UTF-8?q?=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/static/cms/cms.js | 237 ++++++++++++++++-- .../static/cms/templates/article_editor.html | 84 ++++++- 2 files changed, 283 insertions(+), 38 deletions(-) diff --git a/src/main/ui/static/cms/cms.js b/src/main/ui/static/cms/cms.js index 59c8b043a..31cfc7030 100644 --- a/src/main/ui/static/cms/cms.js +++ b/src/main/ui/static/cms/cms.js @@ -255,10 +255,32 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu } }]); - app.controller('cmsAddArticleCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', function ($scope, $http, $state, $stateParams, commonDialog) { + app.controller('cmsAddArticleCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog','industryMap','stateMap', function ($scope, $http, $state, $stateParams, commonDialog,industryMap,stateMap) { + $scope.industries = industryMap.configs(); + $scope.states = stateMap.configs(); + + $scope.publishall = 1; + $scope.saveArticle = function () { + $scope.article.publishall = $scope.publishall; + if( $scope.publishall == 0){ + if($scope.select_industries.length <= 0 || $scope.select_industries == "") { + alert("所推送的行业不能为空"); + return; + } + if($scope.select_states.length <= 0 || $scope.select_states == "") { + alert("所推送的地区不能为空"); + return; + } + $scope.article.selectIndustries = $scope.select_industries.join(','); + $scope.article.selectStates = $scope.select_states.join(','); + if ($scope.select_clients) { + $scope.article.selectClients = $scope.select_clients.join(','); + } + + } $scope.article.reference = $scope.reference; - $scope.article.royalpay_industry = $scope.royalpay_industry; + $http.post('/app/cms/categories/' + $stateParams.catId + '/articles', $scope.article).then(function (resp) { $state.go('^.article_view', {articleId: resp.data.article_id}); }, function (resp) { @@ -266,35 +288,131 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu }) }; - $scope.loadRoyalpayindustry = function () { - $http.get('/static/data/rp_industry_apply.json').then(function (resp) { - $scope.royalpayindustry = resp.data; - }) + $scope.params = {textType: 'all', org_name: 'ALL'}; + $scope.loadPartners = function (page) { + var params = angular.copy($scope.params); + params.page = page || $scope.pagination.page || 1; + $http.get('/sys/partners', {params: params}).then(function (resp) { + $scope.partners = resp.data.data; + $scope.pagination = resp.data.pagination; + }); }; - $scope.loadRoyalpayindustry(); - $scope.onRoyalPayIndustrySelect = function (selectedItem) { - $scope.royalpay_label = selectedItem.label; - $scope.royalpay_industry = selectedItem.mccCode; - }; + $scope.toggleSelectIndustries = function (industry) { + if (!$scope.select_industries) { + $scope.select_industries = []; + } + var $idx = $scope.select_industries.indexOf(industry); + if ($idx >= 0) { + $scope.select_industries.splice($idx, 1); + } else { + $scope.select_industries.push(industry); + $scope.select_industries.sort(compare); + } + } + $scope.selectAllIndustries = function() { + for(var i=0;i<$scope.industries.length;i++) { + $scope.toggleSelectIndustries($scope.industries[i].value) + } + } + $scope.selectAllIndustries(); + + $scope.toggleStates =function(state){ + if (!$scope.select_states) { + $scope.select_states = []; + } + var $idx = $scope.select_states.indexOf(state); + if ($idx >= 0) { + $scope.select_states.splice($idx, 1); + } else { + $scope.select_states.push(state); + $scope.select_states.sort(compare); + } + } + $scope.selectAllIndustries = function() { + for(var i=0;i<$scope.states.length;i++) { + $scope.toggleStates($scope.states[i].value) + } + } + $scope.selectAllIndustries(); + + $scope.toggleClient =function(client_moniker){ + if (!$scope.select_clients) { + $scope.select_clients = []; + } + var $idx = $scope.select_clients.indexOf(client_moniker); + if ($idx >= 0) { + $scope.select_clients.splice($idx, 1); + } else { + $scope.select_clients.push(client_moniker); + $scope.select_clients.sort(compare); + } + } + + var compare = function (x, y) { + x = parseInt(x); + y = parseInt(y); + if (x < y) { + return -1; + } else if (x > y) { + return 1; + } else { + return 0; + } + } }]); - app.controller('cmsArticleEditCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', 'article', function ($scope, $http, $state, $stateParams, commonDialog, article) { + app.controller('cmsArticleEditCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', 'article', 'industryMap','stateMap',function ($scope, $http, $state, $stateParams, commonDialog, article,industryMap,stateMap) { $scope.article = article.data; + + $scope.industries = industryMap.configs(); + $scope.states = stateMap.configs(); + + if($scope.article.publishall){ + $scope.publishall = $scope.article.publishall; + }else{ + $scope.publishall = 1 + } + + if ($scope.article.select_industries) { + $scope.select_industries = $scope.article.select_industries.split(","); + } + if($scope.article.select_clients){ + $scope.select_clients = $scope.article.select_clients.split(","); + } + if($scope.article.select_states){ + $scope.select_states = $scope.article.select_states.split(","); + } + + if ($scope.article.reference) { $scope.reference = JSON.parse($scope.article.reference); } else { $scope.reference = {}; } - if($scope.article.royalpay_industry){ - $scope.royalpay_industry = $scope.article.royalpay_industry; - } - $scope.saveArticle = function () { + + $scope.article.publishall = $scope.publishall; + if( $scope.publishall == 0){ + if($scope.select_industries.length <= 0 || $scope.select_industries == "") { + alert("所推送的行业不能为空"); + return; + } + if($scope.select_states.length <= 0 || $scope.select_states == "") { + alert("所推送的地区不能为空"); + return; + } + $scope.article.select_industries = $scope.select_industries.join(','); + $scope.article.select_states = $scope.select_states.join(','); + if ($scope.select_clients) { + $scope.article.select_clients = $scope.select_clients.join(','); + } + + } $scope.article.reference = $scope.reference; - $scope.article.royalpay_industry = $scope.royalpay_industry; + $http.put('/app/cms/categories/' + $stateParams.catId + '/articles/' + $stateParams.articleId, $scope.article).then(function (resp) { $state.go('^.article_view', {articleId: $stateParams.articleId}); }, function (resp) { @@ -302,17 +420,84 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu }) }; - $scope.loadRoyalpayindustry = function () { - $http.get('/static/data/rp_industry_apply.json').then(function (resp) { - $scope.royalpayindustry = resp.data; - }) + $scope.params = {textType: 'all', org_name: 'ALL'}; + $scope.loadPartners = function (page) { + var params = angular.copy($scope.params); + params.page = page || $scope.pagination.page || 1; + $http.get('/sys/partners', {params: params}).then(function (resp) { + $scope.partners = resp.data.data; + $scope.pagination = resp.data.pagination; + }); }; - $scope.loadRoyalpayindustry(); - $scope.onRoyalPayIndustrySelect = function (selectedItem) { - $scope.royalpay_label = selectedItem.label; - $scope.royalpay_industry = selectedItem.mccCode; - }; + $scope.toggleSelectIndustries = function (industry) { + if (!$scope.select_industries) { + $scope.select_industries = []; + } + var $idx = $scope.select_industries.indexOf(industry); + if ($idx >= 0) { + $scope.select_industries.splice($idx, 1); + } else { + $scope.select_industries.push(industry); + $scope.select_industries.sort(compare); + } + } + $scope.selectAllIndustries = function() { + for(var i=0;i<$scope.industries.length;i++) { + $scope.toggleSelectIndustries($scope.industries[i].value) + } + } + if(!$scope.article.publishall){ + $scope.selectAllIndustries(); + } + + + $scope.toggleStates =function(state){ + if (!$scope.select_states) { + $scope.select_states = []; + } + var $idx = $scope.select_states.indexOf(state); + if ($idx >= 0) { + $scope.select_states.splice($idx, 1); + } else { + $scope.select_states.push(state); + $scope.select_states.sort(compare); + } + } + $scope.selectAllIndustries = function() { + for(var i=0;i<$scope.states.length;i++) { + $scope.toggleStates($scope.states[i].value) + } + } + if(!$scope.article.publishall){ + $scope.selectAllIndustries(); + } + + $scope.toggleClient =function(client_moniker){ + if (!$scope.select_clients) { + $scope.select_clients = []; + } + var $idx = $scope.select_clients.indexOf(client_moniker); + if ($idx >= 0) { + $scope.select_clients.splice($idx, 1); + } else { + $scope.select_clients.push(client_moniker); + $scope.select_clients.sort(compare); + } + } + + var compare = function (x, y) { + x = parseInt(x); + y = parseInt(y); + if (x < y) { + return -1; + } else if (x > y) { + return 1; + } else { + return 0; + } + } + }]); diff --git a/src/main/ui/static/cms/templates/article_editor.html b/src/main/ui/static/cms/templates/article_editor.html index 3130a961d..3ecb724f2 100644 --- a/src/main/ui/static/cms/templates/article_editor.html +++ b/src/main/ui/static/cms/templates/article_editor.html @@ -77,21 +77,81 @@
- -
- -
-

Required - Field

+ +
+
+ + +
+
+ + +
+ +
+ +
+ +    + +
+
+ +
+ +    + +
+
+
+ +
+ +    + +
+
+ + +
+ +
+ +
+ +
+ + +
+ +
+ +    + +
+
+ + +
From 78ddd81bbc2c9ed90b75cd5c3958eab5e1dca068 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Wed, 6 Nov 2019 16:01:47 +0800 Subject: [PATCH 20/33] =?UTF-8?q?=E3=80=90R=E3=80=91=E5=B9=BF=E5=91=8A?= =?UTF-8?q?=E4=BD=8D=E5=B1=8F=E8=94=BD=E5=90=8C=E8=A1=8C=E4=B8=9A=E5=95=86?= =?UTF-8?q?=E6=88=B7=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/static/cms/cms.js | 5 +++-- src/main/ui/static/cms/templates/article_editor.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/ui/static/cms/cms.js b/src/main/ui/static/cms/cms.js index 31cfc7030..d3aeea811 100644 --- a/src/main/ui/static/cms/cms.js +++ b/src/main/ui/static/cms/cms.js @@ -365,6 +365,7 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu app.controller('cmsArticleEditCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', 'article', 'industryMap','stateMap',function ($scope, $http, $state, $stateParams, commonDialog, article,industryMap,stateMap) { $scope.article = article.data; + $scope.article.publishall = $scope.article.publishall +""; $scope.industries = industryMap.configs(); $scope.states = stateMap.configs(); @@ -447,7 +448,7 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu $scope.toggleSelectIndustries($scope.industries[i].value) } } - if(!$scope.article.publishall){ + if($scope.publishall == 1){ $scope.selectAllIndustries(); } @@ -469,7 +470,7 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu $scope.toggleStates($scope.states[i].value) } } - if(!$scope.article.publishall){ + if($scope.publishall == 1){ $scope.selectAllIndustries(); } diff --git a/src/main/ui/static/cms/templates/article_editor.html b/src/main/ui/static/cms/templates/article_editor.html index 3ecb724f2..64c185d1b 100644 --- a/src/main/ui/static/cms/templates/article_editor.html +++ b/src/main/ui/static/cms/templates/article_editor.html @@ -80,7 +80,7 @@
- +
From d3cb52c8696e3bc9bbf2138a352c56a5b6af4b54 Mon Sep 17 00:00:00 2001 From: luoyang Date: Wed, 6 Nov 2019 16:48:54 +0800 Subject: [PATCH 21/33] fix pom.xml --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 05ac6f933..73e8b23bd 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.72 + 1.2.73 UTF-8 1.4.0 From 2212a028296f8ad2dd33fe00f6917429d95d8c7a Mon Sep 17 00:00:00 2001 From: luoyang Date: Thu, 7 Nov 2019 06:55:11 +0800 Subject: [PATCH 22/33] =?UTF-8?q?fix=20=E5=95=86=E6=88=B7=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E5=8F=B7=20size>0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/appclient/core/impls/RetailAppServiceImp.java | 2 +- .../application/core/impls/SimpleClientApplyServiceImpl.java | 4 ++-- .../manage/merchants/core/impls/ClientManagerImpl.java | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 73e8b23bd..6df944b8e 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.73 + 1.2.74 UTF-8 1.4.0 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 1e12421b4..b8388f94d 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 @@ -2196,7 +2196,7 @@ public class RetailAppServiceImp implements RetailAppService { throw new BadRequestException("Verification code is wrong"); } List account = clientAccountMapper.findByPhone(contactPhone, "+" + nationCode); - if (account != null) { + if (account != null && account.size()>0) { throw new BadRequestException("Mobile phone number has been bound to other users, please unbind it before binding"); } diff --git a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java index 33cb0305b..3cc6c9bd0 100644 --- a/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/application/core/impls/SimpleClientApplyServiceImpl.java @@ -281,7 +281,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { nation_code = "+" + nation_code; } List account = clientAccountMapper.findByPhone(contact_phone, nation_code); - if (account != null) { + if (account != null && account.size()>0) { throw new ForbiddenException("用户名已被注册"); } } @@ -599,7 +599,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService { JSONObject apply = sysClientPreMapperMapper.findByUserName(username); List account = clientAccountMapper.findByPhone(apply.getString("contact_phone"), "+61"); - if (account != null) { + if (account != null && account.size() > 0) { throw new ForbiddenException("The user name has been registered"); } String clientMoniker = generateClientMoniker(); 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 fb8f5d81a..5eac5ab73 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 @@ -1579,7 +1579,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } private void checkPhoneAndWechatExist(NewAccountBean account) { - if (clientAccountMapper.findByPhone(account.getContactPhone(), account.getNation_code().startsWith("+")?account.getNation_code():"+"+account.getNation_code()) != null) { + List accounts = clientAccountMapper.findByPhone(account.getContactPhone(), account.getNation_code().startsWith("+") ? account.getNation_code() : "+" + account.getNation_code()); + if ( accounts != null && accounts.size()>0) { throw new BadRequestException("Mobile phone number has been bound to other accounts"); } } From 8a363e3ed62ab4ab64245ea575506d454842d9e5 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Thu, 7 Nov 2019 14:08:22 +0800 Subject: [PATCH 23/33] =?UTF-8?q?=E3=80=90R=E3=80=91=E7=AD=BE=E8=AE=A2?= =?UTF-8?q?=E5=90=88=E5=90=8C=E5=BC=B9=E7=AA=97fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../merchantapplication/merchant_application.js | 1 + .../templates/agreement_signature_dialog.html | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/ui/static/merchantapplication/merchant_application.js b/src/main/ui/static/merchantapplication/merchant_application.js index 41cd82057..d97e167cd 100644 --- a/src/main/ui/static/merchantapplication/merchant_application.js +++ b/src/main/ui/static/merchantapplication/merchant_application.js @@ -783,6 +783,7 @@ }]); app.controller('agreementSignDialogCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) { + $scope.registering = true; $scope.submitSign = function (fullName) { var sign = $("#signature").jSignature('getData', 'image'); var signInfo = {}; diff --git a/src/main/ui/static/payment/partner/templates/agreement_signature_dialog.html b/src/main/ui/static/payment/partner/templates/agreement_signature_dialog.html index c6da33664..f4bcc46d2 100644 --- a/src/main/ui/static/payment/partner/templates/agreement_signature_dialog.html +++ b/src/main/ui/static/payment/partner/templates/agreement_signature_dialog.html @@ -17,11 +17,13 @@
- You are signing the agreement, and the merchant will be officially opened after you submit your signature -
- 您正在签署协议,签名提交后正式开通商户。 -
-
+
+ You are signing the agreement, and the merchant will be officially opened after you submit your signature +
+ 您正在签署协议,签名提交后正式开通商户。 +
+
+
(* Please sign here\请在此签名)
From 5ba4873bfaff9d2a0295d0d357df775f9a606582 Mon Sep 17 00:00:00 2001 From: duLingLing Date: Thu, 7 Nov 2019 14:33:59 +0800 Subject: [PATCH 24/33] =?UTF-8?q?Upd:=E4=BF=AE=E5=A4=8D=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=AB=AF=E5=BE=AE=E4=BF=A1=E7=BB=91=E5=AE=9A=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=B7=B2=E7=BB=91=E5=AE=9A=E7=94=A8=E6=88=B7=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../payment/manage/mappers/system/ClientAccountMapper.java | 6 +++++- .../manage/merchants/core/impls/ClientManagerImpl.java | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 6df944b8e..8bfc4b029 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.74 + 1.2.75 UTF-8 1.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java index 2005ca0fc..17081b797 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java @@ -94,5 +94,9 @@ public interface ClientAccountMapper { @AutoSql(type = SqlType.SELECT) @AdvanceSelect(addonWhereClause = "is_valid=1", excludeColumns = {"salt", "password_hash"}) - JSONObject findByWechatOpenId(@Param("wechat_openid")String openid); + List findByWechatOpenId(@Param("wechat_openid")String openid); + + @AutoSql(type = SqlType.SELECT) + @AdvanceSelect(addonWhereClause = "is_valid=1", excludeColumns = {"salt", "password_hash"}) + List findByWechatUnionId(@Param("wx_unionid")String unionId); } 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 5eac5ab73..edd5498f2 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 @@ -1653,7 +1653,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (account == null) { throw new BadRequestException("account not exists"); } - if (clientAccountMapper.findByWechatOpenId(user.getString("openid")) != null || clientAccountMapper.findByWxUnioinId(user.getString("unioinid")) != null) { + if (clientAccountMapper.findByWechatOpenId(user.getString("openid")).size()>1 || clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size()>1) { throw new BadRequestException("The WeChat has been linked to other accounts"); } JSONObject res = new JSONObject(); From f31d50c1e6e04a23ff7bce4eaeaee6dbcdd6bf80 Mon Sep 17 00:00:00 2001 From: duLingLing Date: Thu, 7 Nov 2019 14:41:29 +0800 Subject: [PATCH 25/33] =?UTF-8?q?UPD:=E4=BF=AE=E5=A4=8D=E5=95=86=E6=88=B7-?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=B4=A6=E5=8F=B7=E7=BB=91=E5=AE=9A=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../payment/manage/merchants/core/impls/ClientManagerImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8bfc4b029..c2f19ec66 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.75 + 1.2.76 UTF-8 1.4.0 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 edd5498f2..7734f5090 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 @@ -1653,7 +1653,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (account == null) { throw new BadRequestException("account not exists"); } - if (clientAccountMapper.findByWechatOpenId(user.getString("openid")).size()>1 || clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size()>1) { + if (clientAccountMapper.findByWechatOpenId(user.getString("openid")).size()>0 || clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size()>0) { throw new BadRequestException("The WeChat has been linked to other accounts"); } JSONObject res = new JSONObject(); From 214195b24d2a524bc0edddd93ff32d92febb3059 Mon Sep 17 00:00:00 2001 From: duLingLing Date: Thu, 7 Nov 2019 15:06:26 +0800 Subject: [PATCH 26/33] =?UTF-8?q?UPD:=E4=BF=AE=E5=A4=8D=E5=95=86=E6=88=B7-?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=B4=A6=E5=8F=B7=E7=BB=91=E5=AE=9A=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../merchants/core/impls/ClientManagerImpl.java | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index c2f19ec66..6f10cc43c 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.76 + 1.2.77 UTF-8 1.4.0 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 7734f5090..d1539284d 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 @@ -1653,8 +1653,15 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid if (account == null) { throw new BadRequestException("account not exists"); } - if (clientAccountMapper.findByWechatOpenId(user.getString("openid")).size()>0 || clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size()>0) { - throw new BadRequestException("The WeChat has been linked to other accounts"); + if(user.getString("openid")!=null && !"".equals(user.getString("openid"))) { + if (clientAccountMapper.findByWechatOpenId(user.getString("openid")).size() > 0) { + throw new BadRequestException("The WeChat has been linked to other accounts"); + } + } + if(user.getString("unioinid")!=null && !"".equals(user.getString("unioinid"))){ + if(clientAccountMapper.findByWechatUnionId(user.getString("unioinid")).size()>0 ){ + throw new BadRequestException("The WeChat has been linked to other accounts"); + } } JSONObject res = new JSONObject(); if (StringUtils.equals(user.getString("openid"), account.getString("wechat_openid"))) { From 7f871d1aa4ddd060f4c3b2c6268097a81bb33518 Mon Sep 17 00:00:00 2001 From: duLingLing Date: Thu, 7 Nov 2019 16:18:11 +0800 Subject: [PATCH 27/33] =?UTF-8?q?Upd:=E6=B7=BB=E5=8A=A0=E6=96=B0=E9=97=BB?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=87=E9=A2=98=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E8=AF=A5=E5=AD=97=E6=AE=B5=E5=8F=AA=E9=92=88=E5=AF=B9news?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- src/main/ui/static/cms/cms.js | 79 +++++++++++++++++-- .../static/cms/templates/article_editor.html | 14 ++++ 3 files changed, 89 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 6f10cc43c..73cd2b7c9 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.77 + 1.2.78 UTF-8 1.4.0 diff --git a/src/main/ui/static/cms/cms.js b/src/main/ui/static/cms/cms.js index d3aeea811..6aca78a6a 100644 --- a/src/main/ui/static/cms/cms.js +++ b/src/main/ui/static/cms/cms.js @@ -255,11 +255,41 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu } }]); - app.controller('cmsAddArticleCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog','industryMap','stateMap', function ($scope, $http, $state, $stateParams, commonDialog,industryMap,stateMap) { + app.controller('cmsAddArticleCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog','industryMap','stateMap','Upload', function ($scope, $http, $state, $stateParams, commonDialog,industryMap,stateMap,Upload) { + $scope.catId = $scope.catId $scope.industries = industryMap.configs(); $scope.states = stateMap.configs(); - $scope.publishall = 1; + $scope.isImage = true; + $scope.uploadImageFile = function (file) { + if(typeof $scope.article =='undefined'){ + $scope.article={} + } + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.imageFileProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.imageFileProgress; + $scope.article.image = resp.data.url; + if ($scope.article.image.endsWith('pdf')) { + $scope.isImage = false; + } else { + $scope.isImage = true; + } + }, function (resp) { + delete $scope.imageFileProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.imageFileProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; $scope.saveArticle = function () { $scope.article.publishall = $scope.publishall; @@ -279,6 +309,10 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu } } + if($scope.catId=='news' && $scope.article.image==null){ + alert("请上传封面图"); + return; + } $scope.article.reference = $scope.reference; $http.post('/app/cms/categories/' + $stateParams.catId + '/articles', $scope.article).then(function (resp) { @@ -363,8 +397,9 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu }]); - app.controller('cmsArticleEditCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', 'article', 'industryMap','stateMap',function ($scope, $http, $state, $stateParams, commonDialog, article,industryMap,stateMap) { + app.controller('cmsArticleEditCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', 'article', 'industryMap','stateMap','Upload',function ($scope, $http, $state, $stateParams, commonDialog, article,industryMap,stateMap,Upload) { $scope.article = article.data; + $scope.catId=$stateParams.catId; $scope.article.publishall = $scope.article.publishall +""; $scope.industries = industryMap.configs(); @@ -393,8 +428,39 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu $scope.reference = {}; } - $scope.saveArticle = function () { + $scope.isImage = true; + if ($scope.article.image && $scope.article.image.endsWith('pdf')) { + $scope.isImage = false; + } + $scope.uploadImageFile = function (file) { + if (file != null) { + if (file.size > 3 * 1024 * 1024) { + commonDialog.alert({title: 'Error', content: '文件大小不能超过3MB,请压缩后重试', type: 'error'}) + } else { + $scope.imageFileProgress = {value: 0}; + Upload.upload({ + url: '/attachment/files', + data: {file: file} + }).then(function (resp) { + delete $scope.imageFileProgress; + $scope.article.image = resp.data.url; + if ($scope.article.image.endsWith('pdf')) { + $scope.isImage = false; + } else { + $scope.isImage = true; + } + }, function (resp) { + delete $scope.imageFileProgress; + commonDialog.alert({title: 'Upload Failed', content: resp.data.message, type: 'error'}) + }, function (evt) { + $scope.imageFileProgress.value = parseInt(100 * evt.loaded / evt.total); + }) + } + } + }; + + $scope.saveArticle = function () { $scope.article.publishall = $scope.publishall; if( $scope.publishall == 0){ if($scope.select_industries.length <= 0 || $scope.select_industries == "") { @@ -412,8 +478,11 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu } } + if($scope.catId=='news' && $scope.article.image==null){ + alert("请上传封面图"); + return; + } $scope.article.reference = $scope.reference; - $http.put('/app/cms/categories/' + $stateParams.catId + '/articles/' + $stateParams.articleId, $scope.article).then(function (resp) { $state.go('^.article_view', {articleId: $stateParams.articleId}); }, function (resp) { diff --git a/src/main/ui/static/cms/templates/article_editor.html b/src/main/ui/static/cms/templates/article_editor.html index 64c185d1b..a223d0c4e 100644 --- a/src/main/ui/static/cms/templates/article_editor.html +++ b/src/main/ui/static/cms/templates/article_editor.html @@ -16,6 +16,20 @@
+
+ +
+
+ +
+ + + +
+
From 87324141db379e09f52f1c1d85d3e323f6586823 Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Thu, 7 Nov 2019 17:39:06 +0800 Subject: [PATCH 28/33] =?UTF-8?q?=E3=80=90R=E3=80=91=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E8=B4=B9=E7=8E=87fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/merchants/core/impls/ClientManagerImpl.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 73cd2b7c9..28b988311 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.78 + 1.2.79 UTF-8 1.4.0 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 d1539284d..35a789bf4 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 @@ -2724,7 +2724,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } else { BigDecimal rate_value = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat").getBigDecimal("rate_value"); if (customer_surcharge_rate.compareTo(PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()) > 0 - || customer_surcharge_rate.compareTo(rate_value) < 0) { + || customer_surcharge_rate.compareTo(rate_value) <= 0) { throw new ForbiddenException("Invalid Range"); } clientModifySupport.processClientConfigModify(new CustomerSurchargeRateModify(account, clientMoniker, customer_surcharge_rate)); @@ -4237,10 +4237,12 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } } if (appClientBean.getCustomerSurchargeRate() != null) { - if (appClientBean.getCustomerSurchargeRate() <= 0) { - throw new ForbiddenException("customerSurchargeRate is 0"); - } BigDecimal customerSurchargeRate = new BigDecimal(appClientBean.getCustomerSurchargeRate()).setScale(2, RoundingMode.HALF_DOWN); + BigDecimal rateValue = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), "Wechat").getBigDecimal("rate_value"); + if (customerSurchargeRate.compareTo(PlatformEnvironment.getEnv().getMaxCustomerSurchargeRate()) > 0 + || customerSurchargeRate.compareTo(rateValue) <= 0) { + throw new ForbiddenException("Invalid Range"); + } setCustomerSurchargeRate(account, client.getString("client_moniker"), customerSurchargeRate); } clientInfoCacheSupport.clearClientCache(client_id); From d40b65ba6f24f8f36d2bf148388a148b5ef620b9 Mon Sep 17 00:00:00 2001 From: duLingLing Date: Mon, 11 Nov 2019 11:16:30 +0800 Subject: [PATCH 29/33] =?UTF-8?q?Upd:=E7=99=BB=E5=BD=95=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=94=B1OpenId=E5=8F=98=E6=9B=B4=E4=B8=BAuni?= =?UTF-8?q?onId,=E5=BE=AE=E4=BF=A1=E4=B8=8D=E5=90=8C=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=9B=B8=E5=90=8C=E8=AF=86=E5=88=AB=E5=AD=97=E6=AE=B5=E4=B8=BA?= =?UTF-8?q?unionid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/appclient/core/impls/RetailAppServiceImp.java | 4 ++-- .../payment/manage/mappers/system/ClientAccountMapper.java | 4 ++-- .../manage/merchants/core/impls/ClientManagerImpl.java | 1 + .../payment/manage/signin/core/SignInAccountService.java | 4 ++-- .../manage/signin/core/impls/SignInAccountServiceImpl.java | 4 ++-- .../manage/signin/core/impls/SignInStatusManagerImpl.java | 6 +++--- .../payment/manage/mappers/system/ClientAccountMapper.xml | 4 ++-- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 28b988311..3f9f1080c 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.79 + 1.2.80 UTF-8 1.4.0 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 b8388f94d..e040bfce4 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 @@ -2298,8 +2298,8 @@ public class RetailAppServiceImp implements RetailAppService { result.put("remark_contact_phone",contact_phone); result.put("nation_code",account.getString("nation_code")); } - result.put("wechat_bind_status",account.containsKey("wechat_openid")); - if(account.containsKey("wechat_openid")){ + result.put("wechat_bind_status",account.containsKey("wx_unionid")); + if(account.containsKey("wx_unionid")){ result.put("wechat_name",account.getString("wechat_name")); } return result; diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java index 17081b797..1ae4eee05 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.java @@ -85,10 +85,10 @@ public interface ClientAccountMapper { /** * 获取绑定微信的最新账号 - * @param openid + * @param unionId * @return */ - JSONObject findOneByOpenIdAndCreateTimeDesc(@Param("wechat_openid")String openid); + JSONObject findOneByUnionIdAndCreateTimeDesc(@Param("wx_unionid")String unionId); JSONObject findOneByPhoneAndCreateTimeDesc(@Param("contact_phone")String contactPhone,@Param("nation_code")String nationCode); 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 35a789bf4..e58eae0a9 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 @@ -1698,6 +1698,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid account.put("wechat_openid", null); account.put("wechat_name", null); account.put("wechat_headimg", null); + account.put("wx_unionid", null); clientAccountMapper.update(account); signInAccountService.clearAccountCache(accountId); } diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java index 80d383b03..f035120e2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/SignInAccountService.java @@ -42,10 +42,10 @@ public interface SignInAccountService { /** * 获取绑定微信最新的账号 - * @param openid + * @param unionId * @return */ - JSONObject clientWechatOneSignIn(String openid); + JSONObject clientWechatOneSignIn(String unionId); JSONObject clientWechatAppSignIn(String openId); 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 5e3cc18c1..600727fe9 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 @@ -363,8 +363,8 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati } @Override - public JSONObject clientWechatOneSignIn(String openid){ - JSONObject account = clientAccountMapper.findOneByOpenIdAndCreateTimeDesc(openid); + public JSONObject clientWechatOneSignIn(String unionId){ + JSONObject account = clientAccountMapper.findOneByUnionIdAndCreateTimeDesc(unionId); if (account == null) { return null; } diff --git a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInStatusManagerImpl.java b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInStatusManagerImpl.java index 98b0bdb4d..736d9023c 100644 --- a/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInStatusManagerImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/signin/core/impls/SignInStatusManagerImpl.java @@ -385,13 +385,13 @@ public class SignInStatusManagerImpl implements SignInStatusManager { if(user==null){ throw new BadRequestException("WeChat users do not exist"); } + String unionId = user.getString("unionid"); String openId = user.getString("openid"); - JSONObject account = signInAccountService.clientWechatOneSignIn(openId); + JSONObject account = signInAccountService.clientWechatOneSignIn(unionId); if (account == null) { JSONObject wechatUserInfo = mpClientAppWechatApiProvider.getApi("merchant-app").appUserInfo(openId,user.getString("access_token")); JSONObject res = new JSONObject(); String nickName = wechatUserInfo.getString("nickname"); - String unionId = wechatUserInfo.getString("unionid"); res.put("bind_status", false); res.put("app_openid", openId); res.put("status", "success"); @@ -405,7 +405,7 @@ public class SignInStatusManagerImpl implements SignInStatusManager { account = getCurrentClient(statusKey); account.put("sign_key", statusKey); result.put("account",account); - result.put("app_openid", openId); + result.put("app_openid", unionId); result.put("bind_status", true); result.put("status", "success"); return result; diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml index 3689e89a3..8abdc3f0d 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/system/ClientAccountMapper.xml @@ -28,9 +28,9 @@ OR sc.parent_client_id IN (select client_id from sys_clients where client_id =#{client_id} or parent_client_id=#{client_id})); - SELECT * FROM sys_accounts a - WHERE a.is_valid =1 and a.wechat_openid=#{wechat_openid} + WHERE a.is_valid =1 and a.wx_unionid=#{wx_unionid} ORDER BY a.create_time DESC limit 1 From 3a50fc9dee4d08d20e17054c30f18cf93b6212d4 Mon Sep 17 00:00:00 2001 From: luoyang Date: Mon, 11 Nov 2019 15:20:08 +0800 Subject: [PATCH 30/33] =?UTF-8?q?fix=20=E5=AE=A2=E6=88=B7=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E6=89=8B=E7=BB=AD=E8=B4=B9=E5=AF=BC=E8=87=B4=E6=8F=90?= =?UTF-8?q?=E6=88=90=E7=BB=84=E7=BB=87=E6=88=90=E6=9C=AC=E6=89=8B=E7=BB=AD?= =?UTF-8?q?=E8=B4=B9=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../impls/CityPartnerPrizeServiceImpl.java | 18 +++--------------- .../mappers/payment/TransactionMapper.xml | 10 ++++++++-- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index 3f9f1080c..108bb5286 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.80 + 1.2.81 UTF-8 1.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java index f645150be..349aa4013 100644 --- a/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/citypartner/core/impls/CityPartnerPrizeServiceImpl.java @@ -429,7 +429,6 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { List transactionDetail = transactionMapper.listTransactionForCityPartnerCommissionByDate(year, month); Map> groupByOrgMap = transactionDetail.stream().collect(Collectors.groupingBy(e -> e.getInteger("org_id"))); for (Map.Entry> oneOrg : groupByOrgMap.entrySet()) { - int orgId = oneOrg.getKey(); JSONObject org = orgMapper.findOne(orgId); if (org == null) { @@ -440,8 +439,6 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { generateold(monthStr); return; } - - List items = oneOrg.getValue(); Map> groupByChannelMap = items.stream().collect(Collectors.groupingBy(e -> e.getString("channel"))); List channelAmount = orgChannelAmount(org, groupByChannelMap, channelCharge); @@ -450,23 +447,18 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { channel.put("month", month); channel.put("year", year); channel.put("org_id", orgId); - financialPartnerCommissionMapper.save(channel); } } Map> groupByClientMap = transactionDetail.stream().collect(Collectors.groupingBy(e -> e.getInteger("client_id"))); for (Map.Entry> oneClient : groupByClientMap.entrySet()) { - JSONObject org = orgMapper.findOne(oneClient.getValue().get(0).getInteger("org_id")); Map> groupByChannel = oneClient.getValue().stream().collect(Collectors.groupingBy(e -> e.getString("channel"))); - List clientChannelAmount = clientChannelAmount(oneClient.getKey(), org, groupByChannel, channelCharge, year, month, 1); for (JSONObject channel : clientChannelAmount) { financialPartnerCommissionDetailMapper.save(channel); } - } - Runnable task = () -> { generateAgent(monthStr, channelCharge); generateReferrer(monthStr); @@ -479,7 +471,6 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { public List orgChannelAmount(JSONObject orgInfo, Map> channelMap, JSONObject channelCharge) { List amountByChannel = new ArrayList<>(); - for (Map.Entry> oneChannel : channelMap.entrySet()) { BigDecimal total = BigDecimal.ZERO; BigDecimal total_surage = BigDecimal.ZERO; @@ -487,7 +478,6 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { BigDecimal royalpay_surage = BigDecimal.ZERO; JSONObject json = new JSONObject(); String channel = oneChannel.getKey(); - if ("hf".equals(oneChannel.getKey().toLowerCase()) || "yeepay".equals(oneChannel.getKey().toLowerCase()) || "lakalapay".equals(oneChannel.getKey().toLowerCase())) { channel = "cb_bankpay"; if (orgInfo.get("cb_bankpay_rate_value") == null) { @@ -498,9 +488,8 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { throw new ServerErrorException(orgInfo.getString("name") + "组织下" + oneChannel.getKey() + "成本手续费未设置"); } } - for (JSONObject params : oneChannel.getValue()) { - BigDecimal tmpClearingAmount = params.getBigDecimal("clearing_amount"); + BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback")); //增加货币判断 @@ -543,7 +532,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { channel = "cb_bankpay"; } for (JSONObject params : oneChannel.getValue()) { - BigDecimal tmpClearingAmount = params.getBigDecimal("clearing_amount"); + BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback")); //增加货币判断 @@ -578,7 +567,6 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { //type 1:一级代理 2:二级代理 public List clientChannelAmount(int clientId, JSONObject orgInfo, Map> channelMap, JSONObject channelCharge, int year, int month, int type) { List amountByChannel = new ArrayList<>(); - for (Map.Entry> oneChannel : channelMap.entrySet()) { String recordId = ""; if (type == 1) { @@ -607,7 +595,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService { } catch (Exception e) { } for (JSONObject params : oneChannel.getValue()) { - BigDecimal tmpClearingAmount = params.getBigDecimal("clearing_amount"); + BigDecimal tmpClearingAmount = params.getBooleanValue("customer_surcharge") ? params.getBigDecimal("settle_amount") : params.getBigDecimal("clearing_amount"); BigDecimal channelRate = params.get("org_rate") != null ? params.getBigDecimal("org_rate") : (orgInfo.getBigDecimal(channel.toLowerCase() + "_rate_value").divide(CommonConsts.HUNDRED, 4, RoundingMode.DOWN)); BigDecimal tmpTotalSurcharge = params.getBigDecimal("total_surcharge").subtract(params.getBigDecimal("surcharge_cashback")); //增加货币判断 diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index 645f42769..99175a97a 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -742,10 +742,13 @@ if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount) clearing_amount, if(t.transaction_type = 'Credit', t.total_surcharge, -t.total_surcharge) total_surcharge, if(t.transaction_type = 'Credit', t.channel_surcharge, -t.channel_surcharge) channel_surcharge, + if(t.transaction_type = 'Credit', t.settle_amount, -t.settle_amount) settle_amount, t.order_id, t.org_rate, - t.surcharge_cashback + t.surcharge_cashback, + o.customer_surcharge from pmt_transactions t + LEFT JOIN pmt_orders o on o.order_id = t.order_id INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1 AND so.type = 0 AND so.citypartner = 1 AND so.commission = 1 @@ -766,10 +769,13 @@ if(t.transaction_type = 'Credit', t.clearing_amount, -t.clearing_amount) clearing_amount, if(t.transaction_type = 'Credit', t.total_surcharge, -t.total_surcharge) total_surcharge, if(t.transaction_type = 'Credit', t.channel_surcharge, -t.channel_surcharge) channel_surcharge, + if(t.transaction_type = 'Credit', t.settle_amount, -t.settle_amount) settle_amount, t.order_id, t.org_rate, - t.surcharge_cashback + t.surcharge_cashback, + o.customer_surcharge from pmt_transactions t + LEFT JOIN pmt_orders o on o.order_id = t.order_id INNER JOIN sys_org so ON t.org_id = so.org_id AND so.is_valid = 1 AND so.type = 0 AND so.parent_org_id != '' From fccea0db9cbb36ef8788601c20374ea19803ff17 Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 11 Nov 2019 18:55:47 +0800 Subject: [PATCH 31/33] export excel columns add settle date, settle amount, total surcharge, GST --- .../core/impls/TradeLogServiceImpl.java | 542 +++++++++--------- 1 file changed, 275 insertions(+), 267 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java index b51ea893a..f35d166ae 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java @@ -65,14 +65,12 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.DateFormat; import java.text.DecimalFormat; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.List; +import java.util.*; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import java.util.zip.ZipEntry; @@ -461,29 +459,29 @@ public class TradeLogServiceImpl implements TradeLogService { } private JSONObject listPartnerTransFlow(TradeLogQuery query, JSONObject partner) throws Exception { - int client_id = partner.getIntValue("client_id"); + int clientId = partner.getIntValue("client_id"); String timezone = partner.getJSONObject("client").getString("timezone"); JSONObject params = query.toParams(timezone); - clientManager.validateClients(client_id, params); - params.put("client_id", client_id); + clientManager.validateClients(clientId, params); + params.put("client_id", clientId); List logs = transactionMapper.listTransFlow(params); - if (client_id!=1563){ - logs.stream().forEach(p -> { - String login_id = p.getString("login_id"); - if (StringUtils.isNotEmpty(login_id)) { - p.put("order_detail", (StringUtils.isEmpty(p.getString("order_detail")) ? "" : login_id+":"+p.getString("order_detail"))); - }else{ + if (clientId != 1563) { + logs.forEach(p -> { + String loginId = p.getString("login_id"); + if (StringUtils.isNotEmpty(loginId)) { + p.put("order_detail", (StringUtils.isEmpty(p.getString("order_detail")) ? "" : loginId + ":" + p.getString("order_detail"))); + } else { p.put("order_detail", (StringUtils.isEmpty(p.getString("order_detail")) ? "" : p.getString("order_detail"))); } }); } - TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Arrays.asList("transaction_time")); + TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Collections.singletonList("transaction_time")); + TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy", Collections.singletonList("clearing_time")); final JSONObject analysis = analysisTransLogs(logs); JSONObject result = new JSONObject(); result.put("data", logs); -// JSONObject analysis = transactionMapper.analysisTransFlow(params); analysis.put("balance", transactionMapper.analysisBalance(params)); if (analysis.containsKey("paid_fee") && analysis.containsKey("refund_fee")) { analysis.put("actual_fee", analysis.getBigDecimal("paid_fee").add(analysis.getBigDecimal("refund_fee"))); @@ -584,13 +582,12 @@ public class TradeLogServiceImpl implements TradeLogService { @Override public void exportTransFlow(TradeLogQuery query, JSONObject partner, HttpServletResponse response) throws Exception { - // File jasperFile = trans_flow.getFile(); JSONObject transFlow = listPartnerTransFlow(query, partner); JSONObject analysis = transFlow.getJSONObject("analysis"); JSONObject client = clientManager.getClientInfo(Integer.parseInt(query.getClient_ids()[0])); if (!transFlow.getJSONArray("data").isEmpty()) { try { - List dataList = (List) transFlow.get("data"); + List dataList = transFlow.getJSONArray("data").toJavaList(JSONObject.class); JSONObject parmerters = new JSONObject(); parmerters.put("dateFrom", StringUtils.isNotBlank(query.getDatefrom()) ? DateFormatUtils.format(DateUtils.parseDate(query.getDatefrom(), "yyyyMMdd"), "dd/MM/yyyy") : ""); @@ -656,10 +653,9 @@ public class TradeLogServiceImpl implements TradeLogService { logger.debug("excel The method======= exportExcel() start......................."); JSONObject transFlow = listPartnerTransFlow(query, partner); JSONObject client = clientManager.getClientInfo(Integer.parseInt(query.getClient_ids()[0])); - // JSONObject analysis = transFlow.getJSONObject("analysis"); - if (transFlow.getJSONArray("data").size() > 0) { + if (!transFlow.getJSONArray("data").isEmpty()) { try { - List dataList = (List) transFlow.get("data"); + List dataList = transFlow.getJSONArray("data").toJavaList(JSONObject.class); String transType; JSONObject device; int status; @@ -683,16 +679,13 @@ public class TradeLogServiceImpl implements TradeLogService { parmerters.put("dateTo", StringUtils.isNotBlank(query.getDateto()) ? query.getDateto() : DateFormatUtils.format(new Date(), "yyyyMMdd")); parmerters.put("partnerCode", client.getString("client_moniker")); // parmerters.put("actual_fee", analysis.containsKey("actual_fee") ? - // analysis.getBigDecimal("actual_fee") : 0); JRDataSource jrDataSource = new JRBeanCollectionDataSource(dataList); response.setContentType("application/vnd.ms-excel"); String fileName = StringUtils.isEmpty(parmerters.getString("dateFrom")) ? parmerters.getString("dateTo") : (parmerters.getString("dateFrom") + "~" + parmerters.getString("dateTo")); - // String fileName = new String(URLEncoder.encode(defaultname,"utf8")); response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xlsx"); OutputStream outputStream = response.getOutputStream(); JasperPrint jasperPrint = JasperFillManager.fillReport(trans_excel.getInputStream(), parmerters, jrDataSource); - // JRXlsExporter exporter = new JRXlsExporter(); JRXlsxExporter exporter = new JRXlsxExporter(); ExporterInput exporterInput = new SimpleExporterInput(jasperPrint); exporter.setExporterInput(exporterInput); @@ -715,23 +708,27 @@ public class TradeLogServiceImpl implements TradeLogService { } private void excelTrans(Row row, JSONObject data) { - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(data.getString("transaction_time")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(data.getString("client_order_id")); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(data.getString("system_transaction_id")); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(data.getString("client_moniker")); - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(data.getString("short_name")); - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(data.getString("order_id")); - row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(data.getString("channel")); - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(data.getString("display_amount")); - row.createCell(8, Cell.CELL_TYPE_STRING).setCellValue(data.getString("transaction_amount")); - row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(data.getString("currency")); - row.createCell(10, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clearing_amount")); - row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(data.getString("trans_type").equals("clearing")?"-":data.getBigDecimal("exchange_rate").toString()); - row.createCell(12, Cell.CELL_TYPE_STRING).setCellValue(data.getString("trans_type")); - row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clear_status")); - row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(data.getString("gateway")); - row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(data.getString("order_detail")); - row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(data.getString("dev_id")); + row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(data.getString("transaction_time")); + row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(data.getString("client_order_id")); + row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(data.getString("system_transaction_id")); + row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(data.getString("client_moniker")); + row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(data.getString("short_name")); + row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(data.getString("order_id")); + row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(data.getString("channel")); + row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(data.getString("display_amount")); + row.createCell(8, Cell.CELL_TYPE_STRING).setCellValue(data.getString("transaction_amount")); + row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(data.getString("currency")); + row.createCell(10, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clearing_amount")); + row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(data.getString("settle_amount")); + row.createCell(12, Cell.CELL_TYPE_STRING).setCellValue(data.getString("total_surcharge")); + row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(data.getString("tax_amount")); + row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clearing_time")); + row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(data.getString("trans_type").equals("clearing") ? "-" : data.getBigDecimal("exchange_rate").toString()); + row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(data.getString("trans_type")); + row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(data.getString("clear_status")); + row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(data.getString("gateway")); + row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(data.getString("order_detail")); + row.createCell(20, Cell.CELL_TYPE_STRING).setCellValue(data.getString("dev_id")); } @Override @@ -739,110 +736,112 @@ public class TradeLogServiceImpl implements TradeLogService { logger.debug("excel The method======= exportExcelNew() start......................."); JSONObject transFlow = listPartnerTransFlow(query, partner); JSONObject client = clientManager.getClientInfo(Integer.parseInt(query.getClient_ids()[0])); - if (transFlow.getJSONArray("data").size() > 0) { - List dataList = (List) transFlow.get("data"); - HSSFWorkbook workbook = new HSSFWorkbook(); - // 声明一个工作薄 - // 生成一个表格 - HSSFSheet sheet = workbook.createSheet("trans_excel"); - // 设置表格默认列宽度为15个字节 - sheet.setDefaultColumnWidth((short) 40); - // 生成一个样式 - HSSFCellStyle style = workbook.createCellStyle(); - // 设置这些样式 - style.setFillForegroundColor(HSSFColor.LIGHT_ORANGE.index); - style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - style.setBorderBottom(HSSFCellStyle.BORDER_THIN); - style.setBorderLeft(HSSFCellStyle.BORDER_THIN); - style.setBorderRight(HSSFCellStyle.BORDER_THIN); - style.setBorderTop(HSSFCellStyle.BORDER_THIN); - style.setAlignment(HSSFCellStyle.ALIGN_CENTER); - HSSFFont font = workbook.createFont(); - // font.setColor(HSSFColor.VIOLET.index); - font.setFontHeightInPoints((short) 16); - font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); - // 把字体应用到当前的样式 - style.setFont(font); - - HSSFCellStyle style2 = workbook.createCellStyle(); - // 设置这些样式 - style2.setFillForegroundColor(HSSFColor.WHITE.index); - style2.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); - style2.setBorderBottom(HSSFCellStyle.BORDER_THIN); - style2.setBorderLeft(HSSFCellStyle.BORDER_THIN); - style2.setBorderRight(HSSFCellStyle.BORDER_THIN); - style2.setBorderTop(HSSFCellStyle.BORDER_THIN); - style2.setAlignment(HSSFCellStyle.ALIGN_CENTER); - HSSFFont font2 = workbook.createFont(); - // font.setColor(HSSFColor.VIOLET.index); - font2.setFontHeightInPoints((short) 12); - font2.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); - // 把字体应用到当前的样式 - style2.setFont(font2); - HSSFRow row0 = sheet.createRow(0); - HSSFCell cell00 = row0.createCell(0); - HSSFCell cell01 = row0.createCell(1); - HSSFCell cell02 = row0.createCell(2); - HSSFCell cell03 = row0.createCell(3); - HSSFCell cell04 = row0.createCell(4); - cell00.setCellStyle(style); - cell01.setCellStyle(style); - cell02.setCellStyle(style); - cell03.setCellStyle(style); - cell04.setCellStyle(style); - HSSFRichTextString text00 = new HSSFRichTextString("Data/Time"); - HSSFRichTextString text01 = new HSSFRichTextString("Description"); - HSSFRichTextString text02 = new HSSFRichTextString("Debit"); - HSSFRichTextString text03 = new HSSFRichTextString("Credit"); - HSSFRichTextString text04 = new HSSFRichTextString("Remark"); - cell00.setCellValue(text00); - cell01.setCellValue(text01); - cell02.setCellValue(text02); - cell03.setCellValue(text03); - cell04.setCellValue(text04); - for (int i = 0; i < dataList.size(); i++) { - HSSFRow row = sheet.createRow(i + 1); - HSSFCell cell0 = row.createCell(0); - HSSFCell cell1 = row.createCell(1); - HSSFCell cell2 = row.createCell(2); - HSSFCell cell3 = row.createCell(3); - HSSFCell cell4 = row.createCell(4); - cell0.setCellStyle(style2); - cell1.setCellStyle(style2); - cell2.setCellStyle(style2); - cell3.setCellStyle(style2); - cell4.setCellStyle(style2); - HSSFRichTextString text0 = new HSSFRichTextString(dataList.get(i).getString("transaction_time")); - HSSFRichTextString text1 = new HSSFRichTextString(dataList.get(i).getString("order_id2")); - String debit = dataList.get(i).getString("transaction_type").equals("Debit") ? dataList.get(i).getBigDecimal("clearing_amount").toString() - : "-"; - HSSFRichTextString text2 = new HSSFRichTextString(debit); - String credit = dataList.get(i).getString("transaction_type").equals("Credit") ? dataList.get(i).getBigDecimal("clearing_amount").toString() - : "-"; - HSSFRichTextString text3 = new HSSFRichTextString(credit); - HSSFRichTextString text4 = new HSSFRichTextString(dataList.get(i).getString("order_detail")); - cell0.setCellValue(text0); - cell1.setCellValue(text1); - cell2.setCellValue(text2); - cell3.setCellValue(text3); - cell4.setCellValue(text4); - } - JSONObject parmerters = new JSONObject(); - parmerters.put("dateFrom", StringUtils.isNotBlank(query.getDatefrom()) ? query.getDatefrom() : ""); - parmerters.put("dateTo", StringUtils.isNotBlank(query.getDateto()) ? query.getDateto() : DateFormatUtils.format(new Date(), "yyyyMMdd")); - parmerters.put("partnerCode", client.getString("client_moniker")); - response.setContentType("application/vnd.ms-excel"); - String fileName = StringUtils.isEmpty(parmerters.getString("dateFrom")) ? parmerters.getString("dateTo") - : (parmerters.getString("dateFrom") + "~" + parmerters.getString("dateTo")); - response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls"); - OutputStream outputStream = response.getOutputStream(); + if (!transFlow.getJSONArray("data").isEmpty()) { + List dataList = transFlow.getJSONArray("data").toJavaList(JSONObject.class); + try (HSSFWorkbook workbook = new HSSFWorkbook()) { + // 声明一个工作薄 + // 生成一个表格 + HSSFSheet sheet = workbook.createSheet("trans_excel"); + // 设置表格默认列宽度为15个字节 + sheet.setDefaultColumnWidth((short) 40); + // 生成一个样式 + HSSFCellStyle style = workbook.createCellStyle(); + // 设置这些样式 + style.setFillForegroundColor(HSSFColor.LIGHT_ORANGE.index); + style.setFillPattern(CellStyle.SOLID_FOREGROUND); + style.setBorderBottom(CellStyle.BORDER_THIN); + style.setBorderLeft(CellStyle.BORDER_THIN); + style.setBorderRight(CellStyle.BORDER_THIN); + style.setBorderTop(CellStyle.BORDER_THIN); + style.setAlignment(CellStyle.ALIGN_CENTER); + HSSFFont font = workbook.createFont(); + // font.setColor(HSSFColor.VIOLET.index); + font.setFontHeightInPoints((short) 16); + font.setBoldweight(Font.BOLDWEIGHT_BOLD); + // 把字体应用到当前的样式 + style.setFont(font); + + HSSFCellStyle style2 = workbook.createCellStyle(); + // 设置这些样式 + style2.setFillForegroundColor(HSSFColor.WHITE.index); + style2.setFillPattern(CellStyle.SOLID_FOREGROUND); + style2.setBorderBottom(CellStyle.BORDER_THIN); + style2.setBorderLeft(CellStyle.BORDER_THIN); + style2.setBorderRight(CellStyle.BORDER_THIN); + style2.setBorderTop(CellStyle.BORDER_THIN); + style2.setAlignment(CellStyle.ALIGN_CENTER); + HSSFFont font2 = workbook.createFont(); + // font.setColor(HSSFColor.VIOLET.index); + font2.setFontHeightInPoints((short) 12); + font2.setBoldweight(Font.BOLDWEIGHT_NORMAL); + // 把字体应用到当前的样式 + style2.setFont(font2); + HSSFRow row0 = sheet.createRow(0); + HSSFCell cell00 = row0.createCell(0); + HSSFCell cell01 = row0.createCell(1); + HSSFCell cell02 = row0.createCell(2); + HSSFCell cell03 = row0.createCell(3); + HSSFCell cell04 = row0.createCell(4); + cell00.setCellStyle(style); + cell01.setCellStyle(style); + cell02.setCellStyle(style); + cell03.setCellStyle(style); + cell04.setCellStyle(style); + HSSFRichTextString text00 = new HSSFRichTextString("Data/Time"); + HSSFRichTextString text01 = new HSSFRichTextString("Description"); + HSSFRichTextString text02 = new HSSFRichTextString("Debit"); + HSSFRichTextString text03 = new HSSFRichTextString("Credit"); + HSSFRichTextString text04 = new HSSFRichTextString("Remark"); + cell00.setCellValue(text00); + cell01.setCellValue(text01); + cell02.setCellValue(text02); + cell03.setCellValue(text03); + cell04.setCellValue(text04); + for (int i = 0; i < dataList.size(); i++) { + HSSFRow row = sheet.createRow(i + 1); + HSSFCell cell0 = row.createCell(0); + HSSFCell cell1 = row.createCell(1); + HSSFCell cell2 = row.createCell(2); + HSSFCell cell3 = row.createCell(3); + HSSFCell cell4 = row.createCell(4); + cell0.setCellStyle(style2); + cell1.setCellStyle(style2); + cell2.setCellStyle(style2); + cell3.setCellStyle(style2); + cell4.setCellStyle(style2); + JSONObject dataItem = dataList.get(i); + HSSFRichTextString text0 = new HSSFRichTextString(dataItem.getString("transaction_time")); + HSSFRichTextString text1 = new HSSFRichTextString(dataItem.getString("order_id2")); + String debit = dataItem.getString("transaction_type").equals("Debit") ? dataItem.getBigDecimal("clearing_amount").toString() + : "-"; + HSSFRichTextString text2 = new HSSFRichTextString(debit); + String credit = dataItem.getString("transaction_type").equals("Credit") ? dataItem.getBigDecimal("clearing_amount").toString() + : "-"; + HSSFRichTextString text3 = new HSSFRichTextString(credit); + HSSFRichTextString text4 = new HSSFRichTextString(dataItem.getString("order_detail")); + cell0.setCellValue(text0); + cell1.setCellValue(text1); + cell2.setCellValue(text2); + cell3.setCellValue(text3); + cell4.setCellValue(text4); + } + JSONObject parmerters = new JSONObject(); + parmerters.put("dateFrom", StringUtils.isNotBlank(query.getDatefrom()) ? query.getDatefrom() : ""); + parmerters.put("dateTo", StringUtils.isNotBlank(query.getDateto()) ? query.getDateto() : DateFormatUtils.format(new Date(), "yyyyMMdd")); + parmerters.put("partnerCode", client.getString("client_moniker")); + response.setContentType("application/vnd.ms-excel"); + String fileName = StringUtils.isEmpty(parmerters.getString("dateFrom")) ? parmerters.getString("dateTo") + : (parmerters.getString("dateFrom") + "~" + parmerters.getString("dateTo")); + response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls"); + OutputStream outputStream = response.getOutputStream(); - try { - workbook.write(outputStream); - outputStream.close(); - } catch (IOException e) { + try { + workbook.write(outputStream); + outputStream.close(); + } catch (IOException e) { - e.printStackTrace(); + e.printStackTrace(); + } } } @@ -856,10 +855,10 @@ public class TradeLogServiceImpl implements TradeLogService { @Override public JSONObject listSettlementLog(TradeLogQuery query, JSONObject partner) { - int client_id = partner.getIntValue("client_id"); + int clientId = partner.getIntValue("client_id"); String timezone = partner.getJSONObject("client").getString("timezone"); JSONObject params = query.toParams(timezone); - params.put("client_id", client_id); + params.put("client_id", clientId); PageList logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc"))); JSONObject result = PageListUtils.buildPageListResult(logs); @@ -867,13 +866,13 @@ public class TradeLogServiceImpl implements TradeLogService { if (query.getPage() == 1) { if (!logs.isEmpty()) { JSONObject clearingDetail = clearingDetailMapper.findByDetailId(logs.get(0).getIntValue("clear_detail_id")); - if (clearingDetail!=null){ + if (clearingDetail != null) { JSONObject clearingLog = clearingLogMapper.findById(clearingDetail.getIntValue("clearing_id")); - if(clearingLog.getBooleanValue("editable")){ + if (clearingLog.getBooleanValue("editable")) { result.put("padding", true); - logs.get(0).put("padding",true); - logger.info("##editable"+clearingLog.getBooleanValue("editable")); + logs.get(0).put("padding", true); + logger.info("##editable{}", clearingLog.getBooleanValue("editable")); } } } @@ -883,8 +882,7 @@ public class TradeLogServiceImpl implements TradeLogService { @Override public Double getClientUnClearedAmount(JSONObject partner) { - Double unCleared = transactionMapper.getClientUnClearedAmount(partner.getIntValue("client_id")); - return unCleared; + return transactionMapper.getClientUnClearedAmount(partner.getIntValue("client_id")); } public static JSONObject tunnel() { @@ -1098,11 +1096,11 @@ public class TradeLogServiceImpl implements TradeLogService { clearings.addAll(mpPaymentApi.settlementLogs(from, to, mch.getMerchantId())); } for (SettlementLog clear : clearings) { - JSONObject date_params = new JSONObject(); - date_params.put("from", clear.getStart()); - date_params.put("to", clear.getEnd()); - date_params.put("clearing_date", clear.getSettlementDate()); - List oneClear = transactionMapper.getMerchantAmount(date_params); + JSONObject dateParams = new JSONObject(); + dateParams.put("from", clear.getStart()); + dateParams.put("to", clear.getEnd()); + dateParams.put("clearing_date", clear.getSettlementDate()); + List oneClear = transactionMapper.getMerchantAmount(dateParams); Date now = new Date(); for (JSONObject clientClear : oneClear) { // JSONObject params = new JSONObject(); @@ -1115,7 +1113,7 @@ public class TradeLogServiceImpl implements TradeLogService { austracDataMapper.delete(clientClear.getIntValue("client_id"), clientClear.getDate("clearing_time")); BigDecimal lastTransTotal = austracDataMapper.getClientLastTransactionTotal(clientClear.getIntValue("client_id"), clientClear.getDate("clearing_time")); - clientClear.put("clearing_amount", clientClear.getBigDecimal("clearing_amount").setScale(0, BigDecimal.ROUND_DOWN)); + clientClear.put("clearing_amount", clientClear.getBigDecimal("clearing_amount").setScale(0, RoundingMode.DOWN)); if (lastTransTotal != null && lastTransTotal.compareTo(new BigDecimal(0)) < 0) { clientClear.put("clearing_amount", clientClear.getBigDecimal("clearing_amount").add(lastTransTotal)); } @@ -1126,8 +1124,8 @@ public class TradeLogServiceImpl implements TradeLogService { clientClear.put("bank_settlement_data", clear.getBankSettlementDate()); austracDataMapper.save(clientClear); } - JSONObject fee = transactionMapper.getSumMerchantAmount(date_params); - fee.put("clearing_amount", clear.getSettlementFee().subtract(fee.getBigDecimal("clearing_amount")).setScale(0, BigDecimal.ROUND_DOWN)); + JSONObject fee = transactionMapper.getSumMerchantAmount(dateParams); + fee.put("clearing_amount", clear.getSettlementFee().subtract(fee.getBigDecimal("clearing_amount")).setScale(0, RoundingMode.DOWN)); fee.put("clearing_time", clear.getSettlementDate()); fee.put("order_time", clear.getSettlementDate()); fee.put("create_time", now); @@ -1158,7 +1156,7 @@ public class TradeLogServiceImpl implements TradeLogService { params.put("client_id", client.getIntValue("client_id")); List logs = orderMapper.listOrdersByClientsNoPages(params); - if (null != logs && logs.size() > 0) { + if (!logs.isEmpty()) { int count = 0; for (JSONObject object : logs) { if (object.getIntValue("clearing_status") == 2 && object.getIntValue("client_id") == client.getIntValue("client_id")) { @@ -1192,27 +1190,23 @@ public class TradeLogServiceImpl implements TradeLogService { @Override public void exportSettlementLog(TradeLogQuery query, JSONObject partner, HttpServletResponse resp) { - String begin = query.getDatefrom() == null ?"":query.getDatefrom(); - String end = query.getDateto() == null ?"":query.getDateto(); + String begin = query.getDatefrom() == null ? "" : query.getDatefrom(); + String end = query.getDateto() == null ? "" : query.getDateto(); String timezone = partner.getJSONObject("client").getString("timezone"); JSONObject params = query.toParams(timezone); if (params.get("client_ids") == null) { - params.put("client_id",partner.getJSONObject("client").getString("client_id")); + params.put("client_id", partner.getJSONObject("client").getString("client_id")); } List clientOrderList = transactionMapper.getClientOrderByTransactionTime(params); List clientOrders = new ArrayList<>(clientOrderList.size()); - clientOrderList.parallelStream().forEach(p->{ - clientOrders.add(p.getInteger("clearing_order")); - }); + clientOrderList.parallelStream().forEach(p -> clientOrders.add(p.getInteger("clearing_order"))); List settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders); - OutputStream ous = null; - try { + try (OutputStream ous = resp.getOutputStream(); + Workbook wb = new XSSFWorkbook()) { JSONObject clearDetailTotal = transactionMapper.getClearDetailTotal(params); resp.setContentType("application/octet-stream;"); resp.addHeader("Content-Disposition", "attachment; filename=" + "Merchant_Settlement_Info_" + begin + "_" + end + ".xlsx"); - ous = resp.getOutputStream(); - Workbook wb = new XSSFWorkbook(); Cell cell = null; Font font = wb.createFont(); font.setBoldweight(Font.BOLDWEIGHT_BOLD); @@ -1223,7 +1217,7 @@ public class TradeLogServiceImpl implements TradeLogService { int rowNum = 0; Row row = sheet.createRow(rowNum); String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency", - "Input Amount", "Total Amount", "Clearing Amount", "Sruchange Rate", "Settle Amount", "Remark", "Dev No","Company Name","Short Name","Settment Date"}; + "Input Amount", "Total Amount", "Clearing Amount", "Sruchange Rate", "Settle Amount", "Surcharge", "GST", "Remark", "Dev No", "Company Name", "Short Name", "Settlement Date"}; String[] analysis = {"Total Credit", "Total Debit", "Gross Amount", "Total Charge", "Net Amount"}; for (int i = 0; i < title.length; i++) { row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]); @@ -1245,26 +1239,30 @@ public class TradeLogServiceImpl implements TradeLogService { } else { row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue("-"); } - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, BigDecimal.ROUND_DOWN).toPlainString()); + row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, RoundingMode.DOWN).toPlainString()); row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_type")); row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency")); row.createCell(8, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("display_amount") == null ? "" - : settle.getBigDecimal("display_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString()); + : settle.getBigDecimal("display_amount").setScale(2, RoundingMode.DOWN).toPlainString()); row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("transaction_amount") == null ? "" - : settle.getBigDecimal("transaction_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString()); + : settle.getBigDecimal("transaction_amount").setScale(2, RoundingMode.DOWN).toPlainString()); row.createCell(10, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("clearing_amount") == null ? "" - : settle.getBigDecimal("clearing_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString()); - row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("rate") == null? "": settle.getBigDecimal("rate").toPlainString() + "%"); + : settle.getBigDecimal("clearing_amount").setScale(2, RoundingMode.DOWN).toPlainString()); + row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("rate") == null ? "" : settle.getBigDecimal("rate").toPlainString() + "%"); row.createCell(12, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("settle_amount") == null ? "" - : settle.getBigDecimal("settle_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString()); - row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("remark")); + : settle.getBigDecimal("settle_amount").setScale(2, RoundingMode.DOWN).toPlainString()); + row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("total_surcharge") == null ? "" + : settle.getBigDecimal("total_surcharge").setScale(2, RoundingMode.DOWN).toPlainString()); + row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("tax_amount") == null ? "" + : settle.getBigDecimal("tax_amount").setScale(2, RoundingMode.DOWN).toPlainString()); + row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("remark")); device = clientDeviceMapper.find(settle.getString("dev_id")); if (device != null) clientDevId = device.getString("client_dev_id"); - row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(clientDevId); - row.createCell(15,Cell.CELL_TYPE_STRING).setCellValue(settle.getString("company_name")); - row.createCell(16,Cell.CELL_TYPE_STRING).setCellValue(settle.getString("short_name")); - row.createCell(17,Cell.CELL_TYPE_STRING).setCellValue(settle.getString("settle_date")); + row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(clientDevId); + row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("company_name")); + row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("short_name")); + row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("settle_date")); } row = sheet.createRow(++rowNum); for (int i = 0; i < analysis.length; i++) { @@ -1283,26 +1281,23 @@ public class TradeLogServiceImpl implements TradeLogService { ous.flush(); } catch (IOException e) { e.printStackTrace(); - } finally { - IOUtils.closeQuietly(ous); } + } @Override public void exportPDFSettlement(TradeLogQuery query, JSONObject partner, HttpServletResponse response) { - String begin = query.getDatefrom() == null ?"":query.getDatefrom(); - String end = query.getDateto() == null ?"":query.getDateto(); + String begin = query.getDatefrom() == null ? "" : query.getDatefrom(); + String end = query.getDateto() == null ? "" : query.getDateto(); JSONObject client = partner.getJSONObject("client"); String timezone = client.getString("timezone"); JSONObject params = query.toParams(timezone); if (params.get("client_ids") == null) { - params.put("client_id",client.getString("client_id")); + params.put("client_id", client.getString("client_id")); } List clientOrderList = transactionMapper.getClientOrderByTransactionTime(params); List clientOrders = new ArrayList<>(clientOrderList.size()); - clientOrderList.parallelStream().forEach(p->{ - clientOrders.add(p.getInteger("clearing_order")); - }); + clientOrderList.parallelStream().forEach(p -> clientOrders.add(p.getInteger("clearing_order"))); List settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders); TimeZoneUtils.switchTimeZoneToString(settlementLogDetailList, timezone, "yyyy-MM-dd HH:mm:ss", Arrays.asList("transaction_time")); try { @@ -1321,13 +1316,13 @@ public class TradeLogServiceImpl implements TradeLogService { scaleDecimalVal(item, "settle_amount", platformCurrency); scaleDecimalVal(item, "total_surcharge", platformCurrency); scaleDecimalVal(item, "transaction_amount", platformCurrency); - item.put("exchange_rate", item.getBigDecimal("exchange_rate").setScale(5, BigDecimal.ROUND_DOWN)); - item.put("gateway" , item.getInteger("gateway") == null ? "-" : TradeType.fromGatewayNumber(item.getIntValue("gateway")).getTradeType()); - item.put("rate", item.getBigDecimal("rate") == null? "-": item.getBigDecimal("rate").toPlainString() + "%"); + item.put("exchange_rate", item.getBigDecimal("exchange_rate").setScale(5, RoundingMode.DOWN)); + item.put("gateway", item.getInteger("gateway") == null ? "-" : TradeType.fromGatewayNumber(item.getIntValue("gateway")).getTradeType()); + item.put("rate", item.getBigDecimal("rate") == null ? "-" : item.getBigDecimal("rate").toPlainString() + "%"); }); JRDataSource jrDataSource = new JRBeanCollectionDataSource(settlementLogDetailList); response.setContentType("application/pdf"); - String fileName = partner.getString("client_moniker") + "_" + parmerters.getString("dateRange").replaceAll("/", ""); + String fileName = partner.getString("client_moniker") + "_" + parmerters.getString("dateRange").replace("/", ""); response.setHeader("Content-Disposition", "attachment;fileName=" + fileName + ".pdf"); OutputStream outs = response.getOutputStream(); byte[] bytes = JasperRunManager.runReportToPdf(partner_settlement_flow.getInputStream(), parmerters, jrDataSource); @@ -1342,92 +1337,105 @@ public class TradeLogServiceImpl implements TradeLogService { @Override public void exportExcelAllPartner(TradeLogQuery query, JSONObject partner, HttpServletResponse resp) throws Exception { logger.debug("excel The method======= exportExcel() start......................."); - int client_id = partner.getIntValue("client_id"); + int clientId1 = partner.getIntValue("client_id"); String timezone = partner.getJSONObject("client").getString("timezone"); JSONObject params = query.toParams(timezone); - clientManager.validateClients(client_id, params); - params.put("client_id", client_id); + clientManager.validateClients(clientId1, params); + params.put("client_id", clientId1); List logs = transactionMapper.listTransFlow(params); - TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Arrays.asList("transaction_time")); - if (logs.size() > 0) { + TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Collections.singletonList("transaction_time")); + TimeZoneUtils.switchTimeZoneToString(logs, TimeZone.getDefault().getID(), "dd/MM/yyyy", Collections.singletonList("clearing_time")); + if (!logs.isEmpty()) { OutputStream ous = null; String transType; int status; - HSSFWorkbook wb = new HSSFWorkbook(); - Font font = wb.createFont(); - font.setBoldweight(Font.BOLDWEIGHT_BOLD); - font.setFontHeightInPoints((short) 10); - CellStyle analysisStyle = wb.createCellStyle(); - analysisStyle.setFont(font); - String[] clientIds = query.getClient_ids(); - List clientIdList = new ArrayList<>(); - clientIdList.add("ALL"); - if (clientIds.length >= 2) { - clientIdList.addAll(Arrays.asList(clientIds)); - } - HSSFSheet sheet = null; - JSONObject client = null; - JSONObject device = null; - String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency(); - for (String clientId : clientIdList) { - if ("ALL".equals(clientId)) { - sheet = wb.createSheet(clientId); - } else { - client = clientManager.getClientInfo(Integer.parseInt(clientId)); - sheet = wb.createSheet(client == null ? clientId : client.getString("client_moniker")); - } - int rowNum = 0; - Row row = sheet.createRow(rowNum); - String[] title = {"Transaction Time", "Client Order ID", "System Order ID", "Client Moniker", "Short Name", "Order ID", "Channel", "Input Amount", "Transaction Amount", "Transaction Currency", "Clearing Amount", "Exchange Rate", - "Transaction Type", "Clearing Status", "Gateway", "Remark", "Dev No"}; - for (int j = 0; j < title.length; j++) { - row.createCell(j, Cell.CELL_TYPE_STRING).setCellValue(title[j]); + try (HSSFWorkbook wb = new HSSFWorkbook()) { + Font font = wb.createFont(); + font.setBoldweight(Font.BOLDWEIGHT_BOLD); + font.setFontHeightInPoints((short) 10); + CellStyle analysisStyle = wb.createCellStyle(); + analysisStyle.setFont(font); + String[] clientIds = query.getClient_ids(); + List clientIdList = new ArrayList<>(); + clientIdList.add("ALL"); + if (clientIds.length >= 2) { + clientIdList.addAll(Arrays.asList(clientIds)); } - if ("ALL".equals(clientId)) { - for (JSONObject log : logs) { - String login_id = log.getString("login_id"); - if (StringUtils.isNotEmpty(login_id)) { - log.put("order_detail", (StringUtils.isEmpty(log.getString("order_detail")) ? "" : login_id+":"+log.getString("order_detail"))); - }else{ - log.put("order_detail", (StringUtils.isEmpty(log.getString("order_detail")) ? "" : log.getString("order_detail"))); - } - transType = log.getString("trans_type"); - if ("refund".equals(transType)) { - status = log.getIntValue("status"); - if (status == 6) - transType = "Partly " + transType; - else if (status == 7) { - transType = "Fully " + transType; + HSSFSheet sheet = null; + JSONObject client = null; + JSONObject device = null; + String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency(); + for (String clientId : clientIdList) { + if ("ALL".equals(clientId)) { + sheet = wb.createSheet(clientId); + } else { + client = clientManager.getClientInfo(Integer.parseInt(clientId)); + sheet = wb.createSheet(client == null ? clientId : client.getString("client_moniker")); + } + int rowNum = 0; + Row row = sheet.createRow(rowNum); + String[] title = {"Transaction Time", "Client Order ID", "System Order ID", "Client Moniker", "Short Name", + "Order ID", "Channel", "Input Amount", "Transaction Amount", "Transaction Currency", "Clearing Amount", + "Settle Amount", "Surcharge", "GST", "Settle Date", "Exchange Rate", + "Transaction Type", "Clearing Status", "Gateway", "Remark", "Dev No"}; + for (int j = 0; j < title.length; j++) { + row.createCell(j, Cell.CELL_TYPE_STRING).setCellValue(title[j]); + } + if ("ALL".equals(clientId)) { + for (JSONObject log : logs) { + String login_id = log.getString("login_id"); + if (StringUtils.isNotEmpty(login_id)) { + log.put("order_detail", (StringUtils.isEmpty(log.getString("order_detail")) ? "" : login_id + ":" + log.getString("order_detail"))); + } else { + log.put("order_detail", (StringUtils.isEmpty(log.getString("order_detail")) ? "" : log.getString("order_detail"))); + } + transType = log.getString("trans_type"); + if ("refund".equals(transType)) { + status = log.getIntValue("status"); + if (status == 6) + transType = "Partly " + transType; + else if (status == 7) { + transType = "Fully " + transType; + } + log.put("trans_type", transType); + device = clientDeviceMapper.find(log.getString("order_dev_id")); + if (device != null) + log.put("dev_id", device.getString("client_dev_id")); } - log.put("trans_type", transType); - device = clientDeviceMapper.find(log.getString("order_dev_id")); - if (device != null) - log.put("dev_id", device.getString("client_dev_id")); + scaleDecimalVal(log, "display_amount", platformCurrency); + scaleDecimalVal(log, "transaction_amount", platformCurrency); + scaleDecimalVal(log, "clearing_amount", platformCurrency); + scaleDecimalVal(log, "settle_amount", platformCurrency); + scaleDecimalVal(log, "total_surcharge", platformCurrency); + scaleDecimalVal(log, "tax_amount", platformCurrency); + row = sheet.createRow(++rowNum); + excelTrans(row, log); + } + } else { + List logsByClientId = logs.stream().filter(log -> log.getString("client_id").equals(clientId)).collect(Collectors.toList()); + for (JSONObject log : logsByClientId) { + scaleDecimalVal(log, "display_amount", platformCurrency); + scaleDecimalVal(log, "transaction_amount", platformCurrency); + scaleDecimalVal(log, "clearing_amount", platformCurrency); + scaleDecimalVal(log, "settle_amount", platformCurrency); + scaleDecimalVal(log, "total_surcharge", platformCurrency); + scaleDecimalVal(log, "tax_amount", platformCurrency); + row = sheet.createRow(++rowNum); + excelTrans(row, log); } - scaleDecimalVal(log, "display_amount", platformCurrency); - scaleDecimalVal(log, "transaction_amount", platformCurrency); - scaleDecimalVal(log, "clearing_amount", platformCurrency); - row = sheet.createRow(++rowNum); - excelTrans(row, log); - } - } else { - List logsByClientId = logs.stream().filter(log -> log.getString("client_id").equals(clientId)).collect(Collectors.toList()); - for (JSONObject log : logsByClientId) { - row = sheet.createRow(++rowNum); - excelTrans(row, log); } } - } - resp.setContentType("application/octet-stream;"); - resp.addHeader("Content-Disposition", - "attachment; filename=" + query.getDatefrom() + "_" + query.getDateto() + ".xls"); - ous = resp.getOutputStream(); - try { - wb.write(ous); - ous.close(); - } catch (Exception e) { - e.printStackTrace(); + resp.setContentType("application/octet-stream;"); + resp.addHeader("Content-Disposition", + "attachment; filename=" + query.getDatefrom() + "_" + query.getDateto() + ".xls"); + ous = resp.getOutputStream(); + try { + wb.write(ous); + ous.close(); + } catch (Exception e) { + e.printStackTrace(); + } } } } From f85e3e533463ced82729b0f54a33e2c308b2d07f Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 11 Nov 2019 19:08:35 +0800 Subject: [PATCH 32/33] documents update --- src/document/cn/apis.js | 4 ++++ src/document/en/apis.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/document/cn/apis.js b/src/document/cn/apis.js index fb38635bd..b64cbb268 100644 --- a/src/document/cn/apis.js +++ b/src/document/cn/apis.js @@ -591,6 +591,9 @@ * @apiSuccess (transactions) {int} input_amount 订单输入金额,单位是货币最小单位 * @apiSuccess (transactions) {int} customer_payment_amount 用户实际支付金额,单位是货币最小单位 * @apiSuccess (transactions) {int} settle_amount 结算金额,币种为AUD,单位是货币最小单位 + * @apiSuccess (transactions) {int} transfer_amount 打款金额(结算金额-手续费-GST),币种为AUD,单位是货币最小单位 + * @apiSuccess (transactions) {int} surcharge 手续费,币种为AUD,单位是货币最小单位 + * @apiSuccess (transactions) {int} gst GST金额,币种为AUD,单位是货币最小单位 * @apiSuccess (transactions) {double} exchange_rate 使用汇率 * @apiSuccess (transactions) {String} remark 备注 * @@ -655,6 +658,7 @@ * @apiSuccess (transactions) {int} settle_amount 结算金额,单位是AUD分 * @apiSuccess (transactions) {String} surcharge_rate 手续费费率(x%) * @apiSuccess (transactions) {int} surcharge 手续费金额,单位是AUD分 + * @apiSuccess (transactions) {int} gst GST金额,单位是AUD分 * @apiSuccess (transactions) {int} transfer_amount 打款金额,单位是AUD分 * @apiSuccess (transactions) {double} exchange_rate 使用汇率 * @apiSuccess (transactions) {String} remark 备注 diff --git a/src/document/en/apis.js b/src/document/en/apis.js index 11108a57c..00fae5eee 100644 --- a/src/document/en/apis.js +++ b/src/document/en/apis.js @@ -600,6 +600,9 @@ * @apiSuccess (transactions) {int} total_amount Total payment amount, which uses the base unit of order currency * @apiSuccess (transactions) {int} input_amount Order input amount, which uses the base unit of order currency * @apiSuccess (transactions) {int} settle_amount Settle amount, AUD cents + * @apiSuccess (transactions) {int} transfer_amount Final settle amount(settle amount - surcharge - gst), AUD cents + * @apiSuccess (transactions) {int} surcharge surcharge, AUD cents + * @apiSuccess (transactions) {int} gst GST, AUD cents * @apiSuccess (transactions) {double} exchange_rate Using exchange rate * @apiSuccess (transactions) {String} remark Remark * @@ -665,6 +668,7 @@ * @apiSuccess (transactions) {int} settle_amount Amount to make settlement, AUD cents * @apiSuccess (transactions) {String} surcharge_rate Rate of surcharge (x%) * @apiSuccess (transactions) {int} surcharge Surcharge amount, AUD cents + * @apiSuccess (transactions) {int} gst GST, AUD cents * @apiSuccess (transactions) {int} transfer_amount Amount send to merchant's bank account, AUD cents * @apiSuccess (transactions) {double} exchange_rate Using exchange rate * @apiSuccess (transactions) {String} remark Remark From f4834125cc51b8a8cddb8d83aa9ac0a1e919bca9 Mon Sep 17 00:00:00 2001 From: duLingLing Date: Mon, 11 Nov 2019 21:17:35 +0800 Subject: [PATCH 33/33] =?UTF-8?q?Upd:=E6=B7=BB=E5=8A=A0Gateway=E5=AD=90?= =?UTF-8?q?=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../manage/tradelog/beans/TradeLogQuery.java | 10 ++ .../core/impls/TradeLogServiceImpl.java | 6 + .../static/payment/partner/partner-manage.js | 27 +++ .../partner/templates/partner_pay_logs.html | 26 ++- .../templates/partner_trade_logs.html | 26 ++- .../tradelog/templates/trade_logs.html | 159 +++++++++++++----- .../payment/tradelog/tradelog-manage.js | 28 +++ .../ui/static/payment/tradelog/tradelog.js | 27 +++ 9 files changed, 261 insertions(+), 50 deletions(-) diff --git a/pom.xml b/pom.xml index 108bb5286..f4271e834 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 1.2.81 + 1.2.82 UTF-8 1.4.0 diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java index 827cb9ec2..f2c40c9b2 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/beans/TradeLogQuery.java @@ -40,6 +40,16 @@ public class TradeLogQuery { private String org_id; private String org_id2; + public Integer getGatewayChild() { + return gatewayChild; + } + + public void setGatewayChild(Integer gatewayChild) { + this.gatewayChild = gatewayChild; + } + + private Integer gatewayChild; + public JSONObject toParams(String timezone) { JSONObject params = new JSONObject(); if (datefrom != null) { diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java index f35d166ae..f728f5350 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java @@ -149,6 +149,9 @@ public class TradeLogServiceImpl implements TradeLogService { if (manager != null && manager.getInteger("org_id") != null) { params.put("org_id", manager.getIntValue("org_id")); } + if(query.getGatewayChild()!=null){ + params.put("trade_type",new ArrayList(){{add(query.getGatewayChild());}}); + } PageList logs = orderMapper.listOrdersByClients(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); if (timezone != null) { @@ -182,6 +185,9 @@ public class TradeLogServiceImpl implements TradeLogService { } } orgManager.checkOrgIds(manager, params); + if(query.getGatewayChild()!=null){ + params.put("trade_type",new ArrayList(){{add(query.getGatewayChild());}}); + } PageList logs = orderMapper.listOrders(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("create_time.desc"))); JSONObject result = PageListUtils.buildPageListResult(logs); JSONObject analysis = orderMapper.analysisOrders(params); diff --git a/src/main/ui/static/payment/partner/partner-manage.js b/src/main/ui/static/payment/partner/partner-manage.js index 85db1cb62..7021bc4e5 100644 --- a/src/main/ui/static/payment/partner/partner-manage.js +++ b/src/main/ui/static/payment/partner/partner-manage.js @@ -3351,6 +3351,28 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter params.dateto = $filter('date')(params.dateto, 'yyyyMMdd'); } params.page = page || $scope.pagination.page || 1; + if(params.gateway){ + if((params.gateway.sort().toString()!=[0,1].toString()) && (params.gateway.sort().toString()!=[5,6].toString())){ + delete params.gatewayChilds; + delete params.gatewayChild; + } + if(params.gatewayChilds){ + var exist = false + params.gatewayChilds.forEach(function (child) { + if(child==params.gatewayChild){ + exist = true + } + }) + if(!exist){ + params.gatewayChild = null + } + }else{ + delete params.gatewayChild; + } + }else{ + delete params.gatewayChilds; + delete params.gatewayChild; + } $http.get('/sys/partners/' + $scope.partner.client_moniker + '/trade_logs', {params: params}).then(function (resp) { $scope.tradeLogs = resp.data.data; $scope.pagination = resp.data.pagination; @@ -3358,6 +3380,11 @@ define(['angular', 'decimal', 'static/commons/commons', 'uiBootstrap', 'uiRouter }); }; + $scope.initGatewayChild = function(){ + $scope.params.gatewayChilds = $scope.params.gateway; + $scope.params.gatewayChild=null; + $scope.loadTradeLogs(1); + } $scope.gatewaySelected = function (arr) { return $scope.params.gateway != null && $scope.params.gateway.filter(function (gateway) { return arr.indexOf(gateway) >= 0 diff --git a/src/main/ui/static/payment/partner/templates/partner_pay_logs.html b/src/main/ui/static/payment/partner/templates/partner_pay_logs.html index 7152f1475..c9d3dcb5c 100644 --- a/src/main/ui/static/payment/partner/templates/partner_pay_logs.html +++ b/src/main/ui/static/payment/partner/templates/partner_pay_logs.html @@ -42,9 +42,9 @@ All | Retail In-Store | + ng-click="params.gateway=[0,1];initGatewayChild()">Retail In-Store | Retail API | + ng-click="params.gateway=[5,6];initGatewayChild()">Retail API | QR Code |
+
diff --git a/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html b/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html index 870e70a7a..8b1c3f72b 100644 --- a/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html +++ b/src/main/ui/static/payment/tradelog/templates/partner_trade_logs.html @@ -160,9 +160,9 @@ All | Retail In-Store | + ng-click="params.gateway=[0,1];initGatewayChild()">Retail In-Store | Retail API | + ng-click="params.gateway=[5,6];initGatewayChild()">Retail API | QR Code |
+
diff --git a/src/main/ui/static/payment/tradelog/templates/trade_logs.html b/src/main/ui/static/payment/tradelog/templates/trade_logs.html index e51704979..5b33d2b14 100644 --- a/src/main/ui/static/payment/tradelog/templates/trade_logs.html +++ b/src/main/ui/static/payment/tradelog/templates/trade_logs.html @@ -1,26 +1,32 @@