diff --git a/src/main/java/au/com/royalpay/payment/manage/actchairty/core/ActChairtyService.java b/src/main/java/au/com/royalpay/payment/manage/actchairty/core/ActChairtyService.java index 0a868a187..e94e09f40 100644 --- a/src/main/java/au/com/royalpay/payment/manage/actchairty/core/ActChairtyService.java +++ b/src/main/java/au/com/royalpay/payment/manage/actchairty/core/ActChairtyService.java @@ -17,12 +17,12 @@ public interface ActChairtyService { JSONObject listChairClients(int page, int limit); - void disableClient(String clientMoniker); - List getWeekendAnalysis(JSONObject params); PageList getClientRank(JSONObject params); + JSONObject gettotal(); + 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 ade6ede8b..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 @@ -58,12 +58,6 @@ public class ActChairtyServiceImp implements ActChairtyService { return PageListUtils.buildPageListResult(clients); } - @Override - public void disableClient(String clientMoniker) { - actChairtyMapper.disableClient(clientMoniker); - } - - @Override public List getWeekendAnalysis(JSONObject params) { List result = new ArrayList<>(); @@ -90,6 +84,23 @@ public class ActChairtyServiceImp implements ActChairtyService { return getChairtyWeekRaking; } + @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/actchairty/web/ActChairtyController.java b/src/main/java/au/com/royalpay/payment/manage/actchairty/web/ActChairtyController.java index d041c5e81..cc3ad7daa 100644 --- a/src/main/java/au/com/royalpay/payment/manage/actchairty/web/ActChairtyController.java +++ b/src/main/java/au/com/royalpay/payment/manage/actchairty/web/ActChairtyController.java @@ -42,11 +42,6 @@ public class ActChairtyController { actChairtyService.configClient(clientMoniker, config, manager); } - @ManagerMapping(value = "/clients/{clientMoniker}", method = RequestMethod.DELETE, role = { ManagerRole.ADMIN }) - public void disableClient(@PathVariable String clientMoniker) { - actChairtyService.disableClient(clientMoniker); - } - @ManagerMapping(value = "/traAnalysis", method = RequestMethod.GET, role = { ManagerRole.ADMIN }) public List traAnalysis(ActChairtyQuery params) { return actChairtyService.getWeekendAnalysis(params.params()); @@ -59,4 +54,9 @@ public class ActChairtyController { } return PageListUtils.buildPageListResult(clientRank); } + + @ManagerMapping(value = "/total", method = RequestMethod.GET, role = {ManagerRole.ADMIN}) + public JSONObject getTotal() { + return actChairtyService.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 1515f7fde..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 @@ -23,9 +23,6 @@ public interface ActChairtyMapper { @AutoSql(type = SqlType.INSERT) void save(JSONObject chairtyClient); - @AutoSql(type = SqlType.DELETE) - void disableClient(@Param("client_moniker") String clientMoniker); - PageList chairtyClientNum(PageBounds pageBounds); List getChairtyWeekstartAnalysis(@Param("begin") Date begin, @Param("end") Date end); @@ -34,5 +31,7 @@ public interface ActChairtyMapper { PageList getChairtyWeekRaking(@Param("begin") Date begin, @Param("end") Date end,PageBounds pageBounds); + 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 63a760c86..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,29 +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 pmt_transactions.refund_id is null and pmt_transactions.channel != 'Settlement' GROUP BY act_charity.client_id order by sum_ordernum desc - @@ -36,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/manage.html b/src/main/ui/manage.html index a5e3f5bdb..10872beb9 100644 --- a/src/main/ui/manage.html +++ b/src/main/ui/manage.html @@ -347,10 +347,7 @@ margin-bottom: 10%;"/> 合同签约情况 - -
  • +
  • 半边天公益活动 diff --git a/src/main/ui/static/actchairty/act_chairty.js b/src/main/ui/static/actchairty/act_chairty.js index 19c011b62..7d6af2eb7 100644 --- a/src/main/ui/static/actchairty/act_chairty.js +++ b/src/main/ui/static/actchairty/act_chairty.js @@ -28,11 +28,6 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul $scope.loadClients(); $scope.new_conf = {}; $scope.ctrl = {dateInput: false}; - $scope.disableClient = function (client) { - $http.delete('/actchairty/clients/' + client.client_moniker).then(function () { - $scope.loadClients(); - }); - }; $scope.submitClient = function () { $scope.errmsg = null; var conf = { @@ -80,27 +75,14 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul $http.get('/actchairty/clients', {params: params}).then(function (resp) { $scope.chairtyPartnersRanking = resp.data.data; $scope.total_ranking_pagination = resp.data.pagination; - var amount = 0; - var chairty = 0; - angular.forEach(resp.data.data, function (data) { - amount += parseFloat(data.sum_ordernum); - chairty += parseFloat(data.chairty_num) - return amount,chairty; - }); - $scope.totalAmount = amount; - $scope.totalChairty = Math.round(chairty*100)/100; ; - }) - }; - - - - $scope.getTotalCashBack = function () { - - - + }); + $scope.getTotalAmount = function () { + $http.get('/actchairty/total').then(function (resp) { + $scope.totalAmount = resp.data.amount; + $scope.totalChairty = resp.data.chairty; + }) + }; }; - - $scope.getClientsCashbackRankingByDate = function (date,page) { $scope.event_date = date; var params = {}; @@ -116,9 +98,6 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts'], function (angul } $http.get('/actchairty/ranking', {params: params}).then(function (resp) { $scope.cashbackPartnersRankingByDate = resp.data.data; - if(resp.data.data != null){ - - } $scope.day_ranking_pagination = resp.data.pagination; }); }; @@ -197,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 b66d46696..b08680a38 100644 --- a/src/main/ui/static/actchairty/templates/act_chairty_merchants.html +++ b/src/main/ui/static/actchairty/templates/act_chairty_merchants.html @@ -46,19 +46,15 @@ 订单量 订单金额 捐款额 - Operation - - + + - - -