master
yuan 8 years ago
parent 51dc7988f2
commit e27769b945

@ -231,7 +231,6 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
public JSONObject getCommonAnalysis(JSONObject partner, AnalysisBean partnerAnalysisBean) { public JSONObject getCommonAnalysis(JSONObject partner, AnalysisBean partnerAnalysisBean) {
String timezone = partner.getJSONObject("client").getString("timezone"); String timezone = partner.getJSONObject("client").getString("timezone");
JSONObject params = partnerAnalysisBean.toParams(timezone); JSONObject params = partnerAnalysisBean.toParams(timezone);
JSONObject params1 = partnerAnalysisBean.toParams(timezone);
try { try {
clientManager.validateClients(partner.getIntValue("client_id"), params); clientManager.validateClients(partner.getIntValue("client_id"), params);
} catch (Exception e) { } catch (Exception e) {
@ -241,9 +240,9 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
params.put("client_id", partner.getIntValue("client_id")); params.put("client_id", partner.getIntValue("client_id"));
JSONObject today = getTransJSONO(params); JSONObject today = getTransJSONO(params);
params1.put("begin",DateUtils.addDays(params1.getDate("begin"),-1)); params.put("begin",DateUtils.addDays(params.getDate("begin"),-1));
params1.put("end",DateUtils.addDays(params1.getDate("end"),-1)); params.put("end",DateUtils.addDays(params.getDate("end"),-1));
JSONObject yes = getTransJSONO(params1); JSONObject yes = getTransJSONO(params);
res.put("today",today); res.put("today",today);
res.put("yes",yes); res.put("yes",yes);
res.put("not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params))); res.put("not_settled", new BigDecimal(transactionAnalysisMapper.analysisNotSettled(params)));
@ -261,7 +260,6 @@ public class DashboardServiceImpl implements DashboardService,DashboardAnalysisT
JSONObject object = transactionAnalysisMapper.getClientTransaction(params); JSONObject object = transactionAnalysisMapper.getClientTransaction(params);
res.put("trade_amount", object.getBigDecimal("trade_amount")); res.put("trade_amount", object.getBigDecimal("trade_amount"));
res.put("trade_count", object.getIntValue("trade_count")); res.put("trade_count", object.getIntValue("trade_count"));
params.remove("begin");
res.put("customers", transactionAnalysisMapper.countCustomers(params)); res.put("customers", transactionAnalysisMapper.countCustomers(params));
return res; return res;
} }

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

Loading…
Cancel
Save