From 481fa42eb54ffa59ff6b96f5bb1acfddc38ff984 Mon Sep 17 00:00:00 2001 From: "eason.qian" Date: Fri, 30 Mar 2018 16:46:29 +0800 Subject: [PATCH] fix --- .../appclient/core/impls/RetailAppServiceImp.java | 15 +++++++++++++++ .../manage/mappers/payment/TransactionMapper.xml | 7 ++++++- .../notice/templates/send_notice_dialog.html | 9 +++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) 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 60e64d11d..5007dbe3c 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 @@ -1051,10 +1051,25 @@ public class RetailAppServiceImp implements RetailAppService { throw new BadRequestException("No Transactions in date " + dateStr + " at " + timezone); } TimeZoneUtils.switchTimeZoneToString(transactions, timezone, "HH:mm:ss", Collections.singletonList("transaction_time")); + BigDecimal display_amount = BigDecimal.ZERO; + BigDecimal cny_display_amount = BigDecimal.ZERO; + for (JSONObject transaction:transactions){ + if (PlatformEnvironment.getEnv().getForeignCurrency().equals(transaction.getString("currency"))){ + if ("Credit".equals(transaction.getString("transaction_type"))){ + display_amount = display_amount.add(transaction.getBigDecimal("display_amount")); + } + }else { + if ("Credit".equals(transaction.getString("transaction_type"))){ + cny_display_amount = cny_display_amount.add(transaction.getBigDecimal("cny_display_amount")); + } + } + } JSONObject res = new JSONObject(); res.put("transactions", transactions); JSONObject analysis = transactionMapper.analysisRetailDailyReport(date, to, devId, device.getIntValue("client_id")); analysis.put("date", TimeZoneUtils.formatTime(date, "dd/MMM/yyyy", timezone)); + analysis.put("display_amount",display_amount); + analysis.put("cny_display_amount",cny_display_amount); res.put("analysis", analysis); return res; } catch (ParseException e) { 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 606a52adc..b75e0e4b7 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 @@ -668,7 +668,12 @@ =#{from} and t.transaction_time<#{to} and (t.transaction_type='Credit' or t.refund_id is not null) and t.client_id=#{client_id} diff --git a/src/main/ui/static/config/notice/templates/send_notice_dialog.html b/src/main/ui/static/config/notice/templates/send_notice_dialog.html index 4c0acf836..d21a30e3f 100644 --- a/src/main/ui/static/config/notice/templates/send_notice_dialog.html +++ b/src/main/ui/static/config/notice/templates/send_notice_dialog.html @@ -35,4 +35,13 @@ +
+
+
+
+ We are saving... +
+
\ No newline at end of file