123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <?php
- namespace catchAdmin\report\controller;
- use catcher\base\CatchRequest as Request;
- use catcher\CatchResponse;
- use catcher\base\CatchController;
- use catchAdmin\report\model\Report as ReportModel;
- class Report extends CatchController
- {
- protected $reportModel;
-
- public function __construct(ReportModel $reportModel)
- {
- $this->reportModel = $reportModel;
- }
-
- /**
- * 首页数量数据
- * @param Request $request
- */
- public function homePageCountData(Request $request)
- {
- // 部门数据
- $department_data = $this->reportModel->getDepartmentCountData() ?: [];
- // 用户数据
- $user_data = $this->reportModel->getDeviceUserCountData() ?: [];
- $data = array_merge($department_data, $user_data);
- return CatchResponse::success($data);
- }
- /**
- * 基站增长趋势数据
- * @param Request $request
- */
- public function stationGrowthTrendData(Request $request)
- {
- $data = $this->reportModel->getStationGrowthTrendData() ?: [];
-
- return CatchResponse::success($data);
- }
- /**
- * 用户设备增长趋势数据
- * @param Request $request
- */
- public function deviceGrowthTrendData(Request $request)
- {
- $data = $this->reportModel->getDeviceGrowthTrendData() ?: [];
-
- return CatchResponse::success($data);
- }
- /**
- * 设备类型统计
- * @param Request $request
- */
- public function hydraulicCount(Request $request)
- {
- $list =array(
- ['type'=>'液压泵','name'=>'在线','value'=>103],
- ['type'=>'液压泵','name'=>'离线','value'=>17],
- ['type'=>'液压泵','name'=>'其他','value'=>28],
- ['type'=>'液压泵','name'=>'总数','value'=>148],
- ['type'=>'液压扳手','name'=>'合格','value'=>140],
- ['type'=>'液压扳手','name'=>'不合格','value'=>24],
- ['type'=>'液压扳手','name'=>'总数','value'=>164],
- );
- $pump_bar=array(
- 'xData'=>['总数','B1','B2','B3','B4','B5',],
- 'yData'=>[250,100,20,30,60,40],
- );
- $pump_pie=array(
- ['name'=>'在线','value'=>113],
- ['name'=>'离线','value'=>17],
- ['name'=>'其他','value'=>18],
- );
- $wrench_bar=array(
- 'xData'=>['总数','A1','A2','A3','A4','A5',],
- 'yData'=>[230,103,17,50,35,25],
- );
- $wrench_pie=array(
- ['name'=>'合格','value'=>103],
- ['name'=>'不合格','value'=>17],
- );
- $data=array(
- 'list'=>$list,
- 'pump_bar'=>$pump_bar,
- 'pump_pie'=>$pump_pie,
- 'wrench_bar'=>$wrench_bar,
- 'wrench_pie'=>$wrench_pie,
- );
- return CatchResponse::success($data);
- }
- /**
- * 风场设备统计
- * @param Request $request
- */
- public function windCount(Request $request)
- {
- $list =array(
- ['name'=>'风场1','total'=>103,'online'=>20,'offline'=>40],
- ['name'=>'风场2','total'=>103,'online'=>20,'offline'=>40],
- ['name'=>'风场3','total'=>42,'online'=>20,'offline'=>40],
- ['name'=>'风场4','total'=>10,'online'=>20,'offline'=>40],
- ['name'=>'风场5','total'=>103,'online'=>20,'offline'=>40],
- ['name'=>'风场6','total'=>103,'online'=>20,'offline'=>40],
- ['name'=>'风场7','total'=>123,'online'=>20,'offline'=>40],
- ['name'=>'风场8','total'=>103,'online'=>20,'offline'=>40],
- ['name'=>'风场9','total'=>103,'online'=>20,'offline'=>40],
-
- );
- $xdata=['风场1','风场2','风场3','风场4','风场5','风场6','风场7','风场8','风场9',];
- $ydata=[20,30,49,20,56,54,87,23,69];
- $data=array(
- 'list'=>$list,
- 'xdata'=>$xdata,
- 'ydata'=>$ydata,
- );
- return CatchResponse::success($data);
- }
-
- /**
- * 告警统计
- * @param Request $request
- */
- public function alarmDeviceCount(Request $request)
- {
- $list =array(
- ['type'=>'液压泵','name'=>'电量告警','value'=>100],
- ['type'=>'液压泵','name'=>'液压油偏低','value'=>120],
- ['type'=>'液压泵','name'=>'液压油偏高','value'=>30],
- ['type'=>'液压泵','name'=>'总数','value'=>250],
-
- );
- $pump_bar=array(
- 'xData'=>['总数','电量告警','液压油偏低','液压油偏高'],
- 'yData'=>[250,100,120,30],
- );
- $pump_pie=array(
- ['name'=>'电量告警','value'=>100],
- ['name'=>'液压油偏低','value'=>120],
- ['name'=>'液压油偏高','value'=>30],
- );
-
- $data=array(
- 'list'=>$list,
- 'pump_bar'=>$pump_bar,
- 'pump_pie'=>$pump_pie,
- );
- return CatchResponse::success($data);
- }
- /**
- * 告警统计
- * @param Request $request
- */
- public function companyCount(Request $request)
- {
- $list =array(
- ['type'=>'测试部门1','name'=>'液压泵','value'=>100],
- ['type'=>'测试部门1','name'=>'液压扳手','value'=>120],
- ['type'=>'测试部门1','name'=>'风机','value'=>30],
- ['type'=>'测试部门1','name'=>'总数','value'=>250],
- ['type'=>'测试部门2','name'=>'液压泵','value'=>100],
- ['type'=>'测试部门2','name'=>'液压扳手','value'=>120],
- ['type'=>'测试部门2','name'=>'风机','value'=>30],
- ['type'=>'测试部门2','name'=>'总数','value'=>250],
- ['type'=>'测试部门3','name'=>'液压泵','value'=>100],
- ['type'=>'测试部门3','name'=>'液压扳手','value'=>120],
- ['type'=>'测试部门3','name'=>'风机','value'=>30],
- ['type'=>'测试部门3','name'=>'总数','value'=>250],
- );
- $bar_data=array(
- 'xData'=>['测试部门1','测试部门2','测试部门3'],
- 'pump_yData'=>[120,120,130],
- 'wrench_yData'=>[40,150,90],
- 'flange_yData'=>[100,80,30],
- );
- $pump_pie=array(
- ['name'=>'电量告警','value'=>100],
- ['name'=>'液压油偏低','value'=>120],
- ['name'=>'液压油偏高','value'=>30],
- );
-
-
- $data=array(
- 'list'=>$list,
- 'bar_data'=>$bar_data,
- 'pump_pie'=>$pump_pie,
- );
- return CatchResponse::success($data);
- }
- /**
- * 维保设备记录统计
- * @param Request $request
- */
- public function maintainCount(Request $request)
- {
- $list =array(
- ['type'=>'法兰','name'=>'总数','value'=>250],
- ['type'=>'法兰','name'=>'及格','value'=>200],
- ['type'=>'法兰','name'=>'不及格','value'=>50],
- );
- $pump_bar=array(
- 'xData'=>['总数','紧固及格','紧固不及格'],
- 'yData'=>[250,200,50],
- );
- $pump_pie=[
- ['name'=>'紧固及格','value'=>200],
- ['name'=>'紧固不及格','value'=>50]
- ];
- $list_type = array(
- 'xData'=>['c1','c2','c3','c4'],
- 'yData'=>[250,200,50,40],
- );
-
- $data=array(
- 'list'=>$list,
- 'pump_bar'=>$pump_bar,
- 'pump_pie'=>$pump_pie,
- );
- return CatchResponse::success($data);
- }
-
-
- }
|