From 0bbd6b82976d1d002b560d3eb5426f946f9e30fd Mon Sep 17 00:00:00 2001 From: luoyang14z7 <704328506@qq.com> Date: Wed, 11 Jul 2018 10:53:57 +0800 Subject: [PATCH] fix : develop_act_Chairty --- .../core/impls/ActChairtyServiceImp.java | 16 +++++++++++++--- .../manage/mappers/act/ActChairtyMapper.java | 2 +- .../manage/mappers/act/ActChairtyMapper.xml | 10 +++++----- src/main/ui/static/actchairty/act_chairty.js | 2 +- .../templates/act_chairty_merchants.html | 4 ++-- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/actchairty/core/impls/ActChairtyServiceImp.java b/src/main/java/au/com/royalpay/payment/manage/actchairty/core/impls/ActChairtyServiceImp.java index 828693fd4..3aec253af 100644 --- a/src/main/java/au/com/royalpay/payment/manage/actchairty/core/impls/ActChairtyServiceImp.java +++ b/src/main/java/au/com/royalpay/payment/manage/actchairty/core/impls/ActChairtyServiceImp.java @@ -86,9 +86,19 @@ public class ActChairtyServiceImp implements ActChairtyService { @Override public JSONObject gettotal() { - - - + List gettotalnum = actChairtyMapper.chairtyClientNum(); + int amount=0 ; + double chairty=0.00; + for (JSONObject gettotals : gettotalnum) { + amount += gettotals.getIntValue("sum_ordernum"); + chairty += gettotals.getDoubleValue("count_ordernum") * 0.01; + } + BigDecimal bg = new BigDecimal(chairty); + double f1 = bg.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); + JSONObject gettotal = new JSONObject(); + gettotal.put("amount", amount); + gettotal.put("chairty", f1); + return gettotal; } diff --git a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.java b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.java index c90569b57..21de95ebf 100644 --- a/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.java +++ b/src/main/java/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.java @@ -31,7 +31,7 @@ public interface ActChairtyMapper { PageList getChairtyWeekRaking(@Param("begin") Date begin, @Param("end") Date end,PageBounds pageBounds); - List chairtytotalNum(); + List chairtyClientNum(); } diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml index 913072a8b..7ee2fe472 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/act/ActChairtyMapper.xml @@ -6,20 +6,21 @@ select client_moniker,active_time,IFNULL(count(org_id),0) as count_ordernum,ifnu from act_charity left JOIN pmt_transactions on act_charity.client_id = pmt_transactions.client_id and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=act_charity.active_time -and t.refund_id is null and t.channel != 'Settlement' - +and pmt_transactions.refund_id is null and pmt_transactions.channel != 'Settlement' GROUP BY act_charity.client_id order by sum_ordernum desc @@ -27,6 +28,5 @@ GROUP BY act_charity.client_id order by sum_ordernum desc select act_charity.client_moniker,((count(pmt_transactions.org_id)) * 0.01) as chair_ordernum,ifnull(sum(pmt_transactions.transaction_amount),0) as sum_ordernum from act_charity left JOIN pmt_transactions ON act_charity.client_id = pmt_transactions.client_id and pmt_transactions.transaction_type='Credit' and pmt_transactions.transaction_time>=#{begin} and pmt_transactions.transaction_time<=#{end} GROUP BY act_charity.client_moniker order by sum_ordernum desc - \ No newline at end of file diff --git a/src/main/ui/static/actchairty/act_chairty.js b/src/main/ui/static/actchairty/act_chairty.js index 2da9c5473..7d6af2eb7 100644 --- a/src/main/ui/static/actchairty/act_chairty.js +++ b/src/main/ui/static/actchairty/act_chairty.js @@ -176,7 +176,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul $scope.doPartnerTotalRanking(1); }; $scope.doAnalysis(1); - $scope.getTotalCashBack(1); + $scope.getTotalAmount(1); $scope.settleDelayEchart = function (chart) { chart.on('click', function (params) { $scope.cashBack_total_daily = $scope.cashbackDaily[params.dataIndex].chairty_amount; diff --git a/src/main/ui/static/actchairty/templates/act_chairty_merchants.html b/src/main/ui/static/actchairty/templates/act_chairty_merchants.html index 890028d0b..b08680a38 100644 --- a/src/main/ui/static/actchairty/templates/act_chairty_merchants.html +++ b/src/main/ui/static/actchairty/templates/act_chairty_merchants.html @@ -52,8 +52,8 @@ - - + +