master
yuan 7 years ago
parent f9d47980fd
commit fd6db4c432

@ -41,7 +41,7 @@ public class BDAnalysisServiceImpl implements BDAnalysisService {
List<JSONObject> bdSaleList = bdAnalysisMapper.getBDSaleList(jsonObject);
for(JSONObject countApproved : listCountApproved){
for(JSONObject saleList : bdSaleList){
if(countApproved.getIntValue("bd_id") == saleList.getIntValue("bd_id")){
if(countApproved.getString("bd_id").equals(saleList.getString("bd_id"))){
saleList.put("num",countApproved.getString("num"));
}
}

@ -99,7 +99,7 @@
<select id="countClientsTypes" resultType="com.alibaba.fastjson.JSONObject">
SELECT c.industry,count(1) partner_counts FROM sys_clients c
SELECT c.industry,c.royalpayindustry,count(1) partner_counts FROM sys_clients c
<if test="bd_user!=null">
INNER JOIN sys_client_bd d ON c.client_id = d.client_id AND d.bd_id = #{bd_user} and
date(d.start_date)&lt;= date(now()) and (d.end_date is null or date(d.end_date)&gt;= date(now())) and
@ -117,7 +117,7 @@
)
</if>
</where>
GROUP BY industry order by partner_counts desc
GROUP BY c.royalpayindustry order by partner_counts desc
</select>
</mapper>

@ -37,13 +37,24 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
$scope.loadPartnersInTypes();
$scope.doAnalysis();
};
$scope.loadRoyalpayindustry = function () {
$http.get('/static/data/royalpayindustry.json').then(function (resp) {
$scope.royalpayindustry = resp.data;
})
};
$scope.loadRoyalpayindustry();
var getType = function (industryCode) {
var industryLabel = '';
angular.forEach(industryMap.configs(), function (industry) {
if (industry.value == industryCode) {
angular.forEach($scope.royalpayindustry, function (industry) {
if (industry.mccCode == industryCode) {
industryLabel = industry.label;
}else {
angular.forEach(industry.children, function (children){
if (children.mccCode == industryCode) {
industryLabel = children.label;
}
})
}
});
return industryLabel;
@ -57,17 +68,115 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
$scope.legends = [];
for (var i = 0; i < resp.data.length; i++) {
$scope.legends[i] = resp.data[i].partner_type;
var partner_type= getType(resp.data[i].industry);
var partner_type= getType(resp.data[i].mccCode);
resp.data[i].partner_type = partner_type;
$scope.legends[i] = partner_type;
}
$scope.PartnerTypes = angular.copy(resp.data);
var legend = $scope.legends;
$scope.partners_type_chart = chartParser.parse(partnerTypesConfig(legend), $scope.PartnerTypes);
childrenType(0);
$scope.partners_type_chart = partnerTypesConfig($scope.PartnerTypes,$scope.children);;
});
};
$scope.partner_type_chart = function (chart) {
chart.on('click', function (params) {
childrenType(params.dataIndex);
$scope.partners_type_chart = partnerTypesConfig($scope.PartnerTypes,$scope.children);
try {
$scope.$digest();
}catch (err){}
});
};
var childrenType = function (index) {
$scope.partners_type = $scope.PartnerTypes[index];
$scope.children = $scope.partners_type.children;
for (var i = 0; i < $scope.children.length; i++) {
$scope.legends[i] = $scope.children.children_partner_type;
var children_partner_type= getType($scope.children[i].royalpayindustry);
$scope.children[i].children_partner_type = children_partner_type;
}
$scope.PartnerTypes[index].children = $scope.children;
/*$scope.type_count = $scope.PartnerTypes[index].count_value;*/
}
$scope.loadPartnersInTypes();
var partnerTypesConfig = function (legend) {
var partnerTypesConfig = function (innerData,outerData) {
outerData = outerData||[];
var innerSeriesTemplate = {
name: '商户类别',
type: 'pie',
radius: outerData.length==0?'80%':'40%',
center: ['50%', '40%'],
selectedMode: 'single',
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
},
normal : {
label : {
position : 'inner'
},
labelLine : {
show : false
}
}
},
data:[]
};
angular.forEach(innerData,function (item) {
innerSeriesTemplate.data.push({
name:item.partner_type,
value:item.count_value,
selected:$scope.partners_type.partner_type===item.partner_type
})
});
var outerSeriesTemplate = {
name: '商户类别', type: 'pie',
radius : ['50%', '63%'],
center: ['50%', '40%'],
label: {
normal: {
formatter: '{b} : {c} ({d}%)'
}
},
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
},
data:[]
};
angular.forEach(outerData,function (item) {
outerSeriesTemplate.data.push({
name:item.children_partner_type,
value:item.partner_counts})
});
var series = [innerSeriesTemplate];
if(outerData.length){
series.push(outerSeriesTemplate)
}
return {
tooltip: {
trigger: 'item',
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
color: colors,
/* legend: {
orient: 'horizontal',
/!*y: '450px',
left: 'right',*!/
x: 'center',
y: 'bottom',
data: $scope.legends
},*/
series: series
}
};
/*var partnerTypesConfig = function (legend) {
return {
chart: {
tooltip: {
@ -99,7 +208,7 @@ define(['angular', 'uiBootstrap', 'uiRouter', 'angularEcharts','./transaction/an
column: {key: 'partner_counts', name: 'partner_type'}
}]
}
};
};*/
$scope.today = new Date();

@ -64,9 +64,11 @@
<div class="col-sm-6 col-xs-12">
<p class="text-center">各类型商家数量分布</p>
<div class="chart" style="height: 400px" echarts="partners_type_chart"
chart-setter="partner_type_chart($chart)"
ng-class="{nodata:partners_type_chart.nodata}"></div>
</div>
<div class="col-sm-6 col-xs-12">
<p class="text-center">{{partners_type.partner_type}} 行业列表</p>
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
@ -75,14 +77,20 @@
</tr>
</thead>
<tbody>
<tr ng-repeat="partner in PartnerTypes">
<td ng-bind="partner.partner_type"></td>
<tr ng-repeat="partner in children">
<td ng-bind="partner.children_partner_type"></td>
<td ng-bind="partner.partner_counts"></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-sm-12 col-xs-12" >
<label style="display: inline" ng-repeat="type in PartnerTypes | orderBy:'count_value':true">
<span ng-bind="type.partner_type" class="text-primary"></span>:
<span ng-bind="type.count_value" class="text-primary"></span> |
</label>
</div>
</div>
</div>
<div class="box box-warning">

Loading…
Cancel
Save