From 6e8608209d1ead89110245543e7ef1569ec83a93 Mon Sep 17 00:00:00 2001 From: yixian Date: Thu, 20 May 2021 22:38:41 +0800 Subject: [PATCH 01/12] card view --- src/main/ui/static/templates/payment/v1/card_pay.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/ui/static/templates/payment/v1/card_pay.js b/src/main/ui/static/templates/payment/v1/card_pay.js index 2cbd7be32..4c2979b03 100644 --- a/src/main/ui/static/templates/payment/v1/card_pay.js +++ b/src/main/ui/static/templates/payment/v1/card_pay.js @@ -25,6 +25,7 @@ $(function () { if (msg.success) { location.href = './result' } else { + ctrl.pending = false; $errorMsgBox.text('[' + evt.errCode + ']' + evt.errMsg).show(); } $('.threeds-container').addClass('hide'); From 2c9788643957d4d9075f5782b6858907194bf836 Mon Sep 17 00:00:00 2001 From: yixian Date: Thu, 20 May 2021 22:41:23 +0800 Subject: [PATCH 02/12] card view --- src/main/ui/static/templates/payment/v1/card_pay.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/ui/static/templates/payment/v1/card_pay.js b/src/main/ui/static/templates/payment/v1/card_pay.js index 4c2979b03..8975a1efe 100644 --- a/src/main/ui/static/templates/payment/v1/card_pay.js +++ b/src/main/ui/static/templates/payment/v1/card_pay.js @@ -26,7 +26,7 @@ $(function () { location.href = './result' } else { ctrl.pending = false; - $errorMsgBox.text('[' + evt.errCode + ']' + evt.errMsg).show(); + $errorMsgBox.text('[' + msg.errCode + ']' + msg.errMsg).show(); } $('.threeds-container').addClass('hide'); } From b98c423e6992c4a9958b402b57c465ff9b7545cc Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 28 May 2021 10:05:42 +0800 Subject: [PATCH 03/12] RELEASE --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bc28e6d54..f5a3ce2d2 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ 4.0.0 manage - 2.3.87-SNAPSHOT + 2.3.87 UTF-8 2.4.0 From 70d1c78885f27cc0d44b59a165d4bfcb07c70c2a Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 31 May 2021 14:08:12 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E6=92=A4=E5=9B=9E=E6=B8=85=E7=AE=97?= =?UTF-8?q?=E4=B8=8A=E9=94=81=20=E6=B8=85=E7=AE=97=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clearing/core/impl/CleanServiceImpl.java | 31 ++++++++++++------- .../partner/templates/partner_settlement.html | 2 +- .../templates/partner_settlement_logs.html | 2 +- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index e6e295462..4d7667f47 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -1649,20 +1649,27 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider if (!log.getBooleanValue("editable")) { throw new ForbiddenException("Settlement log has been sent and unable to edit"); } - List details = clearingDetailMapper.listReportsOfSettlement(clearingId); - List detailsWithDistributedSurcharge = details.stream().filter(detail -> detail.getBigDecimal("distributed_surcharge").compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList()); - if (!detailsWithDistributedSurcharge.isEmpty()) { - for (JSONObject detail : detailsWithDistributedSurcharge) { - releaseDistributedSurcharge(detail); + if (!locker.lock("settle_task", 3600_000)) { + throw new ServerErrorException("Settle Task Running!"); + } + try { + List details = clearingDetailMapper.listReportsOfSettlement(clearingId); + List detailsWithDistributedSurcharge = details.stream().filter(detail -> detail.getBigDecimal("distributed_surcharge").compareTo(BigDecimal.ZERO) > 0).collect(Collectors.toList()); + if (!detailsWithDistributedSurcharge.isEmpty()) { + for (JSONObject detail : detailsWithDistributedSurcharge) { + releaseDistributedSurcharge(detail); + } } + transactionMapper.deleteSettlementTransaction(clearingId); + transactionMapper.removeSettleRemark(clearingId); + preSettleTaskMapper.resetClearStatus(clearingId); + clearingDetailAnalysisMapper.clearAnalysis(clearingId); + taskManualSettleMapper.rollbackExecutedTask(clearingId); + clearingDetailMapper.deleteSettleLogs(clearingId); + clearingLogMapper.deleteSettleLogs(clearingId); + }finally { + locker.unlock("settle_task"); } - transactionMapper.deleteSettlementTransaction(clearingId); - transactionMapper.removeSettleRemark(clearingId); - preSettleTaskMapper.resetClearStatus(clearingId); - clearingDetailAnalysisMapper.clearAnalysis(clearingId); - taskManualSettleMapper.rollbackExecutedTask(clearingId); - clearingDetailMapper.deleteSettleLogs(clearingId); - clearingLogMapper.deleteSettleLogs(clearingId); } @Override diff --git a/src/main/ui/static/payment/partner/templates/partner_settlement.html b/src/main/ui/static/payment/partner/templates/partner_settlement.html index a455f5aa6..27f1ce4e7 100644 --- a/src/main/ui/static/payment/partner/templates/partner_settlement.html +++ b/src/main/ui/static/payment/partner/templates/partner_settlement.html @@ -231,7 +231,7 @@ {{log.report_date|limitTo:10}} -   +   diff --git a/src/main/ui/static/payment/tradelog/templates/partner_settlement_logs.html b/src/main/ui/static/payment/tradelog/templates/partner_settlement_logs.html index 906f5cd97..3ede5d21a 100644 --- a/src/main/ui/static/payment/tradelog/templates/partner_settlement_logs.html +++ b/src/main/ui/static/payment/tradelog/templates/partner_settlement_logs.html @@ -284,7 +284,7 @@ {{log.clearing_time|limitTo:10}} -   +   Card Payment From f548bb7ce3ec11c14e1e18e5bd91c1ec8858cf57 Mon Sep 17 00:00:00 2001 From: yixian Date: Mon, 31 May 2021 14:46:32 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E5=BE=85=E6=B8=85=E7=AE=97=E6=A0=87?= =?UTF-8?q?=E8=AE=B0=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/impls/RetailAppServiceImp.java | 9 ++------- .../merchants/core/impls/ClientManagerImpl.java | 16 +++------------- .../core/impls/TradeLogServiceImpl.java | 17 +++-------------- .../manage/mappers/log/ClearingDetailMapper.xml | 12 +++++++----- .../mappers/payment/TransactionMapper.xml | 2 +- 5 files changed, 16 insertions(+), 40 deletions(-) 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 b0e474a75..80284ba35 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 @@ -851,14 +851,9 @@ public class RetailAppServiceImp implements RetailAppService { PageList logs = clearingDetailMapper.listClientSettlementLog(params, new PageBounds(appQueryBean.getPage(), appQueryBean.getLimit(), Order.formString("report_date.desc"))); logs.forEach(log -> log.put("total_charge", log.getBigDecimal("total_charge").add(log.getBigDecimal("tax_amount")))); + logs.forEach(log -> log.put("padding", log.getBooleanValue("editable"))); JSONObject result = PageListUtils.buildPageListResult(logs); - if (appQueryBean.getPage() == 1 && !logs.isEmpty()) { - JSONObject clearingLog = clearingLogMapper.findById(logs.get(0).getIntValue("clearing_id")); - if (clearingLog.getBooleanValue("editable")) { - result.put("padding", true); - logs.get(0).put("padding", true); - } - } + result.put("padding", logs.stream().anyMatch(log -> log.getBooleanValue("editable"))); return result; } 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 00d205680..3249041fa 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 @@ -4119,20 +4119,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid } PageList logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc"))); + logs.forEach(log -> log.put("padding", log.getBooleanValue("editable"))); JSONObject result = PageListUtils.buildPageListResult(logs); - if (query.getPage() == 1) { - if (!logs.isEmpty()) { - JSONObject clearingDetail = clearingDetailMapper.findByDetailId(logs.get(0).getIntValue("clear_detail_id")); - if (clearingDetail != null) { - JSONObject clearingLog = clearingLogMapper.findById(clearingDetail.getIntValue("clearing_id")); - if (clearingLog.getBooleanValue("editable")) { - result.put("padding", true); - logs.get(0).put("padding", true); - logger.info("##editable{}", clearingLog.getBooleanValue("editable")); - } - } - } - } + result.put("padding", logs.stream().anyMatch(log->log.getBooleanValue("editable"))); + logger.info("##editable{}", result.getBooleanValue("padding")); return result; } 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 25761287b..0ec3dff0f 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 @@ -1425,21 +1425,10 @@ public class TradeLogServiceImpl implements TradeLogService { } PageList logs = transactionMapper.listSettlementLog(params, new PageBounds(query.getPage(), query.getLimit(), Order.formString("clearing_time.desc"))); + logs.forEach(log -> log.put("padding", log.getBooleanValue("editable"))); result.putAll(PageListUtils.buildPageListResult(logs)); - if (query.getPage() == 1) { - if (!logs.isEmpty()) { - JSONObject clearingDetail = clearingDetailMapper.findByDetailId(logs.get(0).getIntValue("clear_detail_id")); - if (clearingDetail != null) { - JSONObject clearingLog = clearingLogMapper.findById(clearingDetail.getIntValue("clearing_id")); - - if (clearingLog.getBooleanValue("editable")) { - result.put("padding", true); - logs.get(0).put("padding", true); - logger.info("##editable{}", clearingLog.getBooleanValue("editable")); - } - } - } - } + result.put("padding", logs.stream().anyMatch(log -> log.getBooleanValue("editable"))); + logger.info("##editable{}", result.getBooleanValue("padding")); return result; } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.xml index 8444788cb..31ff6d0d7 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/log/ClearingDetailMapper.xml @@ -91,11 +91,13 @@