calculat type

master
wangning 8 years ago
parent 7a5a6276ac
commit 2eea4ed50c

@ -184,4 +184,4 @@ CREATE TABLE `financial_agent_commission_detail` (
alter table financial_partner_commission add column commission_type smallint(1) DEFAULT 1 COMMENT '提成类型 1:渠道计算法 2:总交易额比例 3:收益比例';
alter table financial_partner_commission_detail add column commission_type smallint(1) DEFAULT 1 COMMENT '提成类型 1:渠道计算法 2:总交易额比例 3:收益比例';
alter table financial_partner_commission_detail add column commission_type smallint(1) DEFAULT 1 COMMENT '提成类型 1:渠道计算法 2:总交易额比例 3:收益比例';

@ -195,6 +195,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
BigDecimal netCharge = BigDecimal.ZERO;
BigDecimal orgCharge = BigDecimal.ZERO;
String clientMoniker = "";
int type = 1;
for (JSONObject jsonObject : entry.getValue()) {
grossAmount = grossAmount.add(jsonObject.getBigDecimal("gross_amount"));
totalCharge = totalCharge.add(jsonObject.getBigDecimal("total_charge"));
@ -204,6 +205,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
netCharge = netCharge.add(jsonObject.getBigDecimal("net_charge"));
}
clientMoniker = jsonObject.getString("client_moniker");
type = jsonObject.getIntValue("type");
}
resultGrossAmount = resultGrossAmount.add(grossAmount);
resultTotalCharge = resultTotalCharge.add(totalCharge);
@ -217,6 +219,7 @@ public class CityPartnerPrizeServiceImpl implements CityPartnerPrizeService {
sumResult.put("net_charge", netCharge);
sumResult.put("client_moniker", clientMoniker);
sumResult.put("channel_detail", entry.getValue());
sumResult.put("type",type);
partnerClientInfos.add(sumResult);
}
result.put("partner_client_infos", partnerClientInfos);

@ -73,6 +73,7 @@ public class CityPartnerPrizeController {
BigDecimal netCharge = BigDecimal.ZERO;
String cityPartnerName = "";
int org_id = 0;
int type = 1;
for (JSONObject jsonObject : entry.getValue()) {
grossAmount = grossAmount.add(jsonObject.getBigDecimal("gross_amount"));
totalCharge = totalCharge.add(jsonObject.getBigDecimal("total_charge"));
@ -83,6 +84,7 @@ public class CityPartnerPrizeController {
}
org_id = jsonObject.getIntValue("org_id");
cityPartnerName = jsonObject.getString("name");
type = jsonObject.getIntValue("commission_type");
}
sumResult.put("gross_amount", grossAmount);
sumResult.put("total_charge", totalCharge);
@ -91,6 +93,7 @@ public class CityPartnerPrizeController {
sumResult.put("org_name", cityPartnerName);
sumResult.put("org_id", org_id);
sumResult.put("net_charge", netCharge);
sumResult.put("type",type);
sumResult.put("channel_detail", entry.getValue());
resultTotalCharge = resultTotalCharge.add(totalCharge);
resultRoyalpayCharge = resultRoyalpayCharge.add(royalpayCharge);

@ -1,6 +1,21 @@
/**
* Created by yixian on 2017-03-08.
*/
var commissionTypeMap = [{
"label": 1,
"value": "渠道计算法"
},
{
"label": 2,
"value": "总交易额比例"
},
{
"label": 3,
"value": "收益比例"
}
];
define(['angular','../../analysis/org/analysis-org'], function (angular) {
'use strict';
var app = angular.module('orgcommission', ['ui.router']);
@ -78,9 +93,11 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
$state.go('analysis_org.orgcommission.month', {monthStr: monthStr})
};
}]);
app.controller('orgCommissionMonthViewCtrl', ['$scope', 'monthData', function ($scope, monthData) {
app.controller('orgCommissionMonthViewCtrl', ['$scope', 'monthData','$filter', function ($scope, monthData) {
$scope.monthData = monthData.data;
$scope.ctrl = {};
$scope.commissionTypeMap = commissionTypeMap;
$scope.active = function (log) {
if($scope.ctrl.activeLog && $scope.ctrl.activeLog.org_id==log.org_id){
$scope.ctrl.activeLog=null;
@ -100,5 +117,23 @@ define(['angular','../../analysis/org/analysis-org'], function (angular) {
$scope.ctrl.activeLog=log;
}
}]);
app.filter('commission_type_filter', function () {
return function (sectorValue) {
var sectorLabel = '';
angular.forEach(commissionTypeMap, function (sector) {
if (sector.label == sectorValue) {
sectorLabel = sector.value;
}
});
return sectorLabel;
}
});
return app;
});

@ -33,6 +33,7 @@
<th>RoyalPay Charge</th>
<th>Net Charge</th>
<th>City Partner Charge</th>
<th>Type</th>
<th>Details</th>
</tr>
</thead>
@ -44,6 +45,7 @@
<td ng-bind="log.royalpay_charge|currency:'AUD'"></td>
<td ng-bind="log.net_charge|currency:'AUD'"></td>
<td ng-bind="log.org_charge|currency:'AUD'"></td>
<td ng-bind="log.type|commission_type_filter"></td>
<td>
<a ui-sref=".orgdetail({orgId:log.org_id})">
<i class="fa fa-search"></i>

Loading…
Cancel
Save