支付通道交易列表添加交易商户数跟开通该渠道商户数

master
yangkai 6 years ago
parent 516a5014dc
commit 4264a2bb75

@ -20,9 +20,9 @@ public class ChannelsAnalysisServiceImpl implements ChannelsAnalysisService {
@Override
public List<JSONObject> getChannelMount(JSONObject params) {
if (!params.containsKey("client_ids") && !params.containsKey("org_id")){
/*if (!params.containsKey("client_ids") && !params.containsKey("org_id")){
params.put("client_id",0);
}
}*/
List<JSONObject> listChannel = new ArrayList<>();
listChannel.add(putParam(params,"Wechat"));
listChannel.add(putParam(params,"Bestpay"));
@ -86,6 +86,18 @@ public class ChannelsAnalysisServiceImpl implements ChannelsAnalysisService {
obj.put("total",count.getIntValue("total"));
obj.put("order",count.getIntValue("orders"));
obj.put("channel",name);
obj.put("transaction_partners",count.getIntValue("transaction_partners"));
int enablePartners = 0;
if ("AlipayOnline".equals(name)) {
params.put("gateway_alipay_online", 1);
enablePartners = customerAndOrdersStatisticsMapper.countEnableChannel(params);
params.remove("gateway_alipay_online");
} else {
params.put("enable_" + name.toLowerCase(), 1);
enablePartners = customerAndOrdersStatisticsMapper.countEnableChannel(params);
params.remove("enable_" + name.toLowerCase());
}
obj.put("enable_partners", enablePartners);
return obj;
}
}

@ -61,4 +61,6 @@ public interface CustomerAndOrdersStatisticsMapper {
int countTotalCustomers(JSONObject params);
int countTotalOldCustomers(JSONObject params);
int countEnableChannel(JSONObject params);
}

@ -275,10 +275,12 @@
SELECT
ifnull(sum(s.orders),0) orders,
ifnull(sum(s.total),0) total,
ifnull(sum(s.single_amount),0) single_amount
ifnull(sum(s.single_amount),0) single_amount,
ifnull(count(distinct s.client_id), 0) transaction_partners
FROM statistics_customer_order s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
<where>
AND s.client_id != 0
<if test="client_ids!=null">
AND s.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
@ -566,4 +568,50 @@
</if>
</where>
</select>
<select id="countEnableChannel" resultType="java.lang.Integer">
<![CDATA[
SELECT
IFNULL(
COUNT(DISTINCT c.client_id),
0
) count
FROM
sys_clients c
INNER JOIN sys_client_config cc ON cc.client_id = c.client_id
INNER JOIN sys_org o ON o.org_id = c.org_id
WHERE
c.open_status = 5
AND c.approve_result = 1
AND c.approve_time IS NOT NULL
]]>
<if test="client_ids!=null">
AND c.client_id IN
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
#{client_id}
</foreach>
</if>
<if test="client_ids==null and client_id != null">
and c.client_id=#{client_id}
</if>
<if test="gateway_alipay_online!=null">and cc.gateway_alipay_online = #{gateway_alipay_online}</if>
<if test="enable_wechat!=null">and cc.enable_wechat = #{enable_wechat}</if>
<if test="enable_alipay!=null">and cc.enable_alipay = #{enable_alipay}</if>
<if test="enable_bestpay!=null">and cc.enable_bestpay = #{enable_bestpay}</if>
<if test="enable_jd!=null">and cc.enable_jd = #{enable_jd}</if>
<if test="enable_hf!=null">and cc.enable_hf = #{enable_hf}</if>
<if test="enable_rpay!=null">and cc.enable_rpay = #{enable_rpay}</if>
<if test="enable_yeepay!=null">and cc.enable_yeepay = #{enable_yeepay}</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
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
</if>
<if test="bd_group!=null">and c.client_id in
(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>
</select>
</mapper>

@ -131,6 +131,8 @@
<th>Channels</th>
<th>Total Amount (AUD)</th>
<th>Total orders</th>
<th>Transaction Partners</th>
<th>Enable Partners</th>
</tr>
</thead>
<tbody>
@ -139,6 +141,8 @@
ng-bind="channels.channel"></td>
<td ng-bind="channels.total"></td>
<td ng-bind="channels.order"></td>
<td ng-bind="channels.transaction_partners"></td>
<td ng-bind="channels.enable_partners"></td>
</tr>
</tbody>
</table>

Loading…
Cancel
Save