123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- <?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'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>5,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>3,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>2,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>4,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>1,'remarks'=>''],
-
- );
- $list20 =array(
- ['type'=>'液压泵','name'=>'测试设备2','number'=>20210618,'online_time'=>'2022-06-03 11:10:11','address'=>'杭州滨江','unused_days'=>20,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备2','number'=>20210618,'online_time'=>'2022-06-03 11:10:11','address'=>'杭州滨江','unused_days'=>22,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备2','number'=>20210618,'online_time'=>'2022-06-03 11:10:11','address'=>'杭州滨江','unused_days'=>22,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备2','number'=>20210618,'online_time'=>'2022-06-03 11:10:11','address'=>'杭州滨江','unused_days'=>22,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备2','number'=>20210618,'online_time'=>'2022-06-03 11:10:11','address'=>'杭州滨江','unused_days'=>22,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备2','number'=>20210618,'online_time'=>'2022-06-03 11:10:11','address'=>'杭州滨江','unused_days'=>22,'remarks'=>''],
- );
- $list40 =array(
- ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备3','number'=>20210618,'online_time'=>'2022-06-13 11:10:11','address'=>'杭州滨江','unused_days'=>41,'remarks'=>''],
- );
- $pie_data=array(
- ['name'=>'正常使用','value'=>5],
- ['name'=>'20+天未使用','value'=>6],
- ['name'=>'40+天未使用','value'=>8],
- );
-
- $data=array(
- 'list'=>$list,
- 'list20'=>$list20,
- 'list40'=>$list40,
- 'pie_data'=>$pie_data,
- );
- return CatchResponse::success($data);
- }
-
-
- /**
- * 告警统计
- * @param Request $request
- */
- public function alarmDeviceCount(Request $request)
- {
- $list =array(
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','code'=>'ERROR_CODE','comment'=>'液压油偏低','remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','code'=>'ERROR_CODE','comment'=>'液压油偏低','remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','code'=>'ERROR_CODE','comment'=>'液压油偏低','remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','code'=>'ERROR_CODE','comment'=>'液压油偏低','remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','code'=>'ERROR_CODE','comment'=>'液压油偏低','remarks'=>''],
-
- );
- $pie_dataA=array(
- ['name'=>'故障设备','value'=>15],
- ['name'=>'未出现故障设备','value'=>4],
- );
-
- $pie_dataB=array(
- ['name'=>'液压油偏低','value'=>10],
- ['name'=>'扳手校验不合格','value'=>8],
- ['name'=>'液压泵校验过期','value'=>6],
- ['name'=>'扳手外观不合格','value'=>5],
- ['name'=>'设备异常','value'=>4],
- ['name'=>'其他','value'=>3],
- );
- $pie_dataC=array(
- ['name'=>' 测试设备1','value'=>9],
- ['name'=>' 测试设备2','value'=>8],
- ['name'=>' 测试设备3','value'=>7],
- ['name'=>' 测试设备4','value'=>5],
- ['name'=>' 测试设备5','value'=>4],
- ['name'=>' 其他设备','value'=>3],
- );
- $data=array(
- 'list'=>$list,
- 'pie_dataA'=>$pie_dataA,
- 'pie_dataB'=>$pie_dataB,
- 'pie_dataC'=>$pie_dataC,
- );
- return CatchResponse::success($data);
- }
- /**
- * 作业记录统计
- * @param Request $request
- */
- public function workCount(Request $request)
- {
- $list =array(
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'wind_name'=>'风场A','fan_num'=>20,'bolt_num'=>40,'remarks'=>''],
-
- );
-
- $pie_dataB=array(
- ['name'=>' 测试设备1','value'=>9],
- ['name'=>' 测试设备2','value'=>8],
- ['name'=>' 测试设备3','value'=>7],
- ['name'=>' 测试设备4','value'=>5],
- ['name'=>' 测试设备5','value'=>4],
- ['name'=>' 其他设备','value'=>3],
- );
- $pie_dataC=array(
- ['name'=>' 风场A','value'=>9],
- ['name'=>' 风场B','value'=>8],
- ['name'=>' 风场C','value'=>7],
- ['name'=>' 风场D','value'=>5],
- ['name'=>' 风场E','value'=>4],
- ['name'=>' 其他风场','value'=>3],
- );
- $data=array(
- 'list'=>$list,
-
- 'pie_dataB'=>$pie_dataB,
- 'pie_dataC'=>$pie_dataC,
- );
- return CatchResponse::success($data);
- }
- /**
- * 维保设备记录统计
- * @param Request $request
- */
- public function maintainCount(Request $request)
- {
- $list =array(
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>5,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>3,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>2,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>4,'remarks'=>''],
- ['type'=>'液压泵','name'=>'测试设备1','number'=>20210618,'online_time'=>'2022-06-23 11:10:11','address'=>'杭州滨江','unused_days'=>1,'remarks'=>''],
-
- );
- $pie_dataA=array(
- ['name'=>'有效期内','value'=>15],
- ['name'=>'已失效(小于15天)','value'=>4],
- );
-
- $pie_dataB=array(
- ['name'=>'有效使用(大于45天)','value'=>13],
- ['name'=>'警告失效(15~45天)','value'=>2],
- ['name'=>'失效(0~15天)','value'=>4],
- );
- $pie_dataC=array(
- ['name'=>'已维护','value'=>15],
- ['name'=>'未维护','value'=>4],
- );
- $data=array(
- 'list'=>$list,
- 'pie_dataA'=>$pie_dataA,
- 'pie_dataB'=>$pie_dataB,
- 'pie_dataC'=>$pie_dataC,
- );
- return CatchResponse::success($data);
- }
-
-
- }
|