master
yuan 6 years ago
parent 07b0241aed
commit f3096930e2

@ -70,53 +70,7 @@ public class CustomersAnalysisServiceImp implements CustomersAnalysisService {
@Override @Override
public JSONObject getChannelAmountAnalysis(JSONObject params) { public JSONObject getChannelAmountAnalysis(JSONObject params) {
JSONObject result = new JSONObject(); return customerAndOrdersStatisticsMapper.getChannelCommonCount(params);
// params.put("client_id",0);
params.put("channel", "Wechat");
JSONObject wechatPayAmount = customerAndOrdersStatisticsMapper.getSumCustomersChannelAnalysis(params);
if (wechatPayAmount != null) {
result.put("wechatPayAmount", wechatPayAmount.getBigDecimal("total_amount"));
} else {
result.put("wechatPayAmount", 0.00);
}
params.put("channel", "Bestpay");
JSONObject bestPayAmount = customerAndOrdersStatisticsMapper.getSumCustomersChannelAnalysis(params);
if (bestPayAmount != null) {
result.put("bestPayAmount", bestPayAmount.getBigDecimal("total_amount"));
} else {
result.put("bestPayAmount", 0.00);
}
params.put("channel", "Alipay");
JSONObject aliPayAmount = customerAndOrdersStatisticsMapper.getSumCustomersChannelAnalysis(params);
if (aliPayAmount != null) {
result.put("aliPayAmount", aliPayAmount.getBigDecimal("total_amount"));
} else {
result.put("aliPayAmount", 0.00);
}
params.put("channel", "jd");
JSONObject jdPayAmount = customerAndOrdersStatisticsMapper.getSumCustomersChannelAnalysis(params);
if (jdPayAmount != null) {
result.put("jdPayAmount", jdPayAmount.getBigDecimal("total_amount"));
} else {
result.put("jdPayAmount", 0.00);
}
params.put("channel", "AlipayOnline");
JSONObject aliOnlineAmount = customerAndOrdersStatisticsMapper.getSumCustomersChannelAnalysis(params);
if (aliOnlineAmount != null) {
result.put("aliOnlineAmount", aliOnlineAmount.getBigDecimal("total_amount"));
} else {
result.put("aliOnlineAmount", 0.00);
}
params.put("channel", "hf");
JSONObject hfPayAmount = customerAndOrdersStatisticsMapper.getSumCustomersChannelAnalysis(params);
if (hfPayAmount != null) {
result.put("hfPayAmount", hfPayAmount.getBigDecimal("total_amount"));
} else {
result.put("hfPayAmount", 0.00);
}
return result;
} }
@Override @Override

@ -322,8 +322,16 @@
]]> ]]>
<where> <where>
s.client_id != 0 s.client_id != 0
<if test="begin!=null">and s.date &gt;= #{begin}</if> <if test="bd_group!=null">and c.client_id in
<if test="end!=null">and s.date &lt;= #{end}</if> (SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
where b.is_valid=1 and b.start_date&lt;=now() and (b.end_date is null or b.end_date &gt;= now())
AND (c.bd_group=#{bd_group} or c.manager_id=#{bd_group})
<if test="bd_group_bd">and c.manager_id=#{bd_group_bd}</if>
)
</if>
<if test="begin!=null">and s.date &gt;= #{begin} </if>
<if test="end!=null">and s.date &lt; #{end}</if>
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if> <if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
<if test="org_ids!=null">and c.org_id in <if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if> <foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>

@ -52,10 +52,10 @@
datepicker-options="{minDate:params.begin,maxDate:today}"> datepicker-options="{minDate:params.begin,maxDate:today}">
</div> </div>
<div class="btn-group"> <!--<div class="btn-group">
<a role="button" class="btn btn-default btn-sm" <a role="button" class="btn btn-default btn-sm"
ng-click="chooseToday()">Today</a> ng-click="chooseToday()">Today</a>
</div> </div>-->
<div class="btn-group"> <div class="btn-group">
<a role="button" class="btn btn-default btn-sm" <a role="button" class="btn btn-default btn-sm"
ng-click="chooseYesterday()">Yesterday</a> ng-click="chooseYesterday()">Yesterday</a>
@ -143,7 +143,7 @@
<div class="description-header text-bold"><img src="/static/images/wechatpay_sign.png"/>Wechat</div> <div class="description-header text-bold"><img src="/static/images/wechatpay_sign.png"/>Wechat</div>
<div class="description-text"> <div class="description-text">
<label class="description-text text-red" <label class="description-text text-red"
ng-bind="totalChannelAmount.wechatPayAmount|currency: ' $ '"></label> ng-bind="totalChannelAmount.wechatamount|currency: ' $ '"></label>
</div> </div>
</div> </div>
@ -153,7 +153,7 @@
<div class="description-text"> <div class="description-text">
<div class="description-header text-bold"><img src="/static/images/bestpay_sign.png"/>Bestpay</div> <div class="description-header text-bold"><img src="/static/images/bestpay_sign.png"/>Bestpay</div>
<label class="description-text text-red" <label class="description-text text-red"
ng-bind="totalChannelAmount.bestPayAmount|currency: ' $ '"></label> ng-bind="totalChannelAmount.bestpayamount|currency: ' $ '"></label>
</div> </div>
</div> </div>
@ -163,7 +163,7 @@
<div class="description-header text-bold"><img src="/static/images/alipay_sign.png"/>Alipay</div> <div class="description-header text-bold"><img src="/static/images/alipay_sign.png"/>Alipay</div>
<div class="description-text text-red"> <div class="description-text text-red">
<label class="description-text" <label class="description-text"
ng-bind="totalChannelAmount.aliPayAmount|currency: ' $ '"></label> ng-bind="totalChannelAmount.alipayamount|currency: ' $ '"></label>
</div> </div>
</div> </div>
@ -173,7 +173,7 @@
<div class="description-header text-bold"><img src="/static/images/alipay_sign.png"/>AlipayOnline</div> <div class="description-header text-bold"><img src="/static/images/alipay_sign.png"/>AlipayOnline</div>
<div class="description-text text-red"> <div class="description-text text-red">
<label class="description-text" <label class="description-text"
ng-bind="totalChannelAmount.aliOnlineAmount|currency: ' $ '"></label> ng-bind="totalChannelAmount.alipayonlineamount|currency: ' $ '"></label>
</div> </div>
</div> </div>
@ -183,7 +183,7 @@
<div class="description-header text-bold"><img src="/static/images/jd_sign.png"/>JD Pay</div> <div class="description-header text-bold"><img src="/static/images/jd_sign.png"/>JD Pay</div>
<div class="description-text text-red"> <div class="description-text text-red">
<label class="description-text" <label class="description-text"
ng-bind="totalChannelAmount.jdPayAmount|currency: ' $ '"></label> ng-bind="totalChannelAmount.jdamount|currency: ' $ '"></label>
</div> </div>
</div> </div>
@ -193,7 +193,7 @@
<div class="description-header text-bold"><img src="/static/images/hf_sign.png"/>HF Pay</div> <div class="description-header text-bold"><img src="/static/images/hf_sign.png"/>HF Pay</div>
<div class="description-text text-red"> <div class="description-text text-red">
<label class="description-text" <label class="description-text"
ng-bind="totalChannelAmount.hfPayAmount|currency: ' $ '"></label> ng-bind="totalChannelAmount.hfamount|currency: ' $ '"></label>
</div> </div>
</div> </div>
</div> </div>

@ -103,7 +103,7 @@
<div class="description-header text-bold"><img src="/static/images/wechatpay_sign.png"/>Wechat</div> <div class="description-header text-bold"><img src="/static/images/wechatpay_sign.png"/>Wechat</div>
<div class="description-text"> <div class="description-text">
<label class="description-text text-red" <label class="description-text text-red"
ng-bind="totalChannelAmount.wechatPayAmount|currency: ' $ '"></label> ng-bind="totalChannelAmount.wechatamount|currency: ' $ '"></label>
</div> </div>
</div> </div>
@ -113,7 +113,7 @@
<div class="description-text"> <div class="description-text">
<div class="description-header text-bold"><img src="/static/images/bestpay_sign.png"/>Bestpay</div> <div class="description-header text-bold"><img src="/static/images/bestpay_sign.png"/>Bestpay</div>
<label class="description-text text-red" <label class="description-text text-red"
ng-bind="totalChannelAmount.bestPayAmount|currency: ' $ '"></label> ng-bind="totalChannelAmount.bestpayamount|currency: ' $ '"></label>
</div> </div>
</div> </div>
@ -123,7 +123,7 @@
<div class="description-header text-bold"><img src="/static/images/alipay_sign.png"/>Alipay</div> <div class="description-header text-bold"><img src="/static/images/alipay_sign.png"/>Alipay</div>
<div class="description-text"> <div class="description-text">
<label class="description-text text-red" <label class="description-text text-red"
ng-bind="totalChannelAmount.aliPayAmount|currency: ' $ '"></label> ng-bind="totalChannelAmount.alipayamount|currency: ' $ '"></label>
</div> </div>
</div> </div>
@ -133,7 +133,7 @@
<div class="description-header text-bold"><img src="/static/images/alipay_sign.png"/>AlipayOnline</div> <div class="description-header text-bold"><img src="/static/images/alipay_sign.png"/>AlipayOnline</div>
<div class="description-text"> <div class="description-text">
<label class="description-text text-red" <label class="description-text text-red"
ng-bind="totalChannelAmount.aliOnlineAmount|currency: ' $ '"></label> ng-bind="totalChannelAmount.alipayonlineamount|currency: ' $ '"></label>
</div> </div>
</div> </div>
@ -143,7 +143,7 @@
<div class="description-header text-bold"><img src="/static/images/jd_sign.png"/>JD Pay</div> <div class="description-header text-bold"><img src="/static/images/jd_sign.png"/>JD Pay</div>
<div class="description-text"> <div class="description-text">
<label class="description-text text-red" <label class="description-text text-red"
ng-bind="totalChannelAmount.jdPayAmount|currency: ' $ '"></label> ng-bind="totalChannelAmount.jdamount|currency: ' $ '"></label>
</div> </div>
</div> </div>
@ -153,7 +153,7 @@
<div class="description-header text-bold"><img src="/static/images/hf_sign.png"/>HF Pay</div> <div class="description-header text-bold"><img src="/static/images/hf_sign.png"/>HF Pay</div>
<div class="description-text"> <div class="description-text">
<label class="description-text text-red" <label class="description-text text-red"
ng-bind="totalChannelAmount.hfPayAmount|currency: ' $ '"></label> ng-bind="totalChannelAmount.hfamount|currency: ' $ '"></label>
</div> </div>
</div> </div>
</div> </div>

@ -67,7 +67,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
params.begin = $filter('date')(new Date(), 'yyyyMMdd'); params.begin = $filter('date')(new Date(), 'yyyyMMdd');
} }
if (params.end) { if (params.end) {
params.end = $filter('date')(params.end, 'yyyyMMdd'); params.end = $filter('date')(params.end.setMonth(params.end.getMonth()+1), 'yyyyMMdd');
} else { } else {
params.end = $filter('date')(new Date(), 'yyyyMMdd'); params.end = $filter('date')(new Date(), 'yyyyMMdd');
} }

@ -38,7 +38,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
} }
$scope.listTransLogs(); $scope.listTransLogs();
$scope.params = {}; $scope.params = {};
$scope.today = new Date(); $scope.today = new Date(new Date().getTime() - 24*60*60*1000);
if (($scope.currentUser.role & parseInt('1000000000', 2)) > 0 && $scope.currentUser.org_id) { if (($scope.currentUser.role & parseInt('1000000000', 2)) > 0 && $scope.currentUser.org_id) {
$http.get('/sys/manager_accounts/group/group_bds').then(function (resp) { $http.get('/sys/manager_accounts/group/group_bds').then(function (resp) {
@ -74,14 +74,14 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
$scope.doAnalysis(1); $scope.doAnalysis(1);
}; };
$scope.chooseLast7Days = function () { $scope.chooseLast7Days = function () {
$scope.params.end = new Date(); $scope.params.end = new Date(new Date().getTime() - 24*60*60*1000);
var day = new Date(); var day = new Date();
day.setDate(day.getDate() - 7); day.setDate(day.getDate() - 8);
$scope.params.begin = day; $scope.params.begin = day;
$scope.doAnalysis(1); $scope.doAnalysis(1);
}; };
$scope.thisMonth = function () { $scope.thisMonth = function () {
$scope.params.end = new Date(); $scope.params.end = new Date(new Date().getTime() - 24*60*60*1000);
var monthBegin = new Date(); var monthBegin = new Date();
monthBegin.setDate(1); monthBegin.setDate(1);
$scope.params.begin = monthBegin; $scope.params.begin = monthBegin;
@ -98,7 +98,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
$scope.doAnalysis(1); $scope.doAnalysis(1);
}; };
$scope.thisYear = function () { $scope.thisYear = function () {
var yearFinish = new Date(); var yearFinish = new Date(new Date().getTime() - 24*60*60*1000);
$scope.params.end = yearFinish; $scope.params.end = yearFinish;
var currentYearFirstDate = new Date(new Date().getFullYear(), 0, 1); var currentYearFirstDate = new Date(new Date().getFullYear(), 0, 1);
$scope.params.begin = currentYearFirstDate; $scope.params.begin = currentYearFirstDate;

Loading…
Cancel
Save