add org_detail 商户/交易数据/提成

master
luoyang 6 years ago
parent 28742dae95
commit 8002da724c

@ -4,6 +4,8 @@ import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql; import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
import cn.yixblog.support.mybatis.autosql.annotations.SqlType; import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -40,4 +42,6 @@ public interface FinancialPartnerCommissionMapper {
JSONObject findByChanel(@Param("year") int year, @Param("month") int month, @Param("org_id") int orgId,@Param("channel") String channel); JSONObject findByChanel(@Param("year") int year, @Param("month") int month, @Param("org_id") int orgId,@Param("channel") String channel);
PageList<JSONObject> getClientExtractRecord(@Param("org_id") int orgId, PageBounds pageBounds);
} }

@ -27,6 +27,8 @@ public interface OrgManager {
List<JSONObject> getReferrers(); List<JSONObject> getReferrers();
JSONObject getCityPartnerPrizeInfoList(int page, int limit,int orgId, JSONObject manager);
void switchPermission(int orgId, String permissionName, boolean enabled); void switchPermission(int orgId, String permissionName, boolean enabled);
List<JSONObject> listAllOrg(); List<JSONObject> listAllOrg();

@ -1,5 +1,6 @@
package au.com.royalpay.payment.manage.organizations.core.impls; package au.com.royalpay.payment.manage.organizations.core.impls;
import au.com.royalpay.payment.manage.mappers.financial.FinancialPartnerCommissionMapper;
import au.com.royalpay.payment.manage.mappers.system.OrgMapper; import au.com.royalpay.payment.manage.mappers.system.OrgMapper;
import au.com.royalpay.payment.manage.organizations.beans.OrgInfo; import au.com.royalpay.payment.manage.organizations.beans.OrgInfo;
import au.com.royalpay.payment.manage.organizations.core.OrgManager; import au.com.royalpay.payment.manage.organizations.core.OrgManager;
@ -29,6 +30,8 @@ import javax.annotation.Resource;
public class OrgManagerImpl implements OrgManager { public class OrgManagerImpl implements OrgManager {
@Resource @Resource
private OrgMapper orgMapper; private OrgMapper orgMapper;
@Resource
private FinancialPartnerCommissionMapper financialPartnerCommissionMapper;
@Override @Override
public List<JSONObject> listOrgs(boolean detail) { public List<JSONObject> listOrgs(boolean detail) {
@ -126,6 +129,16 @@ public class OrgManagerImpl implements OrgManager {
return orgMapper.listOrgs(1,new PageBounds()); return orgMapper.listOrgs(1,new PageBounds());
} }
@Override
public JSONObject getCityPartnerPrizeInfoList(int page, int limit,int orgId, JSONObject manager) {
if (orgId > 0) {
PageList<JSONObject> clientExtractList = financialPartnerCommissionMapper.getClientExtractRecord(orgId,
new PageBounds(page, limit));
return PageListUtils.buildPageListResult(clientExtractList);
}
return null;
}
@Override @Override
public void switchPermission(int orgId, String permissionName, boolean enabled) { public void switchPermission(int orgId, String permissionName, boolean enabled) {
JSONObject org = new JSONObject(); JSONObject org = new JSONObject();

@ -97,7 +97,10 @@ public class OrgManageController {
return orgManager.getReferrers(); return orgManager.getReferrers();
} }
@ManagerMapping(value = "/{orgId}/extract/search", method = RequestMethod.GET)
public JSONObject getCityPartnerPrizeInfoAllList(@PathVariable int orgId,
@RequestParam(defaultValue = "1") int page,
@RequestParam(defaultValue = "20") int limit, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager) {
return orgManager.getCityPartnerPrizeInfoList(page, limit,orgId,manager);
}
} }

@ -55,7 +55,7 @@
<select id="listNewClients" resultType="com.alibaba.fastjson.JSONObject"> <select id="listNewClients" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT count(client_id) new_clients,DATE_FORMAT(date(create_time),'%Y-%m-%d') create_time SELECT count(client_id) new_clients,DATE_FORMAT(date(create_time),'%d/%m/%Y') create_times
FROM sys_clients FROM sys_clients
WHERE WHERE
create_time >= #{begin} AND create_time <= #{end} and (approve_result is null or approve_result !=0) create_time >= #{begin} AND create_time <= #{end} and (approve_result is null or approve_result !=0)
@ -63,7 +63,7 @@
<if test="org_id!=null and org_ids==null">and org_id=#{org_id}</if> <if test="org_id!=null and org_ids==null">and org_id=#{org_id}</if>
<if test="org_ids!=null">and org_id in <if test="org_ids!=null">and 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>
GROUP BY YEAR(create_time),MONTH(create_time),DAY(create_time) GROUP BY YEAR(create_time),MONTH(create_time),DAY(create_time) ORDER BY create_time desc
</select> </select>
<select id="countClients" resultType="java.lang.Integer"> <select id="countClients" resultType="java.lang.Integer">

@ -72,4 +72,13 @@
WHERE year = #{year} AND month = #{month} and org_id=#{org_id} and channel=#{channel} WHERE year = #{year} AND month = #{month} and org_id=#{org_id} and channel=#{channel}
</select> </select>
<select id="getClientExtractRecord" resultType="com.alibaba.fastjson.JSONObject">
SELECT
o.name,c.`year`,c.`month`,c.gross_amount,c.total_charge,c.royalpay_charge,c.org_charge,c.channel,c.share_charge
FROM financial_partner_commission c
INNER JOIN sys_org o ON o.org_id = c.org_id and o.type = 0
WHERE c.org_id = #{org_id}
ORDER BY c.year DESC,c.month DESC
</select>
</mapper> </mapper>

@ -364,7 +364,7 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
chart: { chart: {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
formatter: '新增商户数' formatter: '新增商户数:{c}'
}, },
toolbox: { toolbox: {
show: true, show: true,
@ -403,7 +403,7 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
type: 'category', type: 'category',
boundaryGap: false boundaryGap: false
}, },
key: 'create_time' key: 'create_times'
}, },
series: [ series: [
{ {
@ -418,10 +418,25 @@ define(['angular', 'uiRouter', 'uiBootstrap'], function (angular) {
}) })
} }
$scope.loadPartners(1);
$scope.paginationc = {};
$scope.loadCommission = function () {
var params = {};
params.page = $scope.paginationc.page || 1;
params.org_id = $scope.org.org_id;
$http.get('/sys/orgs/'+$scope.org.org_id + '/extract/search', {params: params}).then(function (resp) {
$scope.client_extarct = resp.data.data;
$scope.paginationc = resp.data.pagination;
});
};
$scope.loadCommission();
$scope.loadPartners(1);
$scope.uploadLogo = function (file) { $scope.uploadLogo = function (file) {
if (file == null) { if (file == null) {

@ -582,6 +582,57 @@
</div> </div>
</uib-tab> </uib-tab>
<uib-tab heading="提成"> <uib-tab heading="提成">
<div class="box box-default">
<div class="box-header">合伙人提成</div>
<div class="box-body table-responsive">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>名称</th>
<th>时间</th>
<th>交易金额</th>
<th>商户总手续费</th>
<th>Royalpay手续费</th>
<th>合伙人提成</th>
<th>提成分润</th>
<th>支付渠道</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="clientExtracts in client_extarct">
<td ng-bind="clientExtracts.name"></td>
<td>
{{clientExtracts.year|limitTo:10}}
-
{{clientExtracts.month|limitTo:10}}
</td>
<td ng-bind="clientExtracts.gross_amount|currency:'AUD'"></td>
<td ng-bind="clientExtracts.total_charge|currency:'AUD'"></td>
<td ng-bind="clientExtracts.royalpay_charge|currency:'AUD'"></td>
<td ng-bind="clientExtracts.org_charge|currency:'AUD'"></td>
<td ng-bind="clientExtracts.share_charge|currency:'AUD'"></td>
<td ng-bind="clientExtracts.channel"></td>
</tr>
</tbody>
</table>
</div>
<div class="box-footer" ng-if="client_extarct.length">
<uib-pagination class="pagination"
total-items="paginationc.totalCount"
boundary-links="true"
ng-model="paginationc.page"
items-per-page="paginationc.limit"
max-size="10"
ng-change="loadCommission()"
previous-text="&lsaquo;"
next-text="&rsaquo;"
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">Total Records:{{paginationc.totalCount}};Total Pages:{{paginationc.totalPages}}</div>
</div>
</div>
</div>
</uib-tab> </uib-tab>
</uib-tabset> </uib-tabset>

Loading…
Cancel
Save