master
yuan 7 years ago
parent 6aaa589ad2
commit 51dc7988f2

@ -231,6 +231,7 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
public JSONObject getCommonAnalysis(JSONObject partner, AnalysisBean partnerAnalysisBean) {
String timezone = partner.getJSONObject("client").getString("timezone");
JSONObject params = partnerAnalysisBean.toParams(timezone);
JSONObject params1 = partnerAnalysisBean.toParams(timezone);
try {
clientManager.validateClients(partner.getIntValue("client_id"), params);
} catch (Exception e) {
@ -240,15 +241,15 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
JSONObject res = new JSONObject();
params.put("client_id", partner.getIntValue("client_id"));
JSONObject today = getTransJSONO(params);
params.put("begin",DateUtils.addDays(params.getDate("begin"),-1));
params.put("end",DateUtils.addDays(params.getDate("end"),-1));
JSONObject yes = getTransJSONO(params);
params1.put("begin",DateUtils.addDays(params1.getDate("begin"),-1));
params1.put("end",DateUtils.addDays(params1.getDate("end"),-1));
JSONObject yes = getTransJSONO(params1);
res.put("today",today);
res.put("yes",yes);
res.put("not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
res.put("trade_amount_rise",yes.getBigDecimal("trade_amount").compareTo(BigDecimal.ZERO)>0 ? (today.getBigDecimal("trade_amount").subtract(yes.getBigDecimal("trade_amount"))).divide(yes.getBigDecimal("trade_amount"), 4, BigDecimal.ROUND_HALF_UP):BigDecimal.ZERO);
res.put("trade_count_rise", yes.getIntValue("trade_count") > 0 ? (today.getBigDecimal("trade_count").subtract(yes.getBigDecimal("trade_count"))).divide(yes.getBigDecimal("trade_count"), 4, BigDecimal.ROUND_HALF_UP) : 0);
res.put("new_customers_rise", yes.getIntValue("new_customers") > 0 ? (today.getBigDecimal("new_customers").subtract(yes.getBigDecimal("new_customers"))).divide(yes.getBigDecimal("new_customers"), 4, BigDecimal.ROUND_HALF_UP) : 0);
res.put("customers_rise", yes.getIntValue("customers") > 0 ? (today.getBigDecimal("customers").subtract(yes.getBigDecimal("customers"))).divide(yes.getBigDecimal("customers"), 4, BigDecimal.ROUND_HALF_UP) : 0);
params.remove("begin");
params.remove("end");
List<JSONObject> logs = transactionMapper.listSettlementLogTotal(params);
@ -260,7 +261,8 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
JSONObject object = transactionAnalysisMapper.getClientTransaction(params);
res.put("trade_amount", object.getBigDecimal("trade_amount"));
res.put("trade_count", object.getIntValue("trade_count"));
res.put("new_customers", transactionAnalysisMapper.countNewCustomers(params));
params.remove("begin");
res.put("customers", transactionAnalysisMapper.countCustomers(params));
return res;
}
@Override

@ -317,9 +317,7 @@
SELECT COUNT(*) FROM (SELECT o.customer_id FROM pmt_transactions t
INNER JOIN pmt_orders o ON o.order_id = t.order_id
]]>
<![CDATA[
WHERE o.create_time >= #{begin} AND o.create_time < #{end}
]]>
<where>
<if test="client_ids!=null">
AND o.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
@ -329,9 +327,12 @@
<if test="client_ids==null and client_id != null">
and o.client_id=#{client_id}
</if>
<if test="begin!=null">and o.create_time &gt;= #{begin}</if>
<if test="end!=null">and o.create_time &lt; #{end}</if>
<if test="org_id!=null and org_ids==null">and o.org_id=#{org_id}</if>
<if test="org_ids!=null">and o.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</where>
<![CDATA[
GROUP BY o.customer_id) p
]]>

@ -232,13 +232,13 @@
<div class="mini-stat clearfix bg-white">
<span class="mini-stat-icon bg-light"><i class="ion ion-person-stalker text-warning"></i></span>
<div class="mini-stat-info text-right text-muted f-14">
<span class="counter text-warning" style="font-size: 24px" ng-bind="transcommon.today.new_customers">5210</span>
New Customers
<span class="counter text-warning" style="font-size: 24px" ng-bind="transcommon.today.customers">5210</span>
Customers
</div>
<p class="mb-0 m-t-20 text-muted">Yesterday: {{transcommon.yes.new_customers}} <span class="pull-right" ng-class="{'text-red':transcommon.today.new_customers<transcommon.yes.new_customers}">
<i class="fa fa-caret-up m-r-5" ng-if="transcommon.today.new_customers >=transcommon.yes.new_customers"></i>
<i class="fa fa-caret-down m-r-5" ng-if="transcommon.today.new_customers<transcommon.yes.new_customers"></i>
{{transcommon.new_customers_rise|abs|percentage:2}}</span></p>
<p class="mb-0 m-t-20 text-muted">Yesterday: {{transcommon.yes.customers}} <span class="pull-right" ng-class="{'text-red':transcommon.today.customers<transcommon.yes.customers}">
<i class="fa fa-caret-up m-r-5" ng-if="transcommon.today.customers >=transcommon.yes.customers"></i>
<i class="fa fa-caret-down m-r-5" ng-if="transcommon.today.customers<transcommon.yes.customers"></i>
{{transcommon.customers_rise|abs|percentage:2}}</span></p>
</div>
</div>
<div class="col-md-3 col-sm-6 col-xs-12">

Loading…
Cancel
Save